/* ============================================================================
   APEC — OUR HISTORY · STYLESHEET
   Dark cinematic archive: ink, warm cream, brass. Fraunces / Instrument Sans /
   IBM Plex Mono. Scroll-driven scenes are powered by js/history.js which sets
   --p (0..1 progress) on [data-scene] sections and .in on [data-rv] reveals.
   ========================================================================== */

:root {
  --ink:        #0a0b0d;
  --ink-2:      #101217;
  --ink-3:      #161922;
  --line:       rgba(237, 231, 216, 0.13);
  --line-soft:  rgba(237, 231, 216, 0.07);
  --cream:      #ede7d8;
  --cream-dim:  #b6afa0;
  --muted:      #837e70;
  --gold:       #c9a45c;
  --gold-hi:    #e6c581;
  --gold-dim:   rgba(201, 164, 92, 0.35);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-text:    "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", Consolas, "Courier New", monospace;

  --pad: clamp(1.25rem, 4vw, 4rem);
  --measure: 34em;
  --head-h: 4.25rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-text);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.6;
  overflow-x: clip;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

::selection { background: var(--gold); color: var(--ink); }

a { color: var(--gold-hi); text-decoration-color: var(--gold-dim); text-underline-offset: 3px; }
a:hover { color: var(--cream); }

.skip-link {
  position: fixed; top: -4rem; left: 1rem; z-index: 300;
  background: var(--gold); color: var(--ink);
  padding: 0.6rem 1rem; font-family: var(--font-mono); font-size: 0.8rem;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* Film grain */
.grain {
  position: fixed; inset: -50%; z-index: 120; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.045;
  animation: grain-shift 0.9s steps(4) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1%); }
  50% { transform: translate(1%, -2%); }
  75% { transform: translate(-1%, 2%); }
  100% { transform: translate(2%, -1%); }
}

/* ---- Intro curtain --------------------------------------------------------- */
.loader {
  position: fixed; inset: 0; z-index: 400;
  background: var(--ink);
  display: grid; place-items: center;
  clip-path: inset(0 0 0% 0);
  transition: clip-path 0.85s cubic-bezier(0.76, 0, 0.24, 1);
}
.loader.done {
  clip-path: inset(0 0 100% 0);
  pointer-events: none;
}
.loader__inner { text-align: center; transition: opacity 0.4s, transform 0.5s; }
.loader.done .loader__inner { opacity: 0; transform: translateY(-34px); }
.loader__label {
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.42em;
  text-transform: uppercase; color: var(--muted);
}
.loader__year {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(6rem, 22vmin, 15rem); line-height: 1;
  color: var(--cream); font-variant-numeric: tabular-nums;
  margin: 1.4rem 0 2rem; letter-spacing: 0.02em;
}
.loader__line { width: min(46vw, 20rem); height: 1px; background: var(--line); margin: 0 auto; }
.loader__line i {
  display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-hi));
  transform: scaleX(0); transform-origin: 0 50%;
}
html.locked { overflow: hidden; }

/* Reveals wait behind the curtain, then play */
body:not(.booted) .reveal-load,
body:not(.booted) .hero__word .ch { animation-play-state: paused; }

/* ---- Constellation globe ---------------------------------------------------- */
.globe {
  position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%;
  pointer-events: none;
}
body.globe-on .hero__globe img { opacity: 0; transition: opacity 0.6s; }

/* ---- Custom cursor ------------------------------------------------------------ */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 500; pointer-events: none;
  border-radius: 50%; opacity: 0;
  will-change: transform;
}
.cursor-dot { width: 6px; height: 6px; background: var(--gold-hi); margin: -3px 0 0 -3px; }
.cursor-ring {
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border: 1px solid rgba(201, 164, 92, 0.65);
  display: grid; place-items: center;
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out),
              margin 0.3s var(--ease-out), border-color 0.3s, background-color 0.3s;
}
.cursor-ring span {
  font-family: var(--font-mono); font-size: 0.55rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink); opacity: 0; transition: opacity 0.2s;
  user-select: none;
}
body.cursor-on { cursor: none; }
body.cursor-on a, body.cursor-on button, body.cursor-on [role="button"] { cursor: none; }
body.cursor-on .cursor-dot, body.cursor-on .cursor-ring { opacity: 1; }
.cursor-ring.is-link { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-color: var(--gold); }
.cursor-ring.is-view {
  width: 92px; height: 92px; margin: -46px 0 0 -46px;
  background: var(--gold-hi); border-color: var(--gold-hi);
}
.cursor-ring.is-view span { opacity: 1; }
.cursor-ring.is-down { transform: scale(0.85); }

/* ---- Fixed chrome --------------------------------------------------------- */
.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--head-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad);
  transition: background-color 0.4s, backdrop-filter 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.site-head.scrolled {
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; }
.brand__mark { width: 40px; height: auto; opacity: 0.92; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.15rem; letter-spacing: 0.14em; color: var(--cream);
}
.brand__text small {
  font-family: var(--font-mono); font-size: 0.58rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.head-years {
  font-family: var(--font-mono); font-size: 0.75rem;
  letter-spacing: 0.18em; color: var(--gold);
}

.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 110;
  background: transparent;
}
.progress span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-hi));
  transform: scaleX(0); transform-origin: 0 50%;
}

/* Giant scrubbing year behind content — a rolling odometer */
.year-stage {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  display: grid; place-items: center; overflow: hidden;
}
.year-stage__inner {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(12rem, 42vmin, 30rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(201, 164, 92, 0.16);
  opacity: 0;
  transform: translateY(4vh) scale(0.985);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  display: flex;
}
.year-stage__inner.on { opacity: 1; transform: none; }
.odo-col { width: 0.58em; height: 1em; overflow: hidden; }
.odo-strip { display: block; will-change: transform; }
/* grid-center each digit in its 1em row: Fraunces' baseline metrics overflow it */
.odo-strip b { display: grid; place-items: center; height: 1em; font-weight: 300; }
@supports not (-webkit-text-stroke: 1px black) {
  .year-stage__inner { color: rgba(201, 164, 92, 0.07); -webkit-text-stroke: 0; }
}

/* Chapter rail */
.rail {
  position: fixed; right: 1.6rem; top: 50%; transform: translateY(-50%);
  z-index: 100; display: flex; flex-direction: column; gap: 0.35rem;
}
.rail a {
  display: flex; align-items: center; gap: 0.65rem; justify-content: flex-end;
  padding: 0.28rem 0; text-decoration: none;
}
.rail__label {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em;
  color: var(--muted); opacity: 0; transform: translateX(6px);
  transition: opacity 0.25s, transform 0.25s, color 0.25s;
  white-space: nowrap;
}
.rail a:hover .rail__label, .rail a:focus-visible .rail__label,
.rail a.act .rail__label { opacity: 1; transform: none; }
.rail a.act .rail__label { color: var(--gold); }
.rail__dot {
  width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid var(--muted); background: transparent; flex: none;
  transition: background-color 0.25s, border-color 0.25s, transform 0.25s;
}
.rail a:hover .rail__dot { border-color: var(--cream); }
.rail a.act .rail__dot {
  background: var(--gold); border-color: var(--gold); transform: scale(1.35);
  box-shadow: 0 0 12px rgba(201, 164, 92, 0.5);
}
@media (max-width: 1100px) { .rail { display: none; } }

/* ---- Load reveals (hero) --------------------------------------------------- */
.reveal-load {
  opacity: 0; transform: translateY(22px);
  animation: rise 1s var(--ease-out) forwards; animation-delay: var(--d, 0s);
}
.hero__line { display: block; overflow: hidden; padding: 0 0.06em; }
.hero__word { display: inline-block; white-space: nowrap; }
.hero__word .ch {
  display: inline-block;
  transform: translateY(118%) rotate(7deg);
  animation: char-up 0.95s var(--ease-out) forwards;
  animation-delay: calc(var(--d, 0s) + var(--ci, 0) * 0.045s);
}
@keyframes rise    { to { opacity: 1; transform: none; } }
@keyframes char-up { to { transform: none; } }

/* Character cascade for big titles revealed on scroll */
.split-title[data-rv] { opacity: 1; transform: none; }
.split-title .ch {
  display: inline-block;
  opacity: 0; transform: translateY(0.38em) rotate(3.5deg);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
  transition-delay: calc(var(--d, 0s) + var(--ci, 0) * 0.024s);
}
.split-title.in .ch { opacity: 1; transform: none; }

/* ---- Hero ------------------------------------------------------------------ */
.hero {
  position: relative; z-index: 1; /* above the fixed constellation canvas */
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: calc(var(--head-h) + 2rem) var(--pad) 6rem;
  isolation: isolate; overflow: clip;
}
.hero::before {
  /* translucent — the globe canvas glows through from behind */
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(120% 90% at 50% 110%, rgba(201, 164, 92, 0.13), transparent 55%),
    radial-gradient(80% 60% at 50% -10%, rgba(26, 29, 38, 0.85), transparent 60%);
}
.hero__globe {
  position: absolute; inset: 0; z-index: -1; display: grid; place-items: center;
  overflow: hidden;
}
.hero__globe img {
  width: min(88vmin, 700px); opacity: 0.05;
  animation: globe-drift 26s ease-in-out infinite alternate;
}
@keyframes globe-drift {
  from { transform: scale(1) rotate(-1.2deg); }
  to   { transform: scale(1.07) rotate(1.2deg); }
}
.hero__kicker {
  font-family: var(--font-mono); font-size: clamp(0.62rem, 1.4vw, 0.78rem);
  letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold);
}
.hero__title {
  font-family: var(--font-display); font-weight: 340;
  font-size: clamp(4.2rem, 15.5vw, 12.5rem);
  line-height: 0.92; letter-spacing: -0.015em; margin: 2.4rem 0 2.6rem;
}
.hero__accent { font-style: italic; font-weight: 420; color: var(--gold-hi); }
.hero__sub {
  max-width: 36em; color: var(--cream-dim);
  font-size: clamp(1rem, 1.6vw, 1.2rem); line-height: 1.7;
}
.hero__years {
  display: flex; align-items: center; gap: 1.1rem; margin-top: 2.8rem;
  font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.22em;
  color: var(--cream-dim);
}
.hero__years i {
  width: clamp(3.5rem, 9vw, 7rem); height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.hero__cue {
  position: absolute; bottom: 2.2rem; left: 50%; translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
}
.hero__cue span {
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--muted);
}
.hero__cue em {
  width: 1px; height: 3.4rem; background: var(--line);
  position: relative; overflow: hidden;
}
.hero__cue em::after {
  content: ""; position: absolute; inset: 0;
  background: var(--gold);
  animation: cue-drop 2s var(--ease-out) infinite;
}
@keyframes cue-drop {
  0% { transform: translateY(-100%); }
  55% { transform: translateY(0); }
  100% { transform: translateY(102%); }
}

/* ---- Shared section furniture ---------------------------------------------- */
main { position: relative; z-index: 1; }

.kicker {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--gold);
}

/* Scroll reveals (JS adds .in) */
[data-rv] {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0s);
}
[data-rv].in { opacity: 1; transform: none; }

/* ---- Prologue (pinned scene) ------------------------------------------------ */
.prologue { position: relative; height: 380vh; }
.prologue__pin {
  position: sticky; top: 0; height: 100svh; overflow: clip;
  display: grid; place-items: center; text-align: center;
  padding: 0 var(--pad);
}
.prologue__beat {
  grid-area: 1 / 1; max-width: 44em;
  opacity: 0; transform: translateY(34px) scale(0.99);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
  visibility: hidden;
}
.prologue__beat.act { opacity: 1; transform: none; visibility: visible; }
.prologue__beat .kicker { display: block; margin-bottom: 1.6rem; }
.prologue__beat p {
  font-family: var(--font-display); font-weight: 350;
  font-size: clamp(1.55rem, 3.6vw, 2.9rem); line-height: 1.32;
  letter-spacing: 0.002em;
}
.prologue__beat strong { color: var(--gold-hi); font-weight: 480; }
.prologue__meter {
  position: absolute; bottom: 2.2rem; left: 50%; translate: -50% 0;
  display: flex; gap: 0.5rem;
}
.prologue__meter i {
  width: 2.2rem; height: 2px; background: var(--line);
  overflow: hidden; position: relative;
}
.prologue__meter i::after {
  content: ""; position: absolute; inset: 0; background: var(--gold);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.4s;
}
.prologue__meter i.fill::after { transform: scaleX(1); }

/* ---- Marquee chapter dividers --------------------------------------------------- */
.era-marquee {
  overflow: clip; padding: 3.5rem 0 2.5rem;
  transform: rotate(-1.6deg) skewX(var(--skew, 0deg));
  will-change: transform;
}
.era-marquee__track {
  display: flex; width: max-content;
  animation: marquee 46s linear infinite;
}
.era-marquee--rev .era-marquee__track { animation-direction: reverse; }
.era-marquee__track > span {
  font-family: var(--font-display); font-style: italic; font-weight: 320;
  font-size: clamp(3.6rem, 9.5vw, 8.5rem); line-height: 1.1;
  white-space: nowrap; padding-right: 0.35em;
  color: transparent; -webkit-text-stroke: 1px rgba(237, 231, 216, 0.20);
}
.era-marquee__track > span i { font-style: italic; -webkit-text-stroke: 1px rgba(201, 164, 92, 0.45); }
@supports not (-webkit-text-stroke: 1px black) {
  .era-marquee__track > span { color: rgba(237, 231, 216, 0.07); }
  .era-marquee__track > span i { color: rgba(201, 164, 92, 0.14); }
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---- Era opener --------------------------------------------------------------- */
.era-opener {
  position: relative; min-height: 92svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 22vh var(--pad) 14vh; overflow: clip;
}
.era-opener__num {
  position: absolute; top: 50%; right: calc(var(--pad) * -0.3);
  transform: translateY(-50%);
  font-family: var(--font-display); font-weight: 300; font-style: italic;
  font-size: clamp(16rem, 44vw, 42rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(237, 231, 216, 0.07);
  pointer-events: none; user-select: none;
  translate: 0 calc((var(--p, 0) - 0.5) * -9vh);
}
.era-opener__range {
  font-family: var(--font-mono); font-size: clamp(0.7rem, 1.5vw, 0.85rem);
  letter-spacing: 0.34em; color: var(--gold); margin-bottom: 1.6rem;
}
.era-opener__range b { color: var(--cream); font-weight: 500; }
.era-opener__title {
  font-family: var(--font-display); font-weight: 340;
  font-size: clamp(2.9rem, 8.5vw, 7rem); line-height: 1.02;
  letter-spacing: -0.01em; max-width: 9em;
}
.era-opener__intro {
  margin-top: 2.2rem; max-width: var(--measure); color: var(--cream-dim);
  font-size: clamp(1.02rem, 1.5vw, 1.18rem); line-height: 1.7;
}
.era-opener__rule {
  margin-top: 3.5rem; height: 1px; width: min(38rem, 60%);
  background: linear-gradient(90deg, var(--gold-dim), transparent);
  transform: scaleX(calc(0.15 + var(--p, 0) * 0.85)); transform-origin: 0 50%;
}

/* ---- Events ------------------------------------------------------------------- */
.era-events { display: flex; flex-direction: column; gap: clamp(7rem, 16vh, 12rem); padding: 4rem 0 16vh; }

.event {
  display: grid; align-items: center;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  padding: 0 var(--pad);
  position: relative;
}
.event__text { grid-column: 2 / span 4; position: relative; }
.event__media { grid-column: 7 / span 6; }
.event--flip .event__text  { grid-column: 8 / span 4; grid-row: 1; }
.event--flip .event__media { grid-column: 1 / span 6; grid-row: 1; }

.event__year {
  position: absolute; top: -1.1em; left: -0.06em; z-index: -1;
  font-family: var(--font-display); font-style: italic; font-weight: 300;
  font-size: clamp(4.4rem, 8vw, 7rem); line-height: 1;
  color: rgba(201, 164, 92, 0.14);
  user-select: none;
}
.event__tag {
  display: inline-block; margin-bottom: 1.1rem;
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--gold);
  border: 1px solid var(--gold-dim); border-radius: 999px;
  padding: 0.34rem 0.75rem;
}
.event__title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.12; letter-spacing: -0.005em;
  margin-bottom: 0.9rem;
}
.event__meta {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em;
  color: var(--muted); margin-bottom: 1.3rem; line-height: 1.8;
}
.event__meta b { color: var(--cream-dim); font-weight: 500; }
.event__body { color: var(--cream-dim); max-width: var(--measure); }
.event__facts { display: flex; flex-wrap: wrap; gap: 1rem 2.2rem; margin-top: 1.8rem; }
.event__facts div { display: flex; flex-direction: column; }
.event__facts b {
  font-family: var(--font-display); font-weight: 380; font-size: 2rem;
  line-height: 1.1; color: var(--gold-hi);
}
.event__facts span {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); max-width: 16em; margin-top: 0.3rem;
}

/* Note events (no images): a wide archival card */
.event--note { display: block; padding: 0 var(--pad); }
.event--note .event__card {
  position: relative;
  margin: 0 auto; max-width: 52rem;
  border: 1px solid var(--line); background: linear-gradient(160deg, var(--ink-2), var(--ink));
  padding: clamp(2rem, 4.5vw, 3.6rem) clamp(1.6rem, 5vw, 4rem);
}
.event--note .event__card::before {
  content: ""; position: absolute; inset: 0.55rem;
  border: 1px solid var(--line-soft); pointer-events: none;
}
.event--note .event__year { top: -0.72em; left: 0.5rem; }

/* Photos — unmask as they enter the viewport */
.event__media figure { position: relative; }
.event__media figure[data-rv] { opacity: 1; transform: none; }
.event__media figure[data-rv] a.ph {
  clip-path: inset(0 0 101% 0);
  transition: clip-path 1.05s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.event__media figure[data-rv].in a.ph { clip-path: inset(0 0 0% 0); }
.event__media figure[data-rv] figcaption {
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: calc(var(--d, 0s) + 0.35s);
}
.event__media figure[data-rv].in figcaption { opacity: 1; transform: none; }
.event__media a.ph {
  display: block; position: relative; overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-2);
  cursor: zoom-in;
}
.event__media a.ph::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(10, 11, 13, 0.35), inset 0 0 70px rgba(10, 11, 13, 0.42);
  pointer-events: none;
}
.event__media img {
  width: 100%; height: 100%; object-fit: cover;
  filter: sepia(0.14) contrast(1.03) saturate(0.92);
  transform: translateY(calc((var(--p, 0.5) - 0.5) * -7%)) scale(1.12);
  transition: filter 0.5s;
}
.event__media a.ph:hover img { filter: sepia(0.02) contrast(1.04) saturate(1); }
.event__media figcaption {
  margin-top: 0.7rem;
  font-family: var(--font-mono); font-size: 0.66rem; line-height: 1.7;
  letter-spacing: 0.04em; color: var(--muted);
  display: flex; gap: 0.6rem;
}
.event__media figcaption::before {
  content: ""; width: 1.1rem; height: 1px; background: var(--gold-dim);
  flex: none; margin-top: 0.55em;
}

/* photo collage layouts */
.media-1 .ph { aspect-ratio: 3 / 2; }
.media-multi { display: grid; gap: clamp(0.8rem, 1.6vw, 1.4rem); }
.media-multi figure:first-child { grid-column: 1 / -1; }
.media-multi figure:first-child .ph { aspect-ratio: 16 / 9; }
.media-2 { grid-template-columns: 1fr; }
.media-3, .media-4 { grid-template-columns: 1fr 1fr; }
.media-3 figure:not(:first-child) .ph,
.media-4 figure:not(:first-child) .ph { aspect-ratio: 4 / 3; }
.media-2 figure:not(:first-child) .ph { aspect-ratio: 21 / 9; }
.media-3 figure:nth-child(2) { transform: translateY(clamp(0rem, 1.5vw, 1.2rem)); }

/* ---- Presidents gallery (pinned horizontal) ------------------------------------ */
.presidents { position: relative; }
.presidents__pin {
  position: sticky; top: 0; height: 100svh; overflow: clip;
  display: flex; flex-direction: column; justify-content: center;
}
.presidents__head { padding: calc(var(--head-h) + 1rem) var(--pad) 0; }
.presidents__head h2 {
  font-family: var(--font-display); font-weight: 340;
  font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1.04; margin-top: 1rem;
}
.presidents__head h2 em { font-style: italic; color: var(--gold-hi); }
.presidents__hint {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted); margin-top: 1rem;
}
.presidents__hint .hint-mobile { display: none; }
@media (max-width: 760px) {
  .presidents__hint .hint-desktop { display: none; }
  .presidents__hint .hint-mobile { display: inline; }
}
.presidents__track-wrap { position: relative; margin-top: clamp(1.5rem, 4vh, 3.5rem); }
.presidents__track-wrap::before {
  content: ""; position: absolute; left: 0; right: 0; top: 116px;
  height: 1px; background: var(--line-soft);
}
.presidents__track {
  display: flex; gap: clamp(1.6rem, 3vw, 3rem);
  padding: 0 var(--pad);
  width: max-content;
  will-change: transform;
}
.pres-card { width: clamp(180px, 21vw, 240px); flex: none; position: relative; }
.pres-card__idx {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.18em;
  color: var(--muted); display: flex; align-items: center; gap: 0.7rem;
  margin-bottom: 0.9rem;
}
.pres-card__idx::after {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid var(--gold-dim); background: var(--ink);
  transition: background-color 0.3s;
}
.pres-card:hover .pres-card__idx::after { background: var(--gold); }
.pres-card__photo {
  aspect-ratio: 3 / 3.6; overflow: hidden; border: 1px solid var(--line);
  background: var(--ink-2); position: relative;
}
.pres-card__photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%;
  filter: grayscale(1) contrast(1.04);
  transition: filter 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}
.pres-card:hover .pres-card__photo img { filter: grayscale(0); transform: scale(1.045); }
.pres-card__term {
  margin-top: 1rem; font-family: var(--font-mono); font-size: 0.66rem;
  letter-spacing: 0.16em; color: var(--gold);
}
.pres-card__name {
  font-family: var(--font-display); font-weight: 420; font-size: 1.18rem;
  line-height: 1.25; margin-top: 0.35rem;
}
.pres-card__country { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }

@media (max-width: 760px) {
  .presidents { height: auto !important; }
  .presidents__pin { position: static; height: auto; padding-bottom: 4rem; }
  .presidents__track-wrap { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
  .presidents__track { transform: none !important; padding-bottom: 1.2rem; }
  .pres-card { scroll-snap-align: center; width: 68vw; }
}

/* ---- Stewards (secretaries) ------------------------------------------------------ */
.stewards { padding: 18vh var(--pad); max-width: 62rem; margin: 0 auto; }
.stewards h2 {
  font-family: var(--font-display); font-weight: 340;
  font-size: clamp(2rem, 4.6vw, 3.4rem); margin: 1rem 0 0.8rem;
}
.stewards > p { color: var(--cream-dim); max-width: var(--measure); }
.stewards ol { list-style: none; margin-top: 3rem; }
.stewards li {
  display: grid; grid-template-columns: 7.5rem 1fr auto; gap: 1.4rem;
  align-items: baseline;
  padding: 0.85rem 0.4rem; border-bottom: 1px solid var(--line-soft);
  transition: background-color 0.3s, padding-left 0.3s;
}
.stewards li:first-child { border-top: 1px solid var(--line-soft); }
.stewards li:hover { background: rgba(237, 231, 216, 0.025); padding-left: 0.9rem; }
.stewards li b { font-weight: 500; font-size: 1.02rem; }
.stewards li .term { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; color: var(--gold); }
.stewards li .country { font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted); }

/* ---- Legacy ------------------------------------------------------------------------ */
.legacy { padding: 16vh var(--pad) 10vh; position: relative; overflow: clip; }
.legacy::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(70% 55% at 50% 45%, rgba(201, 164, 92, 0.07), transparent 70%);
}
.legacy__grid {
  max-width: 72rem; margin: 4rem auto 0;
  display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(1.2rem, 2.4vw, 2.2rem);
}
.legacy h2 {
  font-family: var(--font-display); font-weight: 340; text-align: center;
  font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1.05;
  max-width: 16em; margin: 1.2rem auto 0;
}
.legacy h2 em { font-style: italic; color: var(--gold-hi); }
.legacy .kicker { display: block; text-align: center; }

.legacy-card {
  border: 1px solid var(--line); background: linear-gradient(165deg, var(--ink-2), rgba(16, 18, 23, 0.35));
  padding: clamp(1.6rem, 2.6vw, 2.4rem);
}
.legacy-card h3 {
  font-family: var(--font-display); font-weight: 420; font-size: 1.45rem; line-height: 1.2;
  margin-bottom: 1.2rem;
}
.legacy-card--mission { grid-column: span 7; }
.legacy-card--law { grid-column: span 5; grid-row: span 2; }
.legacy-card--news { grid-column: span 7; display: grid; grid-template-columns: 1fr minmax(9rem, 12rem); gap: 1.6rem; }
.legacy-card--web { grid-column: span 12; }

.legacy-card--mission ol { list-style: none; counter-reset: obj; }
.legacy-card--mission li {
  counter-increment: obj; display: flex; gap: 1.1rem;
  padding: 0.9rem 0; color: var(--cream-dim);
}
.legacy-card--mission li + li { border-top: 1px solid var(--line-soft); }
.legacy-card--mission li::before {
  content: counter(obj, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--gold);
  padding-top: 0.35em; letter-spacing: 0.1em;
}

.legacy-card--law ul { list-style: none; position: relative; }
.legacy-card--law ul::before {
  content: ""; position: absolute; left: 1.45rem; top: 0.4rem; bottom: 0.6rem;
  width: 1px; background: var(--line);
}
.legacy-card--law li { display: flex; gap: 1.3rem; padding: 0.75rem 0; position: relative; }
.legacy-card--law li b {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.72rem;
  letter-spacing: 0.1em; color: var(--gold); width: 2.9rem; flex: none;
  background: var(--ink-2); align-self: flex-start; position: relative; z-index: 1;
  padding-top: 0.2em;
}
.legacy-card--law li span { color: var(--cream-dim); font-size: 0.92rem; }

.legacy-card--news p { color: var(--cream-dim); font-size: 0.95rem; }
.legacy-card--news figure img { border: 1px solid var(--line); filter: sepia(0.1); }
.legacy-card--news figcaption {
  margin-top: 0.55rem; font-family: var(--font-mono); font-size: 0.6rem;
  color: var(--muted); letter-spacing: 0.06em;
}

.legacy-card--web ul { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.legacy-card--web li { border-left: 1px solid var(--gold-dim); padding-left: 1.1rem; }
.legacy-card--web li b {
  display: block; font-family: var(--font-mono); font-weight: 500;
  font-size: 0.82rem; letter-spacing: 0.04em; color: var(--gold-hi);
}
.legacy-card--web li span { font-size: 0.8rem; color: var(--muted); }

.legacy__stats {
  max-width: 72rem; margin: clamp(3rem, 7vh, 5rem) auto 0;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem;
  border-top: 1px solid var(--line); padding-top: 2.6rem;
}
.stat { text-align: center; }
.stat b {
  font-family: var(--font-display); font-weight: 320;
  font-size: clamp(2.6rem, 5.5vw, 4.6rem); line-height: 1; color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.stat b i { font-style: normal; color: var(--gold); }
.stat > span {
  display: block; margin-top: 0.6rem;
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}

/* ---- Archive table ------------------------------------------------------------------ */
.archive { padding: 14vh var(--pad) 16vh; max-width: 66rem; margin: 0 auto; }
.archive h2 {
  font-family: var(--font-display); font-weight: 340;
  font-size: clamp(2rem, 4.6vw, 3.4rem); margin: 1rem 0;
}
.archive > p { color: var(--cream-dim); max-width: var(--measure); margin-bottom: 3rem; }
.archive__scroll { overflow-x: auto; }
.archive table { width: 100%; border-collapse: collapse; min-width: 34rem; }
.archive th {
  text-align: left; font-family: var(--font-mono); font-weight: 500;
  font-size: 0.6rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted); padding: 0 0.8rem 0.9rem; border-bottom: 1px solid var(--line);
}
.archive td { padding: 0.72rem 0.8rem; border-bottom: 1px solid var(--line-soft); font-size: 0.9rem; }
.archive tbody tr { transition: background-color 0.25s; }
.archive tbody tr:hover { background: rgba(237, 231, 216, 0.03); }
.archive td.y { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.1em; color: var(--gold); white-space: nowrap; }
.archive td.v { font-weight: 500; }
.archive td.m { color: var(--cream-dim); font-size: 0.84rem; }
.archive td .dash { color: var(--muted); opacity: 0.6; }

/* ---- Outro ---------------------------------------------------------------------------- */
.outro {
  position: relative; min-height: 92svh; display: grid; place-items: center;
  text-align: center; padding: 20vh var(--pad); overflow: clip; isolation: isolate;
}
.outro::before {
  /* translucent so the constellation globe glows through from behind */
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: radial-gradient(110% 80% at 50% 115%, rgba(201, 164, 92, 0.16), transparent 60%);
}
.outro__year {
  font-family: var(--font-mono); letter-spacing: 0.3em; color: var(--gold);
  font-size: clamp(0.7rem, 1.6vw, 0.9rem);
}
.outro h2 {
  font-family: var(--font-display); font-weight: 330;
  font-size: clamp(3rem, 10vw, 8.5rem); line-height: 1.02; letter-spacing: -0.01em;
  margin: 1.8rem 0 2.2rem;
}
.outro h2 em { font-style: italic; color: var(--gold-hi); }
.outro p { color: var(--cream-dim); max-width: 34em; margin: 0 auto; }
.outro__mark { margin: 3.4rem auto 0; width: 84px; opacity: 0.5; }

/* ---- Footer ----------------------------------------------------------------------------- */
.site-foot {
  position: relative; z-index: 1; /* above the fixed constellation canvas */
  border-top: 1px solid var(--line-soft);
  padding: 4.5rem var(--pad) 5rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.site-foot img { opacity: 0.55; width: 72px; }
.site-foot__org {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--cream-dim);
}
.site-foot__note { font-size: 0.82rem; color: var(--muted); line-height: 1.8; }
.site-foot__link { font-family: var(--font-mono); font-size: 0.76rem; }

.noscript-note { padding: 6rem var(--pad); text-align: center; color: var(--cream-dim); }

/* ---- Lightbox ------------------------------------------------------------------------------ */
.lightbox {
  border: none; padding: 0; background: transparent;
  max-width: min(92vw, 1100px); max-height: 90vh;
  margin: auto; /* the global reset removes the UA's dialog centering */
}
.lightbox::backdrop {
  background: rgba(6, 7, 9, 0.88);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.lightbox figure { margin: 0; }
.lightbox img {
  max-width: 100%; max-height: 78vh; width: auto; height: auto; margin: 0 auto;
  border: 1px solid var(--line);
}
.lightbox figcaption {
  margin-top: 1rem; text-align: center; color: var(--cream-dim);
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.05em; line-height: 1.7;
}
.lightbox__close {
  position: fixed; top: 1.2rem; right: 1.6rem;
  background: none; border: 1px solid var(--line); color: var(--cream);
  width: 2.6rem; height: 2.6rem; border-radius: 50%; font-size: 1.3rem;
  cursor: pointer; transition: border-color 0.25s, color 0.25s, rotate 0.25s;
}
.lightbox__close:hover { border-color: var(--gold); color: var(--gold); rotate: 90deg; }

/* ---- Responsive ------------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .event__text { grid-column: 1 / -1; }
  .event__media { grid-column: 1 / -1; }
  .event--flip .event__text { grid-column: 1 / -1; grid-row: auto; }
  .event--flip .event__media { grid-column: 1 / -1; grid-row: auto; }
  .event__year { position: static; display: block; margin-bottom: -0.32em; }
  .legacy-card--mission, .legacy-card--law, .legacy-card--news, .legacy-card--web { grid-column: 1 / -1; grid-row: auto; }
  .legacy-card--web ul { grid-template-columns: 1fr; }
  .legacy__stats { grid-template-columns: repeat(2, 1fr); row-gap: 2.4rem; }
  .stewards li { grid-template-columns: 5.4rem 1fr; }
  .stewards li .country { grid-column: 2; }
}
@media (max-width: 560px) {
  .brand__text small { display: none; }
  .media-3, .media-4 { grid-template-columns: 1fr; }
  .media-3 figure:nth-child(2) { transform: none; }
  .legacy-card--news { grid-template-columns: 1fr; }
  .hero__title { font-size: clamp(4rem, 22vw, 6rem); }
}

/* ---- Reduced motion ----------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal-load, [data-rv] { opacity: 1 !important; transform: none !important; }
  .hero__word .ch, .split-title .ch { opacity: 1 !important; transform: none !important; animation: none !important; }
  .event__media figure[data-rv] a.ph { clip-path: none !important; }
  .event__media figure[data-rv] figcaption { opacity: 1 !important; transform: none !important; }
  .loader { display: none; }
  .cursor-dot, .cursor-ring { display: none; }
  .era-marquee { transform: rotate(-1.6deg); }
  .era-marquee__track { animation: none; }
  .prologue { height: auto !important; }
  .prologue__pin { position: static; height: auto; padding: 20vh var(--pad); display: block; }
  .prologue__beat { position: static; opacity: 1; transform: none; visibility: visible; margin: 3rem auto; }
  .prologue__meter { display: none; }
  .presidents { height: auto !important; }
  .presidents__pin { position: static; height: auto; padding: 4rem 0; }
  .presidents__track-wrap { overflow-x: auto; }
  .presidents__track { transform: none !important; }
  .event__media img { transform: none; }
  .year-stage { display: none; }
  .grain { animation: none; }
}
