/* ==========================================================================
   Eustrhálon — world home page styles
   Ported 1:1 from the design handoff (design_handoff_eustrhalon_home).
   Parchment light surfaces + dark explore/modal surfaces. The reader keeps
   its own stylesheet (reader.css); these pages share only the font families.
   ========================================================================== */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #efe7d5;
  font-family: 'Spectral', Georgia, serif;
  color: #33302a;
}
::selection { background: #6b5836; color: #f4efe1; }
a { text-decoration: none; color: inherit; }
button { font: inherit; }

@keyframes eustFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes eustRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- top bar ---------- */
.eh-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 60px);
  background: color-mix(in srgb, #e7dcc2 90%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #cbbf9e;
}
.eh-brand { display: flex; align-items: center; gap: 12px; }
.eh-brand span {
  font-family: 'Marcellus', serif;
  font-size: clamp(16px, 2.4vw, 20px);
  letter-spacing: 0.16em;
}
.eh-nav {
  display: flex; gap: clamp(16px, 3vw, 34px);
  font-family: 'Marcellus SC', serif; font-size: 12px;
  letter-spacing: 0.2em; color: #6a5a3c;
}
.eh-nav a { white-space: nowrap; }
.eh-nav .eh-nav-story { color: #2c281f; border-bottom: 1px solid #a8925f; padding-bottom: 2px; }
@media (max-width: 560px) {
  .eh-brand span { display: none; }
  .eh-nav { gap: 14px; font-size: 10.5px; letter-spacing: 0.16em; }
}

/* ---------- hero ---------- */
.eh-hero {
  position: relative;
  padding: clamp(60px, 9vw, 104px) clamp(20px, 5vw, 60px) clamp(40px, 6vw, 60px);
  text-align: center;
  background: radial-gradient(120% 100% at 50% 0%, #f4eede 0%, #e9dfc7 100%);
}
.eh-hero-inner { max-width: 780px; margin: 0 auto; animation: eustRise 0.8s ease both; }
.eh-eyebrow {
  font-family: 'Marcellus SC', serif;
  font-size: clamp(11px, 1.6vw, 13px);
  letter-spacing: 0.5em; color: #8a744a; margin-bottom: 22px;
}
.eh-hero h1 {
  font-family: 'Marcellus', serif; font-weight: 400;
  font-size: clamp(56px, 12vw, 118px);
  line-height: 0.95; margin: 0; letter-spacing: 0.02em; color: #2c281f;
}
.eh-hero-sub { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 3vw, 20px); margin: 24px 0 4px; }
.eh-hero-sub .eh-rule-l { height: 1px; width: clamp(50px, 12vw, 100px); background: linear-gradient(90deg, transparent, #a8925f); }
.eh-hero-sub .eh-rule-r { height: 1px; width: clamp(50px, 12vw, 100px); background: linear-gradient(90deg, #a8925f, transparent); }
.eh-hero-sub em {
  font-family: 'Marcellus', serif; font-style: italic;
  font-size: clamp(18px, 3vw, 24px); color: #7a6231; white-space: nowrap;
}
.eh-hero p {
  max-width: 640px; margin: 24px auto 0;
  font-size: clamp(16px, 2.2vw, 19px); line-height: 1.75; color: #4f4838;
}
.eh-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.eh-btn-primary {
  font-family: 'Marcellus SC', serif; font-size: 12.5px; letter-spacing: 0.24em;
  color: #f4efe1; background: #6b5836; padding: 14px 30px;
  transition: background 0.2s ease;
}
.eh-btn-primary:hover { background: #55462b; }
.eh-btn-secondary {
  font-family: 'Marcellus SC', serif; font-size: 12.5px; letter-spacing: 0.24em;
  color: #6b5836; border: 1px solid #b9a878; padding: 14px 30px;
  transition: border-color 0.2s ease;
}
.eh-btn-secondary:hover { border-color: #6b5836; }

/* ---------- section headings ---------- */
.eh-section-head { text-align: center; }
.eh-section-head .eh-kicker {
  font-family: 'Marcellus SC', serif; font-size: 12px;
  letter-spacing: 0.42em; color: #8a744a;
}
.eh-section-head h2 {
  font-family: 'Marcellus', serif; font-weight: 400;
  font-size: clamp(30px, 5vw, 42px); margin: 8px 0 0; color: #2c281f;
}

/* ---------- map ---------- */
.eh-map {
  padding: clamp(48px, 7vw, 80px) clamp(20px, 5vw, 60px) clamp(40px, 6vw, 64px);
  background: radial-gradient(120% 100% at 50% 0%, #e9dfc7 0%, #e2d6ba 100%);
  border-top: 1px solid #cbbf9e;
}
.eh-map-inner { max-width: 1120px; margin: 0 auto; }
.eh-map .eh-section-head { margin-bottom: 34px; }
.eh-map-frame {
  border: 1px solid #b9a878; padding: clamp(6px, 1.2vw, 12px);
  background: #d8caa6; box-shadow: 0 24px 60px rgba(60, 44, 20, 0.28);
}
.eh-map-frame-inner { border: 1px solid #c7b788; overflow: hidden; }
.eh-map-frame img { display: block; width: 100%; height: auto; }
.eh-map-caption {
  text-align: center; font-family: 'Marcellus SC', serif;
  font-size: 11.5px; letter-spacing: 0.3em; color: #8a744a; margin-top: 16px;
}

/* ---------- realm index ---------- */
.eh-index {
  padding: clamp(52px, 7vw, 80px) clamp(20px, 5vw, 60px);
  background: #efe7d5; border-top: 1px solid #cbbf9e;
}
.eh-index-inner { max-width: 1120px; margin: 0 auto; }
.eh-index .eh-section-head { margin-bottom: 44px; }
.eh-index-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 52px; }
.eh-col-head {
  font-family: 'Marcellus SC', serif; font-size: 13px; letter-spacing: 0.3em;
  color: #7a6231; padding-bottom: 14px;
  border-bottom: 1px solid #cbbf9e; margin-bottom: 6px;
}
.eh-index-row {
  display: flex; align-items: baseline; gap: 16px; width: 100%;
  padding: 13px 8px; cursor: pointer; border: none;
  border-bottom: 1px dotted #c9bd9a; background: none;
  color: #33302a; transition: background 0.2s ease;
}
.eh-index-row:hover { background: #e7dcc2; }
.eh-index-row .eh-row-num { font-family: 'Marcellus', serif; font-size: 15px; color: #a8925f; width: 30px; text-align: right; }
.eh-index-row .eh-row-name { font-family: 'Marcellus', serif; font-size: clamp(18px, 2.4vw, 21px); flex: 1; text-align: left; }
.eh-index-row .eh-row-tag { font-style: italic; color: #756a54; font-size: 14px; text-align: right; }

/* ---------- from the canon ---------- */
.eh-canon {
  padding: clamp(52px, 7vw, 76px) clamp(20px, 5vw, 60px);
  background: #e7dcc2; border-top: 1px solid #cbbf9e;
}
.eh-canon-inner { max-width: 1120px; margin: 0 auto; }
.eh-canon .eh-kicker {
  text-align: center; display: block;
  font-family: 'Marcellus SC', serif; font-size: 12px;
  letter-spacing: 0.42em; color: #8a744a; margin-bottom: 34px;
}
.eh-canon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 26px; }
.eh-quote-card { background: #f4eede; border: 1px solid #cbbf9e; padding: 32px 28px; }
.eh-quote-card .eh-quote-label {
  font-family: 'Marcellus SC', serif; font-size: 11px;
  letter-spacing: 0.28em; color: #a8925f; margin-bottom: 14px;
}
.eh-quote-card p {
  font-family: 'Marcellus', serif;
  font-size: clamp(19px, 2.6vw, 22px); line-height: 1.4;
  color: #3a3529; margin: 0;
}

/* ---------- chronicle band ---------- */
.eh-chronicle {
  display: block;
  padding: clamp(56px, 8vw, 78px) clamp(20px, 5vw, 60px);
  text-align: center;
  background: radial-gradient(120% 130% at 50% 0%, #f4eede 0%, #e2d6ba 100%);
  border-top: 1px solid #cbbf9e;
}
.eh-chronicle .eh-kicker {
  font-family: 'Marcellus SC', serif; font-size: 12px;
  letter-spacing: 0.4em; color: #8a744a;
}
.eh-chronicle .eh-chronicle-title {
  font-family: 'Marcellus', serif;
  font-size: clamp(26px, 4.4vw, 36px); color: #2c281f; margin: 12px 0 20px;
}
.eh-chronicle .eh-pill {
  display: inline-block;
  font-family: 'Marcellus SC', serif; font-size: 13px; letter-spacing: 0.26em;
  color: #f4efe1; background: #6b5836; padding: 15px 36px;
  transition: background 0.2s ease;
}
.eh-chronicle:hover .eh-pill { background: #55462b; }

/* ---------- explore (realm tiles) ---------- */
.eh-explore {
  padding: clamp(60px, 8vw, 96px) clamp(20px, 5vw, 60px) clamp(70px, 9vw, 110px);
  background: radial-gradient(130% 90% at 50% 0%, #1c2a37 0%, #101a24 60%);
}
.eh-explore-inner { max-width: 1200px; margin: 0 auto; }
.eh-explore .eh-kicker {
  font-family: 'Marcellus SC', serif; font-size: 12px;
  letter-spacing: 0.42em; color: #8fa6ba;
}
.eh-explore h2 {
  font-family: 'Marcellus', serif; font-weight: 400;
  font-size: clamp(32px, 5vw, 46px); margin: 10px 0 0; color: #eef4f9;
}
.eh-explore .eh-explore-sub {
  font-family: 'Spectral', serif; font-style: italic;
  font-size: clamp(15px, 2.2vw, 17px); color: #9fb4c6;
  max-width: 560px; margin: 16px auto 0;
}
/* threshold tabs */
.eh-tabs {
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
  margin-top: 34px;
}
.eh-tab {
  background: none; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 11px 22px;
  font-family: 'Marcellus SC', serif; font-size: 11.5px; letter-spacing: 0.22em;
  color: #8fa6ba;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.eh-tab:hover { color: #eef4f9; border-color: rgba(255, 255, 255, 0.35); }
.eh-tab[data-on] {
  color: #eef4f9; border-color: #a9c0d3;
  background: rgba(127, 152, 171, 0.14);
}

.eh-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px; margin-top: 40px;
}
.eh-tiles[hidden] { display: none; }
.eh-tile {
  position: relative; display: flex; flex-direction: column; text-align: left;
  cursor: pointer; border: 1px solid rgba(255, 255, 255, 0.09); padding: 0;
  overflow: hidden; background: #16222e;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.eh-tile:hover { transform: translateY(-5px); }
.eh-tile-art {
  height: 120px; overflow: hidden; position: relative;
  border-bottom: 1px solid var(--realm-accent, #7c98ae);
}
.eh-tile-art img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(0.92);
}
.eh-tile-caption { position: relative; padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 5px; }
.eh-tile-caption .eh-tile-head { display: flex; align-items: baseline; gap: 10px; }
.eh-tile-caption .eh-tile-roman { font-family: 'Marcellus', serif; font-size: 14px; color: var(--realm-accent, #7c98ae); }
.eh-tile-caption .eh-tile-name { font-family: 'Marcellus', serif; font-size: 22px; color: #eef4f9; }
.eh-tile-caption .eh-tile-domain {
  font-family: 'Marcellus SC', serif; font-size: 10.5px;
  letter-spacing: 0.2em; color: #8fa6ba; text-transform: uppercase;
}
.eh-tile-caption .eh-tile-tag {
  font-family: 'Spectral', serif; font-style: italic;
  font-size: 13.5px; color: #7f97ab; margin-top: 2px;
}

/* house tiles — sigil panel until house art exists (img slot in houses.js) */
.eh-tile-sigilpanel {
  height: 120px; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  border-bottom: 1px solid var(--realm-accent, #7c98ae);
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 1px, transparent 1px, transparent 10px),
    linear-gradient(135deg, color-mix(in srgb, var(--realm-accent, #7c98ae) 18%, transparent) 0%, rgba(16, 26, 36, 0.2) 100%);
}
.eh-tile-sigilpanel .eh-sigil-diamond {
  width: 26px; height: 26px; transform: rotate(45deg);
  border: 1px solid var(--realm-accent, #7c98ae); display: block;
  background: color-mix(in srgb, var(--realm-accent, #7c98ae) 22%, transparent);
}
.eh-tile-sigilpanel span:last-child {
  font-family: 'Marcellus SC', serif; font-size: 10px;
  letter-spacing: 0.24em; color: #8fa6ba; text-transform: uppercase;
  padding: 0 12px; text-align: center;
}

/* character tiles — portrait crop */
.eh-tiles-char .eh-tile-art { height: 190px; }
.eh-tiles-char .eh-tile-art img { object-position: center 18%; }

/* ---------- footer ---------- */
.eh-footer {
  padding: clamp(44px, 6vw, 64px) clamp(20px, 5vw, 60px);
  background: #2c281f; color: #a89a78; text-align: center;
}
.eh-footer svg { opacity: 0.85; margin-bottom: 16px; }
.eh-footer .eh-footer-mark { font-family: 'Marcellus', serif; font-size: 22px; color: #efe6d2; letter-spacing: 0.14em; }
.eh-footer .eh-footer-tag { font-family: 'Marcellus SC', serif; font-size: 11px; letter-spacing: 0.32em; margin-top: 8px; }
.eh-footer .eh-footer-imprint {
  font-family: 'Spectral', serif; font-size: 12px; line-height: 1.7;
  color: #8d8168; margin-top: 18px;
}
.eh-footer .eh-footer-imprint a {
  color: #a8925f; text-decoration: none;
  border-bottom: 1px solid rgba(168, 146, 95, 0.4);
}
.eh-footer .eh-footer-imprint a:hover { color: #efe6d2; border-bottom-color: #efe6d2; }

/* ---------- realm modal ---------- */
#eh-scrim {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(9, 14, 20, 0.72);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: eustFade 0.25s ease;
}
#eh-scrim[hidden] { display: none; }
#eh-modal {
  position: fixed; z-index: 91;
  inset: clamp(0px, 4vh, 40px) 0 0; margin: 0 auto;
  max-width: 780px; height: calc(100vh - clamp(0px, 4vh, 40px));
  overflow: hidden; display: flex; flex-direction: column;
  background: #101a24; box-shadow: 0 -20px 80px rgba(0, 0, 0, 0.6);
  animation: eustRise 0.32s ease;
}
#eh-modal[hidden] { display: none; }

.eh-modal-banner {
  position: relative; flex: 0 0 auto;
  padding: clamp(28px, 4vw, 42px) clamp(24px, 5vw, 48px) clamp(24px, 3vw, 30px);
  overflow: hidden;
}
.eh-banner-art {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0.32; pointer-events: none;
}
.eh-banner-pinstripe {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 1px, transparent 1px, transparent 9px);
  pointer-events: none;
}
.eh-modal-close {
  position: absolute; top: 18px; right: 18px; z-index: 2;
  width: 40px; height: 40px; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%; cursor: pointer; color: #eef4f9;
  transition: background 0.2s ease;
}
.eh-modal-close:hover { background: rgba(0, 0, 0, 0.5); }
.eh-modal-eyebrow {
  position: relative; display: flex; align-items: center; gap: 8px;
  font-family: 'Marcellus SC', serif; font-size: 12px;
  letter-spacing: 0.3em; color: rgba(255, 255, 255, 0.75);
}
.eh-modal-eyebrow .eh-dot { opacity: 0.5; }
.eh-modal-banner h3 {
  position: relative; font-family: 'Marcellus', serif; font-weight: 400;
  font-size: clamp(38px, 7vw, 60px); line-height: 1.0;
  margin: 12px 0 0; color: #ffffff;
}
.eh-modal-tag {
  position: relative; font-family: 'Spectral', serif; font-style: italic;
  font-size: clamp(16px, 2.6vw, 19px); color: rgba(255, 255, 255, 0.9); margin-top: 8px;
}

.eh-modal-body {
  flex: 1 1 auto; overflow-y: auto;
  padding: clamp(28px, 4vw, 40px) clamp(24px, 5vw, 48px) clamp(40px, 6vw, 54px);
  color: #cdd8e2;
}
.eh-modal-phil {
  font-family: 'Marcellus', serif;
  font-size: clamp(20px, 3vw, 25px); line-height: 1.45;
  color: #e6eef5; margin: 0 0 6px; text-align: center;
}
.eh-modal-divider { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 22px 0 30px; }
.eh-modal-divider .eh-div-l { height: 1px; width: 40px; background: linear-gradient(90deg, transparent, #4a5f72); }
.eh-modal-divider .eh-div-d { width: 8px; height: 8px; border: 1px solid #7c98ae; transform: rotate(45deg); display: block; }
.eh-modal-divider .eh-div-r { height: 1px; width: 40px; background: linear-gradient(90deg, #4a5f72, transparent); }

.eh-modal-label {
  font-family: 'Marcellus SC', serif; font-size: 11px;
  letter-spacing: 0.28em; color: var(--realm-accent, #7c98ae); margin-bottom: 10px;
}
.eh-modal-overview { font-size: 17px; line-height: 1.8; color: #b9cad8; margin: 0 0 30px; }
.eh-modal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 26px 34px; }
.eh-modal-grid .eh-modal-label { margin-bottom: 8px; }
.eh-modal-grid p { font-size: 15.5px; line-height: 1.75; color: #a7b8c6; margin: 0; }

.eh-modal-sigil {
  display: flex; align-items: center; gap: 12px; margin-top: 34px;
  padding: 16px 20px; background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.eh-modal-sigil[hidden] { display: none; }
.eh-modal-grid > div[hidden] { display: none; }
.eh-modal-sigil .eh-sigil-swatch {
  width: 14px; height: 14px; background: var(--realm-accent, #7c98ae);
  transform: rotate(45deg); display: block; flex: 0 0 auto;
}
.eh-modal-sigil .eh-sigil-label {
  font-family: 'Marcellus SC', serif; font-size: 11px;
  letter-spacing: 0.22em; color: #8fa6ba;
}
.eh-modal-sigil .eh-sigil-text { font-family: 'Marcellus', serif; font-size: 17px; color: #dfe7ee; margin-left: auto; }

.eh-modal-nav {
  flex: 0 0 auto; display: flex; align-items: stretch;
  border-top: 1px solid rgba(255, 255, 255, 0.1); background: #0d151d;
}
.eh-modal-nav .eh-nav-step {
  flex: 0 0 auto; padding: 16px 22px; background: none; border: none;
  cursor: pointer; color: #9fb4c6;
  font-family: 'Marcellus SC', serif; font-size: 11px; letter-spacing: 0.2em;
  transition: color 0.2s ease;
}
.eh-modal-nav .eh-nav-step:hover { color: #eef4f9; }
.eh-modal-nav .eh-nav-prev { border-right: 1px solid rgba(255, 255, 255, 0.08); }
.eh-modal-nav .eh-nav-next { border-left: 1px solid rgba(255, 255, 255, 0.08); }
.eh-modal-nav .eh-nav-read {
  flex: 1 1 auto; display: flex; align-items: center; justify-content: center;
  padding: 16px; color: #cdd8e2;
  font-family: 'Marcellus SC', serif; font-size: 11px; letter-spacing: 0.22em;
  transition: color 0.2s ease;
}
.eh-modal-nav .eh-nav-read:hover { color: #ffffff; }

body.eh-modal-open { overflow: hidden; }
