:root {
  --sc-canvas: #151e22;
  --sc-surface: #202b2b;
  --sc-ink: #f4ecda;
  --sc-ink-soft: #d6cebd;
  --sc-accent: #efc58f;
  --sc-accent-ink: #1c231e;
  --sc-font-display: 'Palatino Linotype', Palatino, Cambria, 'Times New Roman', serif;
  --sc-font-text: 'Segoe UI', Arial, sans-serif;
  --gutter: clamp(1.3rem, 6.1vw, 7.4rem);
  --rule: #edcea34d;
  --header: 4.7rem;
}

html { scroll-padding-top: var(--header); }
body { min-width: 0; line-height: 1.62; }
a { color: inherit; }
p { margin: 0; }
section { position: relative; }
.frame { width: min(100%, 106rem); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: fixed; inset: .5rem auto auto .5rem; z-index: 20; transform: translateY(-180%); padding: .75rem 1rem; color: var(--sc-accent-ink); background: var(--sc-accent); }
.skip:focus { transform: none; }
main:focus { outline: none; }
:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 5px; }

.masthead {
  position: fixed; z-index: 5; inset: 0 0 auto; min-height: var(--header);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  padding: .5rem var(--gutter); border-bottom: 1px solid #e6cbae35;
  background: #162024;
}
.wordmark { display: flex; align-items: center; gap: .76rem; justify-self: start; text-decoration: none; }
.sigil { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 1px solid #edcea37a; font: 1.65rem/1 var(--sc-font-display); color: var(--sc-accent); }
.brand-name { font: 1.1rem/1.15 var(--sc-font-display); letter-spacing: .04em; }
.brand-name small { display: block; margin-top: .28rem; font: .65rem/1 var(--sc-font-text); letter-spacing: .1em; color: var(--sc-ink-soft); }
.waypoints { display: flex; align-items: stretch; gap: clamp(.55rem, 2.6vw, 2.65rem); }
.waypoints a, .source-link { display: inline-flex; min-height: 44px; align-items: center; position: relative; text-decoration: none; white-space: nowrap; font-size: .78rem; font-weight: 600; letter-spacing: .055em; color: var(--sc-ink-soft); }
.waypoints a[aria-current], .waypoints a:hover, .source-link:hover { color: var(--sc-accent); }
.waypoints a[aria-current]::after { content: ''; position: absolute; bottom: 4px; width: 100%; border-bottom: 1px solid currentColor; }
.source-link { justify-self: end; gap: .48rem; }
.source-link span { color: var(--sc-accent); }
.reading-line { position: absolute; inset: auto 0 -1px; height: 1px; background: var(--sc-accent); transform: scaleX(var(--read-progress, 0)); transform-origin: left; }

#world { display: none; position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; background: var(--sc-canvas); }
.motion-ready #world { display: block; }
.scene, .plate, .world-shade, .world-route { position: absolute; inset: 0; }
.scene { opacity: 0; }
.scene-athens { opacity: 1; }
.plate { background-size: cover; background-position: center; transform: translate3d(var(--land-x, 0px), var(--land-y, 0px), 0) scale(var(--land-zoom, 1.04)); }
.plate-athens { background-image: url('assets/athens.webp'); }
.plate-persia { background-image: url('assets/persia.webp'); }
.plate-craft { background-image: url('assets/scillus.webp'); background-position: 87% center; }
.plate-vietnam { background-image: url('assets/vietnam.webp'); }
.morning-air { position: absolute; inset: 6% 1% 0 29%; background: radial-gradient(ellipse at 77% 39%, #f2bb6a26, transparent 54%); transform: translate3d(var(--air-x, 0px), 0, 0); }
.stage-portrait { position: absolute; top: 9%; right: 2%; width: 59%; height: 98%; background: url('assets/bust.webp') center bottom / contain no-repeat; opacity: var(--stone-opacity, 1); transform: translate3d(var(--stone-x, 0px), var(--stone-y, 0px), 0); filter: drop-shadow(-22px 22px 38px #141c208c); }
.stone-sill { position: absolute; inset: auto 0 0; height: 14%; background: linear-gradient(transparent, #111a1e 96%); transform: translateY(var(--sill-y, 0px)); }
.world-shade { background: linear-gradient(90deg, #111a20e8, #111a20bd 27%, #111a2040 54%, transparent 76%); }
.dawn { position: absolute; inset: 0; opacity: var(--fire, 0); background: radial-gradient(ellipse at 70% 58%, #ffd28f61, #d3823a19 23%, transparent 52%); mix-blend-mode: screen; }
.world-route { width: 100%; height: 100%; opacity: var(--route-opacity, 0); }
.world-route path { vector-effect: non-scaling-stroke; }
.route-trace { stroke: #f4cd9a66; stroke-width: 1; stroke-dasharray: 3 8; }
.route-light { stroke: #ffdb9d; stroke-width: 1.7; stroke-dasharray: 1; stroke-dashoffset: var(--route-length, 1); }

main { position: relative; z-index: 1; }
.chapter { isolation: isolate; }
.static-art { position: absolute; z-index: -1; inset: 0; background-position: center; background-size: cover; }
.static-hero { background-image: url('assets/athens.webp'); }
.static-hero::before { content: ''; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, #111a20e8, #111a20bd 27%, #111a207a 54%, transparent 76%); }
.static-hero::after { content: ''; position: absolute; inset: 8% 2% 0 39%; background: url('assets/bust.webp') center bottom / contain no-repeat; }
.static-persia { background-image: linear-gradient(90deg, #111a20ee, #111a2060), url('assets/persia.webp'); }
.static-craft { background-image: linear-gradient(90deg, #111a20ec, #111a2090 40%, transparent 83%), url('assets/scillus.webp'); background-position: 87% center; }
.static-vietnam { background-image: linear-gradient(90deg, #111a20f0, #111a2055), url('assets/vietnam.webp'); }
.motion-ready .static-art { display: none; }
.hero-frame { min-height: 100svh; display: grid; grid-template-rows: 1fr auto; align-items: center; padding-top: var(--header); }
.hero-copy { margin-top: clamp(0rem, 4vh, 3rem); width: fit-content; position: relative; z-index: 1; }
.kicker { display: flex; gap: .62rem; align-items: center; color: var(--sc-accent); font-size: .72rem; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; }
.tiny-rule { flex: 0 0 1.45rem; height: 1px; background: currentColor; }
h1, h2, .turn-line { font-family: var(--sc-font-display); font-weight: 400; color: var(--sc-ink); }
h1 { margin: .045em 0 .09em -.054em; font-family: Georgia, var(--sc-font-display); font-size: clamp(4.1rem, 12vw, 12rem); letter-spacing: -.085em; line-height: .95; }
h1 span { color: var(--sc-accent); }
.greek-name { color: var(--sc-accent); font: 1.15rem/1.2 var(--sc-font-display); letter-spacing: .055em; }
.greek-name span[aria-hidden] { margin-inline: .45em; opacity: .64; }
.hero-intro { margin: 1.6rem 0 1.55rem; max-width: 25ch; font: clamp(1.15rem, 2vw, 1.6rem)/1.36 var(--sc-font-display); color: var(--sc-ink); }
.begin { display: inline-flex; align-items: center; gap: 1.6rem; min-height: 47px; padding: .58rem .98rem; color: var(--sc-accent-ink); background: var(--sc-accent); text-decoration: none; font-weight: 700; font-size: .83rem; }
.begin:hover { background: #ffdbab; }
.begin:active { transform: translateY(1px); }
.hero-note { display: flex; gap: 2.25rem; border-top: 1px solid var(--rule); padding-block: 1.05rem; color: var(--sc-ink-soft); font-size: .66rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.hero-note span span { padding-inline: .2em; color: var(--sc-accent); }

.chapter h2 { margin: .22em 0 .37em; line-height: .99; letter-spacing: -.062em; font-size: clamp(3.4rem, 7.7vw, 8.6rem); }
.camp-frame { min-height: 191svh; display: grid; grid-template-rows: 1fr .86fr; align-items: center; padding-block: clamp(5rem, 12vh, 8.5rem); }
.camp-copy, .river-copy { width: min(100%, 35rem); }
.camp-copy p:not(.kicker), .river-copy p:not(.kicker), .craft-lead > p:not(.kicker), .turn p + p { max-width: 39ch; color: var(--sc-ink-soft); font-size: clamp(1rem, 1.5vw, 1.2rem); }
.camp-copy p + p, .river-copy p + p, .craft-lead p + p { margin-top: .95rem; }
.camp-copy .scene-source { color: var(--sc-accent); font-size: .79rem; }
.scene-source a:hover { color: var(--sc-ink); }
.turn { align-self: center; position: relative; margin-block: 1rem; }
.turn-line { color: var(--sc-accent); font-size: clamp(3rem, 6.8vw, 7rem); line-height: 1.03; letter-spacing: -.045em; }
.turn p + p { margin-top: 1rem; }

.craft { background: #1b2824; }
.motion-ready .craft { background: transparent; }
.craft-frame { min-height: 113svh; display: grid; grid-template-columns: minmax(0, 36rem) minmax(0, 1fr); align-content: center; gap: clamp(1.75rem, 4vw, 3.5rem); padding-block: clamp(4.5rem, 10vh, 7rem); }
.craft-frame > * { grid-column: 1; }
.craft-frame h2 { font-size: clamp(3.4rem, 6.2vw, 7rem); }
.craft-lead .craft-aside { font-size: .86rem; max-width: 40ch; }
.ledger { margin: 0; padding: clamp(1.2rem, 3vw, 2.2rem); border: 1px solid #edcea355; background: #162520ed; box-shadow: 0 26px 60px #0c151957; }
.ledger > div + div { padding-top: 1.25rem; margin-top: 1.25rem; border-top: 1px solid var(--rule); }
.ledger dt { color: var(--sc-accent); font: clamp(1.65rem, 3vw, 2.55rem)/1.05 var(--sc-font-display); }
.ledger dt small { display: inline-block; margin-left: .45rem; color: var(--sc-ink-soft); font: .72rem/1.4 var(--sc-font-text); letter-spacing: .09em; }
.ledger dd { margin: .6rem 0 0; color: var(--sc-ink-soft); }
.ledger strong { color: var(--sc-ink); }

.river-frame { min-height: 111svh; display: flex; align-items: center; padding-block: 5rem; }
.river-copy .begin { margin-top: 1.6rem; }
.sources { background: #17221f; border-top: 1px solid var(--rule); }
.sources-frame { display: grid; grid-template-columns: .75fr 1.25fr; gap: clamp(2.4rem, 8vw, 9rem); padding-block: clamp(3.5rem, 8vw, 7rem); }
.sources h2 { margin: .27em 0 .37em; font-size: clamp(3.25rem, 6vw, 6rem); line-height: 1; letter-spacing: -.06em; }
.sources p, .sources ul { color: var(--sc-ink-soft); }
.source-notes { border-top: 1px solid var(--rule); }
details { border-bottom: 1px solid var(--rule); }
summary { min-height: 47px; cursor: pointer; font-weight: 600; padding: .75rem 0; }
summary:focus-visible { outline-offset: -2px; }
summary::marker { color: var(--sc-accent); }
details p, details ul { margin: 0 0 1rem; }
details ul { padding-left: 1.2rem; }
.source-notes a { text-underline-offset: .23em; color: var(--sc-accent); }
.source-notes a:hover, summary:hover { color: #ffdbab; }
.colophon { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1rem; border-top: 1px solid var(--rule); font-size: .82rem; }

@media (max-width: 780px) {
  :root { --header: 6.2rem; }
  .masthead { grid-template-columns: 1fr auto; grid-template-rows: 2.7rem 2.75rem; gap: 0 .75rem; padding-block: .3rem 0; }
  .source-link { grid-area: 1 / 2; }
  .waypoints { grid-area: 2 / 1 / 3 / -1; justify-content: space-between; border-top: 1px solid #e6cbae25; }
  .waypoints a { font-size: .75rem; }
  .hero-frame { align-items: end; }
  .hero-copy { margin: 0 0 clamp(1.1rem, 4vh, 2.4rem); }
  h1 { font-size: clamp(3.7rem, 14vw, 7.1rem); }
  .hero-intro { margin-block: 1rem; }
  .hero-note { justify-content: space-between; align-items: end; gap: .65rem; font-size: .56rem; line-height: 1.35; letter-spacing: .075em; }
  .hero-note > span:last-child { text-align: right; }
  .stage-portrait, .static-hero::after { top: 10%; right: -12%; left: auto; width: 107%; height: 57%; background-position: center 38%; }
  .plate-athens, .static-hero { background-position: 70% center; }
  .plate-persia, .static-persia { background-position: 78% center; }
  .plate-vietnam, .static-vietnam { background-position: 66% center; }
  .world-shade { background: none; }
  .world-shade::before, .world-shade::after { content: ''; position: absolute; inset: 0; }
  .world-shade::before { opacity: calc(1 - var(--section-shade, 0)); background: linear-gradient(0deg, #111a20f7 6%, #111a20df 28%, #111a2078 59%, #111a2015 86%); }
  .world-shade::after { opacity: var(--section-shade, 0); background: linear-gradient(90deg, #111a20ed 0%, #111a20cb 57%, #111a2080); }
  .static-hero::before { background: linear-gradient(0deg, #111a20f7 6%, #111a20df 29%, #111a2040 72%); }
  .world-route { mask-image: linear-gradient(90deg, transparent 66%, #000 82%); }
  .static-craft { background-image: linear-gradient(90deg, #111a20ed 0%, #111a20cb 57%, #111a2080), url('assets/scillus.webp'); }
  .camp-frame { min-height: 184svh; }
  .craft-frame, .sources-frame { grid-template-columns: 1fr; }
  .river-frame { min-height: 99svh; }
}

@media (max-height: 680px) and (max-width: 780px) {
  .hero-frame { min-height: max(100svh, 33rem); }
  .stage-portrait, .static-hero::after { top: 13%; height: 50%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .camp-frame { min-height: auto; gap: 4rem; }
  .craft-frame, .river-frame { min-height: auto; }
}
