/* Marcus Hansen. Tokens first, then base, then each scene.
   Default CSS is the static, stacked page. `.film-on` (set in <head> when motion is allowed)
   turns the first three sections into pinned stages that js/film.js scrubs with scroll. */

:root {
  --canvas: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #5f5f65;
  --hair: rgb(29 29 31 / .12);
  --accent: #12b76a;
  --flood: #1d1d1f;
  --on-flood: #f5f5f7;
  --on-flood-2: #a1a1a6;
  --flood-accent: #2fd684;
  /* Marcus's own gradient: the three company colors in one sweep. The period wears it, and so does
     the type on the flood. --text-grad is the same sweep tuned to read on the flood in each theme. */
  --accent-grad: linear-gradient(135deg, #e3c078 0%, #19b877 50%, #2c6cf0 100%);
  --text-grad: linear-gradient(95deg, #f3d898 0%, #58e2a8 48%, #86b4ff 100%);

  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;

  --r-card: 28px;
  --r-pill: 999px;
  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --section: clamp(5rem, 12vw, 10rem);

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0b0b0c;
    --surface: #1a1a1c;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --hair: rgb(245 245 247 / .16);
    --accent: #2fd684;
    --flood: #f5f5f7;
    --on-flood: #1d1d1f;
    --on-flood-2: #5f5f65;
    --flood-accent: #0c8f52;
    --text-grad: linear-gradient(95deg, #8a6516 0%, #0a7d48 48%, #1849a9 100%);
  }
}

/* ---------- Company colors ----------
   Each company keeps the color from its own site. A tile on the homepage and that company's page
   read the same set, so the color you tap is the color you land in. The gradient is the brand color
   lit from the top right and deepening toward a neighboring hue, never a second brand color. */
.tile--a, [data-co="rx"] {
  --flood: #1a1410; --on-flood: #f8f5f0; --on-flood-2: #c9b99d; --flood-accent: #d9bd82;
  --flood-grad: radial-gradient(90% 120% at 100% 0%, #5b4526 0%, rgb(91 69 38 / 0) 62%), linear-gradient(165deg, #261c13 0%, #130e0a 100%);
  --num-grad: linear-gradient(100deg, #fbf0d6 0%, #dfc387 55%, #b8935a 100%);
}
.tile--b, [data-co="rd"] {
  --flood: #1f5c4c; --on-flood: #ffffff; --on-flood-2: #cfe8df; --flood-accent: #a5f0d4;
  --flood-grad: radial-gradient(85% 120% at 100% 0%, #2c8f6c 0%, rgb(44 143 108 / 0) 60%), linear-gradient(165deg, #216552 0%, #0f3f40 100%);
}
.tile--c, [data-co="cm"] {
  --flood: #1849a9; --on-flood: #ffffff; --on-flood-2: #dbe5fb; --flood-accent: #ffffff;
  --flood-grad: radial-gradient(85% 120% at 100% 0%, #2f73e8 0%, rgb(47 115 232 / 0) 60%), linear-gradient(165deg, #1a4fb4 0%, #12217c 100%);
}
/* On its own page a company also tints the paper, the ink and the period. */
[data-co="rx"] { --canvas: #f8f5f0; --surface: #fffdf9; --ink: #1a1410; --ink-2: #6b5e4e; --hair: rgb(26 20 16 / .12); --accent: #c5a870; --accent-grad: linear-gradient(135deg, #e2c992 0%, #a9853f 100%); }
[data-co="rd"] { --canvas: #f4f7f5; --surface: #ffffff; --ink: #17231f; --ink-2: #55635d; --hair: rgb(23 35 31 / .12); --accent: #257966; --accent-grad: linear-gradient(135deg, #37a384 0%, #175848 100%); }
[data-co="cm"] { --canvas: #f5f7fb; --surface: #ffffff; --ink: #101828; --ink-2: #55607a; --hair: rgb(16 24 40 / .12); --accent: #1849a9; --accent-grad: linear-gradient(135deg, #3d7df0 0%, #142f8f 100%); }
@media (prefers-color-scheme: dark) {
  [data-co="rx"] { --canvas: #0f0c09; --surface: #1c1712; --ink: #f8f5f0; --ink-2: #b3a591; --hair: rgb(248 245 240 / .16); --accent: #d4b77f; }
  [data-co="rd"] { --canvas: #0a100e; --surface: #151d1a; --ink: #f1f6f4; --ink-2: #9fb0a9; --hair: rgb(241 246 244 / .16); --accent: #3fbf9c; --accent-grad: linear-gradient(135deg, #6fe0bd 0%, #1f8a6c 100%); }
  [data-co="cm"] { --canvas: #090c14; --surface: #141927; --ink: #f3f6fc; --ink-2: #9ea9c2; --hair: rgb(243 246 252 / .16); --accent: #5b8cff; --accent-grad: linear-gradient(135deg, #8fb3ff 0%, #2c5fe0 100%); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--ink-2) var(--canvas); }
.film-on { scroll-behavior: smooth; }
/* Moving between the homepage and a company page cross-fades instead of flashing. */
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 clamp(1rem, .96rem + .2vw, 1.125rem)/1.5 var(--font-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
::selection { background: var(--accent); color: #0b0b0c; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.nav :focus-visible { outline-color: var(--nav-ink); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

h2 {
  font: 760 clamp(2rem, 1.1rem + 3.6vw, 4rem)/1.03 var(--font-display);
  font-variation-settings: "wdth" 112;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.skip {
  position: fixed; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--canvas); padding: .7rem 1rem; border-radius: var(--r-pill);
}
.skip:focus { top: 1rem; }

/* Buttons: pills everywhere, press feedback on pointer-down. */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.4rem;
  background: var(--ink); color: var(--canvas);
  border-radius: var(--r-pill);
  font-weight: 500; white-space: nowrap;
  touch-action: manipulation; user-select: none;
  transition: transform 140ms var(--ease-out), background-color 200ms ease;
}
.btn:active { transform: scale(.97); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair); }
.btn--sm { min-height: 38px; padding: 0 1rem; font-size: .9375rem; }
@media (max-width: 400px) { .btn:not(.btn--sm) { padding: 0 1.1rem; } .open__cta > div { gap: .5rem; } }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: color-mix(in srgb, var(--ink) 82%, var(--canvas)); }
  .btn--ghost:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
}

/* The period. Same dot everywhere. */
.pd {
  display: inline-block; width: .32em; height: .32em; margin-left: .08em;
  border-radius: 50%; background: var(--accent-grad, var(--accent));
}

/* ---------- Nav: one floating translucent layer, content scrolls under it ---------- */
.nav {
  --nav-ink: var(--ink);
  --nav-bg: color-mix(in srgb, var(--canvas) 72%, transparent);
  position: fixed; z-index: 50;
  top: max(.75rem, env(safe-area-inset-top)); left: 50%;
  translate: -50% 0;
  display: flex; align-items: center; gap: clamp(.75rem, 2.4vw, 2rem);
  width: min(100% - 1.5rem, 760px); height: 54px; padding: 0 .5rem 0 1.25rem;
  color: var(--nav-ink);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nav-ink) 10%, transparent), 0 10px 30px -18px rgb(0 0 0 / .35);
  transition: color 240ms ease, background-color 240ms ease, box-shadow 240ms ease;
}
.nav.is-on-flood {
  --nav-ink: var(--on-flood);
  --nav-bg: color-mix(in srgb, var(--flood) 62%, transparent);
}
.nav__brand { font: 760 1rem/1 var(--font-display); font-variation-settings: "wdth" 112; letter-spacing: -.01em; margin-right: auto; white-space: nowrap; }
.nav__links { display: flex; gap: clamp(.9rem, 2vw, 1.6rem); font-size: .9375rem; }
.nav__links a { padding: .6rem 0; opacity: .72; transition: opacity 160ms ease; }
.nav__links a:hover, .nav__links a:focus-visible { opacity: 1; }
.nav .btn { background: var(--nav-ink); color: var(--canvas); transition: transform 140ms var(--ease-out), background-color 240ms ease, color 240ms ease; }
.nav.is-on-flood .btn { color: var(--flood); }
@media (max-width: 640px) { .nav__links { display: none; } }
@supports not (color: color-mix(in srgb, red, blue)) {
  .nav { --nav-bg: var(--canvas); }
  .nav.is-on-flood { --nav-bg: var(--flood); }
}
@media (prefers-reduced-transparency: reduce) {
  .nav { --nav-bg: var(--canvas); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nav.is-on-flood { --nav-bg: var(--flood); }
}

/* ---------- Shared film plumbing ---------- */
.film { position: relative; }
.anchor { position: absolute; top: 0; left: 0; width: 1px; height: 1px; pointer-events: none; }
.drop { overflow: hidden; overflow: clip; }
.film-on .film .stage { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; overflow: clip; }

/* ---------- Scene 1: wordmark ---------- */
.mark {
  display: inline-flex; align-items: flex-end;
  font: 800 var(--mark-size, clamp(3.2rem, 15vw, 6rem))/.92 var(--font-display);
  font-variation-settings: "wdth" 125, "wght" 800;
  letter-spacing: -.035em;
  white-space: nowrap;
}
.mark__letters { display: inline-block; }
.mark__inner { display: inline-block; transform-origin: 0 50%; }
.mark .ln { display: block; overflow: hidden; overflow: clip; padding-bottom: .04em; }
.mark .ch { display: inline-block; }
.mark__dot {
  flex: none; width: .2em; height: .2em; margin: 0 0 .145em .05em;
  border-radius: 50%; background: var(--accent-grad, var(--accent));
}
@media (min-width: 760px) {
  .mark .ln { display: inline-block; }
  .mark .ln + .ln { margin-left: .22em; }
}

.open {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(1.1rem, 2.6vh, 1.75rem);
  padding: 6rem var(--pad) 3rem; text-align: center;
}
.open__sub p { max-width: 30ch; font-size: clamp(1.1875rem, 1rem + .9vw, 1.75rem); line-height: 1.35; color: var(--ink-2); text-wrap: balance; }
.open__cta { padding: 6px; margin: -6px; }
.open__cta > div { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }

/* Load-in: letters rise out of the mask line, then the period lands. */
@keyframes rise { from { transform: translateY(108%); } to { transform: none; } }
@keyframes land { from { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.18); opacity: 1; } to { transform: none; opacity: 1; } }
.film-on .film--open .ch { animation: rise 900ms var(--ease-out) both; animation-delay: calc(var(--i) * 38ms + 120ms); }
.film-on .film--open .mark__dot { animation: land 520ms var(--ease-out) both 760ms; }
.film-on .open__sub p { animation: rise 800ms var(--ease-out) both 820ms; }
.film-on .open__cta > div { animation: rise 800ms var(--ease-out) both 920ms; }

/* Flood layer. Static page: a dark band holding the three lines and the photo. */
.flood {
  background: var(--flood); color: var(--on-flood);
  padding: var(--section) var(--pad);
  display: grid; gap: clamp(2.5rem, 6vw, 4rem); justify-items: center;
}
.flood__label { display: none; }
.lines { display: grid; gap: 1.25rem; text-align: center; }
.line {
  font: 760 clamp(2.1rem, 1rem + 5.2vw, 5.25rem)/1.02 var(--font-display);
  font-variation-settings: "wdth" 112;
  letter-spacing: -.025em; text-wrap: balance;
  padding-bottom: .12em;
}
.line > span { display: block; }
/* The statement is set in the gradient. The padding keeps descenders inside the painted box. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .line > span {
    padding-bottom: .14em; margin-bottom: -.14em;
    background: var(--text-grad); -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent;
  }
}
.num { font-variant-numeric: tabular-nums; }
.portrait { width: min(72vw, 340px); height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 12%; border-radius: var(--r-card); }

.about { max-width: 46rem; margin: 0 auto; padding: var(--section) var(--pad); display: grid; gap: 1.25rem; }
.about h2 { font-size: clamp(1.75rem, 1.1rem + 2.4vw, 3rem); padding-bottom: .1em; }
.about p { max-width: 58ch; color: var(--ink-2); }

.film-on .film--open { height: 580vh; }
.film-on .film--open #about { top: auto; bottom: 100vh; bottom: 100lvh; }
.film-on .open { position: absolute; inset: 0; min-height: 0; padding-bottom: calc(3rem + (100lvh - 100svh)); }
.film-on .flood {
  position: absolute; inset: 0; display: block; padding: 0;
  clip-path: inset(50%); will-change: clip-path;
}
.film-on .flood__label, .film-on .lines .line {
  display: block; position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: max-content; max-width: calc(100% - 2 * var(--pad)); text-align: center;
}
.film-on .flood__label { font-weight: 500; white-space: nowrap; }
.flood__label span { display: block; padding: .15em 0; }
.film-on .lines { display: block; }
.film-on .lines .line { width: min(100% - 2 * var(--pad), 28rem + 30vw); }
.film-on .portrait { position: absolute; left: 0; top: 0; max-width: none; border-radius: 0; clip-path: circle(0% at 50% 42%); }
.film-on .about {
  position: absolute; margin: 0; padding: 0;
  left: var(--pad); right: var(--pad); top: 56%;
  max-width: none; gap: 1rem;
}
.film-on .about h2 { font-size: clamp(1.5rem, 1.05rem + 2vw, 2.6rem); }
@media (max-width: 899px) { .film-on .about { gap: .7rem; } .film-on .about p { font-size: .9375rem; line-height: 1.45; } }
@media (min-width: 900px) {
  .film-on .about { left: 50%; right: var(--pad); top: 50%; translate: 0 -50%; max-width: 34rem; }
}

/* ---------- Scene 2: companies ---------- */
.co { padding: var(--section) var(--pad); max-width: 1320px; margin: 0 auto; }
.co__title { margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.bento { position: relative; display: grid; gap: 14px; grid-template-columns: 1fr; }
.tile { display: block; min-height: 220px; border-radius: var(--r-card); position: relative; }
.tile__in {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 1rem;
  height: 100%; min-height: inherit; padding: clamp(1.25rem, 2.2vw, 2rem);
  background: var(--surface); border-radius: inherit; position: relative; overflow: clip;
  box-shadow: inset 0 0 0 1px var(--hair);
  transition: transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out);
}
/* A colored tile is a lit surface: gradient fill and a bright top edge where the light catches it. */
.tile--strong .tile__in { background: var(--flood-grad, var(--flood)); color: var(--on-flood); box-shadow: inset 0 1px 0 rgb(255 255 255 / .14); }
.tile--quiet { min-height: 0; }
.tile--quiet .tile__in { background: transparent; }
.tile__copy { display: grid; gap: .35rem; }
.tile__name { font: 760 clamp(1.35rem, 1rem + 1.2vw, 2rem)/1.05 var(--font-display); font-variation-settings: "wdth" 112; letter-spacing: -.02em; }
.tile__desc { max-width: 34ch; color: var(--ink-2); }
.tile--strong .tile__desc { color: var(--on-flood-2); }
.tile__meta { font-size: .9375rem; margin-top: .35rem; }
.tile__go { position: absolute; top: clamp(1.25rem, 2.2vw, 2rem); right: clamp(1.25rem, 2.2vw, 2rem); transition: transform 320ms var(--ease-out); }
a.tile:active .tile__in { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) {
  a.tile:hover .tile__in { transform: translateY(-4px); box-shadow: inset 0 0 0 1px var(--hair), 0 24px 40px -28px rgb(0 0 0 / .45); }
  a.tile--strong:hover .tile__in { box-shadow: inset 0 1px 0 rgb(255 255 255 / .14), 0 26px 44px -24px color-mix(in srgb, var(--flood) 70%, #000); }
  a.tile:hover .tile__go { transform: translateX(4px); }
}

/* Figures in the two dark tiles: the supplied charts, redrawn with the page's own line and its period. */
.fig { display: flex; flex-direction: column; gap: .65rem; flex: 1; min-height: 0; }
.fig__head { color: var(--on-flood-2); font-size: .9375rem; line-height: 1.3; padding-right: 2.5rem; }
.fig__head b {
  display: block; margin-bottom: .2rem; color: var(--on-flood);
  font: 760 clamp(1.6rem, 1.15rem + 1.6vw, 2.5rem)/1 var(--font-display); font-variation-settings: "wdth" 112;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.fig__plot { position: relative; flex: 1 1 112px; min-height: 56px; margin-right: 9px; border-bottom: 1px solid color-mix(in srgb, var(--on-flood) 24%, transparent); }
.fig__ink { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fig__line { fill: none; stroke: var(--flood-accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.fig__line--ghost { stroke: color-mix(in srgb, var(--on-flood) 30%, transparent); stroke-width: 1.5; }
.fig__area { fill: color-mix(in srgb, var(--flood-accent) 15%, transparent); }
/* Gradient ink: each line brightens toward its newest point and the area under it fades out.
   The gradients live in the page's inline sprite; the plain color after url() is the fallback. */
.tile--a .fig__line, [data-co="rx"] .fig__line { stroke: url(#g-rx) var(--flood-accent); }
.tile--a .fig__area, [data-co="rx"] .fig__area { fill: url(#g-rx-area) color-mix(in srgb, var(--flood-accent) 15%, transparent); }
.tile--b .fig__line:not(.fig__line--ghost), [data-co="rd"] .fig__line:not(.fig__line--ghost) { stroke: url(#g-rd) var(--flood-accent); }
.fig__end { position: absolute; right: -7px; top: var(--end); width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--flood-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--flood-accent) 24%, transparent); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .tile--a .fig__head b { width: fit-content; background: var(--num-grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
}
.fig__axis { display: flex; justify-content: space-between; gap: 1rem; font-size: .8125rem; color: var(--on-flood-2); margin-right: 9px; }

/* ---------- Company logos ----------
   Each company's own logo, drawn inline so the same drawing can sit on its color, on a light page
   or on a dark one. --lg-a and --lg-b are the logo's two inks. The logos are different shapes, so
   --logo-k sets how tall each one stands for them to carry the same weight. */
.logo { display: block; width: auto; max-width: 100%; height: calc(var(--logo-h, 2.75rem) * var(--logo-k, 1)); }
.logo .lg-a { fill: var(--lg-a); }
.logo .lg-b { fill: var(--lg-b); }
.logo .lg-s { stroke: var(--lg-s, var(--lg-a)); }
.logo .lg-c { fill: var(--lg-c); }
.logo .lg-cs { stroke: var(--lg-c); }
.logo--rx { --lg-a: #c5a870; --lg-b: #1a1410; }
.logo--rd { --lg-a: #2f6a58; --lg-b: #0f2821; }
.logo--cm { --lg-a: #1849a9; --lg-b: #101828; --lg-c: #fff; --logo-k: .8; }
.logo--dra { --logo-k: 2.1; }
/* Reversed on the company's own color, the way each brand reverses its logo. */
.tile--a .logo--rx { --lg-b: #f8f5f0; }
.tile--b .logo--rd { --lg-a: #fbf8f3; --lg-b: #fbf8f3; }
.tile--c .logo--cm { --lg-a: #fff; --lg-b: #fff; --lg-c: #1849a9; }
@media (prefers-color-scheme: dark) {
  [data-co="rx"] .logo--rx { --lg-b: #f8f5f0; }
  [data-co="rd"] .logo--rd { --lg-a: #5aa58c; --lg-b: #fbf8f3; --lg-s: #d6ebe2; }
  [data-co="cm"] .logo--cm { --lg-b: #f3f6fc; }
  /* This logo only exists in its printed colors, so on a dark page it keeps its white card. */
  .logo--dra { box-sizing: content-box; padding: .7rem .95rem; border-radius: 16px; background: #fff; }
}
/* In a tile the logo is the company's name. */
.tile__name--logo { margin-bottom: .5rem; }
.tile__name--logo .logo { --logo-h: clamp(2.6rem, 2.1rem + 1.4vw, 3.4rem); }
@media (min-width: 1000px) {
  /* The bottom row is short and this logo is tall, so it stands beside its lines instead of above them. */
  .tile--e .tile__copy { grid-template-columns: auto minmax(0, 1fr); column-gap: clamp(1.5rem, 2.5vw, 2.5rem); align-items: end; }
  .tile--e .tile__name--logo { grid-row: 1 / span 2; margin-bottom: 0; }
}

@media (min-width: 640px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tile--a, .tile--b { min-height: 340px; }
}
@media (min-width: 1000px) {
  .bento { grid-template-columns: repeat(12, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, .44fr); }
  .tile { min-height: 0; }
  .tile--a { grid-column: 1 / 8; grid-row: 1; }
  .tile--b { grid-column: 8 / 13; grid-row: 1; }
  .tile--c { grid-column: 1 / 6; grid-row: 2; }
  .tile--e { grid-column: 6 / 13; grid-row: 2; }
}
@media (min-width: 1000px) and (max-height: 840px) {
  .tile--c .tile__desc, .tile--e .tile__desc { display: none; }
  .tile--a .tile__desc, .tile--b .tile__desc { display: none; }
}

/* Pinned deck, desktop only. film.js adds .is-pinned when the grid fits the viewport. */
.film--co.is-pinned { height: 250vh; }
.film--co.is-pinned #companies { top: 125vh; }
.film--co.is-pinned .co { height: 100%; display: flex; flex-direction: column; padding-block: 6.25rem 2rem; }
.film--co.is-pinned .bento { flex: 1; min-height: 0; }
.film--co.is-pinned .tile { will-change: transform; }
.film-on .film--co:not(.is-pinned) .stage { position: static; height: auto; overflow: visible; }

/* ---------- Scene 3: where the AI stops ---------- */
/* One horizontal strip of stations at every width. Without the film it is a native swipeable row;
   with it, film.js slides the strip under the runner as the page scrolls. */
.film--line {
  --padl: max(var(--pad), calc((100vw - 1320px) / 2 + var(--pad)));
  --content: calc(min(100vw, 1320px) - 2 * var(--pad));
  --gap: clamp(1.5rem, 4vw, 3.5rem);
  --sw: calc(var(--content) - 44px);
  --pitch: calc(var(--sw) + var(--gap));
}
@media (min-width: 700px) { .film--line { --sw: calc((var(--content) - var(--gap)) / 2); } }
@media (min-width: 1100px) { .film--line { --sw: calc((var(--content) - 2 * var(--gap)) / 3); } }

.walk { padding: var(--section) 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(1.75rem, 6vh, 4.5rem); }
.walk__title { padding-inline: var(--padl); font-size: clamp(2.4rem, 1rem + 6vw, 5.5rem); }
.walk__view { overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: var(--padl); scrollbar-width: none; }
.walk__view::-webkit-scrollbar { display: none; }
.walk__strip { position: relative; width: max-content; padding: 0 var(--padl) 8px; }
/* One station per screen on a phone: room after the last one so it can line up on the left like the rest. */
@media (max-width: 699px) { .walk__strip { padding-right: calc(var(--padl) + 44px); } }
.walk__stations { display: flex; gap: var(--gap); }
.station { flex: none; width: var(--sw); scroll-snap-align: start; display: grid; gap: .6rem; align-content: start; justify-items: start; }
.station__dot { display: flex; align-items: center; height: 44px; margin-bottom: .35rem; }
.station__dot i { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); transition: background-color 260ms ease, box-shadow 260ms ease, transform 420ms var(--ease-out); }
.station--human .station__dot i { width: 22px; height: 22px; margin-left: 38px; background: transparent; box-shadow: inset 0 0 0 4px var(--ink); }
.station--next .station__dot i { background: var(--ink); }
.station h3 { font: 760 clamp(1.5rem, 1.05rem + 1.9vw, 2.6rem)/1.05 var(--font-display); font-variation-settings: "wdth" 112; letter-spacing: -.02em; }
.station p { max-width: 34ch; color: var(--ink-2); font-size: clamp(1.0625rem, .95rem + .5vw, 1.3125rem); line-height: 1.45; text-wrap: pretty; }
.walk__link { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; font-weight: 500; }
.walk__link svg { transition: transform 320ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .walk__link:hover { text-decoration: underline; text-underline-offset: .25em; }
  .walk__link:hover svg { transform: translate(3px, -3px); }
}

/* The rail. Green carries the AI as far as the wall; the ink line past it belongs to people. */
.walk__rail, .walk__fill, .walk__human { position: absolute; top: 21px; left: calc(var(--padl) + 6px); height: 2px; border-radius: 2px; transform-origin: 0 50%; }
.walk__rail { width: calc(var(--pitch) * 4 + 14px); background: var(--hair); }
.walk__fill { width: calc(var(--pitch) * 4); background: var(--accent); }
.walk__human { left: calc(var(--padl) + var(--pitch) * 4 + 60px); width: calc(var(--pitch) - 54px); background: var(--ink); }
.walk__wall { position: absolute; top: 0; left: calc(var(--padl) + var(--pitch) * 4 + 20px); width: 6px; height: 44px; border-radius: 3px; background: var(--ink); }
.walk__runner { position: absolute; top: 11px; left: calc(var(--padl) - 5px); width: 22px; height: 22px; border-radius: 50%; background: var(--accent); transform: translateX(calc(var(--pitch) * 4)); }

/* Film: pinned stage, stations wait dimmed until the runner reaches them. film.js lights them. */
.film-on .film--line { height: 460vh; }
.film-on .walk { height: 100%; align-content: center; padding-block: 6rem 2rem; }
.film-on .walk__view { overflow: hidden; overflow: clip; scroll-snap-type: none; }
.film-on .walk__strip, .film-on .walk__runner { will-change: transform; }
.film-on .station { transition: opacity 240ms ease; }
.film-on .station.is-past { opacity: 0; } /* a station sliding off the left edge fades instead of being cut mid-word */
.film-on .station h3 { transition: color 320ms ease, opacity 320ms ease; }
.film-on .station p, .film-on .walk__link { transition: opacity 520ms var(--ease-out), translate 640ms var(--ease-out); }
.film-on .station:not(.is-lit) h3 { color: var(--ink-2); opacity: .55; }
.film-on .station:not(.is-lit) p, .film-on .station:not(.is-lit) .walk__link { opacity: 0; translate: 0 12px; }
.film-on .station:not(.is-lit) .station__dot i { background: var(--hair); transform: scale(.7); }
.film-on .station--human:not(.is-lit) .station__dot i { background: transparent; box-shadow: inset 0 0 0 4px var(--hair); transform: none; }

/* ---------- Speaking ---------- */
.talk { padding: var(--section) var(--pad); }
.talk__grid { max-width: 1320px; margin: 0 auto; display: grid; gap: clamp(2rem, 5vw, 4rem); }
.talk__lead { display: grid; gap: 1rem; align-content: start; }
.talk__lead p { color: var(--ink-2); max-width: 36ch; font-size: clamp(1.0625rem, 1rem + .4vw, 1.3rem); }
.topics { display: grid; gap: 0; align-content: start; }
.topics li {
  font: 600 clamp(1.15rem, 1rem + .9vw, 1.7rem)/1.2 var(--font-text); letter-spacing: -.015em;
  padding: 1.1rem 0; text-wrap: balance;
}
.topics li + li { border-top: 1px solid var(--hair); }
.episode {
  display: grid; gap: 0; background: var(--surface); border-radius: var(--r-card); overflow: clip;
  box-shadow: inset 0 0 0 1px var(--hair);
  transition: transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out), opacity 700ms var(--ease-out);
}
.episode__img { display: block; aspect-ratio: 16 / 9; background: var(--flood); overflow: clip; }
.episode__img img { width: 100%; height: 100%; object-fit: cover; }
.episode__img.is-empty { display: none; }
.episode__copy { display: grid; gap: .45rem; padding: clamp(1.25rem, 2.2vw, 2rem); }
.episode__show { color: var(--ink-2); font-size: .9375rem; }
.episode__title { font: 760 clamp(1.25rem, 1rem + 1vw, 1.75rem)/1.12 var(--font-display); font-variation-settings: "wdth" 108; letter-spacing: -.015em; text-wrap: balance; }
.episode__date { display: inline-flex; align-items: center; gap: .4rem; font-size: .9375rem; margin-top: .4rem; }
.episode:active { transform: scale(.99); }
@media (hover: hover) and (pointer: fine) {
  .episode:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px var(--hair), 0 24px 40px -28px rgb(0 0 0 / .45); }
}
@media (min-width: 900px) {
  .talk__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto 1fr; column-gap: clamp(3rem, 7vw, 7rem); }
  .talk__lead { grid-column: 1; grid-row: 1; }
  .episode { grid-column: 1; grid-row: 2; align-self: start; max-width: 30rem; }
  .topics { grid-column: 2; grid-row: 1 / 3; }
}

/* ---------- Close ---------- */
.end {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(1.5rem, 4vh, 2.5rem);
  padding: var(--section) var(--pad) max(2rem, env(safe-area-inset-bottom)); text-align: center;
}
.end__row { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: center; }
.end__link { display: inline-flex; align-items: center; gap: .35rem; font-weight: 500; padding: .75rem 0; }
.end__link:hover { text-decoration: underline; text-underline-offset: .25em; }
.end__fine { margin-top: auto; color: var(--ink-2); font-size: .875rem; }
.end .mark { margin-top: auto; }

/* The wordmark unfolds back out of the period. */
.film-on .mark--end .mark__inner {
  transform-origin: 100% 50%; transform: scaleX(.02);
  font-variation-settings: "wdth" 62, "wght" 800;
  transition: transform 1100ms var(--ease-out), font-variation-settings 1100ms var(--ease-out);
}
.film-on .mark--end.is-in .mark__inner { transform: none; font-variation-settings: "wdth" 125, "wght" 800; }

/* Scroll reveals for the two plain sections. Content is visible without JS. */
/* Uses `translate`, not `transform`, so hover and press transforms on a revealed card still work. */
.film-on .reveal { opacity: 0; translate: 0 18px; transition: opacity 700ms var(--ease-out), translate 700ms var(--ease-out), transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.film-on .reveal.is-in { opacity: 1; translate: none; }
.film-on .film--co:not(.is-pinned) .tile { opacity: 0; transform: translateY(24px) scale(.97); transition: opacity 700ms var(--ease-out), transform 800ms var(--ease-out); }
.film-on .film--co:not(.is-pinned) .tile.is-in { opacity: 1; transform: none; }
/* Charts wipe in left to right, then the period lands on the end of the line. Pinned: film.js scrubs it. */
.film-on .film--co:not(.is-pinned) .fig__ink { clip-path: inset(-12px 100% -12px -12px); transition: clip-path 1500ms var(--ease-in-out) 250ms; }
.film-on .film--co:not(.is-pinned) .tile.is-in .fig__ink { clip-path: inset(-12px); }
.film-on .fig__end { scale: 0; transition: scale 520ms var(--ease-out); }
.film-on .film--co:not(.is-pinned) .tile.is-in .fig__end { scale: 1; transition-delay: 1650ms; }
.film-on .tile.is-drawn .fig__end { scale: 1; }
