:root {
  --ink: var(--text);
  --paper: var(--bg);
  --paper-deep: var(--surface);
  --acid: var(--accent);
  --caviar-brand: #2c2f32;
  --line: rgba(215, 232, 188, .14);
  --serif: "Instrument Serif", Georgia, serif;
  /* Display face prototype (Ogg-style). Free stand-in = Fraunces; swap for Ogg/
     PP Editorial New in production. Headings only; body stays on --serif. */
  --display: "Fraunces", "Instrument Serif", Georgia, serif;
  --sans: "Inter", Arial, sans-serif;
  --mono: "Rimini Sans","DM Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body.menu-open { overflow: hidden; }
a { color: inherit; }
button { color: inherit; }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 200; background: var(--acid); padding: .75rem; }
.skip-link:focus { top: 1rem; }

.codex-intro {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  background: var(--paper);
  overflow: hidden;
  clip-path: inset(0);
  animation: introOpen 1.35s cubic-bezier(.77, 0, .18, 1) 7.1s forwards;
}
.codex-intro-name {
  position: absolute;
  top: clamp(1rem, 2.2vw, 2.25rem);
  left: 50%;
  width: max-content;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  font: 400 clamp(5.5rem, 18vw, 17rem)/.72 var(--serif);
  letter-spacing: -.055em;
  animation: introLockupDock 1.35s cubic-bezier(.77, 0, .18, 1) 5.7s forwards;
}
.codex-intro-name > span { display: block; padding: .04em .02em .14em; }
.codex-intro-name i { display: block; font-style: normal; }
.intro-maysoon { position: relative; z-index: 2; overflow: hidden; color: var(--ink); }
.intro-maysoon i { transform: translateY(112%) rotate(2deg); animation: introMaysoon 1.65s cubic-bezier(.16, 1, .3, 1) .25s forwards; }
.intro-salah {
  position: relative;
  z-index: 1;
  color: var(--acid);
  margin-left: -.92em;
  clip-path: inset(0 100% 0 0);
  transform: translateX(-24%);
  animation: introSalahReveal 1.75s cubic-bezier(.16, 1, .3, 1) 1.45s forwards;
}
.codex-intro p {
  position: absolute;
  top: 58%;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: .12rem;
  width: min(43rem, 86vw);
  margin: 0;
  text-align: center;
  font: italic 400 clamp(1.3rem, 2.2vw, 1.9rem)/1.18 var(--serif);
  animation: introSubtitleOut .8s ease 5.75s forwards;
}
.codex-intro p span { opacity: 0; transform: translateY(12px); animation: fadeUp 1s ease 2.55s forwards; }
.codex-intro p span:nth-child(2) { animation-delay: 3.15s; }
.codex-intro p span:nth-child(3) { animation-delay: 3.75s; }
@keyframes introMaysoon { to { transform: translateY(0) rotate(0); } }
@keyframes introSalahReveal {
  0% { clip-path: inset(0 100% 0 0); transform: translateX(-24%); margin-left: -.92em; }
  100% { clip-path: inset(0); transform: translateX(0); margin-left: .12em; }
}
@keyframes introLockupDock {
  0% { top: clamp(1rem, 2.2vw, 2.25rem); font-size: clamp(5.5rem, 18vw, 17rem); letter-spacing: -.055em; }
  100% { top: 25px; font-size: 1.35rem; letter-spacing: -.02em; }
}
@keyframes introSubtitleOut { to { opacity: 0; } }
@keyframes introOpen {
  0% { clip-path: inset(0); visibility: visible; }
  100% { clip-path: inset(0 50%); visibility: hidden; }
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(-8px); } }

.codex-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  height: 74px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(1rem, 2.5vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(16px);
}
.codex-wordmark { grid-column: 2; grid-row: 1; justify-self: center; font: 400 1.35rem/1 var(--serif); text-decoration: none; }
.codex-wordmark em { color: var(--acid); font-style: normal; }
.codex-edition { grid-column: 1; grid-row: 1; justify-self: start; font: 300 .58rem/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.codex-menu-button { display: flex; gap: .65rem; align-items: center; border: 0; background: transparent; font: 400 .64rem/1 var(--mono); text-transform: uppercase; cursor: pointer; }
.codex-menu-button i { width: 7px; height: 7px; background: var(--ink); border-radius: 50%; }
.codex-header-actions { grid-column: 3; grid-row: 1; justify-self: end; display: flex; align-items: center; gap: clamp(.7rem, 1.5vw, 1.3rem); }

/* Circular language switcher (shared widget classes) */
.lang-switch { position: relative; }
.lang-switch-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--paper-deep); border: 1px solid rgba(233,240,86,.24); color: var(--muted); font: 700 .64rem/1 var(--sans); letter-spacing: .02em; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s; flex-shrink: 0; }
.lang-switch-btn:hover, .lang-switch-btn.open { border-color: rgba(233,240,86,.6); color: var(--ink); }
.lang-switch-btn.active { background: var(--acid); color: var(--caviar-brand); border-color: var(--acid); }
.lang-switch-pop { position: absolute; top: calc(100% + 10px); right: 0; min-width: 200px; background: var(--caviar-brand); border: 1px solid rgba(233,240,86,.18); border-radius: 14px; padding: .4rem; box-shadow: 0 18px 40px rgba(0,0,0,.35); opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.97); transform-origin: top right; transition: opacity .18s, transform .18s, visibility .18s; z-index: 160; }
.lang-switch-pop.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.lang-switch-item { display: block; width: 100%; text-align: left; background: none; border: 0; color: #e7ecdd; font: 400 .82rem var(--sans); padding: .55rem .75rem; border-radius: 8px; cursor: pointer; transition: background .15s; }
.lang-switch-item:hover { background: rgba(233,240,86,.08); }
.lang-switch-item.active { color: var(--acid); font-weight: 600; }

.codex-opening { min-height: 100svh; padding: 96px clamp(1.25rem, 4vw, 4.5rem) 3rem; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.codex-opening h1 { margin: 0; text-align: center; font: 400 clamp(4.5rem, 13vw, 13rem)/.72 var(--display); letter-spacing: -.05em; }
.codex-opening h1 em { display: inline-block; color: var(--acid); font-weight: 400; }
.codex-opening-note { max-width: none; margin: 1.7rem 0 0; font: 400 clamp(1.5rem, 2.7vw, 2.35rem)/1.28 var(--serif); font-style: italic; color: #d7e2c4; white-space: nowrap; }
.codex-enter { margin-top: 2.4rem; display: inline-flex; align-items: center; text-decoration: none; font: 300 .68rem var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.codex-sign { margin-top: 1.4rem; font: 400 clamp(2.4rem, 4.5vw, 3.6rem)/1 "Pitaloka", "Instrument Serif", cursive; color: var(--acid); }
.codex-enter > .enter-arrow { display: inline-grid; place-items: center; margin-left: .8rem; width: 32px; height: 32px; border: 1px solid var(--ink); border-radius: 50%; }

.chaos-copy {
  position: relative;
  overflow: hidden;
}
.chaos-word {
  display: inline-block;
  opacity: 0;
  transform: translate(var(--chaos-x), var(--chaos-y)) rotate(var(--chaos-r));
  filter: blur(5px);
  will-change: transform, opacity, filter;
  transition:
    transform .95s cubic-bezier(.16, 1, .3, 1) var(--order-delay),
    opacity .55s ease var(--order-delay),
    filter .75s ease var(--order-delay);
}
.codex-belief.chaos-awake .chaos-word { opacity: .54; filter: blur(1.5px); }
.codex-belief.chaos-ordering .chaos-word {
  opacity: 1;
  transform: translate(0, 0) rotate(0);
  filter: blur(0);
}
.codex-belief .trust-word {
  color: var(--acid);
  transition-delay: var(--trust-delay);
}
.codex-belief.trust-isolate .chaos-word:not(.trust-word) {
  opacity: .06;
  filter: blur(4px);
  transition-delay: 0ms;
}
.codex-belief.trust-isolate .trust-word {
  opacity: 1;
  transform: scale(1.28);
  filter: blur(0);
  transition-delay: 120ms;
}
.codex-belief.trust-resolve .chaos-word {
  opacity: 1;
  transform: translate(0, 0) rotate(0);
  filter: blur(0);
  transition-delay: 0ms;
}
.codex-belief { min-height: 100svh; display: block; padding: 9rem clamp(1.25rem, 4vw, 4.5rem); overflow: hidden; border-top: 1px solid var(--line); background: var(--paper-deep); color: var(--ink); }
.codex-section-label { margin: 0; font: 300 .62rem var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.codex-belief-copy { max-width: 70rem; }
.codex-belief-copy p { margin: 0 0 1.5em; font: 400 clamp(2rem, 4.4vw, 5rem)/1.02 var(--serif); }
.prologue-sequence {
  position: relative;
  align-self: stretch;
  min-width: 0;
  margin-top: 2rem;
}
.prologue-full-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.prologue-stage {
  position: relative;
  min-height: 68svh;
  overflow: hidden;
}
.prologue-phrase {
  position: absolute;
  display: block;
  max-width: min(90%, 50rem);
  opacity: 0;
  transform: translateY(22px);
  filter: blur(7px);
  font: 400 clamp(2.1rem, 4.8vw, 5.8rem)/.92 var(--serif);
  letter-spacing: -.025em;
  transition: opacity 1.1s ease, transform 1.35s cubic-bezier(.16, 1, .3, 1), filter 1.1s ease;
}
.prologue-phrase em { color: var(--acid); font-style: normal; }
.prologue-phrase.is-active { opacity: 1; transform: translateY(0); filter: blur(0); }
.prologue-phrase.is-past { opacity: 0; transform: translateY(-18px); filter: blur(5px); }
.phrase-ai {
  top: 0;
  left: 0;
  font-size: clamp(12rem, 26vw, 28rem);
  transition-duration: 1.45s, 1.65s, 1.45s;
}
.ai-mark { display: inline-block; color: var(--ink); font: inherit; line-height: .75; letter-spacing: -.06em; }
.ai-i { font-size: .52em; text-transform: none; }
.phrase-hands { top: 18%; right: 5%; width: min(72%, 42rem); font-size: clamp(2.4rem, 5.2vw, 6rem); text-align: right; }
.phrase-enhances { top: 10%; right: 5%; font-size: clamp(1.8rem, 3.4vw, 4rem); text-align: right; }
.phrase-transparency { top: 26%; left: 4%; font-size: clamp(3.4rem, 8.4vw, 9.2rem); }
.phrase-efficiency { right: 8%; bottom: 13%; font-size: clamp(2.5rem, 6.2vw, 7rem); text-align: right; }
.phrase-alleviates { top: 14%; left: 10%; font-size: clamp(2.3rem, 4.8vw, 5.5rem); }
.phrase-cognitive { top: 38%; left: 50%; width: max-content; max-width: 92%; transform: translate(-50%, 22px); font-size: clamp(3.2rem, 7.8vw, 8.5rem); text-align: center; }
.phrase-cognitive.is-active { transform: translate(-50%, 0); }
.phrase-cognitive.is-past { transform: translate(-50%, -18px); }
.phrase-decision { top: 40%; left: 50%; width: min(92%, 60rem); transform: translate(-50%, 22px); font-size: clamp(2.8rem, 6.8vw, 7.3rem); text-align: center; }
.phrase-decision.is-active { transform: translate(-50%, 0); }
.phrase-decision.is-past { transform: translate(-50%, -18px); }
.phrase-professions { top: 38%; left: 50%; width: max-content; max-width: 92%; transform: translate(-50%, 22px); font-size: clamp(3rem, 7.2vw, 8rem); text-align: center; }
.phrase-professions.is-active { transform: translate(-50%, 0); }
.phrase-professions.is-past { transform: translate(-50%, -18px); }
.phrase-to-go { top: 55%; left: 50%; transform: translate(-50%, 22px); color: var(--accent); font-size: clamp(2.2rem, 4.5vw, 5rem); }
.phrase-to-go.is-active { transform: translate(-50%, 0); }
.phrase-to-go.is-past { transform: translate(-50%, -18px); }
.phrase-always { top: 38%; left: 50%; width: min(92%, 58rem); transform: translate(-50%, 22px); font-size: clamp(2.4rem, 5.3vw, 6rem); text-align: center; transition-duration: 1.45s; }
.phrase-always.is-active { transform: translate(-50%, 0); }
.phrase-always.is-past { transform: translate(-50%, -18px); }
.phrase-final-trust {
  top: 35%;
  left: 50%;
  width: max-content;
  transform: translate(-50%, 22px);
  color: var(--acid);
  font-size: clamp(7rem, 17vw, 18rem);
  transition-duration: 1.8s;
}
.phrase-final-trust.is-active { transform: translate(-50%, 0); }
.phrase-final-trust.is-past { transform: translate(-50%, -18px); }
.phrase-final-taste { right: 4%; bottom: 7%; max-width: none; color: var(--acid); font-size: clamp(1.65rem, 3.1vw, 3.2rem); text-align: right; }
.prologue-scroll-cue {
  position: absolute;
  right: 0;
  bottom: 0;
  opacity: 0;
  transform: translateY(10px);
  font: 300 .58rem var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: opacity .8s ease, transform .9s cubic-bezier(.16, 1, .3, 1);
}
.prologue-sequence.sequence-complete .prologue-scroll-cue { opacity: 1; transform: none; }

.codex-chapters { border-top: 1px solid var(--line); }
/* Off-centre square showing how the work looks, alongside the chapters */
.codex-chapters { position: relative; }
.codex-reportsq { position: absolute; inset: 0 0 0 auto; width: min(42vw, 500px); z-index: 0; pointer-events: none; }
.rsq-frame { position: sticky; top: calc(50vh - min(19vw, 215px)); width: 100%; aspect-ratio: 1; margin-right: -11%; border-radius: 8px; overflow: hidden; box-shadow: 0 30px 80px -24px rgba(0,0,0,.6); border: 1px solid rgba(233,240,86,.22); background: #202424; }
.rsq-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.rsq-img.is-on { opacity: 1; }
.rsq-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.rsq-tag { position: absolute; left: 14px; bottom: 14px; z-index: 2; font: 400 .56rem 'Rimini Sans','DM Mono', monospace; letter-spacing: .14em; text-transform: uppercase; color: #0c0e08; background: var(--acid); padding: 5px 9px; border-radius: 4px; }
.report-film { position: absolute; inset: 0; overflow: hidden; background: #202424; color: #e7ebc9; }
.report-film-scene { position: absolute; inset: 0; padding: 9% 10%; opacity: 0; transform: scale(1.06); animation: reportScene 18s infinite both; }
.report-film-scene:nth-child(2) { animation-delay: 3.6s; }
.report-film-scene:nth-child(3) { animation-delay: 7.2s; }
.report-film-scene:nth-child(4) { animation-delay: 10.8s; }
.report-film-scene:nth-child(5) { animation-delay: 14.4s; }
.film-restart .report-film-scene { animation-name: reportSceneRestart; }
@keyframes reportScene { 0%, 17% { opacity: 0; transform: scale(1.06); } 3%, 15% { opacity: 1; transform: scale(1); } 20%, 100% { opacity: 0; transform: scale(.98); } }
@keyframes reportSceneRestart { 0%, 17% { opacity: 0; transform: scale(1.06); } 3%, 15% { opacity: 1; transform: scale(1); } 20%, 100% { opacity: 0; transform: scale(.98); } }
.film-kicker { display: block; color: var(--acid); font: 400 .53rem/1.25 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.report-film-cover { display: grid; align-content: space-between; background: radial-gradient(circle at 80% 25%, #677247, #202424 58%); }
.report-film-cover strong { margin-bottom: 18%; font: 400 clamp(2rem, 4vw, 3.7rem)/.9 var(--serif); letter-spacing: -.03em; }
.report-film-cover em, .report-film-offer em { color: var(--acid); font-style: normal; }
.report-film-signal { background: #242927; }
.film-nav { display: flex; gap: .8rem; padding-bottom: .9rem; border-bottom: 1px solid #56604a; color: #a7b08b; font: 400 .48rem var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.film-nav .is-selected { color: var(--acid); border-bottom: 2px solid var(--acid); margin-bottom: -1rem; padding-bottom: .9rem; }
.report-film-signal > p, .report-film-offer > p { margin: 13% 0 9%; font: 400 clamp(1.7rem, 3.6vw, 3.4rem)/.92 var(--serif); letter-spacing: -.025em; }
.film-score { position: relative; width: 48%; min-height: 8.2rem; padding: .8rem; border: 1px solid #56604a; background: #2d332f; }
.film-score span, .film-score i { display: block; color: #a7b08b; font: 400 .48rem var(--mono); letter-spacing: .12em; text-transform: uppercase; font-style: normal; }
.film-score b { display: block; margin: .15rem 0 -.1rem; color: var(--acid); font: 400 clamp(3.3rem, 7vw, 5.5rem)/1 var(--serif); }
.film-bars { position: absolute; right: 10%; bottom: 15%; width: 38%; }
.film-bars i { display: block; height: .55rem; margin-top: 1rem; background: #3c4737; overflow: hidden; }
.film-bars i::after { content: ""; display: block; height: 100%; width: 84%; background: var(--acid); animation: filmBar 2.6s ease-out infinite; }
.film-bars i:nth-child(2)::after { width: 58%; animation-delay: .25s; }.film-bars i:nth-child(3)::after { width: 72%; animation-delay: .5s; }
@keyframes filmBar { from { transform: translateX(-105%); } to { transform: translateX(0); } }
.report-film-evidence { background: #e7ebc9; color: #202424; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; align-content: center; }
.report-film-evidence .film-kicker { grid-column: 1 / -1; color: #52603c; margin-bottom: .8rem; }
.film-evidence-card { min-height: 52%; padding: 1rem; background: #f6f6e9; box-shadow: 0 15px 28px rgba(28,32,29,.16); }
.film-evidence-card.is-offset { transform: translateY(12%); }.film-evidence-card small { display: block; margin-bottom: 1.4rem; font: 400 .5rem var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.film-evidence-card b { display: block; width: 88%; height: .55rem; margin: .65rem 0; background: #202424; }.film-evidence-card b:nth-child(3) { width: 62%; }.film-evidence-card b:nth-child(4) { width: 73%; }
.report-film-offer { background: linear-gradient(135deg, #202424, #30372e); }.report-film-offer > strong { position: absolute; right: 10%; bottom: 13%; color: var(--acid); font: 400 clamp(2.4rem, 5.6vw, 5rem)/.82 var(--serif); }
.film-slider { margin-top: 1.3rem; width: 64%; }.film-slider span { display: block; margin-bottom: .45rem; color: #a7b08b; font: 400 .5rem var(--mono); letter-spacing: .1em; text-transform: uppercase; }.film-slider i { position: relative; display: block; height: .35rem; background: #515d4b; }.film-slider b { position: absolute; top: 50%; left: 64%; width: .85rem; height: .85rem; border-radius: 50%; background: var(--acid); transform: translate(-50%,-50%); animation: filmKnob 3s ease-in-out infinite; }.film-slider:nth-of-type(2) b { animation-delay: .45s; } @keyframes filmKnob { 0%,100% { left: 22%; } 55% { left: 83%; } }
.report-film-render { padding: 0; }.report-film-render img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.1); animation: filmRenderZoom 18s linear infinite; }.report-film-render span { position: absolute; left: 10%; bottom: 13%; color: #fff; font: 400 clamp(1.6rem, 3.5vw, 3.2rem)/.9 var(--serif); text-shadow: 0 3px 18px rgba(0,0,0,.7); } @keyframes filmRenderZoom { to { transform: scale(1); } }
.codex-chapters > .codex-chapter { position: relative; z-index: 1; }
@media (max-width: 560px) { .codex-reportsq { display: none; } }
.codex-chapter { min-height: 70svh; display: grid; grid-template-columns: 10vw 1fr auto; gap: 2rem; align-items: center; padding: 5rem clamp(1.25rem, 4vw, 4.5rem); border-bottom: 1px solid var(--line); }
.codex-chapter > span, .codex-chapter > p { font: 300 .62rem var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.codex-chapter h2 { max-width: 66rem; margin: 0; font: 400 clamp(2.8rem, 6.4vw, 7rem)/.95 var(--display); letter-spacing: -.025em; }
.codex-chapter h2 em { color: var(--acid); font-weight: 400; }
.codex-chapter-accent { background: var(--acid); color: var(--caviar-brand); position: relative; overflow: hidden; }
.codex-chapter-accent > span, .codex-chapter-accent > h2 { position: relative; z-index: 3; }
/* Rotating circular window onto the work — it stays distinct from the report film. */
.supernova-window { position: absolute; right: clamp(-3rem, 1vw, 4rem); bottom: clamp(-5rem, -3vw, -1rem); width: clamp(340px, 44vw, 640px); height: clamp(340px, 44vw, 640px); border-radius: 50%; overflow: hidden; z-index: 2; box-shadow: 0 40px 110px -28px rgba(20,22,19,.7); pointer-events: none; }
.supernova-window .sw-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.3s ease; }
.supernova-window .sw-img.is-on { opacity: 1; }
@media (max-width: 820px) { .codex-chapter-accent { overflow: visible; } .supernova-window { position: relative; right: auto; bottom: auto; margin: 2.4rem 0 0; width: min(66vw, 300px); height: min(66vw, 300px); } }
.codex-chapter-accent h2 em { color: var(--caviar-brand); }
.codex-chapter-accent h2 em[data-morph] { color: var(--caviar-brand); }
.role-article { display: inline-block; }
.context-word { position: relative; display: inline-block; }.context-word::after { content: ""; position: absolute; left: 1%; right: 1%; bottom: -.1em; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; }.codex-chapter-accent.is-visible .context-word::after { animation: contextUnderline 1.1s cubic-bezier(.16,1,.3,1) 1.1s forwards; } @keyframes contextUnderline { to { transform: scaleX(1); } }
.orchestration-word { position: relative; display: inline-block; color: var(--caviar-brand); }
.codex-chapter a { align-self: end; font: 400 .65rem var(--mono); text-transform: uppercase; text-decoration: none; border-bottom: 1px solid; padding-bottom: .4rem; }
.codex-chapter .codex-chapter-link { grid-column: 2; justify-self: start; align-self: start; }
.codex-chapter-accent .supernova-word {
  position: relative;
  z-index: 1;
  display: inline-block;
  transform-origin: 50% 62%;
}
.codex-chapter-accent.is-visible .supernova-word {
  animation: supernovaWord 1.35s cubic-bezier(.16, 1, .3, 1) .72s both;
}
.codex-chapter-accent .supernova-word::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 46% 12%;
  border-radius: 50%;
  background: var(--caviar-brand);
  opacity: 0;
  transform: scale(.05);
}
.codex-chapter-accent.is-visible .supernova-word::before {
  animation: supernovaBurst 1.3s cubic-bezier(.16, 1, .3, 1) .78s both;
}
.supernova-box {
  grid-column: 1 / -1;
  justify-self: start;
  width: min(70vw, 68rem);
  min-height: clamp(25rem, 32vw, 33rem);
  margin-top: clamp(1rem, 3vw, 3rem);
  padding: clamp(1.5rem, 3vw, 3rem);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid rgba(44, 47, 50, .28);
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .7s ease 1.35s, transform .95s cubic-bezier(.16, 1, .3, 1) 1.35s;
}
.codex-chapter-accent.is-visible .supernova-box { opacity: 1; transform: none; }
.supernova-box p {
  max-width: 90%;
  margin: 0 0 clamp(2rem, 4vw, 4rem);
  font: 400 clamp(2.45rem, 4.8vw, 5.25rem)/1 var(--serif);
  letter-spacing: -.018em;
}
.supernova-box p em { color: var(--acid); font-weight: 400; }
.supernova-box a { display: inline-block; color: var(--ink); }
@keyframes supernovaWord {
  0% { transform: scale(.88); letter-spacing: -.08em; filter: blur(8px); }
  48% { transform: scale(1.08); letter-spacing: .025em; filter: blur(0); }
  100% { transform: scale(1); letter-spacing: normal; filter: blur(0); }
}
@keyframes supernovaBurst {
  0% { opacity: 0; transform: scale(.05); box-shadow: 0 0 0 0 rgba(44, 47, 50, 0); }
  35% { opacity: .18; }
  72% { opacity: 0; transform: scale(2.8); box-shadow: 0 0 0 2rem rgba(44, 47, 50, .08); }
  100% { opacity: 0; transform: scale(3.2); }
}
.intelligence-box {
  grid-column: 2 / -1;
  width: 100%;
  max-width: none;
  min-height: 0;
  margin-top: clamp(1rem, 3vw, 3rem);
  padding: clamp(1.5rem, 3.5vw, 3.5rem);
  background: var(--paper-deep);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  align-items: center;
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .7s ease 1s, transform .95s cubic-bezier(.16, 1, .3, 1) 1s;
}
.codex-chapter.is-visible .intelligence-box { opacity: 1; transform: none; }
.intelligence-box p {
  max-width: none;
  margin: 0;
  font: 400 clamp(2.4rem, 4.7vw, 5.2rem)/1.02 var(--serif);
  letter-spacing: -.018em;
}
.intelligence-box p em { color: var(--acid); font-weight: 400; font-style: normal; }
.trust-statement > span { display: block; }
.trust-statement .trust-line { color: var(--ink); }
/* The copy fills the original wide rectangle; individual words still arrive as a teleprompter. */
.intelligence-box .tp-w { display: inline-block; opacity: 0; transform: translateY(.42em); }
.intelligence-box.tp-running .tp-w { animation: teleprompterWord .52s cubic-bezier(.16,1,.3,1) var(--tp-delay) both; }
@keyframes teleprompterWord { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .intelligence-box .tp-w { opacity: 1; transform: none; animation: none !important; } }
@media (min-width: 761px) {
  .codex-chapter h2 { grid-column: 2 / -1; max-width: none; }
  .codex-chapter:first-of-type h2 { max-width: min(51vw, 49rem); }
  .codex-chapter .codex-chapter-link { grid-column: 2; }
}
/* Keep the editorial spread and its report film in the compact desktop/browser view. */
@media (min-width: 561px) and (max-width: 760px) {
  .codex-chapter { grid-template-columns: 2.5rem 1fr auto; gap: 1.4rem; padding-inline: 1.5rem; }
  .codex-chapter h2 { grid-column: 2 / -1; max-width: none; font-size: clamp(2.55rem, 7.3vw, 4.4rem); }
  .codex-chapter:first-of-type h2 { max-width: 51vw; }
  .codex-chapter .codex-chapter-link { grid-column: 2; align-self: center; }
  .intelligence-box { grid-column: 2 / -1; width: min(100%, 53rem); min-height: 0; padding: 1.35rem; }
  .intelligence-box p { font-size: clamp(1.35rem, 3.3vw, 2rem); }
  .supernova-box { grid-column: 1 / -1; width: min(100%, 35rem); min-height: 22rem; padding: 1.35rem; }
  .supernova-window { position: absolute; right: -4.5rem; bottom: -3.25rem; width: min(48vw, 360px); height: min(48vw, 360px); margin: 0; }
  .rsq-frame { margin-right: -3%; }
}
@media (max-width: 560px) { .codex-opening-note { white-space: normal; max-width: 19rem; } }
/* Entrance: original dome/archway window with changing scenes. */
.codex-door { position: relative; width: min(74vw, 440px); aspect-ratio: 3 / 4; margin: 0 auto 2.6rem; border-radius: 50% 50% 12px 12px / 62% 62% 12px 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.14); box-shadow: 0 50px 110px -34px rgba(20,22,19,.7); }
.codex-door .cd-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.4s ease; }
.codex-door .cd-img.is-on { opacity: 1; }
.codex-entrance { min-height: 100svh; padding: 8rem 2rem; display: grid; place-content: center; text-align: center; background: var(--paper-deep); color: var(--ink); }
.codex-entrance p { font: italic 400 1.25rem var(--serif); }
.codex-entrance h2 { margin: 0; font: 400 clamp(4rem, 10vw, 10rem)/.9 var(--serif); letter-spacing: -.04em; }
.codex-entrance button { justify-self: center; margin-top: 3rem; border: 1px solid var(--paper); border-radius: 100%; width: 150px; aspect-ratio: 1; background: transparent; font: 300 .62rem/1.5 var(--mono); text-transform: uppercase; cursor: pointer; transition: .3s; }
.codex-entrance button:hover { background: var(--acid); color: var(--caviar-brand); border-color: var(--acid); transform: rotate(-4deg); }

[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s cubic-bezier(.16, 1, .3, 1); }
[data-reveal].is-visible { opacity: 1; transform: none; }

/* Every text beat is clipped and rises word-by-word. JS assigns stagger values. */
.motion-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding: .06em .01em .1em;
  margin: -.06em -.01em -.1em;
}
.motion-word-inner {
  display: inline-block;
  opacity: .001;
  transform: translateY(115%) rotate(1.5deg);
  filter: blur(5px);
  transition:
    transform .82s cubic-bezier(.16, 1, .3, 1) var(--word-delay, 0ms),
    opacity .42s ease var(--word-delay, 0ms),
    filter .65s ease var(--word-delay, 0ms);
}
.words-in .motion-word-inner {
  opacity: 1;
  transform: translateY(0) rotate(0);
  filter: blur(0);
}
.codex-menu .motion-word-inner { transition-delay: calc(var(--word-delay, 0ms) + 160ms); }

.codex-menu { position: fixed; inset: 0; z-index: 140; padding: 6rem clamp(1.25rem, 5vw, 5rem) 2rem; display: grid; background: var(--acid); color: var(--caviar-brand); transform: translateX(101%); transition: transform .7s cubic-bezier(.77, 0, .18, 1); }
.codex-menu.is-open { transform: none; }
.codex-menu-top { position: absolute; top: 2rem; left: clamp(1.25rem, 5vw, 5rem); right: clamp(1.25rem, 5vw, 5rem); display: flex; align-items: center; justify-content: space-between; }
.codex-menu-top .lang-switch-btn { background: transparent; border-color: rgba(44,47,50,.4); color: var(--caviar-brand); }
.codex-menu-top .lang-switch-btn.active { background: var(--caviar-brand); color: var(--acid); border-color: var(--caviar-brand); }
.codex-menu-top .lang-switch-pop { background: var(--caviar-brand); }
.codex-menu-close { border: 0; background: none; font: 400 .65rem var(--mono); text-transform: uppercase; cursor: pointer; }
.codex-menu nav { display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(32rem, 2.5fr); gap: clamp(2rem, 8vw, 8rem); min-height: 100%; align-items: start; }
.codex-menu .menu-identity { margin: .7rem 0 0; font: 300 .62rem var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.menu-groups { border-top: 1px solid rgba(44, 47, 50, .3); }
.menu-group,
.menu-primary { border-bottom: 1px solid rgba(44, 47, 50, .3); }
.menu-parent,
.menu-primary {
  width: 100%;
  min-height: clamp(4.4rem, 8vh, 6.5rem);
  padding: .65rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu-parent span { font: 400 clamp(1.55rem, 2.75vw, 3.15rem)/1 var(--serif); }
.menu-primary span { font: 400 clamp(2.15rem, 4.2vw, 4.9rem)/.9 var(--serif); }
.codex-menu small { flex: 0 0 auto; font: 300 .55rem var(--mono); text-transform: uppercase; letter-spacing: .12em; }
.menu-parent::after {
  content: "+";
  flex: 0 0 auto;
  font: 300 1rem var(--mono);
}
.menu-parent[aria-expanded="true"]::after { content: "−"; }
.menu-children {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(1.5rem, 4vw, 4rem);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .6s cubic-bezier(.16, 1, .3, 1), opacity .45s ease, padding .6s cubic-bezier(.16, 1, .3, 1);
}
.menu-group.is-expanded .menu-children { max-height: 26rem; padding: .3rem 0 1.6rem; opacity: 1; }
.codex-menu .menu-children a {
  display: block;
  padding: .55rem 0;
  font: 400 clamp(1.4rem, 2.4vw, 2.2rem)/1.12 var(--serif);
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(44, 47, 50, .16);
}
.menu-primary:hover span,
.menu-parent:hover span,
.menu-children a:hover { font-style: italic; }
.menu-conversation { margin-top: clamp(1rem, 3vh, 2rem); border-top: 1px solid rgba(44, 47, 50, .3); }

@media (max-width: 560px) {
  .codex-edition { font-size: .5rem; }
  .codex-header { grid-template-columns: 1fr auto 1fr; }
  .codex-intro-name { top: 5rem; font-size: clamp(5.4rem, 28vw, 8rem); text-align: center; }
  .codex-intro p { top: 58%; }
  .codex-opening { grid-template-columns: 1fr; }
  .codex-opening h1 { font-size: clamp(5.5rem, 31vw, 9rem); }
  .codex-opening-note { max-width: 18rem; }
  .codex-enter { margin-top: 2rem; }
  .codex-belief { grid-template-columns: 1fr; }
  .codex-chapter { grid-template-columns: 2rem 1fr; min-height: 60svh; }
  .codex-chapter h2 { grid-column: 2; max-width: none; }
  .codex-chapter > p, .codex-chapter > a { grid-column: 2; justify-self: start; }
  .codex-chapter .codex-chapter-link { grid-column: 2; }
  .supernova-box { grid-column: 1 / -1; width: 100%; min-height: 0; margin-top: 1.5rem; padding: 1.4rem; }
  .supernova-box p { max-width: none; margin-bottom: 2.5rem; font-size: clamp(2rem, 8.4vw, 2.75rem); }
  .supernova-window { grid-column: 2; justify-self: end; width: min(78vw, 300px); height: min(78vw, 300px); }
  .intelligence-box { grid-column: 1 / -1; width: 100%; padding: 1.4rem; }
  .intelligence-box p { font-size: clamp(2rem, 8vw, 2.7rem); }
  .codex-menu { padding-top: 5rem; overflow-y: auto; }
  .codex-menu nav { grid-template-columns: 1fr; gap: 2rem; }
  .codex-menu .menu-identity { margin: 0; }
  .menu-parent span { font-size: clamp(1.6rem, 7vw, 2.5rem); }
  .menu-primary span { font-size: clamp(2rem, 10vw, 3.6rem); }
  .menu-children { grid-template-columns: 1fr; }
  .menu-group.is-expanded .menu-children { max-height: 34rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
  .codex-intro { display: none; }
  .prologue-stage { display: none; }
  .prologue-full-copy {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    clip: auto;
    white-space: normal;
    font: 400 clamp(2rem, 4.4vw, 5rem)/1.02 var(--serif);
  }
}
