/* AETHELGARD world site.
   Layout: a hub and eight chapters. Every chapter opens on a full-bleed plate (an image slot),
   then reads in a two-column body: a sticky "on this page" rail and a 68ch text column,
   with figures allowed to break out wide. Each chapter is graded like the film: space, drift,
   crown, aerie, floor, shelf. */
:root {
  color-scheme: dark;
  --void: #050607;
  --night: #090b0f;
  --surface: #0f1217;
  --surface-2: #141820;
  --line: #222732;
  --line-soft: #191d25;
  --ink: #ece6d8;
  --ink-2: #b7b09f;
  --ink-3: #7a7466;
  --gold: #e3c98f;
  --gold-2: #b8955a;
  --zenith: #efe2bf;
  --flotilla: #63a79e;
  --indigo: #4a5aa0;
  --cream: #e8dec7;
  --aerie: #96a0ad;
  --aerie-red: #c4493b;
  --abyssal: #9a7fcb;
  --lamp: #e2aa5d;
  --accent: var(--gold);
  --wash: rgba(227, 201, 143, 0.10);
  --font-display: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --font-body: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter-l: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --max: 1240px;
}
.theme-space  { --accent: var(--gold);     --wash: rgba(227, 201, 143, 0.09); }
.theme-drift  { --accent: var(--flotilla); --wash: rgba(99, 167, 158, 0.10); }
.theme-crown  { --accent: var(--zenith);   --wash: rgba(239, 226, 191, 0.09); }
.theme-aerie  { --accent: var(--aerie);    --wash: rgba(150, 160, 173, 0.08); }
.theme-floor  { --accent: var(--abyssal);  --wash: rgba(154, 127, 203, 0.10); }
.theme-shelf  { --accent: var(--lamp);     --wash: rgba(226, 170, 93, 0.08); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
body {
  margin: 0; min-height: 100vh;
  background-color: var(--night);
  background-image: radial-gradient(120% 60% at 50% 0%, var(--wash), transparent 70%);
  background-repeat: no-repeat;
  color: var(--ink); font-family: var(--font-body); font-size: 18.5px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 50; background: var(--void); }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--gold-2); color: var(--void); }
.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.eyebrow {
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.4; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--accent); font-weight: 400;
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; }

/* ================= header ================= */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  background: rgba(5, 6, 7, 0.82); backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line-soft);
}
.top .wrap { display: flex; align-items: center; gap: 28px; min-height: 64px; }
.mark { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex: none; }
.mark svg { width: 26px; height: 26px; }
.mark span { font-family: var(--font-display); font-weight: 500; letter-spacing: 0.3em; font-size: 17px; }
.menu { margin-left: auto; }
.menu ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.menu a { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.menu a:hover { color: var(--ink); }
.menu a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--ink); font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; padding: 9px 14px; cursor: pointer; }
@media (max-width: 980px) {
  .menu-toggle { display: inline-block; }
  .menu { position: absolute; left: 0; right: 0; top: 100%; background: var(--void); border-bottom: 1px solid var(--line); display: none; margin: 0; }
  .menu.is-open { display: block; }
  .menu ul { flex-direction: column; gap: 0; padding: 8px var(--gutter-r) 16px var(--gutter-l); }
  .menu li a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
}

/* ================= image slots ================= */
.slot { position: relative; margin: 0; overflow: hidden; background: var(--surface); isolation: isolate; }
/* starts as a plain cover fill (so it has a size and lazy-loads everywhere); the script then applies the framing */
.slot > img.pl { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; z-index: 2; }
.slot > img.bd { position: absolute; inset: -6%; width: 112%; height: 112%; max-width: none; object-fit: cover; filter: blur(22px) brightness(0.55); z-index: 1; }
.slot.has-img .ph { visibility: hidden; }
.slot .ph { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 18px 20px; gap: 4px; z-index: 0; }
.slot .ph::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ph-art); }
.slot .ph::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.35;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 9px);
}
.slot .ph-name { font-family: var(--font-display); font-style: italic; font-size: 19px; color: rgba(236, 230, 216, 0.82); line-height: 1.2; }
.slot .ph-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(236, 230, 216, 0.45); }
.r-21x9 { aspect-ratio: 21 / 9; } .r-16x9 { aspect-ratio: 16 / 9; } .r-3x2 { aspect-ratio: 3 / 2; }
.r-4x5 { aspect-ratio: 4 / 5; } .r-1x1 { aspect-ratio: 1 / 1; } .r-3x4 { aspect-ratio: 3 / 4; }
.art-space { --ph-art: radial-gradient(circle at 70% 40%, transparent 14%, rgba(255,247,226,0.85) 14.4%, rgba(227,201,143,0.55) 16%, rgba(184,149,90,0.12) 22%, transparent 34%), radial-gradient(120% 120% at 70% 40%, #12100c, #050505 70%); }
.art-drift { --ph-art: radial-gradient(90% 60% at 50% 100%, rgba(233,222,199,0.30), transparent 70%), linear-gradient(180deg, #2a3a3f 0%, #3c5658 40%, #8b9a8f 78%, #c7bfa6 100%); }
.art-night { --ph-art: radial-gradient(60% 40% at 50% 30%, rgba(227,201,143,0.18), transparent 70%), linear-gradient(180deg, #151b33 0%, #1c3a42 55%, #0b1012 100%); }
.art-crown { --ph-art: radial-gradient(40% 30% at 50% 0%, rgba(255,250,232,0.65), transparent 70%), linear-gradient(180deg, #4d4636 0%, #8f8064 40%, #d8ccae 85%, #efe6cf 100%); }
.art-aerie { --ph-art: linear-gradient(100deg, transparent 0 46%, rgba(196,73,59,0.75) 46% 46.6%, transparent 46.6%), linear-gradient(180deg, #1c2026 0%, #3a414b 50%, #20252b 100%); }
.art-floor { --ph-art: radial-gradient(8% 8% at 62% 58%, rgba(226,170,93,0.9), rgba(226,170,93,0.25) 40%, transparent 70%), radial-gradient(70% 60% at 40% 80%, rgba(154,127,203,0.35), transparent 70%), linear-gradient(180deg, #07060b 0%, #140f20 60%, #0b0812 100%); }
.art-shelf { --ph-art: radial-gradient(30% 40% at 30% 60%, rgba(226,170,93,0.35), transparent 70%), linear-gradient(160deg, #1a150f 0%, #0d0b09 100%); }
.slot figcaption, figure .cap { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ink-3); margin-top: 10px; line-height: 1.5; }
figure.with-cap { margin: 0; }
figure.with-cap .slot { margin-bottom: 0; }

/* ================= chapter opener ================= */
.opener { position: relative; }
.opener .slot { width: 100%; height: clamp(360px, 62vh, 640px); aspect-ratio: auto; }
.opener .slot::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(180deg, rgba(5,6,7,0.15) 0%, rgba(5,6,7,0) 30%, rgba(9,11,15,0.65) 72%, var(--night) 100%); pointer-events: none; }
.opener .slot .ph { justify-content: flex-start; padding-top: 22px; align-items: flex-end; }
.opener-text { position: relative; z-index: 3; margin-top: clamp(-220px, -22vh, -150px); }
.crumbs { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.opener h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(48px, 8vw, 104px); line-height: 0.94; letter-spacing: 0.01em; margin: 10px 0 18px; text-wrap: balance; }
.opener .dek { font-family: var(--font-display); font-style: italic; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.3; color: var(--ink-2); max-width: 36ch; margin: 0; text-wrap: balance; }

/* ================= chapter body ================= */
.chapter { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding-block: 56px 40px; }
.rail { position: relative; }
.rail nav { position: sticky; top: 96px; border-left: 1px solid var(--line); padding-left: 16px; }
.rail .eyebrow { color: var(--ink-3); margin-bottom: 12px; display: block; }
.rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rail a { font-size: 15px; color: var(--ink-2); text-decoration: none; line-height: 1.3; display: block; }
.rail a:hover, .rail a.is-here { color: var(--ink); }
.rail a.is-here { position: relative; }
.rail a.is-here::before { content: ""; position: absolute; left: -17px; top: 2px; bottom: 2px; width: 1px; background: var(--accent); }
.content { min-width: 0; }
.content > section { padding-bottom: 64px; margin-bottom: 64px; border-bottom: 1px solid var(--line-soft); }
.content > section:last-child { border-bottom: 0; margin-bottom: 0; }
.prose { max-width: 68ch; }
.prose p { margin: 0 0 1em; }
.content h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 4.2vw, 50px); line-height: 1.04; margin: 8px 0 22px; text-wrap: balance; }
.content h3 { font-family: var(--font-display); font-weight: 500; font-size: 27px; line-height: 1.15; margin: 34px 0 10px; text-wrap: balance; }
.content h3:first-child { margin-top: 0; }
.lead { font-size: 21px; line-height: 1.55; color: var(--ink); }
@media (max-width: 980px) {
  .chapter { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 28px; }
  .rail { display: none; }
}
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 44px; align-items: start; }
.split > * { min-width: 0; }
.split.wide-left { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
@media (max-width: 760px) { .split, .split.wide-left { grid-template-columns: minmax(0, 1fr); } }
.figure-wide { margin: 34px 0; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 26px 0; }
.gallery > * { min-width: 0; }
@media (max-width: 760px) { .gallery { grid-template-columns: minmax(0, 1fr); } }

.quote { margin: 40px 0; padding: 0 0 0 26px; border-left: 2px solid var(--accent); max-width: 52ch; }
.quote p { font-family: var(--font-display); font-style: italic; font-size: clamp(25px, 2.6vw, 32px); line-height: 1.28; margin: 0; color: var(--ink); }
.quote cite { display: block; margin-top: 12px; font-style: normal; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; border-top: 1px solid var(--line); margin: 26px 0; }
.facts div { padding: 16px 18px 16px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.facts dt, .facts .k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.facts dd, .facts .v { margin: 6px 0 0; font-family: var(--font-display); font-size: 27px; line-height: 1.1; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.facts .s { font-size: 14px; color: var(--ink-2); margin-top: 4px; line-height: 1.4; font-family: var(--font-body); }

.ledger { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 0; margin: 20px 0; border-top: 1px solid var(--line); }
.ledger dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line); }
.ledger dd { margin: 0; padding: 13px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
@media (max-width: 560px) { .ledger { grid-template-columns: minmax(0, 1fr); } .ledger dt { border-bottom: 0; padding-bottom: 0; } }

.panel { border: 1px solid var(--line); background: linear-gradient(180deg, var(--surface-2), var(--surface)); padding: 26px 28px; margin: 30px 0; }
.panel h3 { margin-top: 0; }
.panel ol { margin: 14px 0 0; padding-left: 0; list-style: none; counter-reset: law; display: grid; gap: 12px; }
.panel ol li { counter-increment: law; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; }
.panel ol li::before { content: counter(law, upper-roman); font-family: var(--font-mono); font-size: 12px; color: var(--accent); padding-top: 5px; }

.table-scroll { overflow-x: auto; margin: 22px 0; }
table.t { border-collapse: collapse; width: 100%; font-size: 15.5px; min-width: 520px; }
table.t th, table.t td { text-align: left; vertical-align: top; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); }
table.t th { font-family: var(--font-mono); font-weight: 400; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
table.t td { color: var(--ink-2); }
table.t td:first-child { color: var(--ink); white-space: nowrap; }
table.t .r { text-align: right; padding-right: 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }

.more { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.more a { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; color: var(--ink-2); border: 1px solid var(--line); padding: 8px 12px; }
.more a:hover { color: var(--ink); border-color: var(--accent); }

/* ================= home ================= */
.home-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line-soft); }
.home-hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 30px; padding-block: 48px 64px; min-height: min(86vh, 780px); }
.home-hero h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(36px, 5.2vw, 72px); letter-spacing: 0.12em; line-height: 0.9; margin: 18px 0 26px; color: var(--gold); }
.home-hero .tagline { font-family: var(--font-display); font-style: italic; font-size: clamp(26px, 3vw, 38px); line-height: 1.2; margin: 0 0 22px; max-width: 22ch; }
.home-hero p { color: var(--ink-2); max-width: 46ch; }
.hole-wrap { position: relative; display: flex; justify-content: center; }
.hole-wrap canvas { width: min(100%, 560px); aspect-ratio: 1 / 1; height: auto; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; padding: 14px 20px; border: 1px solid var(--gold-2); color: var(--ink); background: rgba(227, 201, 143, 0.06); }
.btn:hover { background: rgba(227, 201, 143, 0.14); color: var(--ink); }
.btn.ghost { border-color: var(--line); background: none; color: var(--ink-2); }
@media (max-width: 900px) {
  .home-hero .wrap { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 24px; }
  .hole-wrap { order: -1; }
  .home-hero h1 { font-size: clamp(34px, 9.6vw, 84px); letter-spacing: 0.07em; }
  .hole-wrap canvas { width: min(78vw, 380px); }
}
.dimming { display: inline-grid; gap: 4px; margin-top: 26px; padding: 14px 18px; border: 1px solid var(--line); border-left: 2px solid var(--gold); background: rgba(15, 18, 23, 0.7); }
.dimming b { font-family: var(--font-mono); font-weight: 400; font-size: 12.5px; letter-spacing: 0.2em; color: var(--ink); }
.dimming span { font-style: italic; color: var(--ink-2); }

.band { padding-block: 84px; }
.band-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.band-head h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(36px, 4.6vw, 58px); line-height: 1.02; margin: 8px 0 0; text-wrap: balance; }
.band-head p { margin: 0; color: var(--ink-2); max-width: 46ch; }

.numbers { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.numbers div { padding: 24px 18px 22px 0; min-width: 0; }
.numbers div + div { padding-left: 18px; border-left: 1px solid var(--line-soft); }
.numbers .v { font-family: var(--font-display); font-size: clamp(30px, 3.2vw, 44px); line-height: 1; font-variant-numeric: lining-nums; }
.numbers .s { font-size: 14px; color: var(--ink-2); margin-top: 8px; line-height: 1.4; }
@media (max-width: 980px) { .numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); } .numbers div:nth-child(4) { border-left: 0; padding-left: 0; } }
@media (max-width: 560px) { .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); } .numbers div:nth-child(odd) { border-left: 0; padding-left: 0; } .numbers div:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--line-soft); } }

.chapters { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.chapter-card { grid-column: span 4; position: relative; display: block; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--surface); overflow: hidden; min-width: 0; }
.chapter-card.big { grid-column: span 6; }
.chapter-card .slot { aspect-ratio: 16 / 10; }
.chapter-card.big .slot { aspect-ratio: 16 / 9; }

.chapter-card .body { padding: 18px 20px 20px; }
.chapter-card .no { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; color: var(--accent); }
.chapter-card h3 { font-family: var(--font-display); font-weight: 500; font-size: 30px; margin: 6px 0 6px; line-height: 1.05; }
.chapter-card p { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.5; }
.chapter-card:hover h3 { color: var(--gold); }
@media (max-width: 980px) { .chapter-card, .chapter-card.big { grid-column: span 6; } }
@media (max-width: 620px) { .chapter-card, .chapter-card.big { grid-column: span 12; } }

.keyart { position: relative; }
.keyart .slot { height: clamp(320px, 56vw, 640px); aspect-ratio: auto; }
.keyart blockquote { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; margin: 0; padding: 60px var(--gutter-r) 34px var(--gutter-l); background: linear-gradient(180deg, transparent, rgba(5,6,7,0.85)); }
.keyart blockquote p { max-width: var(--max); margin: 0 auto; font-family: var(--font-display); font-style: italic; font-size: clamp(26px, 3.4vw, 44px); line-height: 1.2; }

/* ================= the sky ladder ================= */
.ladder { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 28px; align-items: start; margin-top: 26px; }
.ladder-scale { display: grid; gap: 4px; }
.rung {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; width: 100%; cursor: pointer; text-align: left;
  padding: 0 16px; border: 1px solid var(--line); border-left: 3px solid var(--c, var(--line));
  background: linear-gradient(90deg, color-mix(in srgb, var(--c, #000) 16%, var(--surface)), var(--surface));
  color: var(--ink); font-family: var(--font-display); font-size: 21px; font-weight: 500;
  height: calc(var(--km, 6) * 7px); min-height: 40px;
}
.rung .alt { font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--ink-3); letter-spacing: 0.06em; }
.rung:hover { border-color: var(--c); }
.rung[aria-pressed="true"] { border-color: var(--c); background: linear-gradient(90deg, color-mix(in srgb, var(--c, #000) 32%, var(--surface)), var(--surface-2)); }
.rung.brk { height: 44px; border-style: dashed; border-left-style: solid; }
.gap-note { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.14em; text-transform: uppercase; text-align: center; padding: 2px 0; }
.rung-panel { position: sticky; top: 96px; border: 1px solid var(--line); background: var(--surface); padding: 26px 28px; }
.rung-panel h3 { margin: 6px 0 4px !important; font-size: 34px; }
.rung-panel .air { font-family: var(--font-mono); font-size: 12.5px; color: var(--gold); margin-bottom: 14px; }
.rung-panel dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 16px 0 0; font-size: 15.5px; }
.rung-panel dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; }
.rung-panel dd { margin: 0; color: var(--ink-2); }
@media (max-width: 760px) { .ladder { grid-template-columns: minmax(0, 1fr); } .rung { height: calc(var(--km, 6) * 4px); } .rung-panel { position: static; } }
.c-hole { --c: var(--gold); } .c-ceiling { --c: #3f8f97; } .c-crown { --c: var(--zenith); } .c-drift { --c: var(--flotilla); }
.c-flanks { --c: var(--aerie); } .c-floor { --c: var(--abyssal); } .c-deep { --c: #2c2540; }

.chart-scroll { overflow-x: auto; }
.chart-scroll svg { display: block; width: 100%; min-width: 600px; height: auto; }
.chart-scroll svg text { font-family: var(--font-mono); }
.figure-box { border: 1px solid var(--line); background: var(--surface); padding: 20px 20px 14px; margin: 30px 0; }

/* ================= nations ================= */
.nation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 760px) { .nation-grid { grid-template-columns: minmax(0, 1fr); } }
.nation-card { position: relative; display: block; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--surface); overflow: hidden; min-width: 0; }
.nation-card .slot { aspect-ratio: 16 / 9; }
.nation-card .body { padding: 20px 22px 22px; border-top: 3px solid var(--nc); }
.nation-card .rungline { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--nc); text-transform: uppercase; }
.nation-card h3 { font-family: var(--font-display); font-weight: 500; font-size: 34px; margin: 6px 0 2px; }
.nation-card .ep { font-style: italic; color: var(--ink-2); margin: 0 0 8px; }
.nation-card p { margin: 0; color: var(--ink-2); font-size: 16px; }
.nation-card:hover h3 { color: var(--nc); }
.n-zenith { --nc: var(--zenith); } .n-flotilla { --nc: var(--flotilla); } .n-aerie { --nc: var(--aerie); } .n-abyssal { --nc: var(--abyssal); }
.pager { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 10px; }
.pager a { display: block; border: 1px solid var(--line); padding: 18px 20px; text-decoration: none; color: var(--ink); min-width: 0; }
.pager a:hover { border-color: var(--accent); }
.pager .dir { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.pager .name { font-family: var(--font-display); font-size: 26px; display: block; margin-top: 4px; }
.pager .next { text-align: right; }
.redline { display: inline-block; width: 32px; height: 2px; background: var(--aerie-red); vertical-align: middle; margin: 0 6px; }

/* ================= people ================= */
.cast { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 980px) { .cast { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cast { grid-template-columns: minmax(0, 1fr); } }
.person { min-width: 0; scroll-margin-top: 96px; }
.person .slot { aspect-ratio: 4 / 5; border-bottom: 3px solid var(--nc); }
.person .who { padding: 16px 2px 0; }
.person .tagline { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--nc); }
.person h3 { font-family: var(--font-display); font-weight: 500; font-size: 30px; line-height: 1.05; margin: 6px 0 8px !important; }
.person p { margin: 0; color: var(--ink-2); font-size: 16.5px; line-height: 1.55; }
.person .line { font-family: var(--font-display); font-style: italic; font-size: 19px; color: var(--ink); margin-top: 10px; }
.people-group { margin-bottom: 56px; }
.people-group > .eyebrow { display: block; margin-bottom: 18px; color: var(--nc); }

/* ================= history ================= */
.mural { position: relative; margin: 10px 0 0; padding: 0; list-style: none; }
.mural::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(180deg, var(--gold), var(--line) 40%, var(--line) 85%, var(--gold)); }
.mural > li { position: relative; padding: 0 0 54px 48px; }
.mural > li::before { content: ""; position: absolute; left: 6px; top: 10px; width: 11px; height: 11px; border-radius: 50%; background: var(--night); border: 1px solid var(--gold); }
.mural > li.now::before { background: var(--gold); box-shadow: 0 0 0 5px rgba(227, 201, 143, 0.18); }
.mural .when { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-2); }
.mural h3 { margin: 6px 0 12px !important; font-size: 32px; }
.choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0 4px; }
.choices a { min-width: 0; border: 1px solid var(--line); border-top: 2px solid var(--nc); padding: 12px 14px; text-decoration: none; color: var(--ink-2); font-size: 14px; background: var(--surface); }
.choices b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 19px; color: var(--ink); }
@media (max-width: 640px) { .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ================= the quiet shelf ================= */
.measures { list-style: none; padding: 0; margin: 22px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.measures li { min-width: 0; border: 1px solid var(--line); background: var(--surface); padding: 18px 20px; font-size: 16.5px; color: var(--ink-2); }
.measures li b { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
@media (max-width: 680px) { .measures { grid-template-columns: minmax(0, 1fr); } }
.shelf-tools { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 6px 0 28px; }
.search { font-family: var(--font-body); font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: 12px 16px; width: min(100%, 420px); }
.search::placeholder { color: var(--ink-3); }
.count { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.book { border-top: 1px solid var(--line); scroll-margin-top: 96px; }
.book:last-child { border-bottom: 1px solid var(--line); }
.book summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 14px; align-items: baseline; padding: 18px 0; }
.book summary::-webkit-details-marker { display: none; }
.book .no { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.08em; }
.book .q { font-family: var(--font-display); font-size: 25px; font-weight: 500; line-height: 1.2; }
.book .st { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.book summary:hover .q, .book[open] .q { color: var(--accent); }
.book .text { padding: 0 0 30px 84px; max-width: calc(68ch + 84px); }
.book .text p { color: var(--ink-2); }
.book .text p b { color: var(--ink); font-weight: 500; }
.book .text h4 { font-family: var(--font-mono); font-weight: 400; font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin: 26px 0 12px; }
.book.sealed .q { color: var(--ink-3); }
.book.sealed .st { color: var(--abyssal); }
@media (max-width: 620px) {
  .book summary { grid-template-columns: 48px minmax(0, 1fr); }
  .book .st { grid-column: 2; }
  .book .text { padding-left: 0; }
  .book .q { font-size: 22px; }
}

/* ================= glossary ================= */
.az { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 24px; }
.az a { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); text-decoration: none; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); }
.az a:hover { color: var(--ink); border-color: var(--accent); }
.az span { font-family: var(--font-mono); font-size: 12.5px; color: var(--line); width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line-soft); }
.letter { margin: 0 0 30px; scroll-margin-top: 96px; }
.letter > h2 { font-family: var(--font-display); font-size: 44px !important; color: var(--accent); margin: 0 0 6px !important; }
.terms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin: 0; }
.terms > div { min-width: 0; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.terms dt { font-family: var(--font-display); font-size: 22px; font-weight: 500; color: var(--ink); }
.terms dd { margin: 3px 0 0; color: var(--ink-2); font-size: 16.5px; line-height: 1.5; }
.terms dd a { white-space: nowrap; }
@media (max-width: 760px) { .terms { grid-template-columns: minmax(0, 1fr); } }
.none { font-style: italic; color: var(--ink-3); }

/* ================= footer ================= */
.foot { margin-top: 40px; border-top: 1px solid var(--line); background: var(--void); }
.foot .wrap { display: grid; grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr)); gap: 30px; padding-block: 52px 40px; }
.foot .about p { color: var(--ink-3); font-size: 15px; max-width: 38ch; }
.foot .colh { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot a { color: var(--ink-2); text-decoration: none; font-size: 15px; }
.foot a:hover { color: var(--ink); }
.foot .legal { grid-column: 1 / -1; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 24px; border-top: 1px solid var(--line-soft); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--ink-3); }
@media (max-width: 760px) { .foot .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot .about { grid-column: 1 / -1; } }

/* ================= season one ================= */
.chapter-card.wide { grid-column: span 12; }
.chapter-card.wide .slot { aspect-ratio: 21 / 8; }
.episodes { display: grid; gap: 22px; margin-top: 10px; }
.episode { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 0; border: 1px solid var(--line); background: var(--surface); scroll-margin-top: 96px; }
.episode > .slot { aspect-ratio: 16 / 9; }
.ep-body { padding: 22px 26px 22px; min-width: 0; }
.ep-meta { display: flex; gap: 14px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-2); }
.episode h3 { margin: 8px 0 10px !important; font-size: 32px; }
.teaser { color: var(--ink); margin: 0 0 14px; }
.reveal { border-top: 1px solid var(--line); padding-top: 12px; }
.reveal summary { cursor: pointer; list-style: none; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.reveal summary::-webkit-details-marker { display: none; }
.reveal summary span { color: var(--aerie-red); margin-left: 8px; }
.reveal summary:hover { color: var(--ink); }
.reveal[open] summary { color: var(--ink); margin-bottom: 10px; }
.reveal p { color: var(--ink-2); font-size: 16.5px; margin: 0; }
@media (max-width: 860px) { .episode { grid-template-columns: minmax(0, 1fr); } }

/* ================= gallery ================= */
/* justified rows: read left to right, each image whole, one height per row (the script sets each tile's ratio) */
.masonry { --row: 230px; display: flex; flex-wrap: wrap; gap: 12px; }
.masonry::after { content: ""; flex: 999 1 0; }
@media (max-width: 640px) { .masonry { --row: 150px; gap: 8px; } }
.tile { --ar: 1.5; flex: var(--ar) 1 calc(var(--ar) * var(--row)); aspect-ratio: var(--ar); display: block; position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 500ms ease, opacity 300ms ease; }
.tile span { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; font-family: var(--font-display); font-style: italic; font-size: 17px; line-height: 1.2; background: linear-gradient(180deg, transparent, rgba(5,6,7,0.85)); opacity: 0; transition: opacity 200ms ease; }
.tile:hover img { transform: scale(1.03); }
.tile:hover span, .tile:focus-visible span { opacity: 1; }
@media (hover: none) { .tile span { opacity: 1; } }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(3,4,5,0.96); display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; padding: max(20px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: 12px; min-width: 0; }
.lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; }
.lightbox figcaption { font-family: var(--font-display); font-style: italic; font-size: 20px; color: var(--ink-2); text-align: center; }
.lightbox button { background: none; border: 1px solid var(--line); color: var(--ink); cursor: pointer; font-size: 28px; height: 52px; }
.lightbox .lb-close { position: absolute; top: max(14px, env(safe-area-inset-top, 0px)); right: max(14px, env(safe-area-inset-right, 0px)); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; height: auto; padding: 10px 14px; }
@media (max-width: 620px) { .lightbox { grid-template-columns: 40px minmax(0, 1fr) 40px; } }

.gallery-wrap { padding-block: 40px 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 34px; }
.chips a { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; color: var(--ink-2); border: 1px solid var(--line); padding: 8px 12px; }
.chips a:hover { color: var(--ink); border-color: var(--accent); }
.gal-group { margin-bottom: 56px; scroll-margin-top: 96px; }
.gal-group h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(32px, 4vw, 46px); margin: 6px 0 20px; }
