/* ============================================================
   Carthage Museum — Hero
   Palette drawn from the hero image: bone, silver, storm slate
   ============================================================ */

/* Even an accidental drag-select stays in-world: ember on dark,
   never the OS blue */
::selection {
  background: rgba(190, 148, 90, 0.35);
  color: #f4efe4;
}

:root {
  --ink: #0c0e12;
  --ink-soft: rgba(12, 14, 18, 0.55);
  --bone: #f0ebe1;
  --bone-dim: rgba(240, 235, 225, 0.72);
  --bone-faint: rgba(240, 235, 225, 0.45);
  /* narrative text lights WARM (ember-lit ivory); interface and
     display stay neutral bone — the story speaks in firelight */
  --ink-warm: #e8dcc2;
  --ink-warm-dim: rgba(232, 220, 194, 0.78);
  --accent: #d6d1c4;
  --accent-bright: #ffffff;
  --hairline: rgba(240, 235, 225, 0.18);

  --font-display: "Cinzel", "Times New Roman", serif;
  --font-body: "Cormorant Garamond", Georgia, serif;

  --nav-height: 84px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ------------------------------------------------------------
   Navigation
   ------------------------------------------------------------ */

/* Floating frosted-glass capsule, Apple style */
/* ------------------------------------------------------------
   THE PUNIC THRESHOLD — Gate, Phase 0 of the prologue.
   The painted gate plate (assets/gate.jpg) split into registered
   depth layers around its doorway: far = whole painting, near =
   four slices leaving a live hole. Still before the click; the
   click is the first decisive act. CROSS = 2.5D dolly through the
   opening — near accelerates past the edges, the doorway's painted
   glow yields to the real living hero (one day the oath film), the
   warm bloom and smoke hide the seam. Slice geometry is computed
   in JS from the image's doorway fractions.
   ------------------------------------------------------------ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}

.gate-pending .gate {
  display: block;
}

.gate-pending body {
  overflow: hidden;
}

.gate__scene {
  position: absolute;
  inset: 0;
  opacity: 0;
}

/* Far layer: the whole plate — sky, city glow, doorway interior */
.gate__far {
  position: absolute;
  inset: 0;
  background: url("../assets/gate.jpg") center / cover no-repeat;
  will-change: transform, opacity;
}

/* Near layer: four registered slices of the same plate around the
   doorway, leaving a live hole; scales faster than the far layer so
   the crossing is a dolly, not a zoom */
.gate__near {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.gate__slice {
  position: absolute;
  overflow: hidden;
}

/* Each slice feathers only its hole-facing edge, so the aperture never
   reads as a hard rectangle during the handoff. At rest the feather is
   invisible: the far layer beneath shows identical pixels. */
.gate__slice[data-slice="top"] {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
}

.gate__slice[data-slice="bottom"] {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 26px);
  mask-image: linear-gradient(to bottom, transparent, #000 26px);
}

.gate__slice[data-slice="left"] {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
}

.gate__slice[data-slice="right"] {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 26px);
  mask-image: linear-gradient(to right, transparent, #000 26px);
}

.gate__slice i {
  position: absolute;
  background: url("../assets/gate.jpg") no-repeat;
}

/* Warm breath over the doorway; blooms to hide the seam mid-crossing */
.gate__glow {
  position: absolute;
  background: radial-gradient(50% 50% at 50% 60%, rgba(214, 150, 82, 0.32), rgba(214, 150, 82, 0.08) 55%, transparent 75%);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.gate__haze {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  mix-blend-mode: screen;
  background:
    radial-gradient(ellipse 50% 22% at 30% 68%, rgba(180, 190, 210, 0.5), transparent 70%),
    radial-gradient(ellipse 44% 18% at 72% 76%, rgba(170, 180, 205, 0.4), transparent 70%);
  filter: blur(10px);
  opacity: 0;
  will-change: transform;
}

.gate__dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.gate__grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* The words live inside the doorway, upper-middle — framed by the
   opening, above the horizon glow */
.gate__copy {
  position: absolute;
  left: 0;
  right: 0;
  top: 37vh;
  text-align: center;
  z-index: 2;
}

.gate__place,
.gate__line {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 2px 14px rgba(0, 0, 0, 0.5);
}

.gate__place {
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-warm);
  opacity: 0;
}

.gate__line {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.5rem, 2.8vw, 2.15rem);
  line-height: 1.45;
  color: var(--bone);
  margin: 1.1rem 0 2rem;
  opacity: 0;
}

/* Same grammar as the nav's Begin: warm bone wipes in beneath the
   label, the diagonal arrow nudges through */
.gate__enter {
  position: relative;
  z-index: 0;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bone);
  padding: 0.95em 1.9em 0.95em 2.2em;
  border: 1px solid rgba(240, 235, 225, 0.35);
  border-radius: 999px;
  background: rgba(8, 9, 13, 0.4);
  cursor: pointer;
  opacity: 0;
  transition: border-color 0.35s ease, color 0.35s ease;
}

.gate__enter::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--bone);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}

/* The invitation: every seven seconds — the glow's own breath — a
   band of firelight travels across the button face, and its border
   warms, as if the gate itself glances at the visitor's hand. Begins
   after a few seconds of stillness; the decisive never see it. */
.gate__enter::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(112deg,
    transparent 36%,
    rgba(255, 226, 185, 0.55) 50%,
    transparent 64%);
  transform: translateX(-160%);
  animation: gate-invite-sweep 4.5s ease-in-out 3s infinite;
}

.gate__enter:hover::after {
  display: none;
}

@keyframes gate-invite-sweep {
  0%, 84% { transform: translateX(-160%); }
  97%, 100% { transform: translateX(160%); }
}

.gate__enter {
  animation: gate-invite-warm 4.5s ease-in-out 3s infinite;
}

@keyframes gate-invite-warm {
  0%, 82%, 100% { box-shadow: 0 0 0 rgba(255, 190, 120, 0); }
  92% { box-shadow: 0 0 38px rgba(255, 195, 125, 0.32); border-color: rgba(240, 235, 225, 0.85); }
}

.gate__enter-arrow {
  width: 10px;
  height: 10px;
  transition: transform 0.3s ease;
}

.gate__enter:hover,
.gate__enter:focus-visible {
  border-color: var(--bone);
  color: var(--ink);
}

.gate__enter:hover::before,
.gate__enter:focus-visible::before {
  transform: scaleX(1);
}

.gate__enter:hover .gate__enter-arrow,
.gate__enter:focus-visible .gate__enter-arrow {
  transform: translate(1.5px, -1.5px);
}

/* ------------------------------------------------------------
   The Oath Plate — the painting behind the Threshold's doorway.
   One layer below the gate: the aperture opens onto it, the camera
   pushes into it, and it dissolves into the living hero. The oath
   film will one day play in this same mount.
   ------------------------------------------------------------ */
.oath {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: none;
  background: #000;
  overflow: hidden;
}

.gate-pending .oath {
  display: block;
}

/* The camera IS this container: the push transform lives here so the
   painting and its living atmosphere zoom as one world */
.oath__camera {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.oath__plate {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The pyre burns on the left of the plate; its breath is painted by
   light alone — the pixels beneath never move */
.oath__fireglow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 26% 32% at 21% 42%, rgba(255, 160, 70, 0.34), transparent 70%),
    radial-gradient(ellipse 70% 26% at 50% 52%, rgba(255, 140, 60, 0.10), transparent 75%);
  mix-blend-mode: screen;
  opacity: 0.7;
}

.oath__smoke {
  position: absolute;
  inset: -12%;
  pointer-events: none;
  background: radial-gradient(ellipse 42% 30% at 30% 40%, rgba(190, 170, 155, 0.16), transparent 70%);
  filter: blur(2px);
}

.oath__smoke--near {
  background: radial-gradient(ellipse 50% 26% at 62% 60%, rgba(160, 140, 125, 0.12), transparent 72%);
}

.oath__embers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* The film and its freeze-frame sit above the living painting; both
   arrive by opacity so every seam is a dissolve, never a cut */
.oath__film,
.oath__final {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
}

/* Museum subtitles — high on the frame, on smoked glass, so the words
   never fight the hands for the eye's landing place */
.oath__caption {
  position: absolute;
  left: 50%;
  top: calc(9vh + env(safe-area-inset-top, 0px));
  transform: translateX(-50%);
  max-width: min(92vw, 66rem);
  text-align: center;
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--ink-warm);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7);
  background: rgba(20, 20, 24, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(240, 235, 225, 0.09);
  border-radius: 14px;
  padding: 0.75em 1.4em 0.85em;
  opacity: 0;
  pointer-events: none;
}

.oath__speaker {
  display: block;
  margin-bottom: 0.3em;
  font-family: var(--font-display);
  font-style: normal;
  font-size: 0.62em;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(240, 235, 225, 0.5);
}

/* The ancestral tongue crowns the line; the translation beneath */
.oath__ar {
  display: block;
  margin: 0.1em 0 0.25em;
  font-family: "Amiri", "Geeza Pro", serif;
  font-style: normal;
  font-size: 1.12em;
  line-height: 1.65;
  color: rgba(240, 235, 225, 0.95);
}

/* Museum dark holds the frame edges so the push never reads as a crop */
.oath__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 130% 105% at 50% 46%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

.oath__skip {
  position: absolute;
  top: calc(20px + env(safe-area-inset-top, 0px));
  right: 26px;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  color: rgba(240, 235, 225, 0.42);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.6em 0.9em;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(240, 235, 225, 0.2);
  opacity: 0;
  transition: color 0.3s ease;
}

.oath__skip:hover,
.oath__skip:focus-visible {
  color: var(--bone-dim);
}

@media (pointer: coarse) {
  .oath__skip {
    min-height: 44px;
  }
}

/* ------------------------------------------------------------
   Scroll progress — the museum's position indicator: a horizontal
   hairline along the top edge instead of the native vertical
   scrollbar (hidden only when the animated experience is running).
   ------------------------------------------------------------ */
.no-native-scrollbar {
  scrollbar-width: none;
}

.no-native-scrollbar::-webkit-scrollbar {
  display: none;
  width: 0;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 30;
  pointer-events: none;
}

.scroll-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(to right, rgba(190, 160, 110, 0.45), var(--bone));
  box-shadow: 0 0 8px rgba(240, 235, 225, 0.25);
  transform: scaleX(0);
  transform-origin: left center;
}

/* ------------------------------------------------------------
   CARTHAGE NAV MOTION GRAMMAR

   ENTER     The museum interface quietly arrives.
   CONDENSE  First scroll transforms cinematic plaque into
             navigation instrument (35-180px, scrub-linked,
             then geometric stillness forever).
   ORIENT    One shared marker communicates location.
   RESPOND   The material acknowledges pointer presence.
   ACTIVATE  Only the primary action gains a solid surface.
   LIVE      Sound communicates its state through motion.

   NEVER: magnetic links · 3D tilt · bouncing · particles ·
   hide-on-scroll · geometry morphing after the intro ·
   decorative Tanit animation. The user's hand is the easing
   curve — no easing on the scrubbed morph itself.

   All geometry derives from one number, --nav-progress
   (0 = cinematic plaque, 1 = navigation instrument), published
   by JS. CSS decides what each percentage means. Material
   density flips via .site-nav--condensed near mid-morph.
   ------------------------------------------------------------ */
.site-nav {
  --nav-progress: 0;
  position: fixed;
  top: calc(15px - 6px * var(--nav-progress));
  left: 0;
  right: 0;
  margin-inline: auto;
  width: min(
    calc(1060px - 240px * var(--nav-progress)),
    calc(100vw - 32px + 12px * var(--nav-progress))
  );
  z-index: 10;
  height: calc(56px - 6px * var(--nav-progress));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(1.5rem - 0.25rem * var(--nav-progress));
  padding: 0 calc(clamp(1.25rem, 2.5vw, 2rem) - 0.45rem * var(--nav-progress));
  border-radius: 999px;
  background: linear-gradient(to bottom, rgba(20, 22, 30, 0.4), rgba(11, 12, 17, 0.46));
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(240, 235, 225, 0.08);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(240, 235, 225, 0.08),
    inset 0 -1px 0 rgba(190, 160, 110, 0.05);
  transition:
    background 0.45s ease,
    border-color 0.45s ease,
    box-shadow 0.45s ease;
}

/* Lens-lock: a brief light-catch on the edge when the instrument
   settles into place. Near-subliminal; delete this block if it ever
   reads as an effect. */
.site-nav--glint {
  animation: nav-glint 0.18s ease-out;
}

@keyframes nav-glint {
  35% { border-color: rgba(240, 235, 225, 0.26); }
}

/* Smoked glass catches the light where the pointer moves */
.site-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(140px 70px at var(--nav-mx, 50%) 0%, rgba(240, 235, 225, 0.09), transparent 72%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.site-nav:hover::before {
  opacity: 1;
}

.site-nav:hover {
  background: linear-gradient(to bottom, rgba(20, 22, 30, 0.5), rgba(11, 12, 17, 0.56));
  border-color: rgba(240, 235, 225, 0.13);
}

/* Material density (geometry is the scrub's job): past mid-morph the
   glass becomes more substantial as the object becomes smaller */
.site-nav--condensed {
  background: linear-gradient(to bottom, rgba(18, 20, 27, 0.56), rgba(10, 11, 15, 0.62));
  border-color: rgba(240, 235, 225, 0.1);
  box-shadow:
    0 14px 44px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(240, 235, 225, 0.09),
    inset 0 -1px 0 rgba(190, 160, 110, 0.06);
}

.site-nav--condensed:hover {
  background: linear-gradient(to bottom, rgba(18, 20, 27, 0.64), rgba(10, 11, 15, 0.7));
}

.site-nav__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transform: scale(calc(1 - 0.03 * var(--nav-progress)));
  transform-origin: left center;
}

.site-nav__brand .site-nav__glyph {
  opacity: 0.72;
  transition: opacity 0.35s ease, filter 0.35s ease;
}

.site-nav__brand .site-nav__wordmark {
  opacity: 0.88;
  transition: opacity 0.35s ease;
}

.site-nav__brand:hover .site-nav__glyph {
  opacity: 1;
  filter: drop-shadow(0 0 3px rgba(240, 235, 225, 0.2));
}

.site-nav__brand:hover .site-nav__wordmark {
  opacity: 1;
}

/* The seal of the museum — Tanit, still. She performs in the
   ceremonies, not in the chrome. */
.site-nav__glyph {
  width: 13px;
  height: 17px;
  color: var(--accent);
}

.site-nav__glyph svg {
  display: block;
  width: 100%;
  height: 100%;
}

.site-nav__wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: calc(0.42em - 0.08em * var(--nav-progress));
  padding-left: calc(0.42em - 0.08em * var(--nav-progress)); /* optically re-center against tracking */
}

.site-nav__links {
  position: relative;
  display: flex;
  gap: calc(clamp(1.25rem, 3vw, 2.75rem) - 0.9rem * var(--nav-progress));
}

.site-nav__links a {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-dim);
  transition: color 0.3s ease;
}

/* Hover preview: a faint short mark — "you could go here" — distinct
   from the full active hairline's "you are here" */
.site-nav__links a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 9px;
  height: 1px;
  background: var(--bone);
  opacity: 0.45;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition: transform 0.28s ease;
}

.site-nav__links a:hover,
.site-nav__links a:focus-visible {
  color: var(--accent-bright);
}

.site-nav__links a:hover::after,
.site-nav__links a:focus-visible::after {
  transform: translateX(-50%) scaleX(1);
}

/* The shared active hairline glides between links (moved by JS) */
.site-nav__marker {
  position: absolute;
  left: 0;
  bottom: -7px;
  width: 16px;
  height: 1px;
  background: var(--bone-dim);
  opacity: 0;
  pointer-events: none;
}

.site-nav__end {
  display: flex;
  align-items: center;
  gap: calc(0.75rem - 0.2rem * var(--nav-progress));
}

/* Sound toggle — streams "Song of Carthage" via the YouTube embed */
.site-nav__sound {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: transparent;
  color: var(--bone-dim);
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.site-nav__sound svg {
  width: 19px;
  height: 19px;
}

.site-nav__sound:hover,
.site-nav__sound:focus-visible {
  border-color: var(--accent);
  color: var(--accent-bright);
}

/* Bars hidden & slash shown while muted; when playing, three tiny
   bars breathe asynchronously — barely alive, information not
   decoration */
.site-nav__sound-bars rect {
  opacity: 0;
  transform: scaleY(0.4);
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.site-nav__sound .site-nav__sound-slash {
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.site-nav__sound.is-playing .site-nav__sound-bars rect {
  opacity: 1;
  animation: nav-sound-bar 1.4s ease-in-out infinite;
}

.site-nav__sound.is-playing .site-nav__sound-bars rect:nth-child(2) {
  animation-duration: 1.9s;
  animation-delay: 0.35s;
}

.site-nav__sound.is-playing .site-nav__sound-bars rect:nth-child(3) {
  animation-duration: 1.65s;
  animation-delay: 0.6s;
}

.site-nav__sound.is-playing .site-nav__sound-slash {
  opacity: 0;
}

@keyframes nav-sound-bar {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav__sound.is-playing .site-nav__sound-bars rect {
    animation: none;
    transform: scaleY(0.8);
  }
}

/* Hidden off-screen holder for the YouTube audio player */
.yt-audio {
  position: fixed;
  left: -9999px;
  bottom: 0;
  width: 200px;
  height: 113px;
  overflow: hidden;
  pointer-events: none;
}

/* ACTIVATE: the only element in the nav that gains a solid surface —
   warm bone wipes in beneath the label rather than switching on */
.site-nav__cta {
  position: relative;
  z-index: 0;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: calc(0.8em - 0.08em * var(--nav-progress)) 1.4em calc(0.8em - 0.08em * var(--nav-progress)) 1.6em;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.site-nav__cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--bone);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}

.site-nav__cta-arrow {
  width: 9px;
  height: 9px;
  transition: transform 0.3s ease;
}

.site-nav__cta:hover,
.site-nav__cta:focus-visible {
  border-color: var(--bone);
  color: var(--ink);
}

.site-nav__cta:hover::before,
.site-nav__cta:focus-visible::before {
  transform: scaleX(1);
}

.site-nav__cta:hover .site-nav__cta-arrow,
.site-nav__cta:focus-visible .site-nav__cta-arrow {
  transform: translate(1.5px, -1.5px);
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  isolation: isolate;
  overflow: hidden;
  background: #000; /* revealed as the scene dissolves mid-choreography */
}

/* ------------------------------------------------------------
   MUSEUM ROOM grammar — light changing in a museum. Rooms use
   opacity, small vertical settling, and phrase-level reveals;
   never wipes, never particles, never the Journey's language.
   Without JS every room is plain visible flow.
   ------------------------------------------------------------ */
.js-anim [data-room] [data-room-item] {
  opacity: 0;
  transform: translateY(16px);
}
.journey__phrase {
  display: inline-block;
}

/* THE PAGE STACK — rooms are sticky walls: each room owns the full
   screen until the next section slides over it. Pure CSS; no snap,
   no scroll-jacking — the stack itself is the room transition.
   Desktop/tall viewports only: small screens keep plain flow so no
   content can ever be trapped behind a stuck wall. */
@media (min-width: 701px) and (min-height: 601px) {
  .js-anim .journey { position: sticky; top: 0; z-index: 1; }
  .js-anim .senate { position: sticky; top: 0; z-index: 2; background: #050404; }
  .js-anim .chapters--arc { position: sticky; top: 0; z-index: 3; }
  .js-anim .voyage { position: relative; z-index: 4; }
  .js-anim .chapters--index { position: relative; z-index: 5; }
  /* the stuck walls persist beneath everything that follows — the
     dawn must stand above them or the page ends behind a black wall */
  .js-anim .dawn { position: relative; z-index: 6; }
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

/* The plate carries the scene's rest-shift and rise; slight bleed so
   pointer parallax never exposes an edge. */
.hero__plate {
  position: absolute;
  inset: -3.5%;
  will-change: transform;
}

.hero__plate picture {
  position: absolute;
  inset: 0;
}


.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  transform-origin: 50% 35%;
  will-change: transform;
}

/* Legibility gradient + tonal grade over the photograph */
.hero__vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(12, 14, 18, 0.45) 0%, rgba(12, 14, 18, 0.15) 18%, rgba(12, 14, 18, 0.3) 40%, rgba(12, 14, 18, 0.72) 62%, rgba(12, 14, 18, 0.94) 82%, rgba(12, 14, 18, 0.98) 100%),
    radial-gradient(ellipse 120% 90% at 50% 60%, transparent 55%, rgba(12, 14, 18, 0.45) 100%);
}

/* Drifting mist banks — breathe life into the mountain pass */
.hero__mist {
  position: absolute;
  inset: -15% -25%;
  pointer-events: none;
  will-change: transform;
  mix-blend-mode: screen;
}

.hero__mist--far {
  opacity: 0.07;
  background:
    radial-gradient(ellipse 42% 20% at 22% 38%, rgba(220, 228, 240, 0.9), transparent 70%),
    radial-gradient(ellipse 50% 16% at 74% 30%, rgba(210, 218, 232, 0.7), transparent 70%);
  filter: blur(6px);
}

.hero__mist--near {
  opacity: 0.09;
  background:
    radial-gradient(ellipse 55% 18% at 60% 72%, rgba(216, 222, 234, 0.8), transparent 70%),
    radial-gradient(ellipse 38% 14% at 18% 82%, rgba(206, 214, 228, 0.7), transparent 70%);
  filter: blur(10px);
}

/* Dust motes drifting in the light (canvas-drawn) */
.hero__dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Faint film grain keeps the CG render from feeling sterile */
.hero__grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------
   Depth layer — the scene masked to Hannibal's silhouette,
   stacked above the title so the headline passes behind him.
   Geometry mirrors .hero__media picture exactly (same bleed box,
   same cover mapping), so its pixels align with the backdrop.
   ------------------------------------------------------------ */

.hero__front {
  display: none;
  position: absolute;
  inset: -3.5%;
  z-index: 2;
  pointer-events: none;
  transform-origin: 50% 35%;
  will-change: transform;
  -webkit-mask-image: url("../assets/hero-x1-cutout.png");
  mask-image: url("../assets/hero-x1-cutout.png");
  -webkit-mask-size: cover;
  mask-size: cover;
  -webkit-mask-position: 50% 28%;
  mask-position: 50% 28%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

@supports ((-webkit-mask-image: none) or (mask-image: none)) {
  .js-anim .hero__front {
    display: block;
  }
}

.hero__front picture {
  position: absolute;
  inset: 0;
}

.hero__front-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
}

/* Same grade as .hero__vignette so the subject matches the backdrop */
.hero__front-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(12, 14, 18, 0.45) 0%, rgba(12, 14, 18, 0.15) 18%, rgba(12, 14, 18, 0.3) 40%, rgba(12, 14, 18, 0.72) 62%, rgba(12, 14, 18, 0.94) 82%, rgba(12, 14, 18, 0.98) 100%),
    radial-gradient(ellipse 120% 90% at 50% 60%, transparent 55%, rgba(12, 14, 18, 0.45) 100%);
}

/* Heading floats high on the scene; the title layer sits BEHIND the
   subject (z1 < front z2), the small eyebrow stays readable in front */
.hero__heading {
  position: absolute;
  top: 13vh;
  top: 13svh;
  left: clamp(1.25rem, 5vw, 3rem);
  right: clamp(1.25rem, 5vw, 3rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
}

/* Desktop: one huge line high in the sky, clear of the subject —
   scrolling makes it fall behind him */
/* Breakpoint discipline: the single-line desktop title begins where
   the desktop nav does (861px), so the 768-860 band is consistently
   mobile instead of a mixed state that clips the headline. */
@media (min-width: 861px) {
  .hero__heading {
    top: 11vh;
    top: 11svh;
  }
  .hero__heading .hero__title {
    font-size: clamp(2.8rem, 6.4vw, 6.5rem);
    white-space: nowrap;
  }
  .hero__heading .hero__title-line {
    display: inline-block;
  }
}

.hero__title {
  position: relative;
  z-index: 1;
}

.hero__eyebrow {
  position: relative;
  z-index: 3;
}

.hero__lede,
.hero__actions,
.hero__footer {
  position: relative;
  z-index: 3;
}



.hero__content {
  position: relative;
  width: min(58rem, 100%);
  margin: 0 auto;
  padding: calc(var(--nav-height) + 22vh) clamp(1.25rem, 5vw, 3rem) 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-family: var(--font-display);
  font-size: clamp(0.62rem, 1.1vw, 0.74rem);
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(1rem, 2vh, 1.5rem);
}

.hero__eyebrow-rule {
  display: block;
  width: clamp(2rem, 6vw, 4rem);
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent));
}

.hero__eyebrow-rule:last-child {
  background: linear-gradient(to left, transparent, var(--accent));
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 7.2vw, 5.5rem);
  line-height: 1.08;
  letter-spacing: 0.06em;
  text-wrap: balance;
  color: var(--bone);
  text-shadow: 0 2px 40px rgba(12, 14, 18, 0.6);
}

/* Each line is a mask for the reveal animation */
.hero__title-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em; /* keep descenders inside the mask */
  margin-bottom: -0.08em;
}

.hero__title-line > span {
  display: inline-block;
}

.hero__lede {
  margin-top: clamp(1rem, 2.25vh, 1.5rem);
  max-width: 46rem;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  font-weight: 400;
  line-height: 1.6;
  color: var(--bone-dim);
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: clamp(1.25rem, 3vh, 2rem);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 1.1em 2.2em;
  border-radius: 999px;
  transition: background-color 0.35s ease, color 0.35s ease,
    border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}

.button__arrow {
  width: 0.85em;
  height: 0.85em;
  flex: none;
  transition: transform 0.35s var(--ease-out-expo);
}

.button:hover .button__arrow,
.button:focus-visible .button__arrow {
  transform: translate(2px, -2px);
}

.button--solid {
  background: var(--bone);
  color: var(--ink);
  border: 1px solid var(--bone);
}

.button--solid:hover,
.button--solid:focus-visible {
  background: #fff;
  border-color: #fff;
  box-shadow: 0 8px 40px rgba(240, 235, 225, 0.25);
}

.button--ghost {
  color: var(--bone);
  border: 1px solid rgba(240, 235, 225, 0.3);
  background: rgba(12, 14, 18, 0.25);
  backdrop-filter: blur(6px);
}

.button--ghost:hover,
.button--ghost:focus-visible {
  border-color: var(--bone);
  background: rgba(240, 235, 225, 0.08);
}

/* ------------------------------------------------------------
   Hero footer strip
   ------------------------------------------------------------ */

.hero__footer {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  width: 100%;
  padding: clamp(1.25rem, 3vh, 2rem) clamp(1.25rem, 4vw, 3.5rem) 1.5rem;
}

.hero__dates,
.hero__location {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bone-faint);
}

.hero__dates {
  justify-self: start;
}

.hero__location {
  justify-self: end;
  text-align: right;
}

.hero__scroll {
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.hero__scroll-label {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--bone-faint);
  transition: color 0.3s ease;
}

.hero__scroll:hover .hero__scroll-label {
  color: var(--accent-bright);
}

.hero__scroll-line {
  width: 1px;
  height: 2.25rem;
  background: linear-gradient(to bottom, var(--accent), transparent);
  overflow: hidden;
  position: relative;
}

.hero__scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, var(--accent-bright), transparent);
  transform: translateY(-100%);
  animation: scroll-pulse 2.6s var(--ease-out-expo) infinite;
}

@keyframes scroll-pulse {
  0% { transform: translateY(-100%); }
  60%, 100% { transform: translateY(100%); }
}

/* ------------------------------------------------------------
   Journey interlude — the lede on black, lit word by word on scroll
   ------------------------------------------------------------ */

.journey {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 5vh, 3.5rem);
  /* Echoes' temperament: quiet and warm-to-black — a faint ember
     cast, the last warmth of the hero's light held in the room */
  background:
    radial-gradient(ellipse 70% 50% at 50% 42%, rgba(62, 42, 24, 0.28), transparent 70%),
    #000;
  padding: 0 clamp(1.5rem, 6vw, 4rem);
}

/* The page-stack composition (desktop only, matching the stack media
   query): title at the optical upper-middle (~26vh), paragraph fully
   visible beneath it; 145vh total so the lit room holds a 45vh breath
   before Carthago covers it. Mobile keeps the centered 100svh flow. */
@media (min-width: 701px) and (min-height: 601px) {
  .journey {
    min-height: 145vh;
    min-height: 145svh;
    justify-content: flex-start;
    padding-top: 26vh;
    padding-bottom: 45vh;
  }
}

/* The title that fell through the hero, come to rest as the heading */
.journey__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--bone);
}


.journey__text {
  max-width: 58rem;
  font-family: var(--font-body);
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  font-weight: 400;
  line-height: 1.7;
  text-align: center;
  /* ember-bronze, the room's lit state: darker and more mineral than
     the warm-cream reader ink; the seal keeps the only true gold.
     This is the final (no-JS) state — the scrub raises it from ash.
     The shadow sits at the threshold of perception: light, not paint. */
  color: #d0a76a;
  text-shadow: 0 0 16px rgba(200, 154, 90, 0.2);
  text-wrap: pretty;
}


/* ------------------------------------------------------------
   Senate section — Carthago delenda est
   Full-bleed painting graded near-black, the decree left, negative
   space below (no cards — a door closing)
   ------------------------------------------------------------ */

.senate {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: stretch;
  background: #000;
  isolation: isolate;
  overflow: hidden;
  padding-bottom: clamp(3rem, 8vh, 5rem);
}

/* Desktop stack: the 145vh room grammar — the decree and its meaning
   are lit and read before the Arc may rise (threshold doctrine:
   nothing is covered unread); the tail carries the scrubbed meaning
   reveal, then silence */
@media (min-width: 701px) and (min-height: 601px) {
  .senate {
    min-height: 145vh;
    min-height: calc(100svh + 45vh);
    padding-bottom: 45vh;
  }
}

.senate__media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.senate__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 30%;
  filter: saturate(0.82) brightness(0.9);
  transform-origin: 55% 40%;
  will-change: transform;
}

/* Heavy grade: the scene emerges from black on the left and below */
.senate__grade {
  position: absolute;
  inset: 0;
  /* the painted DELENDA banner sinks to atmosphere: the real
     typography owns the decree (first layer sits over the banner) */
  background:
    radial-gradient(ellipse 44% 40% at 79% 22%, rgba(4, 3, 6, 0.8), transparent 72%),
    linear-gradient(to right, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.88) 30%, rgba(0, 0, 0, 0.45) 55%, rgba(0, 0, 0, 0.2) 78%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 26%, rgba(0, 0, 0, 0.24) 46%, transparent 62%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.75) 0%, transparent 25%);
}

.senate__inner {
  position: relative;
  width: min(80rem, 100%);
  margin: 0 auto;
  /* the decree hangs in the chamber: quote optical center ~36vh,
     the painting and negative space own the lower half */
  padding: calc(var(--nav-height) + 14vh) clamp(1.25rem, 4vw, 3.5rem) clamp(2rem, 5vh, 3.5rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.senate__content {
  max-width: 34rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.senate__eyebrow {
  font-family: var(--font-display);
  font-size: clamp(0.62rem, 1.1vw, 0.72rem);
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(1.5rem, 3.5vh, 2.25rem);
}

.senate__block {
  margin: 0;
}

.senate__latin {
  font-family: var(--font-display);
  font-weight: 500;
  /* carved, not billboard: the only giant in the room */
  font-size: clamp(2.3rem, 4.5vw, 3.75rem);
  line-height: 1.12;
  letter-spacing: 0.055em;
  color: var(--bone);
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.7);
}

.senate__latin-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.senate__latin-line > span {
  display: inline-block;
}

.senate__attribution {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-start;
  margin-top: clamp(1.5rem, 3vh, 2rem);
}

.senate__author {
  font-family: var(--font-display);
  font-style: normal;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

.senate__context {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--bone-faint);
}

.senate__body {
  margin-top: clamp(1.75rem, 4vh, 2.5rem);
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  line-height: 1.75;
  /* the one cold room: Rome's voice never warms — bone, never bronze */
  color: rgba(240, 235, 225, 0.72);
  text-wrap: pretty;
}

.senate__translation {
  display: block;
  font-style: italic;
  font-size: 1.12em;
  color: var(--bone);
  margin-bottom: 0.8rem;
}

@media (max-width: 900px) {
  .senate__inner {
    padding-top: calc(var(--nav-height) + 4vh);
  }
  .senate__image {
    object-position: 58% 25%;
  }
  .senate__grade {
    background:
      linear-gradient(to top, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.85) 40%, rgba(0, 0, 0, 0.62) 70%, rgba(0, 0, 0, 0.55) 100%),
      linear-gradient(to right, rgba(0, 0, 0, 0.55) 0%, transparent 70%);
  }
}

/* ------------------------------------------------------------
   Entrance animation setup — only when JS + motion are allowed.
   Without JS (or with reduced motion) everything is visible.
   ------------------------------------------------------------ */

.js-anim [data-reveal="mask"] {
  transform: translateY(110%);
}

.js-anim [data-reveal="line"],
.js-anim [data-reveal="nav"],
.js-anim [data-reveal="footer"] {
  opacity: 0;
}

.js-anim [data-reveal="nav"] {
  transform: translateY(-8px);
}

.js-anim [data-senate="mask"] {
  transform: translateY(110%);
}

.js-anim [data-senate="line"] {
  opacity: 0;
  transform: translateY(24px);
}

/* THRESHOLD: the room arrives DARK behind the black doorway; its
   light comes up only after the previous room is covered */
.js-anim .senate__image {
  transform: scale(1.07);
  opacity: 0;
}

.js-anim .hero__image {
  transform: scale(1.08);
}

/* At rest Hannibal (independent layer) sits 26vh low, leaving the sky
   clear for the title; scrolling raises him over it. */
.js-anim .hero__front {
  transform: translateY(26vh) scale(1.08);
}

/* Counter-shift keeps the front grade viewport-aligned at rest */
.js-anim .hero__front-vignette {
  transform: translateY(-26vh);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero__scroll-line::after {
    animation: none;
  }
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 860px) {
  .site-nav__links {
    display: none;
  }
}

/* Touch-safe controls (44px minimum): coarse pointers, and any narrow
   viewport regardless of pointer — resized-desktop QA and small
   fine-pointer devices get the same targets as phones */
@media (pointer: coarse), (max-width: 767px) {
  .gate__enter,
  .site-nav__cta {
    min-height: 44px;
  }

  .site-nav__sound {
    width: 44px;
    height: 44px;
  }

  /* Footer links read small but must tap large (44px zone; the
     negative margin keeps the visual rhythm of the column) */
  .dawn__col a {
    padding: 0.82em 0;
    margin: -0.28em 0;
  }
}

@media (max-width: 560px) {
  /* Begin is short enough to keep: brand · sound · Begin — the honest
     mobile nav until the museum has more rooms */
  .site-nav__cta {
    padding: 0.7em 1.2em;
  }
  .site-nav__wordmark {
    font-size: 0.95rem;
    letter-spacing: 0.32em;
    padding-left: 0.32em;
  }
  .hero__eyebrow {
    flex-wrap: wrap;
    justify-content: center;
  }
  .hero__eyebrow-rule {
    display: none;
  }
  .hero__footer {
    grid-template-columns: 1fr auto 1fr;
    padding-bottom: 1.5rem;
  }
  .hero__dates,
  .hero__location {
    font-size: 0.58rem;
    letter-spacing: 0.2em;
  }
  .hero__actions {
    width: 100%;
  }
  .button {
    flex: 1 1 100%;
    text-align: center;
  }
}

/* Very narrow phones: compress the nav so 44px targets still fit.
   Kept AFTER the 560px block — narrowest-last, so these overrides
   actually win the cascade at equal specificity. */
@media (max-width: 380px) {
  .site-nav {
    width: calc(100vw - 20px);
    padding: 0 0.75rem;
    gap: 0.5rem;
  }

  .site-nav__wordmark {
    font-size: 0.86rem;
    letter-spacing: 0.24em;
    padding-left: 0.24em;
  }

  .site-nav__end {
    gap: 0.45rem;
  }

  .site-nav__cta {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ------------------------------------------------------------
   Chapters — a fan of archive cards (ported card-fan pattern)
   ------------------------------------------------------------ */

.chapters {
  position: relative;
  background: #000;
  padding: clamp(6rem, 14vh, 10rem) clamp(1.25rem, 4vw, 3.5rem) clamp(7rem, 16vh, 12rem);
  overflow: hidden;
}

.chapters__head {
  text-align: center;
  margin-bottom: clamp(3rem, 7vh, 5rem);
}

.chapters__eyebrow {
  font-family: var(--font-display);
  font-size: clamp(0.62rem, 1.1vw, 0.72rem);
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.chapters__title {
  font-family: var(--font-display);
  font-weight: 500;
  /* a room title, not a chapter intro — still below Echoes' scale */
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  letter-spacing: 0.05em;
  color: var(--bone);
}

/* Without JS the cards sit in a plain responsive row */
.chapters__fan {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

/* With JS the fan takes over: cards stack dead-center, GSAP fans them */
.js-anim .chapters__fan {
  display: block;
  position: relative;
  height: clamp(24rem, 56vh, 34rem);
}

.fan-card {
  position: relative;
  display: block;
  width: clamp(11rem, 21vw, 16.5rem);
  aspect-ratio: 10 / 16.5;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(240, 235, 225, 0.14);
  background: var(--ink);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  will-change: transform;
}

.js-anim .fan-card {
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: calc(clamp(11rem, 21vw, 16.5rem) / -2);
  margin-top: calc(clamp(11rem, 21vw, 16.5rem) * -0.825);
  opacity: 0;
}

.fan-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out-expo);
}

/* hover motion only where hover truly exists — touch devices must
   never catch sticky hover states */
@media (hover: hover) and (pointer: fine) {
  .fan-card:hover .fan-card__img {
    transform: scale(1.05);
  }
}

.fan-card__grade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.86) 0%, rgba(0, 0, 0, 0.35) 38%, rgba(0, 0, 0, 0.08) 60%, rgba(0, 0, 0, 0.25) 100%);
}

.fan-card__pill {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(240, 235, 225, 0.92);
  padding: 0.5em 1.1em;
  border-radius: 999px;
}

.fan-card__body {
  position: absolute;
  left: 1.1rem;
  right: 1.1rem;
  bottom: 1.1rem;
  display: block;
}

.fan-card__name {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  letter-spacing: 0.04em;
  color: var(--bone);
  margin-bottom: 0.35rem;
}

.fan-card__desc {
  display: block;
  font-family: var(--font-body);
  font-size: clamp(0.88rem, 1.15vw, 1rem);
  line-height: 1.45;
  color: var(--bone-dim);
}

/* Fan pagination controls (JS mode only) */
.chapters__controls {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: clamp(2rem, 5vh, 3.25rem);
}

.js-anim .chapters__controls {
  display: flex;
}

.chapters__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(240, 235, 225, 0.04);
  backdrop-filter: blur(10px);
  color: var(--bone-dim);
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.chapters__arrow svg {
  width: 18px;
  height: 18px;
}

.chapters__arrow:hover,
.chapters__arrow:focus-visible {
  border-color: var(--accent);
  color: var(--accent-bright);
}

.chapters__dots {
  display: flex;
  align-items: center;
  gap: 0;
}

/* Each dot is a real button: 36px hit area around a 7px mark */
.chapters__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
}

.chapters__dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(240, 235, 225, 0.16);
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.chapters__dot.is-active::before {
  background: var(--accent);
  transform: scale(1.4);
}

.chapters__dot:focus-visible {
  outline: 1px solid rgba(240, 235, 225, 0.5);
  outline-offset: 1px;
}

/* ------------------------------------------------------------
   Chapter view — a card grown into a full-screen reader
   ------------------------------------------------------------ */

.chapter-view {
  position: fixed;
  inset: 0;
  z-index: 40;
  visibility: hidden;
  pointer-events: none;
}

.chapter-view.is-open {
  visibility: visible;
  pointer-events: auto;
}

/* The expanding surface: starts at the clicked card's rect (set by JS),
   grows to fill the viewport and stays as the chapter's backdrop */
.chapter-view__cover {
  position: absolute;
  overflow: hidden;
  background: var(--ink);
  will-change: top, left, width, height;
}

.chapter-view__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

/* The open chapter breathes with the hero's atmosphere: mist banks,
   dust motes in the light, and film grain over the artwork */
.chapter-view__mist {
  position: absolute;
  inset: -15% -25%;
  pointer-events: none;
  will-change: transform;
  mix-blend-mode: screen;
}

.chapter-view__mist--far {
  opacity: 0.06;
  background:
    radial-gradient(ellipse 42% 20% at 22% 38%, rgba(220, 228, 240, 0.9), transparent 70%),
    radial-gradient(ellipse 50% 16% at 74% 30%, rgba(210, 218, 232, 0.7), transparent 70%);
  filter: blur(6px);
}

.chapter-view__mist--near {
  opacity: 0.08;
  background:
    radial-gradient(ellipse 55% 18% at 60% 72%, rgba(216, 222, 234, 0.8), transparent 70%),
    radial-gradient(ellipse 38% 14% at 18% 82%, rgba(206, 214, 228, 0.7), transparent 70%);
  filter: blur(10px);
}

.chapter-view__dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.chapter-view__grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* The artwork stays fully visible — only a whisper of vignette for depth */
.chapter-view__grade {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.28) 100%);
}

/* The reading panel: a curatorial caption floating beside the painting,
   anchored low on the artwork's empty side (per-chapter data-panel).
   Smoked glass, feathered toward the scene — never a modal */
.chapter-view__panel {
  position: absolute;
  bottom: 9vh;
  height: min(48vh, 34rem);
  width: clamp(20rem, 34vw, 31.5rem);
  border-radius: 20px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  opacity: 0;
}

.chapter-view[data-panel="left"] .chapter-view__panel {
  left: clamp(2.5rem, 4.5vw, 4.5rem);
}

.chapter-view[data-panel="right"] .chapter-view__panel {
  right: clamp(2.5rem, 4.5vw, 4.5rem);
}

/* Art-directed options: center only when an artwork truly has an
   empty central zone; vertical centering for compositions that ask */
.chapter-view[data-panel="center"] .chapter-view__panel {
  left: 50%;
  margin-left: calc(clamp(20rem, 34vw, 31.5rem) / -2);
}

.chapter-view[data-panel="center"] .chapter-view__glass {
  background: linear-gradient(to bottom, rgba(9, 10, 14, 0.62), rgba(9, 10, 14, 0.56) 62%, rgba(9, 10, 14, 0.42));
}

.chapter-view[data-panel-y="center"] .chapter-view__panel {
  bottom: auto;
  top: 50%;
  margin-top: calc(min(48vh, 34rem) / -2);
}

/* The glass is its own layer so it can recede during idle drift while
   the text keeps its place; its outer edge dissolves toward the artwork */
.chapter-view__glass {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(240, 235, 225, 0.06);
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
  backdrop-filter: blur(18px) saturate(1.05);
  background: linear-gradient(to right, rgba(9, 10, 14, 0.64), rgba(9, 10, 14, 0.58) 62%, rgba(9, 10, 14, 0.4));
}

.chapter-view[data-panel="right"] .chapter-view__glass {
  background: linear-gradient(to left, rgba(9, 10, 14, 0.64), rgba(9, 10, 14, 0.58) 62%, rgba(9, 10, 14, 0.4));
}

@media (max-width: 767px) {
  .chapter-view[data-panel="left"] .chapter-view__panel,
  .chapter-view[data-panel="right"] .chapter-view__panel,
  .chapter-view__panel {
    left: 4vw;
    right: 4vw;
    width: auto;
    bottom: 4vh;
    height: min(42vh, 30rem);
  }

  /* Vertical art direction is desktop-only: mobile is always the sheet */
  .chapter-view[data-panel-y="center"] .chapter-view__panel {
    top: auto;
    margin-top: 0;
  }
}

/* Reduced-motion / no-GSAP reader: everything simply visible, no
   choreography — the story must never be locked behind motion */
.chapter-view--static .chapter-view__cover {
  inset: 0;
}

.chapter-view--static .chapter-view__panel {
  opacity: 1;
  clip-path: none;
}

.chapter-view--static .chapter-view__inner,
.chapter-view--static .chapter-view__close {
  opacity: 1;
}

.chapter-view--static .chapter-view__seed,
.chapter-view--static .chapter-view__beam,
.chapter-view--static .chapter-view__cue {
  display: none;
}

.chapter-view--static .chapter-view__progress {
  opacity: 0.65;
}

.chapter-view__scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Lines dissolve before touching the panel's edges, never clipped raw */
  -webkit-mask-image: linear-gradient(to bottom, transparent 2%, #000 16%, #000 88%, transparent 99%);
  mask-image: linear-gradient(to bottom, transparent 2%, #000 16%, #000 88%, transparent 99%);
}

.chapter-view__scroll::-webkit-scrollbar {
  display: none;
}

.chapter-view__inner {
  width: 100%;
  padding: clamp(1.8rem, 5vh, 2.6rem) clamp(1.4rem, 2.2vw, 2.2rem) 26vh;
  opacity: 0;
}

/* Quiet ghost pill — the body is the focus, not the header */
.chapter-view__pill {
  /* the caption primitive, inherited from the Journey: cards are the
     archive after the film — bronze small-caps label, no chrome */
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(214, 176, 116, 0.85);
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.chapter-view__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  letter-spacing: 0.05em;
  color: var(--bone);
  margin-bottom: 1rem;
}

.chapter-view__lede {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.12rem, 1.5vw, 1.35rem);
  /* the caption's warm-cream voice */
  color: var(--ink-warm);
  margin-bottom: clamp(1.4rem, 3vh, 2rem);
}

.chapter-view__text p {
  font-family: var(--font-body);
  font-size: clamp(1.08rem, 1.4vw, 1.3rem);
  line-height: 1.85;
  color: var(--ink-warm-dim);
  margin-bottom: 1.4em;
  text-wrap: pretty;
  /* Lit words must read over bright artwork */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55), 0 2px 16px rgba(0, 0, 0, 0.6);
}

/* THE EVIDENCE REGISTER — gold small-caps micro-label naming the KIND
   of historical claim above it (ARCHAEOLOGY / ANCIENT ACCOUNT /
   TRADITION / INTERPRETATION / LATER MYTH). Content-driven: a
   CHAPTER_COPY line starting with % renders as one of these. The
   register stays neutral; it never pre-judges a source. */
.chapter-view__text p.chapter-view__evidence {
  margin: -0.9em 0 1.6em;
  font-family: var(--font-display);
  /* trust must whisper, never squint: 0.66rem ≈ 10.6px floor */
  font-size: 0.66rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(214, 176, 116, 0.72);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

/* Spoken, not seen: screen readers announce "Evidence: archaeology"
   while the eye gets only the label */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* SEMANTIC ACCENTS (Content Charter): color that means something.
   Tyrian purple = Phoenician origin; burnt red = 146 BCE. One touch
   each, on the reader pill only — never UI, never body text. */
.chapter-view[data-chapter="chapter-origins"] .chapter-view__pill {
  color: rgba(196, 156, 206, 0.92);
  border-color: rgba(178, 132, 190, 0.38);
}
.chapter-view[data-chapter="chapter-siege"] .chapter-view__pill {
  color: rgba(214, 118, 92, 0.92);
  border-color: rgba(196, 92, 64, 0.38);
}

/* Quiet until wanted: the close control whispers over the artwork */
.chapter-view__close {
  position: absolute;
  top: clamp(1rem, 3vh, 1.75rem);
  right: clamp(1rem, 3vw, 1.75rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(240, 235, 225, 0.14);
  border-radius: 999px;
  background: rgba(10, 10, 12, 0.28);
  backdrop-filter: blur(12px);
  color: rgba(240, 235, 225, 0.6);
  cursor: pointer;
  opacity: 0;
  transition: border-color 0.3s ease, color 0.3s ease, background-color 0.3s ease;
}

.chapter-view__close svg {
  width: 18px;
  height: 18px;
}

.chapter-view__close:hover,
.chapter-view__close:focus-visible {
  border-color: var(--accent);
  color: var(--accent-bright);
  background: rgba(10, 10, 12, 0.5);
}

/* Point -> Line -> Surface: the sign of Tanit is the origin point of
   the interface — the hairline grows out of her raised arms and the
   reading panel materializes from it */
.chapter-view__seed {
  position: absolute;
  width: 15px;
  height: 20px;
  color: var(--bone);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

.chapter-view__seed svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chapter-view__beam {
  position: absolute;
  height: 1px;
  background: rgba(240, 235, 225, 0.75);
  transform: scaleX(0);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

/* Quiet orientation marker at the screen's edge, outside the story box */
.chapter-view__progress {
  position: absolute;
  right: clamp(1.2rem, 3vw, 2rem);
  bottom: clamp(1.4rem, 4vh, 2.6rem);
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--bone-dim);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

body.chapter-open {
  overflow: hidden;
}

/* Chapter intro — the arc of empire, lit word by word on scroll */
.chapters__intro {
  max-width: 54rem;
  margin: clamp(2rem, 5vh, 3rem) auto 0;
}

.chapters__intro-p {
  font-family: var(--font-body);
  font-size: clamp(1.4rem, 2.3vw, 2rem);
  line-height: 1.75;
  /* the Echoes bronze, shared for readability — but the Arc is the
     explanation room: no glow, neutral title and label, restrained
     beats. They share bronze; the Arc must not share Echoes' drama. */
  color: #d0a76a;
  text-wrap: pretty;
  margin-bottom: 1.3em;
}

.chapters__intro-p--beat {
  /* ~5% above body — the italic carries the emphasis, not the size */
  font-size: clamp(1.47rem, 2.42vw, 2.1rem);
  font-style: italic;
  line-height: 1.5;
}

.js-anim .chapters__intro-word {
  /* unlit = a barely-visible ash ghost: the sentence is present as
     shape before the light reaches it, then warms to bronze under
     scroll — a temperature change, same grammar as Echoes */
  opacity: 0.21;
  color: rgba(134, 129, 120, 0.9);
}

.js-anim .chapters__eyebrow,
.js-anim .chapters__title {
  opacity: 0;
  transform: translateY(24px);
}

/* Dramatic beats inside a chapter's text */
.chapter-view__beat {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.3rem, 1.75vw, 1.6rem);
  line-height: 1.5;
  color: var(--bone);
  margin: 1.5em 0;
}

/* Consecutive beats read as one litany */
.chapter-view__beat + .chapter-view__beat {
  margin-top: -0.9em;
}

/* Body copy waits in shadow and is lit word by word on scroll,
   the same illumination as the Arc of Empire intro */
.chapter-view__word {
  opacity: 0.14;
}

/* "Scroll" cue after the title card settles */
/* The cue belongs to the visitor, not the caption: bottom-center of
   the screen. A feathered radial glow deepens the artwork behind it —
   contrast with no visible box */
.chapter-view__cue {
  position: absolute;
  bottom: clamp(0.8rem, 2.5vh, 1.6rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.4rem 3.2rem 1.6rem;
  background: radial-gradient(ellipse 62% 78% at center, rgba(4, 5, 8, 0.58), rgba(4, 5, 8, 0.28) 55%, transparent 78%);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.chapter-view__cue span {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bone);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7), 0 2px 12px rgba(0, 0, 0, 0.65);
}

.chapter-view__cue i {
  display: block;
  width: 1px;
  height: 30px;
  background: linear-gradient(to bottom, var(--bone), transparent);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
}

/* Mobile UI layering — placed after the base rules above so these
   overrides actually win the cascade: the cue floats just above the
   bottom sheet, the progress marker moves to the top-left corner */
@media (max-width: 767px) {
  /* The sheet spans the width, so the glass fades vertically, not
     toward a side that no longer means anything */
  .chapter-view__glass,
  .chapter-view[data-panel="right"] .chapter-view__glass {
    background: linear-gradient(to bottom, rgba(9, 10, 14, 0.64), rgba(9, 10, 14, 0.54));
  }

  .chapter-view__cue {
    bottom: calc(46vh + 0.9rem);
  }

  .chapter-view__progress {
    right: auto;
    bottom: auto;
    top: clamp(1.1rem, 3vh, 1.9rem);
    left: clamp(1.1rem, 3vw, 1.9rem);
  }
}

/* Featured (center) card: side cards veil, the center gleams */
.fan-card {
  transition: border-color 0.45s ease, box-shadow 0.45s ease;
}

.fan-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 10, 0.45);
  opacity: 1;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.fan-card.is-center::after {
  opacity: 0;
}

.fan-card.is-center {
  border-color: rgba(216, 178, 110, 0.65);
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.6),
    0 0 46px rgba(214, 176, 106, 0.24);
}

.fan-card.is-center .fan-card__pill {
  background: #e9d6a8;
}

/* Awaiting-artwork placeholders — unmistakably unfinished, still museum */
.fan-card--placeholder {
  background:
    radial-gradient(ellipse 90% 70% at 50% 35%, rgba(38, 42, 52, 0.85), rgba(10, 11, 15, 0.98)),
    var(--ink);
}

.fan-card__ph {
  position: absolute;
  inset: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  border: 1px dashed rgba(240, 235, 225, 0.22);
  border-radius: 12px;
}

.fan-card__ph-glyph {
  font-size: 0.8rem;
  color: rgba(240, 235, 225, 0.3);
}

.fan-card__ph-label {
  font-family: var(--font-display);
  font-size: 0.56rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(240, 235, 225, 0.35);
}

/* Reader cover fallback when a chapter has no artwork yet */
.chapter-view--placeholder .chapter-view__img {
  display: none;
}

.chapter-view--placeholder .chapter-view__cover::after {
  content: "\25C6";
  position: absolute;
  top: 24vh;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  color: rgba(240, 235, 225, 0.14);
}

/* =====================================================================
   THE JOURNEY (.voyage) — one continuous cinematic passage through
   five worlds, pinned between the Arc of Empire and the chapter
   cards. Scroll owns the camera; the camera never stops.
   ===================================================================== */

/* the split Arc / Index sections breathe toward the voyage;
   the Arc is ROOM III — a full museum room, the label before the
   grand exhibit */
.chapters--arc {
  /* the reading room owns the screen a while longer: content is
     centered in the first viewport, then a 35vh quiet black tail
     holds before the Journey's wall rises — the text is always
     fully lit and read before anything covers it */
  min-height: 135vh;
  min-height: calc(100svh + 35vh);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 35vh;
}
.chapters--arc .chapters__head { margin-bottom: 0; }
.chapters--index { padding-top: clamp(3.5rem, 9vh, 7rem); }

.voyage {
  position: relative;
  background: #000; /* one black across every seam — no visible rectangle */
}

/* Without JS the film cannot run: show the still, hide the stage */
.voyage__stage { display: none; }
.voyage__fallback {
  margin: 0;
  position: relative;
}
.voyage__fallback img {
  display: block;
  width: 100%;
  max-height: 82vh;
  object-fit: cover;
  object-position: 18% 45%;
}
.voyage__fallback figcaption {
  position: absolute;
  left: 6vw;
  bottom: 8vh;
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.2rem, 2.6vw, 2rem);
  color: rgba(240, 235, 225, 0.94);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.65);
}

/* With JS the stage takes over (unless reduced motion re-statics it) */
.js-anim .voyage__stage { display: block; }
.js-anim .voyage__fallback { display: none; }
.js-anim .voyage--static .voyage__stage { display: none; }
.js-anim .voyage--static .voyage__fallback { display: block; }

.voyage__stage {
  position: relative;
  height: 100vh;
  overflow: hidden;
}
.voyage__film,
.voyage__atmos {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.voyage__wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}
.voyage__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 100% at 50% 45%, transparent 55%, rgba(4, 3, 3, 0.62) 100%);
}

/* THE CAPTION PRIMITIVE — authored cinematic inscriptions, not
   subtitles: bronze label, warm-cream statement, a feathered shadow
   in the image (never a panel), staged by the film's own progress */
.voyage__caption {
  position: absolute;
  left: 6vw;
  bottom: 13vh;
  z-index: 2;
  pointer-events: none;
  color: rgba(240, 235, 225, 0.96);
  /* lit words must read over bright quays and snow: tight dark edge
     plus a soft halo, same discipline as the reader's text */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55), 0 2px 16px rgba(0, 0, 0, 0.6);
  opacity: 0;
  --mat: 0;
}
.voyage__caption::before {
  content: "";
  position: absolute;
  left: -3em;
  right: -3.5em;
  top: -2em;
  bottom: -1.8em;
  background: radial-gradient(ellipse at 35% 68%, rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.3) 62%, transparent 88%);
  z-index: -1;
  opacity: var(--mat);
  pointer-events: none;
}
.voyage__caption b {
  display: block;
  color: var(--ink-warm);
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  font-weight: normal;
  letter-spacing: 0.04em;
  will-change: transform, opacity;
}
.voyage__caption span {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  /* archival bronze: dates and places speak the wordmark's language */
  color: rgba(214, 176, 116, 0.85);
}

/* Per-world placement — the caption belongs to the frame.
   City/Alps/Cannae lower-left (Cannae's markers own the right);
   Zama lower-right; the Echo low-center, yielding to the trace. */
.voyage__caption[data-cap="3"] {
  left: auto;
  right: 6vw;
  text-align: right;
}
.voyage__caption[data-cap="3"]::before {
  left: -3.5em;
  right: -3em;
  background: radial-gradient(ellipse at 65% 68%, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.2) 55%, transparent 78%);
}
.voyage__caption[data-cap="4"] {
  left: 50%;
  right: auto;
  bottom: 10vh;
  transform: translateX(-50%);
  text-align: center;
  /* centered absolute text needs a stable measure to wrap against */
  width: max-content;
  max-width: min(46rem, 84vw);
}
.voyage__caption[data-cap="4"]::before {
  left: -2.5em;
  right: -2.5em;
  background: radial-gradient(ellipse at 50% 62%, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.18) 55%, transparent 78%);
}

/* THE FILM OWNS THE SCREEN — while the Journey plays the interface
   recedes to a ghost; hover or keyboard focus restores it. The
   !important is deliberate: the entrance animation leaves inline
   opacity on the nav. */
.film-playing .site-nav {
  opacity: 0.35 !important;
  transition: opacity 0.45s ease;
}
.film-playing .site-nav:hover,
.film-playing .site-nav:focus-within {
  opacity: 1 !important;
}
.voyage__markers {
  position: absolute;
  right: 6vw;
  bottom: 13vh;
  pointer-events: none;
  font-family: var(--font-display);
  text-align: right;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  line-height: 2;
  color: rgba(240, 235, 225, 0.8);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
  opacity: 0;
}

.voyage__loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: rgba(240, 235, 225, 0.6);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  z-index: 4;
  opacity: 1;
  transition: opacity 0.6s ease;
}
.voyage__loader.is-ready { opacity: 0; pointer-events: none; }

/* the navbar glyph answers when the carved sign arrives */
.site-nav__glyph.is-lit {
  color: #e8bd6f;
  filter: drop-shadow(0 0 10px rgba(232, 189, 111, 0.75));
  transition: filter 0.4s ease, color 0.4s ease;
}

@media (max-width: 700px) {
  .voyage__caption { left: 5vw; right: 5vw; bottom: 9vh; }
  .voyage__caption b { font-size: 1.35rem; }
  .voyage__caption span { font-size: 0.62rem; letter-spacing: 0.22em; }
  /* the placement map survives on mobile, at phone margins */
  .voyage__caption[data-cap="3"] { left: auto; right: 5vw; }
  .voyage__caption[data-cap="4"] { left: 50%; right: auto; bottom: 9vh; max-width: 90vw; }
  .voyage__markers {
    top: calc(64px + env(safe-area-inset-top, 0px));
    right: 5vw;
    bottom: auto;
    font-size: 0.6rem;
    line-height: 1.9;
  }
}

/* =====================================================================
   THE FIRST LIGHT (.dawn) — the epilogue. Doctrine: the footer is
   the film becoming an archive. Image owns emotion; the vow owns
   myth (an inscription, never a poem stack); the plinth owns
   navigation; the trust strip owns disclosure; the final line owns
   memory — the page's one permanent gold. Motion is credits, once.
   ===================================================================== */

.dawn {
  position: relative;
  overflow: hidden;
  background: #04060a;
  color: var(--bone);
}

.dawn__sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* THE SHORE AFTER EMPIRE — dawn over the ruins, the sun not yet
     risen, the upper sky left dark for the inscription */
  background: #04060a url("../assets/dawn-shore.jpg") center 24% / cover no-repeat;
}
/* Every room had a door; the exit has none. The museum's black
   dissolves into the painting's own night sky. */
.dawn__sky::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 38vh;
  background: linear-gradient(
    to bottom,
    #000 0%,
    rgba(0, 0, 0, 0.92) 26%,
    rgba(0, 0, 0, 0.55) 58%,
    transparent 100%
  );
}
/* the first light strengthens over the painting's horizon band */
.dawn__glow {
  position: absolute;
  left: 0;
  right: 0;
  top: 26%;
  height: 30%;
  background: radial-gradient(
    ellipse 46% 55% at 50% 55%,
    rgba(240, 176, 92, 0.30),
    rgba(200, 120, 55, 0.12) 50%,
    transparent 75%
  );
  mix-blend-mode: screen;
  opacity: 0.2;
}

/* ---- the vow: a compact inscription in the painting's sky ------- */
.dawn__vow {
  position: relative;
  min-height: 74vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* the vow belongs to the HORIZON: it sinks to stand just above
     the sea light, the dead sky above reclaimed */
  justify-content: flex-end;
  text-align: center;
  gap: clamp(1.3rem, 3vh, 2rem);
  padding: clamp(3.5rem, 8vh, 5rem) clamp(1.5rem, 6vw, 4rem) clamp(5vh, 7vh, 9vh);
}
.dawn__emblem {
  width: clamp(20px, 1.8vw, 25px);
  color: rgba(240, 235, 225, 0.6);
}
.dawn__emblem svg { display: block; width: 100%; height: auto; }
.dawn__epitaph {
  margin: 0;
  max-width: 32rem;
  padding: clamp(1.3rem, 2.6vh, 1.8rem) 0;
  position: relative;
}
/* the rules of a museum wall label — carved outward on entry */
.dawn__epitaph::before,
.dawn__epitaph::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%) scaleX(1);
  width: 44px;
  height: 1px;
  background: rgba(240, 235, 225, 0.35);
}
.dawn__epitaph::before { top: 0; }
.dawn__epitaph::after { bottom: 0; }
.js-anim .dawn__epitaph::before,
.js-anim .dawn__epitaph::after {
  transform: translateX(-50%) scaleX(var(--rule, 0));
}
.dawn__epitaph p { margin: 0; }
.dawn__line { display: block; }
.dawn__line--first {
  font-family: var(--font-display);
  font-size: clamp(0.92rem, 1.25vw, 1.1rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(240, 235, 225, 0.95);
  margin-bottom: 0.9em;
  text-shadow: 0 1px 14px rgba(3, 5, 10, 0.7);
}
/* the vow flows as carved prose */
.dawn__prose {
  display: block;
  max-width: 28rem;
  margin: 0 auto;
  font-family: var(--font-body);
  font-size: clamp(1.06rem, 1.35vw, 1.24rem);
  line-height: 1.9;
  color: var(--ink-warm-dim);
  text-shadow: 0 1px 16px rgba(3, 5, 10, 0.75);
  text-wrap: pretty;
}
.dawn__close {
  font-style: italic;
  color: var(--ink-warm);
}
.dawn__attr {
  margin-top: 1.15rem;
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  letter-spacing: 0.02em;
  color: rgba(232, 220, 194, 0.7);
  text-shadow: 0 1px 12px rgba(3, 5, 10, 0.7);
}
/* ---- the archive plinth: dark flat glass, editorial left --------- */
.dawn__panel {
  position: relative;
  margin: 0 auto;
  max-width: 1120px;
  padding: clamp(2.8rem, 5.5vh, 3.8rem) clamp(1.6rem, 4vw, 3rem) clamp(2rem, 4vh, 2.8rem);
  display: grid;
  grid-template-columns: minmax(210px, 1.15fr) 2fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  background: rgba(6, 7, 9, 0.68);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(240, 235, 225, 0.07);
  border-radius: 10px;
}
/* a faint internal reflection — museum glass, not frosted card */
.dawn__panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(165deg, rgba(240, 235, 225, 0.045), transparent 38%);
}
/* the plinth is PLACED: rises and sharpens once (js world only) */
.js-anim .dawn__panel {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(5px);
}
/* one thin line of first light along the plinth's top edge — PALE,
   not gold: the page's only permanent gold is the final line */
.dawn__beam {
  position: absolute;
  top: -1px;
  left: 8%;
  width: 26%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(240, 240, 232, 0.85), transparent);
  opacity: 0;
  pointer-events: none;
}
.dawn__brand-row {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}
.dawn__brand-glyph { width: 16px; color: rgba(212, 174, 116, 0.75); }
.dawn__brand-glyph svg { display: block; width: 100%; height: auto; }
/* engraved museum metal: aged bronze-gold, archival not decorative */
.dawn__wordmark {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.42em;
  color: rgba(214, 176, 116, 0.9);
}
.dawn__motto {
  margin-top: 0.9rem;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.96rem;
  line-height: 1.7;
  color: rgba(240, 235, 225, 0.62);
}
/* the city's own name: quiet archaeological metadata, never a headline */
.dawn__punic {
  margin-top: 0.55rem;
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(240, 235, 225, 0.42);
}
.dawn__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.2rem, 2.5vw, 2rem);
}
.dawn__col { display: flex; flex-direction: column; gap: 0.55rem; }
.dawn__col-title {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(240, 235, 225, 0.5);
  margin-bottom: 0.35rem;
}
.dawn__col a {
  font-family: var(--font-body);
  font-size: 0.94rem;
  color: rgba(240, 235, 225, 0.78);
  text-decoration: none;
  width: fit-content;
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}
@media (hover: hover) and (pointer: fine) {
  .dawn__col a:hover {
    color: rgba(240, 235, 225, 1);
    border-color: rgba(240, 235, 225, 0.4);
  }
}
.dawn__col a:focus-visible {
  color: rgba(240, 235, 225, 1);
  border-color: rgba(240, 235, 225, 0.4);
  outline: none;
}
/* the trust strip: visible, factual, left-aligned */
.dawn__honest {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(240, 235, 225, 0.07);
  margin-top: 0.6rem;
  padding-top: 1.8rem;
  text-align: left;
}
.dawn__trust {
  margin: 0;
  max-width: 52rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.7;
  color: rgba(240, 235, 225, 0.72);
}
/* the real-landscape anchor: the one place the concept touches modern ground */
.dawn__anchor {
  margin: 0.6rem 0 0;
  max-width: 52rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.7;
  color: rgba(240, 235, 225, 0.58);
}
.dawn__sources {
  margin: 0.6rem 0 0;
  max-width: 52rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  line-height: 1.7;
  color: rgba(240, 235, 225, 0.48);
}
/* the credit: factual archive language — the trust layer speaks
   plainly, the emotion lives above in the inscription */
.dawn__credit {
  margin: 1.2rem 0 0;
  font-family: var(--font-body);
  font-size: 0.84rem;
  line-height: 1.7;
  color: rgba(240, 235, 225, 0.55);
}
.dawn__credit-name {
  color: rgba(240, 235, 225, 0.75);
}
/* THE SEAL — the ending gathers all the page's gold: a small Tanit
   above the final line, the archive answering the imagined survivor.
   Behind it sleep the LAST LIGHT rays, woken only by the visitor's
   hand pulling past the end of the page. */
.dawn__seal {
  /* static, so the rays escape to anchor on the footer itself */
  position: static;
  display: flex;
  justify-content: center;
  padding-top: clamp(2rem, 4vh, 3rem);
}
.dawn__seal-mark {
  position: relative;
  z-index: 2;
  width: 15px;
  color: rgba(232, 189, 111, 0.62);
}
.dawn__seal-mark svg { display: block; width: 100%; height: auto; }
/* the sun is BELOW the page: its light rises from the very bottom
   edge — no margin, no floating origin — and can only ever fan up
   to the seal, a bounded sunrise however long the visitor scrolls */
.dawn__rays {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  width: min(560px, 72vw);
  height: 230px;
  pointer-events: none;
  opacity: 0;
}
/* a soft dawn bloom beneath the rays, so the light reads even at a
   glance before the individual beams resolve */
.dawn__rays::before {
  content: "";
  position: absolute;
  inset: auto -30% 0 -30%;
  height: 120px;
  background: radial-gradient(
    ellipse 55% 100% at 50% 100%,
    rgba(244, 202, 126, 0.65),
    rgba(224, 154, 84, 0.26) 55%,
    transparent 80%
  );
  filter: blur(2px);
}
.dawn__rays i {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: linear-gradient(to top, rgba(246, 212, 146, 0.9), transparent);
  filter: blur(4px);
  transform-origin: bottom center;
}
.dawn__rays i:nth-child(1) { transform: translateX(-50%) rotate(-26deg); height: 68%; }
.dawn__rays i:nth-child(2) { transform: translateX(-50%) rotate(-13deg); height: 86%; }
.dawn__rays i:nth-child(3) { transform: translateX(-50%); }
.dawn__rays i:nth-child(4) { transform: translateX(-50%) rotate(13deg); height: 86%; }
.dawn__rays i:nth-child(5) { transform: translateX(-50%) rotate(26deg); height: 68%; }
/* the final line: sentence case, human — the page's one permanent gold */
.dawn__last {
  position: relative;
  margin: 0;
  padding: 0.9rem 1rem clamp(2.4rem, 5vh, 3.4rem);
  text-align: center;
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.02rem, 1.25vw, 1.15rem);
  letter-spacing: 0.04em;
  color: rgba(236, 198, 128, 0.78);
  text-shadow: 0 1px 12px rgba(3, 5, 10, 0.9);
}

@media (max-width: 860px) {
  /* the fixed nav must never sit on the inscription */
  .dawn__vow {
    padding-top: calc(88px + env(safe-area-inset-top, 0px));
  }
  .dawn__panel {
    grid-template-columns: 1fr;
    margin: 0 16px;
    border-radius: 10px;
  }
  .dawn__cols { grid-template-columns: repeat(2, 1fr); }
}

/* The leading edge of every rising wall — a faint ember hairline.
   Black walls covering black rooms read as unexplained fading; the
   hairline makes the threshold VISIBLE: a wall's edge, not a fade. */
.js-anim .senate::before,
.js-anim .chapters--arc::before,
.js-anim .voyage::before,
.js-anim .chapters--index::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent 4%, rgba(232, 189, 111, 0.3) 50%, transparent 96%);
  z-index: 6;
  pointer-events: none;
}

/* THE SHADOW APRON — a rising wall casts its shadow before it.
   The first bright-room seam (the Senate painting) taught us: the
   seam travels through the viewport, so the darkness must travel
   with the incoming room. The layout edge stays straight; the ember
   hairline stays the only crisp thing — the painting has already
   fallen into darkness by the time the wall's edge arrives. The
   standard treatment for any bright-room seam. */
@media (min-width: 701px) and (min-height: 601px) {
  /* the fan section needs overflow:hidden; the Arc must not clip its
     own shadow — it extends above the section by design */
  .js-anim .chapters--arc {
    overflow: visible;
  }
  .js-anim .chapters--arc::after {
    content: "";
    position: absolute;
    top: -23vh;
    left: 0;
    right: 0;
    height: 23vh;
    background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.86) 34%, rgba(0, 0, 0, 0.42) 66%, transparent 100%);
    z-index: 5; /* shadow veil below the z-6 ember hairline */
    pointer-events: none;
  }
}
