:root {
  --ink: #f5f0e7;
  --muted: #c7c2b5;
  --deep: #061110;
  --deep-2: #0a1916;
  --panel: rgba(8, 25, 23, 0.88);
  --line: rgba(218, 191, 131, 0.28);
  --gold: #d7b679;
  --gold-bright: #f3dca7;
  --paper: #e9e4d9;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--deep);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.6;
  background-image: radial-gradient(circle at 50% 12%, rgba(18, 82, 73, .28), transparent 34%), linear-gradient(#061110, #0a1714 58%, #06100f);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem clamp(1rem, 4vw, 4rem);
  background: rgba(5, 15, 14, .9); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px);
}
.brand { text-decoration: none; letter-spacing: .09em; font-size: .95rem; white-space: nowrap; }
.site-nav { display: flex; gap: 1.1rem; font-size: .9rem; align-items: center; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover { color: var(--gold-bright); }
.menu-button { display: none; }

.hero { min-height: min(82vh, 860px); position: relative; display: grid; align-items: end; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(4,13,12,.06) 0%, rgba(4,13,12,.18) 43%, rgba(4,13,12,.94) 100%); }
.hero-copy { position: relative; z-index: 2; max-width: 780px; padding: clamp(4rem, 10vw, 8rem) clamp(1.25rem, 7vw, 7rem); }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .22em; font-size: .76rem; margin: 0 0 .6rem; }
h1, h2, h3 { line-height: 1.06; font-weight: 400; margin: 0 0 1rem; }
h1 { font-size: clamp(3rem, 8vw, 6.5rem); text-shadow: 0 2px 16px rgba(0,0,0,.55); }
h2 { font-size: clamp(2rem, 4.3vw, 4rem); }
h3 { font-size: clamp(1.4rem, 2.2vw, 2rem); }
.hero-copy > p:not(.eyebrow) { max-width: 660px; font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: #e7e1d5; }
.hero-actions, .retailer-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }
.button { display: inline-block; padding: .85rem 1.2rem; border: 1px solid var(--gold); text-decoration: none; text-transform: uppercase; letter-spacing: .1em; font-size: .77rem; cursor: pointer; color: var(--ink); background: transparent; }
.button.primary { background: var(--gold); color: #10201d; }
.button.ghost { background: rgba(3,13,12,.34); }
.button.small { padding: .68rem .9rem; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }

.section { padding: clamp(4rem, 8vw, 8rem) clamp(1.25rem, 7vw, 7rem); }
.section-heading { max-width: 850px; margin-bottom: 2rem; }
.section-heading > p:not(.eyebrow) { color: var(--muted); font-size: 1.05rem; }
.split-heading { display: flex; align-items: end; justify-content: space-between; max-width: 1180px; gap: 2rem; }

.world-section { background: linear-gradient(180deg, rgba(255,255,255,.025), transparent); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.world-heading { max-width: 900px; margin-bottom: 2.2rem; }
.world-maps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); max-width: 980px; margin: 0 auto; align-items: start; }
.world-map-card { min-width: 0; }
.map-card-heading { text-align: center; margin-bottom: 1rem; }
.map-card-heading h3 { margin-bottom: 0; }
.map-shell, .star-map-shell { position: relative; width: min(100%, 370px); margin: 0 auto; padding: .72rem; background: var(--paper); box-shadow: 0 22px 58px rgba(0,0,0,.34); overflow: hidden; }
.map-image { width: 100%; position: relative; z-index: 1; }
.map-expand { position: absolute; right: 1.25rem; bottom: 1.25rem; z-index: 8; border: 1px solid rgba(255,255,255,.55); background: rgba(6,17,15,.86); color: white; padding: .55rem .72rem; cursor: pointer; font-size: .78rem; }
.hotspot { position: absolute; z-index: 7; width: 17px; height: 17px; border-radius: 50%; border: 1px solid rgba(255,255,255,.95); background: rgba(215,182,121,.78); box-shadow: 0 0 0 4px rgba(215,182,121,.18), 0 0 13px rgba(255,232,176,.72); cursor: pointer; transform: translate(-50%, -50%); }
.hotspot:hover, .hotspot:focus-visible { transform: translate(-50%, -50%) scale(1.2); outline: none; }
.hotspot.glorn { left: 19%; top: 41%; }
.hotspot.morolynne { left: 56%; top: 59%; }
.hotspot.fayre { left: 78%; top: 35%; }
.hotspot.pillar { left: 88%; top: 12%; }
.hotspot.mountains { left: 58%; top: 15%; }
.star-map-shell { background: #06101a; padding: .72rem; aspect-ratio: 2 / 3; }
.star-map-underlay { position: absolute; inset: .72rem; width: calc(100% - 1.44rem); height: calc(100% - 1.44rem); object-fit: cover; filter: brightness(.18) sepia(.12) hue-rotate(155deg) saturate(1.65) contrast(1.2); opacity: .68; }
.star-map-svg { position: absolute; inset: .72rem; width: calc(100% - 1.44rem); height: calc(100% - 1.44rem); z-index: 3; background: radial-gradient(circle at 50% 35%, rgba(28,72,104,.16), rgba(3,8,18,.56)); }
.constellation-lines path { fill: none; stroke: rgba(213,230,255,.78); stroke-width: .18; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 3px rgba(180,220,255,.95)); }
.constellation-stars circle { fill: #f8f4df; filter: drop-shadow(0 0 2px white) drop-shadow(0 0 5px #9fdcff); }
.minor-stars circle { fill: rgba(237,245,255,.86); filter: drop-shadow(0 0 2px rgba(190,225,255,.85)); }
.star-map-glow { position: absolute; inset: .72rem; z-index: 4; pointer-events: none; box-shadow: inset 0 0 70px rgba(0,0,0,.72); background: radial-gradient(circle at 63% 41%, rgba(142,207,255,.11), transparent 18%); }
.map-caption { max-width: 420px; margin: .85rem auto 0; text-align: center; color: var(--muted); font-size: .9rem; }
.lore-panel { padding: 1.35rem 1.55rem; border: 1px solid var(--line); background: rgba(8,25,23,.8); box-shadow: 0 20px 55px rgba(0,0,0,.22); }
.lore-panel p { color: var(--muted); }
.world-lore { max-width: 980px; margin: 2rem auto 0; }

.portal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.portal-card { min-height: 390px; padding: clamp(2rem, 4vw, 4rem); background: linear-gradient(150deg, rgba(10,36,33,.96), rgba(5,19,18,.99)); display: flex; flex-direction: column; justify-content: end; }
.portal-card h2 { font-size: clamp(1.8rem, 3vw, 3rem); }
.portal-card p { color: var(--muted); }
.text-link, .text-button { margin-top: .8rem; color: var(--gold-bright); text-decoration: none; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-size: 1rem; }
.mini-bestiary { display: flex; flex-wrap: wrap; gap: .55rem; margin: .6rem 0 .9rem; }
.bestiary-chip { border: 1px solid var(--line); background: rgba(255,255,255,.025); color: var(--gold-bright); padding: .52rem .7rem; cursor: pointer; }
.bestiary-chip:hover { background: rgba(215,182,121,.12); }
.bestiary-note { min-height: 4.6em; font-style: italic; }

.book-section { border-bottom: 1px solid var(--line); }
.book-layout { display: grid; grid-template-columns: minmax(260px, 410px) minmax(0, 1fr); gap: clamp(2.5rem, 7vw, 7rem); align-items: center; max-width: 1280px; margin: 0 auto; }
.book-cover { width: 100%; box-shadow: 0 30px 70px rgba(0,0,0,.45); }
.book-copy { max-width: 760px; }
.lead { font-size: 1.18rem; color: #eee7da; }
.format-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin: 1.6rem 0; }
.format-grid > div { border: 1px solid var(--line); background: rgba(255,255,255,.025); padding: 1rem; display: flex; flex-direction: column; gap: .25rem; }
.format-grid span { color: var(--muted); font-size: .88rem; }
.format-grid code { color: var(--gold-bright); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.library-note { margin-top: 1.4rem; border-left: 2px solid var(--gold); padding: .8rem 1rem; color: var(--muted); background: rgba(215,182,121,.05); }
.library-note strong { color: var(--ink); }

.reviews-section { background: rgba(255,255,255,.02); }
.review-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; max-width: 1250px; }
.review-card { border: 1px solid var(--line); background: rgba(7,24,21,.82); padding: clamp(1.4rem, 3vw, 2.2rem); }
.review-card.featured { box-shadow: 0 0 0 1px rgba(215,182,121,.18), 0 20px 50px rgba(0,0,0,.18); }
.rating { color: var(--gold-bright); letter-spacing: .12em; font-size: 1.2rem; }
blockquote { margin: 1rem 0; font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.45; }
.review-card p { color: var(--muted); }
.review-card a { color: var(--gold-bright); text-decoration: none; }

.authors-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .9fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; max-width: 1300px; }
.authors-image { width: 100%; border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0,0,0,.24); }
.authors-copy p:not(.eyebrow) { color: var(--muted); }

.press-section { padding-top: 3rem; }
.press-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; max-width: 1250px; }
.press-card { text-decoration: none; border: 1px solid var(--line); padding: 1.3rem; background: rgba(255,255,255,.02); display: flex; flex-direction: column; gap: .4rem; min-height: 160px; }
.press-card span { color: var(--gold); text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; }
.press-card strong { font-weight: 400; font-size: 1.15rem; }
.press-card small { color: var(--muted); margin-top: auto; }
.press-card:hover { background: rgba(215,182,121,.06); }

.site-footer { padding: 2.2rem clamp(1.25rem, 7vw, 7rem); display: flex; justify-content: space-between; gap: 1.4rem; color: #9ea79f; border-top: 1px solid var(--line); font-size: .9rem; }
.site-footer p { margin: .2rem 0 0; }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-links a { text-decoration: none; }

.map-dialog, .spell-dialog { border: 1px solid #d7d0c1; box-shadow: 0 40px 100px rgba(0,0,0,.65); }
.map-dialog { width: min(92vw, 900px); max-height: 92vh; padding: 0; background: #efe9dc; }
.map-dialog::backdrop, .spell-dialog::backdrop { background: rgba(0,0,0,.84); }
.map-dialog img { width: 100%; height: auto; }
.dialog-close { position: sticky; top: .75rem; float: right; margin: .75rem; z-index: 10; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 0; background: rgba(8,18,16,.9); color: white; font-size: 1.55rem; cursor: pointer; }
.spell-dialog { width: min(92vw, 760px); max-height: 90vh; overflow: auto; padding: 0; background: #071412; color: var(--ink); }
.spell-inner { padding: clamp(1.4rem, 5vw, 3.2rem); }
.spell-intro { color: var(--muted); }
.spell-dialog fieldset { border: 1px solid var(--line); margin: 1.2rem 0; padding: 1rem; }
.spell-dialog legend { color: var(--gold-bright); padding: 0 .45rem; }
.spell-dialog label { display: block; padding: .45rem .2rem; color: var(--muted); cursor: pointer; }
.spell-dialog input { accent-color: var(--gold); }
.spell-output { margin-top: 1.4rem; padding: 1rem; border: 1px solid var(--gold); background: rgba(215,182,121,.08); }
.spell-output strong { color: var(--gold-bright); }

@media (max-width: 1000px) {
  .world-maps { grid-template-columns: 1fr; }
  .review-grid, .press-grid { grid-template-columns: 1fr; }
  .authors-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .portal-grid { grid-template-columns: 1fr; }
  .portal-card { min-height: 300px; }
  .book-layout { grid-template-columns: 1fr; }
  .cover-wrap { max-width: 380px; margin: 0 auto; }
  .format-grid { grid-template-columns: 1fr; }
  .site-nav { position: absolute; top: 100%; right: 1rem; left: 1rem; display: none; flex-direction: column; align-items: stretch; padding: 1rem; background: #071312; border: 1px solid var(--line); }
  .site-nav.open { display: flex; }
  .menu-button { display: block; border: 1px solid var(--line); background: transparent; color: var(--ink); padding: .45rem .7rem; }
  .site-footer { flex-direction: column; }
  .split-heading { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
  .hero { min-height: 72vh; }
  .hero-art { object-position: 52% center; }
  .hero-copy { padding-bottom: 3rem; }
  .map-shell, .star-map-shell { width: min(100%, 340px); }
  .hotspot { width: 16px; height: 16px; }
}

/* v4 refinements */
.world-maps { grid-template-columns: minmax(250px, .72fr) minmax(420px, 1.28fr); max-width: 1120px; align-items: start; }
.map-shell { width: min(100%, 300px); border-radius: 4px; }
.reader-map-shell { width: 100%; min-height: 382px; border: 10px solid var(--paper); background: var(--paper); box-shadow: 0 22px 58px rgba(0,0,0,.34); overflow: hidden; }
.reader-map-shell iframe { display:block; width:100%; height:362px; border:0; background:#ddd; }
.map-link-row { text-align:center; margin:.65rem 0 0; }
.reader-map-card .map-caption { max-width: 560px; }
.review-grid { grid-template-columns: repeat(2, minmax(0,1fr)); max-width: 900px; }
.press-grid { grid-template-columns: repeat(4, 1fr); max-width: 1320px; }
.press-card { min-height: 190px; position: relative; overflow: hidden; }
.press-card::after { content:'↗'; position:absolute; right:1rem; top:.8rem; color:rgba(243,220,167,.55); font-size:1.1rem; }

/* Spellweaver: parchment ritual rather than browser form */
.spell-dialog { width:min(94vw,900px); max-height:92vh; overflow:auto; padding:0; color:#302719; background:#e7dcc2; border:1px solid #cfb276; box-shadow:0 40px 120px rgba(0,0,0,.72); }
.spell-dialog::backdrop { background:rgba(2,8,7,.86); backdrop-filter:blur(3px); }
.spell-dialog .dialog-close { background:#17342f; color:#f3dca7; border:1px solid rgba(215,182,121,.55); }
.spell-inner { position:relative; padding:clamp(2rem,6vw,4.4rem); background:
  radial-gradient(circle at 50% 0%, rgba(255,255,255,.7), transparent 34%),
  linear-gradient(rgba(255,255,255,.16), rgba(255,255,255,.03)),
  #e7dcc2; }
.spell-inner::before { content:''; position:absolute; inset:15px; border:1px solid rgba(104,78,31,.35); pointer-events:none; }
.spell-inner .eyebrow { color:#785b29; text-align:center; }
.spell-inner h2 { text-align:center; color:#2f2a20; font-size:clamp(2.2rem,5vw,4rem); }
.spell-intro { color:#5d5140; text-align:center; max-width:650px; margin:0 auto 2.2rem; font-size:1.05rem; }
.spell-sigil { width:64px; height:64px; border-radius:50%; display:grid; place-items:center; margin:0 auto 1rem; border:1px solid #9f7e42; color:#745624; background:rgba(255,255,255,.32); box-shadow:0 0 0 8px rgba(159,126,66,.08); font-size:1.7rem; }
.spell-question { border:0!important; border-top:1px solid rgba(91,71,34,.28)!important; margin:1.6rem 0 0!important; padding:1.5rem 0 0!important; }
.spell-question legend { width:100%; color:#3a3022!important; padding:0!important; font-size:1.14rem; line-height:1.35; }
.spell-question legend span { display:inline-grid; place-items:center; width:34px; height:34px; margin-right:.65rem; border-radius:50%; background:#183b35; color:#f5e6bd; font-size:.75rem; letter-spacing:.08em; }
.spell-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; margin-top:1rem; }
.spell-option { position:relative; display:grid!important; grid-template-columns:42px 1fr; gap:.8rem; align-items:start; padding:1rem!important; color:#5a4c38!important; border:1px solid rgba(95,72,32,.26); background:rgba(255,255,255,.28); cursor:pointer; transition:.16s ease; }
.spell-option:hover { border-color:#9f7e42; background:rgba(255,255,255,.48); transform:translateY(-1px); }
.spell-option input { position:absolute; opacity:0; pointer-events:none; }
.spell-option:has(input:checked) { border-color:#775b28; background:#f4ead0; box-shadow:inset 0 0 0 2px rgba(159,126,66,.2),0 8px 24px rgba(76,54,19,.10); }
.spell-option:has(input:checked) .spell-mark { background:#183b35; color:#f4e3b7; }
.spell-mark { width:38px; height:38px; display:grid; place-items:center; border-radius:50%; border:1px solid rgba(95,72,32,.33); color:#7b5c25; font-size:1.2rem; }
.spell-option strong { display:block; color:#33291b; font-size:1rem; letter-spacing:.04em; margin-bottom:.12rem; }
.spell-submit-row { display:flex; justify-content:center; margin-top:2rem; }
.spell-dialog .button.primary { background:#183b35; border-color:#183b35; color:#f6e8c4; min-width:190px; }
.spell-output { margin:2rem auto 0!important; max-width:680px; padding:1.4rem 1.6rem!important; border:1px solid #9f7e42!important; background:#f3e8cf!important; color:#4c402e; text-align:center; }
.spell-output strong { color:#173c35!important; display:block; font-size:1.35rem; }
.spell-output p { margin:.55rem 0 0; }

@media (max-width: 1100px) {
  .press-grid { grid-template-columns:repeat(2,1fr); }
  .world-maps { grid-template-columns:1fr; }
  .reader-map-shell { max-width:720px; margin:0 auto; }
}
@media (max-width: 700px) {
  .spell-options { grid-template-columns:1fr; }
  .review-grid, .press-grid { grid-template-columns:1fr; }
  .reader-map-shell iframe { height:330px; }
}


/* v6 mobile polish ------------------------------------------------------- */
/* Keep the complete hero/banner visible on phones instead of cropping it. */
@media (max-width: 700px) {
  .site-header {
    padding: .75rem .9rem;
  }
  .brand {
    font-size: clamp(.78rem, 4.2vw, .95rem);
    letter-spacing: .07em;
  }
  .menu-button {
    flex: 0 0 auto;
  }

  .hero {
    min-height: 0;
    display: block;
    overflow: visible;
    background: #071311;
  }
  .hero-art {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center top;
  }
  .hero-shade {
    display: none;
  }
  .hero-copy {
    max-width: none;
    padding: 1.6rem 1rem 2.4rem;
    background: linear-gradient(180deg, #0b1c18 0%, #071311 100%);
  }
  .hero-copy h1 {
    font-size: clamp(2.6rem, 13vw, 4rem);
  }
  .hero-copy > p:not(.eyebrow) {
    font-size: 1.03rem;
  }
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .hero-actions .button {
    width: 100%;
    text-align: center;
  }

  /* Give the World section almost the full screen width on phones. */
  .world-section {
    padding-left: .8rem;
    padding-right: .8rem;
  }
  .world-heading {
    padding-left: .2rem;
    padding-right: .2rem;
  }
  .world-maps {
    width: 100%;
    gap: 2.4rem;
  }
  .map-shell {
    width: min(86vw, 330px);
    padding: .48rem;
  }
  .reader-map-shell {
    width: 100%;
    max-width: none;
    min-height: 0;
    aspect-ratio: 16 / 9;
    border-width: 5px;
  }
  .reader-map-shell iframe {
    width: 100%;
    height: 100%;
    min-height: 0;
  }
  .reader-map-card .map-caption,
  .map-link-row {
    padding-left: .35rem;
    padding-right: .35rem;
  }
  .world-lore {
    margin-left: .2rem;
    margin-right: .2rem;
  }
}

@media (max-width: 420px) {
  .world-section {
    padding-left: .45rem;
    padding-right: .45rem;
  }
  .reader-map-shell {
    border-width: 4px;
  }
}
