/* Crown Expansion Planner — "field atlas" print edition */

@font-face { font-family: 'Fraunces'; src: url('/fonts/Fraunces_600SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('/fonts/Fraunces_700Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/fonts/IBMPlexSans_400Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/fonts/IBMPlexSans_500Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/fonts/IBMPlexSans_600SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }

:root {
  --ink: #14231E;
  --ink-2: #233A32;
  --ink-muted: #8FA59B;
  --paper: #F4EFE4;
  --paper-2: #EDE6D6;
  --surface: #FFFDF8;
  --line: #D6CCB7;
  --text: #1A211E;
  --muted: #5B6159;
  --gold: #B8862B;
  --gold-bright: #D9A441;
  --terracotta: #A94A25;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Plex', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 10px 14px; z-index: 50; }
.skip:focus { left: 8px; }

/* ── Masthead ─────────────────────────────────────────────── */
.masthead { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.masthead__row { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand__name { font-family: var(--serif); font-weight: 600; font-size: 20px; letter-spacing: -0.01em; }
.nav { display: flex; gap: 28px; }
.nav a { text-decoration: none; font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding: 8px 0; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); box-shadow: inset 0 -2px var(--gold-bright); }
.navtoggle { display: none; }

/* ── Buttons ──────────────────────────────────────────────── */
.play {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 22px 8px 18px;
  border-radius: 8px; text-decoration: none; line-height: 1.1;
  font-weight: 600; font-size: 19px;
}
.play small { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.play--dark { background: var(--ink); color: var(--paper); }
.play--dark:hover { color: var(--gold-bright); }
.play--light { background: var(--gold-bright); color: var(--ink); }
.play--light:hover { color: var(--ink); background: #e6b457; }
.play--soon { cursor: default; opacity: 0.92; }
.play--soon.play--dark:hover { color: var(--paper); }
.textlink { font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--gold); padding-bottom: 2px; }

/* ── Title page ───────────────────────────────────────────── */
.title {
  position: relative;
  padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 8vw, 104px);
  background-image:
    linear-gradient(to right, rgba(20, 35, 30, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20, 35, 30, 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center top;
  border-bottom: 1px solid var(--line);
}
.title__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.kicker { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 28px; }
.kicker__rule { width: 40px; height: 2px; background: var(--gold-bright); }
.title h1 { font-size: clamp(40px, 6.4vw, 84px); line-height: 1.02; letter-spacing: -0.025em; max-width: 13ch; }
.title__lead { font-size: clamp(18px, 1.7vw, 21px); color: var(--muted); max-width: 36em; margin: 28px 0 32px; }
.title__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.facts { list-style: none; padding: 0; margin: 40px 0 0; display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--line); }
.facts li { font-size: 14px; font-weight: 500; padding: 12px 0 0 16px; margin-right: 22px; color: var(--ink); position: relative; }
.facts li::before { content: ''; position: absolute; left: 0; top: 20px; width: 6px; height: 6px; background: var(--gold-bright); transform: rotate(45deg); }

/* ── Plates (screenshots) ─────────────────────────────────── */
.plate { margin: 0; }
.plate__frame {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--ink);
  padding: 14px;
  box-shadow: 10px 10px 0 var(--paper-2);
}
.plate__frame::before, .plate__frame::after {
  content: ''; position: absolute; width: 18px; height: 18px; border: 2px solid var(--gold-bright);
}
.plate__frame::before { top: -7px; left: -7px; border-right: 0; border-bottom: 0; }
.plate__frame::after { bottom: -7px; right: -7px; border-left: 0; border-top: 0; }
.plate__frame img { border: 1px solid var(--line); aspect-ratio: 720 / 1603; object-fit: cover; object-position: top; width: 100%; }
.plate figcaption { margin-top: 18px; font-size: 13px; color: var(--muted); letter-spacing: 0.04em; }
.plate__no { font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); margin-right: 8px; }
.plate--hero { max-width: 360px; justify-self: end; transform: rotate(1.2deg); }
.plate--hero .plate__frame img { aspect-ratio: 720 / 1250; }

/* ── Section heads ────────────────────────────────────────── */
.sectionhead { margin-bottom: 40px; }
.sectionhead__label { font-size: 13px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.sectionhead h2 { font-size: clamp(30px, 4vw, 48px); max-width: 20ch; }
.sectionhead--light h2 { color: var(--paper); }

/* ── Contents ─────────────────────────────────────────────── */
.contents { padding: clamp(64px, 9vw, 112px) 0; }
.toc { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.toc a {
  display: grid; grid-template-columns: 64px auto 1fr auto; align-items: baseline; gap: 16px;
  padding: 22px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.toc a:hover .toc__title { color: var(--gold); }
.toc__num { font-family: var(--serif); font-weight: 700; font-size: 22px; color: var(--gold); }
.toc__title { font-family: var(--serif); font-size: clamp(22px, 2.6vw, 32px); font-weight: 600; transition: color .15s; }
.toc__dots { border-bottom: 2px dotted var(--line); transform: translateY(-6px); }
.toc__page { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* ── Route ────────────────────────────────────────────────── */
.route { padding: 0 0 clamp(64px, 9vw, 112px); }
.route__title { font-size: clamp(24px, 2.6vw, 32px); margin-bottom: 36px; }
.route__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; position: relative; }
.route__list::before {
  content: ''; position: absolute; left: 22px; right: 22px; top: 22px; border-top: 2px dashed var(--gold);
}
.route__stop { position: relative; }
.route__step {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--ink); font-weight: 600; font-size: 14px; margin-bottom: 18px; position: relative;
}
.route__stop:last-child .route__step { background: var(--gold-bright); border-color: var(--gold-bright); }
.route__stop h3 { font-size: 21px; margin-bottom: 8px; }
.route__stop p { color: var(--muted); font-size: 15px; }

/* ── Chapters ─────────────────────────────────────────────── */
.chapter { padding: clamp(64px, 9vw, 120px) 0; border-top: 1px solid var(--line); }
.chapter__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: clamp(40px, 8vw, 120px); align-items: center; }
.chapter--flip .chapter__grid { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); }
.chapter--flip .chapter__text { order: 2; }
.chapter__num { font-family: var(--serif); font-weight: 700; font-size: clamp(72px, 10vw, 128px); line-height: 0.9; color: transparent; -webkit-text-stroke: 1.5px var(--gold); margin-bottom: 12px; }
.chapter h2 { font-size: clamp(32px, 4.2vw, 54px); margin-bottom: 20px; max-width: 14ch; }
.chapter__lead { font-size: 19px; color: var(--muted); max-width: 34em; }
.ticks { list-style: none; padding: 0; margin: 24px 0 0; }
.ticks li { position: relative; padding: 10px 0 10px 32px; border-top: 1px solid var(--line); }
.ticks li::before { content: ''; position: absolute; left: 4px; top: 19px; width: 12px; height: 7px; border-left: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(-45deg); }

/* ── Plates wall ──────────────────────────────────────────── */
.plates { background: var(--ink); color: var(--paper); padding: clamp(64px, 9vw, 112px) 0; }
.plates__scroller {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr);
  gap: 32px; overflow-x: auto; scroll-snap-type: x mandatory;
  max-width: var(--wrap); margin: 0 auto; padding: 8px var(--gutter) 24px;
}
.plate--small { scroll-snap-align: start; }
.plates .plate__frame { background: var(--ink-2); border-color: var(--ink-muted); box-shadow: 10px 10px 0 rgba(0,0,0,0.25); }
.plates .plate__frame img { border-color: transparent; }
.plates figcaption, .plates .plate__no { color: var(--ink-muted); }
.plates .plate__no { color: var(--paper); }

/* ── Appendix ─────────────────────────────────────────────── */
.appendix { padding: clamp(64px, 9vw, 112px) 0; }
.appendix__grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; }
.appendix__list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 40px; }
.appendix__list li { break-inside: avoid; padding: 14px 0; border-top: 1px solid var(--line); font-size: 16px; }

/* ── FAQ ──────────────────────────────────────────────────── */
.faq { padding: 0 0 clamp(64px, 9vw, 112px); }
.faq__grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; }
.faq__list { border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 44px 20px 0; position: relative;
  font-family: var(--serif); font-size: 21px; font-weight: 600; min-height: 48px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 8px; top: 16px; font-family: var(--sans); font-size: 26px; color: var(--gold); }
.faq details[open] summary::after { content: '−'; }
.faq details p { color: var(--muted); max-width: 40em; padding-bottom: 12px; }

/* ── Download ─────────────────────────────────────────────── */
.download {
  background:
    radial-gradient(circle at 85% 50%, transparent 0 180px, rgba(143,165,155,0.14) 181px 183px, transparent 184px 300px, rgba(143,165,155,0.1) 301px 303px, transparent 304px),
    var(--ink);
  color: var(--paper);
  padding: clamp(72px, 10vw, 128px) 0;
}
.download__inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.download__mark { margin-bottom: 20px; }
.download h2 { font-size: clamp(34px, 5vw, 60px); margin-bottom: 16px; }
.download p { color: var(--ink-muted); }
.download .play { margin-top: 12px; }
.download__support { margin-top: 28px; font-size: 15px; }
.download__support a { color: var(--paper); }

/* ── Documents (privacy, 404) ─────────────────────────────── */
.doc { padding: clamp(48px, 7vw, 88px) 0 clamp(64px, 9vw, 112px); }
.doc__wrap { max-width: 780px; }
.doc h1 { font-size: clamp(34px, 5vw, 54px); margin-bottom: 16px; }
.doc h2 { font-size: 24px; margin: 40px 0 12px; }
.doc__meta { color: var(--muted); font-size: 15px; }
.doc__summary { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold-bright); padding: 24px 28px; margin: 32px 0; }
.doc__summary h2 { margin-top: 0; }
.doc ul:not(.ticks) { padding-left: 1.2em; }
.doc li { margin-bottom: 8px; }
.notfound { min-height: 40vh; }

/* ── Colophon ─────────────────────────────────────────────── */
.colophon { background: var(--paper-2); border-top: 1px solid var(--line); padding: 56px 0 48px; font-size: 15px; }
.colophon__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.colophon__logo { width: 240px; height: auto; margin-bottom: 16px; }
.colophon__note { color: var(--muted); max-width: 30em; }
.colophon__head { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.colophon p { margin-bottom: 8px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .title__grid, .chapter__grid, .chapter--flip .chapter__grid, .appendix__grid, .faq__grid { grid-template-columns: 1fr; }
  .chapter--flip .chapter__text { order: 0; }
  .plate--hero { justify-self: start; max-width: 300px; transform: none; }
  .chapter .plate { max-width: 340px; }
  .route__list { grid-template-columns: 1fr 1fr; }
  .route__list::before { display: none; }
  .colophon__grid { grid-template-columns: 1fr 1fr; }
  .colophon__grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .navtoggle {
    display: inline-grid; place-items: center; width: 48px; height: 48px; margin-right: -8px;
    background: none; border: 0; cursor: pointer; color: var(--ink);
  }
  .navtoggle__bars, .navtoggle__bars::before, .navtoggle__bars::after {
    display: block; width: 24px; height: 2px; background: currentColor; position: relative; content: '';
  }
  .navtoggle__bars::before { position: absolute; top: -7px; }
  .navtoggle__bars::after { position: absolute; top: 7px; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 0; border-top: 1px solid var(--line); font-size: 14px; }
  .brand__name { font-size: 17px; }
  .toc a { grid-template-columns: 44px 1fr; }
  .toc__dots, .toc__page { display: none; }
  .route__list { grid-template-columns: 1fr; gap: 20px; }
  .appendix__list { columns: 1; }
  .colophon__grid { grid-template-columns: 1fr; }
  .plates__scroller { grid-auto-columns: 72%; }
  .play { width: 100%; justify-content: center; }
  .title__actions { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .plate--hero { transform: none; }
}
