/* After the Artboard: Parallax field report on AI in product design.
   Dark immersive canvas, Parallax type (Bricolage Grotesque + JetBrains Mono),
   Parallax blue. Contrast: text-3 lifted for AA on the dark ground. */

:root {
  --bg:        #05060a;
  --bg-2:      #0a0c13;
  --text:      oklch(0.97 0.006 250);
  --text-2:    oklch(0.85 0.012 250);
  --text-3:    oklch(0.74 0.016 250);
  --accent:    oklch(0.60 0.18 249);
  --accent-hi: oklch(0.70 0.14 249);   /* the site's --accent-on-dark */
  --line:      oklch(1 0 0 / 0.12);
  --line-2:    oklch(1 0 0 / 0.22);
  --font-d: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-m: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: clamp(16px, 3.4vw, 52px);
  --top-h: 60px;
  --band-h: 60px;   /* the live-counter strip at the bottom */
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* Scroll anchoring latches onto the sticky chapter copy and feeds back into
   itself (the page creeps down on load). The layout never shifts above the
   reader, so anchoring buys nothing here. */
html { -webkit-text-size-adjust: 100%; overflow-anchor: none; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-d);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; }
::selection { background: var(--accent); color: white; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Canvas + atmosphere ---------- */
#field {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(5,6,10,0.75) 100%),
    linear-gradient(to bottom, rgba(5,6,10,0.55), transparent 18%, transparent 82%, rgba(5,6,10,0.6));
}
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  display: grid; align-content: end;
  padding: var(--gutter);
  transition: opacity 700ms var(--ease-out), visibility 0s linear 700ms;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__pct {
  font-family: var(--font-m);
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.loader__label {
  font-family: var(--font-m); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 14px;
}

/* ---------- Chrome ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: var(--top-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gutter);
  font-family: var(--font-m); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-2);
}
.brand {
  justify-self: start;
  font-family: var(--font-d); font-weight: 700; font-size: 19px; letter-spacing: -0.03em; text-transform: none;
  color: var(--text); text-decoration: none;
}
.brand span { color: var(--accent-hi); }
.top__title { justify-self: center; color: var(--text); }
.top__right { justify-self: end; display: flex; gap: 22px; align-items: center; }
.top__right a { text-decoration: none; color: var(--text-2); transition: color 150ms; }
.top__right a:hover { color: var(--text); }
.top__ch { font-variant-numeric: tabular-nums; }
.top__ch b { color: var(--accent-hi); font-weight: 500; }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 21; }
.progress i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

.rail {
  position: fixed; right: calc(var(--gutter) - 6px); top: 50%; z-index: 20;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 2px;
}
.rail button {
  appearance: none; background: none; border: 0; padding: 6px 0 6px 18px; cursor: pointer;
  display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  color: var(--text-3); font-family: var(--font-m); font-size: 10px; letter-spacing: 0.12em;
}
.rail button i { display: block; width: 12px; height: 1px; background: currentColor; transition: width 300ms var(--ease-out), background 300ms; }
.rail button span { opacity: 0; transform: translateX(6px); transition: opacity 200ms, transform 300ms var(--ease-out); text-transform: uppercase; }
.rail button:hover span, .rail button:focus-visible span { opacity: 1; transform: none; }
.rail button.is-active { color: var(--text); }
.rail button.is-active i { width: 30px; background: var(--accent-hi); }

/* Live counter: its own strip, divided from the story by a full-width line.
   Chapter copy is laid out above --band-h, so it never touches the strip. */
.band {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--band-h) + env(safe-area-inset-bottom));
  padding: 0 var(--gutter) env(safe-area-inset-bottom);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  border-top: 1px solid var(--line);
  background: rgba(5, 6, 10, 0.9);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-family: var(--font-m);
  transition: opacity 400ms var(--ease-out), visibility 0s linear 0s;
}
.ticker { display: flex; align-items: center; gap: 22px; min-width: 0; color: var(--text-2); }
.ticker__label {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3);
}
.ticker__dot { width: 6px; height: 6px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 10px #3ddc84; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.ticker__row { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.ticker__num {
  font-size: 20px; font-weight: 500; letter-spacing: -0.02em; color: var(--text);
  font-variant-numeric: tabular-nums; min-width: 4ch;
}
.ticker__what { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.ticker__how { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); text-decoration: none; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.ticker__how:hover { color: var(--text); border-color: var(--text); }

.scroll-hint {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3);
  display: flex; align-items: center; gap: 12px;
  transition: opacity 400ms;
}
.scroll-hint i { width: 1px; height: 22px; background: linear-gradient(var(--text-3), transparent); position: relative; overflow: hidden; }
.scroll-hint i::after { content: ''; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--text); animation: drip 1.8s var(--ease-out) infinite; }
@keyframes drip { to { top: 110%; } }
.scrolled .scroll-hint { opacity: 0; }

/* ---------- Chapters ---------- */
main { position: relative; z-index: 2; }
.ch { position: relative; height: 215vh; }
.ch--hero { height: 160vh; }
.pin {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  align-items: center;
  padding: var(--top-h) calc(var(--gutter) + 40px) calc(var(--band-h) + env(safe-area-inset-bottom)) var(--gutter);
  overflow: hidden; /* keeps the text scrims from widening the page */
}
.txt { position: relative; }
.ch[data-text="left"]   .txt { grid-column: 1 / span 5; }
.ch[data-text="right"]  .txt { grid-column: 8 / span 5; }
.ch[data-text="center"] .txt { grid-column: 3 / span 8; text-align: center; align-self: end; padding-bottom: 8vh; }
.ch[data-text="center"] .body { margin-inline: auto; }
.ch[data-text="center"] .txt--split {
  grid-column: 2 / span 10; text-align: left; padding-bottom: 7vh;
  display: grid; grid-template-columns: 1fr 1fr; column-gap: 56px; align-items: start;
}
.txt--split .body { margin: 0 !important; }
/* soft local scrim so copy stays readable over bright particles */
.txt::before {
  content: ''; position: absolute; inset: -18% -22%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(5,6,10,0.72), rgba(5,6,10,0.35) 60%, transparent);
}

.slabel {
  font-family: var(--font-m); font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-3); margin: 0 0 22px;
}
.slabel b { color: var(--accent-hi); font-weight: 500; }
h1, h2 { font-weight: 600; letter-spacing: -0.028em; line-height: 1; margin: 0; text-wrap: balance; }
/* Accent word, as on parallaxorg.com: solid blue, never italic, never gradient */
h1 em, h2 em { font-style: normal; color: var(--accent-hi); }
.hero__lede strong { color: var(--text); font-weight: 500; }
h2 { font-size: clamp(2.5rem, 4.9vw, 5.25rem); }
.big {
  display: block; margin: 26px 0 0;
  font-family: var(--font-d); font-weight: 600;
  font-size: clamp(3.75rem, 7.4vw, 8rem); line-height: 0.9; letter-spacing: -0.045em;
  color: var(--accent-hi);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 40px oklch(0.6 0.18 249 / 0.45);
}
.big small { font-size: 0.42em; letter-spacing: -0.02em; margin-left: 0.08em; }
.big-cap {
  display: block; margin-top: 12px;
  font-family: var(--font-m); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2);
}
.body {
  font-size: clamp(1rem, 1.15vw, 1.15rem); line-height: 1.55; color: var(--text-2);
  max-width: 34em; margin: 26px 0 0;
}
.body strong { color: var(--text); font-weight: 500; }
.src {
  font-family: var(--font-m); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-3); margin: 22px 0 0; line-height: 1.6;
}
.src a { text-decoration: none; color: var(--text-3); border-bottom: 1px solid var(--line-2); }
.src a:hover { color: var(--text); border-color: var(--text); }
sup.fn a { font-family: var(--font-m); font-size: 0.62em; color: var(--accent-hi); text-decoration: none; margin-left: 1px; }

/* Hero */
.ch--hero .pin { display: block; }
.hero__wrap { position: absolute; inset: 0; }
.hero__title {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: max-content; max-width: calc(100vw - 2 * var(--gutter));
  font-size: clamp(3.4rem, 9.6vw, 10.5rem);
  text-align: center;
}
.hero__over {
  position: absolute; left: 0; right: 0; text-align: center;
  top: calc(50% - var(--fh, 200px) - 64px);
}
.hero__lede {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: calc(50% + var(--fh, 200px) + clamp(52px, 10vh, 96px));
  width: min(560px, calc(100vw - 2 * var(--gutter)));
  text-align: center; margin: 0;
  font-size: clamp(1rem, 1.25vw, 1.2rem); line-height: 1.55; color: var(--text-2);
}
.ch--hero .slabel { margin: 0; }

/* Timeline labels (chapter 05) */
.tl {
  list-style: none; margin: 30px 0 0; padding: 0;
  display: grid; gap: 10px;
  font-family: var(--font-m); font-size: 12px; color: var(--text-2);
}
.tl li { display: grid; grid-template-columns: 84px 1fr; gap: 12px; }
.tl time { color: var(--accent-hi); font-variant-numeric: tabular-nums; }

/* ---------- Sources + close ---------- */
.end {
  position: relative; z-index: 2;
  background: linear-gradient(to bottom, transparent, rgba(5,6,10,0.92) 18vh);
  padding: 22vh var(--gutter) 64px;
}
.end__inner { max-width: 1280px; margin: 0 auto; }
.cta {
  display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); column-gap: 24px; align-items: start;
  padding-bottom: 96px; border-bottom: 1px solid var(--line);
}
.cta h2 { grid-column: 1 / span 7; font-size: clamp(2.4rem, 4.6vw, 4.75rem); }
.cta__side { grid-column: 9 / span 4; }
.cta__side p { margin: 0 0 28px; color: var(--text-2); line-height: 1.55; font-size: 1.05rem; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 22px;
  font-family: var(--font-m); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
  border: 1px solid var(--line-2); color: var(--text); background: transparent; cursor: pointer;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out), transform 150ms var(--ease-out), background 150ms;
}
.btn--p { background: var(--text); color: var(--bg); border-color: var(--text); }
@media (hover:hover) and (pointer:fine) {
  .btn:hover { border-color: var(--accent-hi); box-shadow: 3px 3px 0 0 var(--accent-hi); transform: translate(-1.5px, -1.5px); }
}
.btn:active { transform: scale(0.97); box-shadow: none; }

.sources { padding-top: 72px; display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); column-gap: 24px; }
.sources__head { grid-column: 1 / span 3; }
.sources__head h3 { font-family: var(--font-m); font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); margin: 0 0 14px; }
.sources__head p { margin: 0; color: var(--text-2); font-size: 0.95rem; line-height: 1.5; max-width: 24em; }
.sources ol {
  grid-column: 5 / span 8; margin: 0; padding: 0; list-style: none; counter-reset: s;
  columns: 2; column-gap: 40px;
}
.sources li {
  counter-increment: s; break-inside: avoid; position: relative;
  font-size: 13px; line-height: 1.5; color: var(--text-2); padding: 0 0 14px 36px;
}
.sources li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 2px; font-family: var(--font-m); font-size: 11px; color: var(--accent-hi); }
.sources li:target { color: var(--text); }
.sources li a { color: var(--text-2); text-decoration: none; border-bottom: 1px solid var(--line-2); overflow-wrap: anywhere; }
.sources li a:hover { color: var(--text); border-color: var(--text); }

.foot {
  margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--font-m); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3);
}
.foot a { text-decoration: none; color: var(--text-3); }
.foot a:hover { color: var(--text); }

/* Short laptop screens: tighten the chapter copy so it always fits above the strip */
@media (min-width: 760px) and (max-height: 820px) {
  h2 { font-size: clamp(2.2rem, 4.1vw, 4.2rem); }
  .big { font-size: clamp(3rem, 5.6vw, 5.8rem); margin-top: 18px; }
  .big-cap { margin-top: 10px; }
  .body { margin-top: 18px; font-size: 1rem; }
  .slabel { margin-bottom: 16px; }
  .src { margin-top: 16px; }
}
@media (min-width: 760px) and (max-height: 660px) {
  h2 { font-size: clamp(2rem, 3.6vw, 3.4rem); }
  .big { font-size: clamp(2.6rem, 4.6vw, 4.4rem); }
  .body { font-size: 0.95rem; line-height: 1.5; }
}

/* ---------- Mobile ---------- */
@media (max-width: 759px) {
  :root { --top-h: 52px; --band-h: 62px; }
  .top { grid-template-columns: 1fr auto; }
  .top__title { display: none; }
  .top__right a { display: none; }
  .rail { display: none; }
  .scroll-hint { display: none; }
  .ch { height: 195vh; }
  .pin {
    grid-template-columns: 1fr; padding: var(--top-h) var(--gutter) calc(var(--band-h) + env(safe-area-inset-bottom));
    align-items: end;
  }
  .ch[data-text] .txt { grid-column: 1; text-align: left; align-self: end; padding-bottom: 26px; }
  .ch[data-text="center"] .body { margin-inline: 0; }
  .ch[data-text="center"] .txt--split { display: block; padding-bottom: 26px; }
  .txt--split .body { margin-top: 14px !important; }
  .txt--split .tl li:nth-child(n+4) { display: none; }
  .txt::before { inset: -40px -16px 0; background: linear-gradient(to top, rgba(5,6,10,0.94) 60%, rgba(5,6,10,0.6) 85%, transparent); }
  h2 { font-size: clamp(2.25rem, 10.5vw, 3rem); }
  .big { font-size: clamp(3.25rem, 15vw, 4.5rem); margin-top: 16px; }
  .body { font-size: 0.98rem; margin-top: 16px; }
  .slabel { margin-bottom: 14px; }
  .src { margin-top: 14px; }
  .hero__title { font-size: clamp(3rem, 15vw, 4.6rem); line-height: 0.98; }
  .ticker { flex-direction: column; align-items: flex-start; gap: 3px; }
  .ticker__num { font-size: 16px; min-width: 0; }
  .ticker__what { font-size: 10.5px; }
  .ticker__how { display: none; }
  .tl { font-size: 11px; gap: 6px; }
  .tl li { grid-template-columns: 70px 1fr; }
  .cta, .sources { grid-template-columns: 1fr; }
  .cta h2, .cta__side, .sources__head, .sources ol { grid-column: 1; }
  .cta__side { margin-top: 28px; }
  .sources ol { columns: 1; margin-top: 32px; }
  .end { padding-top: 16vh; }
}

.rail { transition: opacity 400ms var(--ease-out), visibility 0s linear 0s; }
.top { transition: background 300ms; }
.at-end .top { background: rgba(5,6,10,0.88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.at-end .band, .at-end .rail { opacity: 0; visibility: hidden; transition: opacity 300ms, visibility 0s linear 300ms; }
html.og { scrollbar-width: none; }
html.og::-webkit-scrollbar { display: none; }
.og .hero__lede { top: calc(50% + var(--fh, 200px) + 92px); }
.og .band, .og .rail, .og .progress, .og .top__right { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .ticker__dot, .scroll-hint i::after { animation: none; }
}
