:root {
  --ink: #0c120e;
  --ink-2: #16201a;
  --bone: #f1ead9;
  --bone-dim: rgba(241, 234, 217, 0.62);
  --amber: #f0a75e;
  --kf: #36c1e6; /* kingfisher blue */
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--ink); }
body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body.loading { overflow: hidden; height: 100svh; }
a { color: inherit; text-decoration: none; }
img, video { display: block; }
::selection { background: var(--amber); color: var(--ink); }

/* ───────── loader ───────── */
.loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--ink);
  display: grid; place-items: center;
  transition: clip-path 1.4s var(--ease-io);
  clip-path: inset(0 0 0 0);
}
body.ready .loader { clip-path: inset(0 0 100% 0); pointer-events: none; }
.loader__center { display: flex; flex-direction: column; align-items: center; position: relative; }

/* the river: a line that fills with the download */
.loader__river {
  width: clamp(200px, 46vw, 340px); height: 2px;
  background: rgba(241, 234, 217, 0.14); border-radius: 2px; overflow: hidden;
}
.loader__river i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--kf), var(--amber));
  box-shadow: 0 0 14px rgba(54, 193, 230, 0.7);
  transform-origin: left; transform: scaleX(var(--pp, 0));
  transition: transform 0.35s linear;
}
.loader__word {
  order: -1; margin-bottom: 30px;
  font-family: var(--serif);
  font-size: clamp(52px, 11vw, 150px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(241, 234, 217, 0.25);
  position: relative;
}
.loader__word span {
  position: absolute; inset: 0;
  color: var(--bone);
  -webkit-text-stroke: 0;
  clip-path: inset(calc(100% - var(--p, 0%)) 0 0 0);
  transition: clip-path 0.3s linear;
}
.loader__meta {
  position: absolute; left: 24px; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom));
  display: flex; justify-content: space-between;
  font: 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--bone-dim);
}
.loader__meta span:first-child::after { content: ""; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ───────── chrome: nav, rail, cursor, grain ───────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 22px clamp(16px, 3vw, 44px);
  mix-blend-mode: difference;
  color: var(--bone);
  opacity: 0; transform: translateY(-12px);
  transition: opacity 1s var(--ease-out) 0.6s, transform 1s var(--ease-out) 0.6s;
}
body.intro-done .nav { opacity: 1; transform: none; }
.nav__logo { font-family: var(--serif); font-size: 28px; letter-spacing: -0.01em; }
.nav__logo sup { font: 10px var(--mono); vertical-align: top; margin-left: 2px; }
.nav__links { display: flex; gap: 34px; font: 12px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.nav__links a { opacity: 0.6; transition: opacity 0.3s; }
.nav__links a:hover, .nav__links a.on { opacity: 1; }
.nav__links a i { font-style: normal; opacity: 0.5; margin-right: 6px; }
.nav__cta {
  justify-self: end;
  font: 12px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid currentColor; border-radius: 99px; padding: 12px 20px;
  transition: background 0.3s, color 0.3s;
}
.nav__cta:hover { background: var(--bone); color: #000; }

.rail {
  position: fixed; right: clamp(16px, 2.4vw, 36px); top: 50%; z-index: 40;
  transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
  font: 11px/1 var(--mono); letter-spacing: 0.08em; color: var(--bone);
  opacity: 0; transition: opacity 1s 0.9s;
}
body.intro-done .rail { opacity: 1; }
.rail__track { width: 1px; height: 160px; background: rgba(241, 234, 217, 0.25); position: relative; }
.rail__fill { position: absolute; left: 0; top: 0; width: 1px; height: 100%; background: var(--bone); transform-origin: top; transform: scaleY(var(--progress, 0)); }
.rail__time { writing-mode: vertical-rl; opacity: 0.7; }

.cursor { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; mix-blend-mode: difference; }
.cursor__dot, .cursor__ring { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); }
.cursor__dot { width: 6px; height: 6px; background: #fff; }
.cursor__ring { width: 38px; height: 38px; border: 1px solid #fff; transition: width 0.4s var(--ease-out), height 0.4s var(--ease-out); }
body.hovering .cursor__ring { width: 76px; height: 76px; }
.cursor { display: none; }
body.has-mouse .cursor { display: block; }

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

/* ───────── the film ───────── */
.scrolly { position: relative; height: 300vh; } /* JS sets one screen per chapter */
.viewport {
  position: sticky; top: 0;
  height: 100svh; width: 100%;
  overflow: hidden;
  background: #000;
}
/* The stage is the film's own 1920×1080 coordinate space. JS scales it to
   cover the viewport, so text placed in stage px stays glued to the picture. */
.stage {
  position: absolute; left: 0; top: 0;
  width: 1920px; height: 1080px;
  transform-origin: 0 0;
  will-change: transform;
}
.stage > * { position: absolute; inset: 0; }
.stage video, .matte { width: 100%; height: 100%; object-fit: cover; }
.matte { opacity: 0; transition: opacity 0.2s linear; pointer-events: none; }
.veil { position: absolute; inset: 0; background: #050806; opacity: 0; pointer-events: none; transition: opacity 0.45s var(--ease-io); }
.veil.on { opacity: 1; }
.matte.on { opacity: 1; }
.plane { pointer-events: none; }
/* Copy of hidden chapters is invisible but still in place, so only the
   showing chapter's links may catch clicks. */
body[data-chapter="0"] .ch[data-ch="0"] a,
body[data-chapter="1"] .ch[data-ch="1"] a,
body[data-chapter="2"] .ch[data-ch="2"] a,
.pages .page.in .ch a { pointer-events: auto; }
.shade {
  background:
    radial-gradient(120% 90% at 30% 50%, transparent 40%, rgba(5, 9, 6, 0.55) 100%),
    linear-gradient(to bottom, rgba(5, 9, 6, 0.45), transparent 22%, transparent 70%, rgba(5, 9, 6, 0.65));
  pointer-events: none;
}

/* chapter copy: hidden until its chapter is active */
.ch { position: absolute; }
.ch .line { display: block; overflow: hidden; }
.ch .char, .ch .word {
  display: inline-block;
  transform: translateY(105%) rotate(4deg);
  transition: transform 1.1s var(--ease-out), opacity 0.6s;
  transition-delay: calc(var(--i, 0) * 28ms);
  opacity: 0;
}
.ch .fade {
  opacity: 0; transform: translateY(24px); filter: blur(6px);
  transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out), filter 1s;
  transition-delay: calc(0.35s + var(--d, 0) * 1s);
}
body[data-chapter="0"] .ch[data-ch="0"] .char,
body[data-chapter="0"] .ch[data-ch="0"] .word,
body[data-chapter="1"] .ch[data-ch="1"] .char,
body[data-chapter="1"] .ch[data-ch="1"] .word,
body[data-chapter="2"] .ch[data-ch="2"] .char,
body[data-chapter="2"] .ch[data-ch="2"] .word { transform: none; opacity: 1; }
body[data-chapter="0"] .ch[data-ch="0"] .fade,
body[data-chapter="1"] .ch[data-ch="1"] .fade,
body[data-chapter="2"] .ch[data-ch="2"] .fade { opacity: 1; transform: none; filter: none; }
/* leaving: fast, no stagger */
body:not([data-chapter="0"]) .ch[data-ch="0"] *,
body:not([data-chapter="1"]) .ch[data-ch="1"] *,
body:not([data-chapter="2"]) .ch[data-ch="2"] * { transition-duration: 0.45s; transition-delay: 0s; }

/* static pages: after the film has played once, each chapter is a plain
   full-screen still with its copy, built as it scrolls into view */
.page { position: relative; height: var(--page-h, 100vh); overflow: hidden; background: #000; }
.still { width: 100%; height: 100%; object-fit: cover; }
.page .matte { opacity: 1; }
.pages .page .ch .char, .pages .page .ch .word {
  transition: transform 1.1s var(--ease-out), opacity 0.6s;
  transition-delay: calc(var(--i, 0) * 28ms);
}
.pages .page .ch .fade {
  transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out), filter 1s;
  transition-delay: calc(0.35s + var(--d, 0) * 1s);
}
.pages .page.in .ch .char, .pages .page.in .ch .word { transform: none; opacity: 1; }
.pages .page.in .ch .fade { opacity: 1; transform: none; filter: none; }
.pages .page.in .hero-copy::before,
.pages .page.in .ch2-copy::before,
.pages .page.in .ch3-copy::before { opacity: 1; transition-delay: 0.15s; }

/* hero (chapter 0) – positions are in stage px */
.title {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: -0.035em;
  color: var(--bone);
  white-space: nowrap;
}
.hero-title {
  left: var(--title-x, 140px);
  top: var(--title-y, 300px);
  font-size: var(--title-size, 430px);
  text-shadow: 0 10px 80px rgba(0, 0, 0, 0.25);
}
.hero-title em { font-style: italic; color: var(--amber); }
.label {
  font: 15px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bone);
}
.label b { color: var(--kf); font-weight: 400; }
.plane .label, .hero-copy p { text-shadow: 0 1px 18px rgba(5, 9, 6, 0.55), 0 0 2px rgba(5, 9, 6, 0.4); }
.hero-eyebrow { left: calc(var(--vx) + 150px); top: calc(var(--vy) + 190px); }
.hero-copy {
  left: calc(var(--vx) + 150px); top: calc(var(--vy) + var(--vh) - 330px);
  width: 520px;
  font-size: 25px; line-height: 1.45; color: var(--bone);
}
.hero-copy p { margin-bottom: 30px; }
.hero-cue {
  right: calc(1920px - var(--vx) - var(--vw) + 150px); top: calc(var(--vy) + var(--vh) - 190px);
  display: flex; align-items: center; gap: 18px;
}
.hero-cue .line-anim { width: 90px; height: 1px; background: rgba(241, 234, 217, 0.35); overflow: hidden; position: relative; }
.hero-cue .line-anim::after {
  content: ""; position: absolute; inset: 0; background: var(--bone);
  animation: cue 2.2s var(--ease-io) infinite;
}
@keyframes cue { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
.coords { right: calc(1920px - var(--vx) - var(--vw) + 150px); top: calc(var(--vy) + 190px); text-align: right; color: var(--bone-dim); }

/* chapter 2 – the stream (bird on the left, facing right) */
.ch2-title {
  left: 360px; top: 250px;
  font-size: 400px;
  color: var(--bone);
  opacity: 0.92;
}
.ch2-title em { font-style: italic; }
.ch-num { color: var(--amber); }
.ch2-num { left: 1240px; top: calc(var(--vy) + 190px); }
.ch2-copy { left: 1240px; bottom: calc(1080px - var(--vy) - var(--vh) + 110px); width: 560px; }
.ch2-copy h2, .ch3-copy h2 {
  font: 400 68px/0.98 var(--serif); letter-spacing: -0.02em; margin-bottom: 22px;
  text-shadow: 0 2px 30px rgba(5, 9, 6, 0.6), 0 0 2px rgba(5, 9, 6, 0.35);
}
.ch2-copy h2 em, .ch3-copy h2 em { color: var(--amber); }
.ch2-copy p, .ch3-copy p {
  font-size: 22px; line-height: 1.5; color: var(--bone); max-width: 560px;
  text-shadow: 0 1px 14px rgba(5, 9, 6, 0.75), 0 0 2px rgba(5, 9, 6, 0.5);
}
.stats { display: flex; gap: 48px; margin-top: 28px; padding-top: 22px; border-top: 1px solid rgba(241, 234, 217, 0.3); }
.stats dt { font: 400 56px/1 var(--serif); }
.stats dd { font: 13px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--bone-dim); margin-top: 8px; }

/* chapter 3 – the water (bird on the right, facing left) */
.ch3-title { left: 760px; top: 200px; font-size: 440px; }
.ch3-num { left: 150px; top: calc(var(--vy) + 190px); }
.ch3-copy { left: 150px; bottom: calc(1080px - var(--vy) - var(--vh) + 130px); width: 640px; }
.ch2-btn { margin-top: 30px; }
.ch3-actions { display: flex; align-items: center; gap: 30px; margin-top: 34px; }
.link { text-shadow: 0 1px 12px rgba(5, 9, 6, 0.7); font: 15px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; border-bottom: 1px solid currentColor; padding-bottom: 6px; }
.ch3-cue { top: auto; bottom: calc(1080px - var(--vy) - var(--vh) + 60px); }

/* Soft dark glow behind each copy block, so text stays readable on bright mist.
   It fades with the chapter, like the copy itself. */
.hero-copy, .ch2-copy, .ch3-copy { isolation: isolate; } /* keeps the glow above the video */
.hero-copy::before, .ch2-copy::before, .ch3-copy::before {
  content: ""; position: absolute; z-index: -1;
  inset: -180px -220px -160px -200px;
  background: radial-gradient(closest-side, rgba(6, 10, 7, 0.8), rgba(6, 10, 7, 0.62) 50%, rgba(6, 10, 7, 0.25) 78%, transparent);
  opacity: 0; transition: opacity 0.6s var(--ease-out);
  pointer-events: none;
}
body[data-chapter="0"] .hero-copy::before,
body[data-chapter="1"] .ch2-copy::before,
body[data-chapter="2"] .ch3-copy::before { opacity: 1; transition-delay: 0.15s; }
.ch2-copy h2 em, .ch3-copy h2 em, .hero-title em { color: #f6b26b; }
.ch-num { text-shadow: 0 1px 14px rgba(5, 9, 6, 0.7); }

.btn {
  display: inline-flex; align-items: center; gap: 14px;
  font: 15px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  padding: 22px 30px; border-radius: 99px;
  background: var(--bone); color: var(--ink);
  transition: background 0.4s, color 0.4s, gap 0.4s var(--ease-out);
}
.btn:hover { background: var(--amber); gap: 22px; }

/* ───────── after the film ───────── */
.after { position: relative; z-index: 2; background: var(--ink); }
.manifesto {
  padding: clamp(120px, 18vw, 260px) clamp(16px, 8vw, 140px);
  font-family: var(--serif);
  font-size: clamp(36px, 5.6vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 1600px;
}
.manifesto .w { opacity: 0.14; transition: opacity 0.5s; }
.manifesto .w.lit { opacity: 1; }
.manifesto em { color: var(--amber); }

.cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
  padding: 0 clamp(16px, 3vw, 44px) clamp(80px, 12vw, 180px);
}
.card {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 6px;
  background: var(--ink-2);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 28px;
}
.card__img {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  transform: scale(1.12); transition: transform 1.6s var(--ease-out), filter 1s;
  filter: saturate(0.8) brightness(0.72);
}
.card:hover .card__img { transform: scale(1.02); filter: saturate(1) brightness(0.85); }
.card > *:not(.card__img) { position: relative; }
.card h3 { font: 400 clamp(32px, 3vw, 48px)/1 var(--serif); margin: 10px 0 12px; }
.card p { color: var(--bone-dim); max-width: 32ch; }

.marquee { overflow: hidden; border-block: 1px solid rgba(241, 234, 217, 0.14); padding: 26px 0; }
.marquee__inner { display: flex; gap: 60px; width: max-content; animation: marquee 38s linear infinite; font: 400 clamp(48px, 8vw, 140px)/1 var(--serif); }
.marquee__inner span:nth-child(even) { font-style: italic; color: var(--amber); }
@keyframes marquee { to { transform: translateX(-50%); } }

.footer {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px;
  padding: clamp(60px, 8vw, 120px) clamp(16px, 3vw, 44px) 36px;
}
.footer h2 { font: 400 clamp(48px, 6vw, 104px)/0.95 var(--serif); letter-spacing: -0.02em; margin-bottom: 36px; }
.footer h2 em { color: var(--amber); }
.footer ul { list-style: none; display: grid; gap: 10px; color: var(--bone-dim); }
.footer .label { color: var(--bone-dim); display: block; margin-bottom: 18px; font-size: 12px; }
.footer__base { grid-column: 1 / -1; display: flex; justify-content: space-between; padding-top: 60px; font: 12px var(--mono); color: var(--bone-dim); letter-spacing: 0.08em; text-transform: uppercase; }

/* ───────── phones ───────── */
@media (max-width: 760px) {
  .nav { grid-template-columns: 1fr auto; padding: 16px; }
  .nav__links { display: none; }
  .nav__cta { padding: 10px 14px; font-size: 11px; }
  .rail { display: none; }
  .cards { grid-template-columns: 1fr; }
  .footer { grid-template-columns: 1fr; }
  .footer__base { flex-direction: column; gap: 10px; }
}
@media (max-aspect-ratio: 1/1) {
  /* the stage is cropped to a narrow window (--vw); re-flow the copy inside it */
  .hero-eyebrow { left: calc(var(--vx) + 40px); top: calc(var(--vy) + 150px); font-size: 22px; }
  .coords { display: none; }
  .hero-copy { left: calc(var(--vx) + 40px); width: calc(var(--vw) - 80px); top: auto; bottom: calc(1080px - var(--vy) - var(--vh) + 150px); font-size: 30px; }
  .hero-cue { display: none; }
  .hero-title { left: calc(var(--vx) + 28px); top: 400px; font-size: calc(var(--vw) * 0.34); }
  .ch2-title { left: calc(var(--vx) + 28px); top: 300px; font-size: calc(var(--vw) * 0.36); }
  .ch2-num { left: calc(var(--vx) + 40px); top: calc(var(--vy) + 150px); font-size: 22px; }
  .ch2-copy { left: calc(var(--vx) + 40px); width: calc(var(--vw) - 80px); top: auto; bottom: calc(1080px - var(--vy) - var(--vh) + 120px); }
  .ch2-copy h2 { font-size: 64px; }
  .ch2-copy p { display: none; }
  .ch3-title { left: calc(var(--vx) + 28px); top: 300px; font-size: calc(var(--vw) * 0.4); }
  .ch3-num { left: calc(var(--vx) + 40px); top: calc(var(--vy) + 150px); font-size: 22px; }
  .ch3-copy { left: calc(var(--vx) + 40px); width: calc(var(--vw) - 80px); bottom: calc(1080px - var(--vy) - var(--vh) + 110px); }
  .ch3-copy h2 { font-size: 64px; }
  .ch3-copy p { display: none; }
  .ch3-cue { display: none; }
  .stats { gap: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .grain, .marquee__inner, .hero-cue .line-anim::after { animation: none; }
}
