/* ==========================================================
   Signal / Noise — Amit Bhalla
   Palette: black, white, and one signal colour.
   Change --signal to re-tune the whole site.
   ========================================================== */

:root {
  --ink: #0a0a0a;
  --paper: #f6f5f1;
  --signal: #3d6bff;
  --ink-soft: rgba(246, 245, 241, 0.55);
  --ink-faint: rgba(246, 245, 241, 0.14);
  --paper-soft: rgba(10, 10, 10, 0.6);
  --paper-faint: rgba(10, 10, 10, 0.14);

  --f-display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --f-serif: 'Instrument Serif', Georgia, serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
}

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

html { -webkit-text-size-adjust: 100%; }
html.is-loading { overflow: hidden; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-display);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }
em { font-style: normal; }
ul { list-style: none; }

.mono {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.serif { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.accent { color: var(--signal); }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.section-tag { display: inline-block; color: var(--signal); margin-bottom: 28px; }

/* ---------- Grain overlay ---------- */
.grain {
  position: fixed; inset: -50%;
  z-index: 90; pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.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 1s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); }
}

/* ---------- Scroll progress ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 95; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--signal); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Cursor ---------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 100;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--paper);
  mix-blend-mode: difference;
  pointer-events: none;
  display: grid; place-items: center;
  transition: width .45s var(--ease-out), height .45s var(--ease-out), margin .45s var(--ease-out), background .3s;
  opacity: 0;
}
.cursor.is-on { opacity: 1; }
.cursor.is-hover {
  width: 88px; height: 88px; margin: -44px 0 0 -44px;
  background: var(--signal); mix-blend-mode: normal;
}
.cursor__label {
  font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink); opacity: 0; transition: opacity .2s;
}
.cursor.is-hover .cursor__label { opacity: 1; transition-delay: .1s; }
@media (hover: hover) and (pointer: fine) {
  html.js, html.js a { cursor: none; }
}
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--signal); color: var(--ink);
  display: flex; align-items: flex-end;
  padding: var(--gutter);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.1s var(--ease-io);
}
.loader.is-done { clip-path: inset(0 0 100% 0); }
html:not(.js) .loader { display: none; }
.loader__inner { width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px 24px; }
.loader__year {
  grid-column: 1 / -1;
  font-size: clamp(96px, 28vw, 420px);
  font-weight: 800; line-height: .8; letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
}
.loader__label--right { text-align: right; }
.loader__label { grid-row: 1; }
.loader__bar { grid-column: 1 / -1; height: 2px; background: rgba(10,10,10,.2); margin-top: 16px; }
.loader__bar span { display: block; height: 100%; width: 100%; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px var(--gutter);
  mix-blend-mode: difference; color: #fff;
}
.nav__logo { font-weight: 800; font-size: 22px; letter-spacing: -.04em; }
.nav__logo span { display: inline-block; transition: transform .5s var(--ease-out); }
.nav__logo:hover span { transform: rotate(180deg); }
.nav__links { display: flex; gap: 28px; }
.nav__links a { position: relative; overflow: hidden; display: inline-block; }
.nav__links a::after {
  content: ''; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: 100% 50%; transition: transform .5s var(--ease-out);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: 0 50%; }
.nav__status { display: flex; align-items: center; gap: 8px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #fff; position: relative; }
.pulse::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1px solid #fff;
  animation: pulse 1.8s var(--ease-out) infinite;
}
@keyframes pulse { from { transform: scale(1); opacity: 1; } to { transform: scale(3.2); opacity: 0; } }
@media (max-width: 860px) { .nav__links { display: none; } }

/* ---------- Line reveal utility ---------- */
.line { display: block; overflow: hidden; padding-bottom: .06em; }
.line > span { display: inline-block; transform: translateY(110%); transition: transform 1.2s var(--ease-out); }
.is-in .line > span, .line.is-in > span { transform: none; }
.is-in .line:nth-child(2) > span { transition-delay: .12s; }
.reveal-up { opacity: 0; transform: translateY(16px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
.is-in .reveal-up, .reveal-up.is-in { opacity: 1; transform: none; transition-delay: .35s; }
html:not(.js) .line > span, html:not(.js) .reveal-up { transform: none; opacity: 1; }

/* ==========================================================
   HERO
   ========================================================== */
.hero {
  position: relative;
  height: 100vh; height: 100svh; min-height: 560px;
  overflow: hidden;
}
.hero__field { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.hero__meta {
  position: absolute; top: 92px;
  display: flex; flex-direction: column; gap: 4px;
  color: var(--ink-soft);
}
.hero__meta--l { left: var(--gutter); }
.hero__meta--r { right: var(--gutter); text-align: right; }
.hero__copy {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(72px, 12vh, 120px);
  pointer-events: none;
}
.hero__line {
  font-size: clamp(34px, 6.4vw, 104px);
  font-weight: 600; line-height: .98; letter-spacing: -.045em;
}
.hero__line .serif { font-size: 1.08em; }
.hero__sub { margin-top: 22px; color: var(--ink-soft); }
.hero__hint {
  position: absolute; right: var(--gutter); bottom: clamp(72px, 12vh, 120px);
  display: flex; align-items: center; gap: 14px; color: var(--ink-soft);
}
.hint-touch { display: none; }
@media (hover: none) { .hint-touch { display: inline; } .hint-desktop { display: none; } }
.scroll-cue { width: 1px; height: 48px; background: var(--ink-faint); position: relative; overflow: hidden; }
.scroll-cue i { position: absolute; left: 0; top: 0; width: 100%; height: 40%; background: var(--signal); animation: cue 1.8s var(--ease-io) infinite; }
@keyframes cue { from { transform: translateY(-100%); } to { transform: translateY(260%); } }
@media (max-width: 860px) {
  .hero__meta--r { display: none; }
  .hero__hint { left: var(--gutter); right: auto; bottom: 28px; }
  .hero__copy { bottom: 96px; }
}

/* "noise." glitch */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%;
  opacity: .9;
}
.glitch::before { color: var(--signal); animation: glitch-a 2.8s steps(1) infinite; }
.glitch::after { color: var(--paper); animation: glitch-b 2.2s steps(1) infinite; mix-blend-mode: difference; }
@keyframes glitch-a {
  0%, 86%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  88% { clip-path: inset(10% 0 60% 0); transform: translate(-4px, 1px); }
  91% { clip-path: inset(55% 0 20% 0); transform: translate(5px, -1px); }
  94% { clip-path: inset(30% 0 45% 0); transform: translate(-2px, 0); }
}
@keyframes glitch-b {
  0%, 80%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  83% { clip-path: inset(70% 0 5% 0); transform: translate(3px, 0); }
  87% { clip-path: inset(5% 0 80% 0); transform: translate(-5px, 0); }
}

/* ==========================================================
   MANIFESTO
   ========================================================== */
.manifesto { position: relative; height: 260vh; }
.manifesto__sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--gutter);
}
.manifesto__text {
  max-width: 22ch;
  font-size: clamp(30px, 5.2vw, 84px);
  font-weight: 500; line-height: 1.04; letter-spacing: -.035em;
}
@media (min-width: 1100px) { .manifesto__text { max-width: 26ch; } }
.manifesto__text .w { color: var(--paper); opacity: .12; transition: opacity .25s linear, color .25s linear; }
.manifesto__text .w.on { opacity: 1; }
.manifesto__text .w.key { font-family: var(--f-serif); font-style: italic; font-weight: 400; }
.manifesto__text .w.key.on { color: var(--signal); }

/* ==========================================================
   PROOF BOARD
   ========================================================== */
.proof {
  background: var(--paper); color: var(--ink);
  padding: clamp(96px, 14vw, 180px) var(--gutter) clamp(72px, 10vw, 140px);
  border-radius: 28px 28px 0 0;
  position: relative; z-index: 2;
}
.proof__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: clamp(48px, 7vw, 96px); }
.proof__title { font-size: clamp(38px, 6.6vw, 112px); font-weight: 700; line-height: .95; letter-spacing: -.05em; }
.proof__title .serif { font-weight: 400; color: var(--signal); }

.board {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--paper-faint); border-left: 1px solid var(--paper-faint);
}
@media (max-width: 960px) { .board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .board { grid-template-columns: 1fr; } }
.cell {
  position: relative; overflow: hidden;
  border-right: 1px solid var(--paper-faint); border-bottom: 1px solid var(--paper-faint);
  padding: 28px 28px 40px;
  min-height: clamp(280px, 30vw, 380px);
  display: flex; flex-direction: column;
  isolation: isolate;
}
.cell::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--ink);
  transform: translateY(101%); transition: transform .7s var(--ease-out);
}
.cell:hover::before { transform: none; }
.cell:hover { color: var(--paper); }
.cell, .cell * { transition: color .4s var(--ease-out); }
.cell__idx { color: var(--paper-soft); }
.cell:hover .cell__idx, .cell:hover .cell__src { color: var(--ink-soft); }
.cell__num {
  margin: auto 0 18px;
  font-size: clamp(64px, 8.4vw, 136px);
  font-weight: 800; line-height: .82; letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cell:hover .cell__num { color: var(--signal); }
.cell__label { font-size: 17px; line-height: 1.35; max-width: 30ch; letter-spacing: -.01em; }
.cell__src { margin-top: 18px; color: var(--paper-soft); }
.cell__meter {
  position: absolute; left: 0; bottom: 0; height: 6px;
  width: calc(var(--v) * 100%);
  background: var(--signal);
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 1.6s var(--ease-out) .2s;
}
.cell.is-in .cell__meter { transform: scaleX(1); }

/* ==========================================================
   PATH — horizontal, pinned
   ========================================================== */
.path { position: relative; background: var(--ink); }
.path__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.path__year {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: clamp(140px, 34vw, 560px); font-weight: 800; letter-spacing: -.07em; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px var(--ink-faint);
  font-variant-numeric: tabular-nums;
  pointer-events: none; user-select: none; white-space: nowrap;
}
.path__track { position: relative; height: 100%; display: flex; will-change: transform; }
.path__wave { position: absolute; left: 0; top: 0; height: 100%; overflow: visible; pointer-events: none; }
.path__wave path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
#waveGhost { stroke: var(--ink-faint); stroke-width: 1; }
#waveLine { stroke: var(--signal); stroke-width: 2; }

.panel {
  position: relative; flex: 0 0 auto;
  width: min(560px, 82vw);
  height: 100%;
  padding: 0 clamp(24px, 4vw, 64px);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: clamp(56px, 10vh, 110px);
}
.panel + .panel { border-left: 1px solid var(--ink-faint); }
.panel--intro { width: min(720px, 92vw); justify-content: center; padding-bottom: 0; padding-left: var(--gutter); }
.panel__intro { font-size: clamp(48px, 7vw, 120px); font-weight: 700; line-height: .92; letter-spacing: -.05em; }
.panel__intro .serif { color: var(--signal); font-weight: 400; }
.panel__note { margin-top: 32px; color: var(--ink-soft); }
.panel__no { color: var(--signal); }
.panel__org { margin-top: 14px; font-size: clamp(34px, 4vw, 60px); font-weight: 700; line-height: .95; letter-spacing: -.04em; }
.panel__role { margin-top: 12px; color: var(--ink-soft); text-transform: none; }
.panel__lede { margin-top: 26px; font-family: var(--f-serif); font-style: italic; font-size: clamp(24px, 2.4vw, 34px); line-height: 1.1; }
.panel__body { margin-top: 12px; color: var(--ink-soft); max-width: 40ch; }
.panel::before {
  content: ''; position: absolute; left: -6px; top: var(--dot-y, 50%);
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--ink); border: 1px solid var(--ink-soft);
  transition: background .4s, border-color .4s, transform .4s var(--ease-out);
}
.panel--intro::before { display: none; }
.panel.is-lit::before { background: var(--signal); border-color: var(--signal); transform: scale(1.5); }
.panel--now .panel__org { color: var(--signal); }

/* ==========================================================
   MARQUEE
   ========================================================== */
.owns { background: var(--signal); color: var(--ink); padding: clamp(28px, 4vw, 56px) 0; overflow: hidden; }
.marquee { display: flex; white-space: nowrap; }
.marquee__row {
  display: flex; align-items: center; flex: 0 0 auto;
  font-size: clamp(54px, 9vw, 150px); font-weight: 800; letter-spacing: -.05em; line-height: 1.02;
}
.marquee__row span { padding: 0 .22em; transition: color .3s, -webkit-text-stroke .3s; }
.marquee__row span:hover { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.marquee__row i { font-style: normal; font-size: .5em; }
.marquee--serif .marquee__row { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -.02em; }

/* ==========================================================
   CONTACT
   ========================================================== */
.contact { padding: clamp(110px, 16vw, 220px) var(--gutter) 28px; }
.contact__q { font-size: clamp(20px, 2vw, 28px); color: var(--ink-soft); max-width: 28ch; letter-spacing: -.01em; }
.contact__big {
  margin-top: 20px;
  font-size: clamp(56px, 11.5vw, 210px); font-weight: 700; line-height: .9; letter-spacing: -.06em;
}
.contact__big .serif { color: var(--signal); font-weight: 400; }
.contact__row { margin-top: clamp(48px, 7vw, 96px); display: flex; flex-wrap: wrap; align-items: center; gap: 48px 72px; }

.magnet {
  width: clamp(150px, 15vw, 210px); aspect-ratio: 1; border-radius: 50%;
  background: var(--signal); color: var(--ink);
  display: grid; place-items: center; text-align: center;
  font-weight: 700; font-size: 22px; line-height: 1; letter-spacing: -.02em;
  transition: transform .6s var(--ease-out), background .3s;
  will-change: transform;
}
.magnet:hover { background: var(--paper); }
.magnet__inner { transition: transform .6s var(--ease-out); pointer-events: none; }

.contact__links { flex: 1 1 320px; max-width: 640px; }
.contact__links li { border-top: 1px solid var(--ink-faint); }
.contact__links li:last-child { border-bottom: 1px solid var(--ink-faint); }
.contact__links a {
  display: flex; justify-content: space-between; gap: 16px; padding: 18px 0;
  position: relative; transition: padding .5s var(--ease-out), color .3s;
}
.contact__links a span:last-child { color: var(--ink-soft); text-transform: none; transition: color .3s; }
.contact__links a:hover { padding-left: 16px; color: var(--signal); }
.contact__links a:hover span:last-child { color: var(--paper); }

.foot {
  margin-top: clamp(96px, 12vw, 180px);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  color: var(--ink-soft); text-transform: none;
}
.foot a { text-decoration: underline; text-underline-offset: 3px; transition: color .3s; }
.foot a:hover { color: var(--signal); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .manifesto { height: auto; }
  .manifesto__sticky { position: static; height: auto; padding-top: 120px; padding-bottom: 120px; }
  .manifesto__text .w { opacity: 1; }
  .manifesto__text .w.key { color: var(--signal); }
}

/* ==========================================================
   SHARED CHROME — menu, wipe, kinetic type, reveals
   ========================================================== */
.nav__menu {
  display: none; background: none; border: 0; color: inherit; cursor: pointer;
  padding: 8px 0; font: inherit;
}
.nav__links a[aria-current="page"]::after { transform: scaleX(1); }
@media (max-width: 860px) {
  .nav__menu { display: block; }
  .nav__status { display: none; }
  .nav { padding-top: max(16px, env(safe-area-inset-top)); }
}

.menu {
  position: fixed; inset: 0; z-index: 150;
  background: var(--signal); color: var(--ink);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) var(--gutter) max(24px, env(safe-area-inset-bottom));
  visibility: hidden;
  clip-path: circle(0% at calc(100% - 40px) 36px);
  transition: clip-path .8s var(--ease-io), visibility 0s linear .8s;
}
.menu.is-open { visibility: visible; clip-path: circle(150% at calc(100% - 40px) 36px); transition: clip-path .8s var(--ease-io); }
html.menu-open { overflow: hidden; }
.menu__top { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.menu__close { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 8px 0; text-transform: uppercase; }
.menu__links { display: flex; flex-direction: column; }
.menu__links a {
  display: flex; align-items: baseline; gap: 14px;
  font-size: clamp(44px, 13vw, 96px); font-weight: 700; letter-spacing: -.05em; line-height: 1.02;
  border-bottom: 1px solid rgba(10,10,10,.18); padding: 4px 0;
  transform: translateY(40px); opacity: 0;
  transition: transform .8s var(--ease-out), opacity .8s var(--ease-out);
}
.menu.is-open .menu__links a { transform: none; opacity: 1; }
.menu.is-open .menu__links a:nth-child(1) { transition-delay: .18s; }
.menu.is-open .menu__links a:nth-child(2) { transition-delay: .23s; }
.menu.is-open .menu__links a:nth-child(3) { transition-delay: .28s; }
.menu.is-open .menu__links a:nth-child(4) { transition-delay: .33s; }
.menu.is-open .menu__links a:nth-child(5) { transition-delay: .38s; }
.menu.is-open .menu__links a:nth-child(6) { transition-delay: .43s; }
.menu__links a[aria-current="page"] { font-family: var(--f-serif); font-style: italic; font-weight: 400; }
.menu__links i { font-style: normal; }
.menu__foot { display: flex; flex-wrap: wrap; gap: 10px 22px; text-transform: none; }

/* Page wipe */
.wipe {
  position: fixed; inset: 0; z-index: 250; pointer-events: none;
  background: var(--signal); color: var(--ink);
  display: flex; align-items: flex-end; padding: var(--gutter);
  transform: translateY(100%);
}
.wipe__label { font-size: clamp(48px, 12vw, 200px); font-weight: 800; letter-spacing: -.06em; line-height: .85; }
.wipe.is-cover { transform: none; transition: transform .7s var(--ease-io); pointer-events: all; }
html.is-entering .wipe { transform: none; }
html.is-entering .wipe.is-leave { transform: translateY(-100%); transition: transform .95s var(--ease-io); }

/* Kinetic headings: each word rises out of a mask */
.wd { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .06em .1em 0; margin: 0 -.06em -.1em 0; }
.wd > span { display: inline-block; transform: translateY(108%); transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--i) * 40ms); }
[data-split].is-in .wd > span { transform: none; }

[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); transition-delay: var(--d, 0s); }
[data-reveal].is-in { opacity: 1; transform: none; }
html:not(.js) [data-reveal], html:not(.js) .wd > span { opacity: 1; transform: none; }

/* Big "line" button */
.btn-line {
  display: inline-flex; align-items: center; gap: 18px;
  padding: 18px 0; border-bottom: 1px solid currentColor;
  font-size: 13px;
}
.btn-line i { font-style: normal; display: inline-block; transition: transform .5s var(--ease-out); }
.btn-line:hover i { transform: translateX(10px); }
.btn-line:hover { color: var(--signal); }

.panel__link { margin-top: 24px; color: var(--signal); align-self: flex-start; border-bottom: 1px solid currentColor; padding-bottom: 4px; }

/* ==========================================================
   HOME — rails teaser
   ========================================================== */
.rails-teaser { padding: clamp(110px, 14vw, 200px) var(--gutter); position: relative; }
.rails-teaser__title { font-size: clamp(40px, 7vw, 120px); font-weight: 700; line-height: .94; letter-spacing: -.05em; max-width: 14ch; }
.rails-teaser__title .serif { color: var(--signal); font-weight: 400; }
.rails-teaser__sub { margin-top: 28px; max-width: 52ch; font-size: clamp(17px, 1.5vw, 21px); color: var(--ink-soft); }

.pipe {
  position: relative; margin: clamp(56px, 8vw, 110px) 0 clamp(40px, 6vw, 72px);
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
}
.pipe__line { position: absolute; left: 0; right: 0; top: 8px; height: 1px; background: var(--ink-faint); overflow: hidden; }
.pipe__pulse {
  position: absolute; top: -1px; left: 0; width: 18%; height: 3px;
  background: linear-gradient(90deg, transparent, var(--signal));
  animation: pipe 3.2s linear infinite;
}
.pipe__pulse--2 { animation-delay: -1.6s; }
@keyframes pipe { from { transform: translateX(-100%); } to { transform: translateX(560%); } }
.pipe__node { position: relative; padding-top: 34px; padding-right: 16px; display: flex; flex-direction: column; gap: 6px; }
.pipe__node::before {
  content: ''; position: absolute; left: 0; top: 2px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--ink); border: 1px solid var(--paper);
}
.pipe__node--hot::before { background: var(--signal); border-color: var(--signal); box-shadow: 0 0 0 6px rgba(61,107,255,.2); }
.pipe__node span { color: var(--signal); }
.pipe__node b { font-size: clamp(22px, 2.4vw, 34px); font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.pipe__node small { color: var(--ink-soft); text-transform: none; font-size: 11px; }
@media (max-width: 760px) {
  .pipe { grid-template-columns: 1fr; gap: 26px; padding-left: 28px; }
  .pipe__line { left: 6px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
  .pipe__pulse { width: 3px; height: 22%; left: -1px; top: 0; background: linear-gradient(180deg, transparent, var(--signal)); animation-name: pipe-v; }
  @keyframes pipe-v { from { transform: translateY(-100%); } to { transform: translateY(460%); } }
  .pipe__node { padding-top: 0; }
  .pipe__node::before { left: -28px; top: 4px; }
}

/* ==========================================================
   HOME — chapter index
   ========================================================== */
.chapters { padding: clamp(110px, 14vw, 200px) var(--gutter) 0; }
.chapters__title { font-size: clamp(38px, 6vw, 100px); font-weight: 700; line-height: .95; letter-spacing: -.05em; max-width: 16ch; margin-bottom: clamp(40px, 6vw, 80px); }
.chapters__title .serif { color: var(--signal); font-weight: 400; }
.chapters__list { list-style: none; border-top: 1px solid var(--ink-faint); }
.chapters__list li { border-bottom: 1px solid var(--ink-faint); }
.chapters__list a {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: 60px 1fr 1fr 40px; align-items: center; gap: 20px;
  padding: clamp(18px, 2.4vw, 30px) 0;
  transition: color .4s var(--ease-out), padding .6s var(--ease-out);
}
.chapters__list a::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--signal);
  transform: scaleY(0); transform-origin: 50% 100%; transition: transform .6s var(--ease-out);
}
.chapters__list a:hover { color: var(--ink); padding-left: 20px; padding-right: 20px; }
.chapters__list a:hover::before { transform: scaleY(1); }
.chapters__list i { font-style: normal; }
.chapters__list b { font-size: clamp(30px, 4.4vw, 72px); font-weight: 700; letter-spacing: -.045em; line-height: 1; }
.chapters__list span { color: var(--ink-soft); max-width: 34ch; transition: color .4s; }
.chapters__list a:hover span { color: var(--ink); }
.chapters__list em { font-size: 28px; justify-self: end; transition: transform .5s var(--ease-out); }
.chapters__list a:hover em { transform: translateX(6px) rotate(-45deg); }
@media (max-width: 760px) {
  .chapters__list a { grid-template-columns: 36px 1fr 24px; gap: 4px 12px; }
  .chapters__list span { grid-column: 2; grid-row: 2; font-size: 14px; }
  .chapters__list em { grid-column: 3; grid-row: 1; font-size: 22px; }
}

/* ==========================================================
   PHONE PASS — home
   ========================================================== */
@media (max-width: 600px) {
  .hero__meta { top: 74px; }
  .hero__line { font-size: clamp(32px, 10vw, 44px); }
  .hero__sub { font-size: 10.5px; line-height: 1.7; }
  .manifesto { height: 220vh; }
  .manifesto__text { font-size: clamp(28px, 8.4vw, 40px); }
  .proof { border-radius: 20px 20px 0 0; }
  .cell { min-height: 0; padding: 22px 20px 34px; }
  .cell__num { margin-top: 36px; font-size: clamp(64px, 20vw, 96px); }
  .panel { width: 86vw; padding: 0 22px clamp(48px, 9vh, 90px); }
  .panel--intro { width: 100vw; }
  .panel__org { font-size: 34px; }
  .panel__lede { margin-top: 16px; }
  .path__year { font-size: 44vw; top: 46%; }
  .contact__row { gap: 36px; }
  .contact__links a { flex-direction: column; gap: 4px; }
  .magnet { width: 132px; font-size: 18px; }
  .foot { flex-direction: column; }
}
@media (max-width: 600px) and (max-height: 700px) {
  .panel__body { font-size: 14px; }
}

/* ---------- Next chapter ---------- */
.next {
  display: block; position: relative; isolation: isolate; overflow: hidden;
  margin-top: clamp(80px, 12vw, 160px);
  padding: clamp(56px, 9vw, 120px) var(--gutter);
  border-top: 1px solid var(--ink-faint);
}
.next::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--signal);
  transform: translateY(101%); transition: transform .8s var(--ease-out);
}
.next:hover::before { transform: none; }
.next:hover { color: var(--ink); }
.next__label { color: var(--signal); transition: color .4s; }
.next:hover .next__label { color: var(--ink); }
.next__title {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin-top: 12px;
  font-size: clamp(52px, 11vw, 200px); font-weight: 700; letter-spacing: -.06em; line-height: .9;
}
.next__title i { font-style: normal; font-size: .6em; transition: transform .6s var(--ease-out); }
.next:hover .next__title i { transform: translateX(16px); }
.next__sub { margin-top: 14px; color: var(--ink-soft); max-width: 46ch; transition: color .4s; }
.next:hover .next__sub { color: var(--ink); }

.page-foot { padding: 28px var(--gutter); margin-top: 0; }

/* Keyboard stepping hint (desktop, once per session) */
.keyhint {
  position: fixed; left: 50%; bottom: 22px; z-index: 85; pointer-events: none;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid var(--ink-faint); border-radius: 999px;
  background: rgba(10, 10, 10, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--ink-soft); font-size: 11px; letter-spacing: .04em;
  opacity: 0; transform: translate(-50%, 8px); transition: opacity .6s, transform .6s;
}
.keyhint.is-on { opacity: 1; transform: translate(-50%, 0); }
.keyhint kbd {
  font: inherit; color: var(--paper); min-width: 20px; text-align: center;
  padding: 1px 5px; border: 1px solid var(--ink-faint); border-radius: 4px;
}
@media (hover: none), (max-width: 759px) { .keyhint { display: none; } }
@media (prefers-reduced-motion: reduce) { .keyhint { transition: none; } }

/* Sideways scrollers are reachable and visibly focused */
[data-hscroll]:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

/* ==========================================================
   INTRO FILM — hero link + lightbox
   ========================================================== */
.hero__film {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 12px; margin-top: 26px;
  padding: 10px 18px 10px 10px; min-height: 44px; border-radius: 999px;
  border: 1px solid var(--ink-faint); color: var(--paper); font-size: 15px; font-weight: 500;
  transition: border-color .3s, background-color .3s;
}
.hero__film:hover, .hero__film:focus-visible { border-color: var(--signal); background: rgba(61, 107, 255, .12); }
.hero__film-play { position: relative; width: 30px; height: 30px; border-radius: 50%; background: var(--signal); flex: none; }
.hero__film-play::after { content: ''; position: absolute; left: 12px; top: 9px; border-left: 10px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.intro { position: relative; background: var(--ink); color: var(--paper); padding: clamp(72px, 12vh, 140px) var(--gutter) clamp(80px, 14vh, 160px); }
.intro__in { max-width: min(1120px, calc((100svh - 220px) * 16 / 9)); margin: 0 auto; }
.intro__h { font-size: clamp(32px, 4.2vw, 64px); font-weight: 600; line-height: 1; letter-spacing: -.04em; margin-bottom: 30px; }
.intro__h .serif { color: var(--signal); }
.vid { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; cursor: pointer; box-shadow: 0 0 0 1px var(--ink-faint), 0 50px 100px -50px rgba(61, 107, 255, .45); }
.vid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease-io, ease); }
.vid:hover img { transform: scale(1.02); }
.vid__play { position: absolute; left: 50%; top: 50%; width: clamp(64px, 8vw, 96px); aspect-ratio: 1; translate: -50% -50%; border: 0; border-radius: 50%; background: var(--signal); cursor: pointer; box-shadow: 0 18px 40px -12px rgba(61, 107, 255, .9); transition: scale .25s; }
.vid:hover .vid__play, .vid__play:focus-visible { scale: 1.08; }
.vid__play span { position: absolute; left: 54%; top: 50%; translate: -50% -50%; border-left: clamp(18px, 2.2vw, 26px) solid #fff; border-top: clamp(11px, 1.35vw, 16px) solid transparent; border-bottom: clamp(11px, 1.35vw, 16px) solid transparent; }
.vid__meta { position: absolute; left: 14px; bottom: 12px; font-size: 11px; color: #fff; background: rgba(10, 10, 10, .72); padding: 6px 10px; border-radius: 999px; }
.vid.is-on { cursor: default; }
.vid iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 600px) { .vid { border-radius: 10px; } .vid__meta { display: none; } .intro__h { margin-bottom: 22px; } }
@media (max-width: 600px) { .hero__film { font-size: 14px; margin-top: 18px; } }
