/* ForgeHorizon Consulting — shared design system (v3).
   Single source of truth for type, color, nav, buttons, forms, footer and
   page layouts. Brand tokens are unchanged from the midterm site.
   Fonts are loaded by a <link> in each page's <head> (not @import here),
   so the browser fetches them in parallel with this file. */

/* --p drives the scroll-linked details ([data-scroll] elements and the How We
   Work rail; set by js/site.js). Registering it as a number lets a transition
   ease it; browsers without @property just follow the scroll exactly.
   1 means "at rest", which is also what no-JS and reduced motion get. */
@property --p {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}

:root {
  /* Colour: brand tokens from the midterm, unchanged. */
  --bg: #071018;
  --hero-top: #07141c;
  --hero-mid: #0c2832;
  --void: #020617;
  --text: #e2e8f0;
  --heading: #f8fafc;
  --lede: #cbd5e1;
  --quiet: #94a3b8;
  --kicker: #99f6e4;
  --accent: #5eead4;
  --cta: #2dd4bf;
  --cta-hover: #5eead4;
  --cta-text: #042f2e;
  --hairline: rgba(226, 232, 240, 0.1);
  --hairline-strong: rgba(226, 232, 240, 0.16);
  --focus: #f8fafc;
  --veil: rgba(7, 16, 24, 0.7);      /* content bands over the mountain */
  --glass: rgba(12, 40, 50, 0.34);

  /* Type: two families, one fluid scale. Every heading on the site is one of
     these five sizes; every supporting sentence is --fs-lede. */
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: Inter, system-ui, sans-serif;
  --fs-display: clamp(2.9rem, 9.4vw, 7.6rem);   /* Home hero */
  --fs-h1: clamp(2.5rem, 7.6vw, 5.8rem);        /* inner page titles */
  --fs-xl: clamp(2.1rem, 6vw, 4.6rem);          /* closing calls to action, frame titles */
  --fs-h2: clamp(1.9rem, 4vw, 3rem);            /* section headings */
  --fs-h3: clamp(1.5rem, 3.3vw, 2.5rem);        /* statements, list headings */
  --fs-lede: clamp(1.03rem, 1.4vw, 1.15rem);
  --fs-small: 0.92rem;
  --fs-fine: 0.85rem;
  --fs-label: 0.75rem;

  /* Layout: one content width and one fluid gutter, so the logo, the hero
     headline and every section start on the same left edge. */
  --header-h: 4.25rem;
  --wide: 80rem;
  --narrow: 44rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);

  /* Spacing rhythm: section padding, heading-to-content gap, grid gap. */
  --s-section: clamp(4.5rem, 10vw, 8.5rem);
  --s-block: clamp(2rem, 5vw, 3.5rem);
  --s-gap: 1.25rem;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);   /* long, soft landings */
}

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

/* color-scheme tells the browser this is a dark page, so the things it draws
   itself (scrollbars, autofilled fields, the form validation bubble) match. */
html { color-scheme: dark; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Page-to-page: a short cross-fade with a small lift (browsers that support
   cross-document view transitions; others just navigate). The header keeps
   its own layer so it stays put while the page changes under it. */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: vt-out 0.28s var(--ease) both; }
::view-transition-new(root) { animation: vt-in 0.55s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-kerning: normal;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--accent); }
a:hover { color: var(--heading); }

h1, h2, h3 { color: var(--heading); text-wrap: balance; }
h1, h2 { font-family: var(--font-head); font-weight: 600; }
p { text-wrap: pretty; }

::selection { background: var(--cta); color: var(--cta-text); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 60;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--cta);
  color: var(--cta-text);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: var(--cta-text); }

[id] { scroll-margin-top: calc(var(--header-h) + 1rem); }

/* ---------- Fixed backdrop: gradient, dotted mountain, grain ---------- */

.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 0;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1100px 600px at 78% 12%, rgba(94, 168, 176, 0.2), transparent 60%),
    linear-gradient(var(--hero-top), var(--hero-mid) 48%, var(--bg));
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.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='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.backdrop canvas {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
}
/* Static mountain: the default (no JS, reduced motion, save-data, any failure).
   Keep position and size in step with layout() in js/mountain.js. */
.backdrop__static {
  position: absolute;
  left: 50%;
  top: 92%;
  width: 150vw;
  max-width: none;
  transform: translate(-50%, -100%);
}
@media (min-width: 900px) {
  .backdrop__static { left: 58%; top: 97%; width: min(95vw, 1600px, 147.8vh); }
}
.mountain-live .backdrop__static { display: none; }
.mountain-live .backdrop canvas { display: block; }

main, .site-footer { position: relative; z-index: 1; }
/* clip, not hidden: keeps sticky frames working while stopping wide motion
   (e.g. AI + Execution sliding in) from adding a horizontal scrollbar. */
main { display: block; overflow-x: clip; }
html.menu-locked { overflow: hidden; }

/* ---------- Header / nav ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s ease, border-color 0.35s ease, transform 0.55s var(--ease-out);
}
/* Tucked away while reading down (js/site.js); back on any scroll up, on
   focus, and always while the menu is open. It moves up by exactly its own
   height, which leaves the progress line below it sitting on the top edge of
   the screen. */
.site-header.is-hidden:not(:focus-within):not(.menu-open) { transform: translateY(-100%); }
.site-header.is-scrolled,
.site-header.menu-open,
html:not(.js) .site-header {
  background: rgba(7, 16, 24, 0.82);
  border-bottom-color: var(--hairline);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header.is-scrolled {
    background: rgba(7, 16, 24, 0.66);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    backdrop-filter: blur(14px) saturate(1.3);
  }
}
.site-header.menu-open { background: var(--bg); }
.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, var(--cta), var(--kicker));
  transform: scaleX(var(--scroll, 0));
  transform-origin: left;
}
.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  min-height: var(--header-h);
  margin: 0 auto;
  padding: 0.6rem var(--gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--heading);
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-decoration: none;
}
.brand:hover { color: var(--heading); }
.brand__mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: 0.3rem;
  background: var(--cta);
  color: var(--cta-text);
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0;
  transition: transform 0.4s var(--ease);
}
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.06); }

.site-menu { display: flex; align-items: center; gap: 1.75rem; }
.site-menu ul {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-menu li a {
  position: relative;
  display: inline-block;
  padding: 0.35rem 0;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.site-menu li a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--cta);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.site-menu li a:hover { color: var(--heading); }
.site-menu li a:hover::after,
.site-menu li a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.site-menu li a[aria-current="page"] { color: var(--kicker); }
/* Just above the breakpoint the bar is at its tightest: close the gaps a little. */
@media (min-width: 1024px) and (max-width: 1179px) {
  .site-menu { gap: 1.1rem; }
  .site-menu ul { gap: 1.15rem; }
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--hairline-strong);
  border-radius: 0.5rem;
  background: rgba(7, 16, 24, 0.4);
  color: var(--heading);
  cursor: pointer;
}
.nav-toggle svg { display: block; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 1023px) {
  .nav-toggle { display: inline-flex; }
  /* Full-height panel under the header bar. (top: 100% is measured from inside
     the bar's border, so the panel is exactly the screen minus the bar.) */
  .site-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: 1.5rem;
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem var(--gutter) calc(1.75rem + env(safe-area-inset-bottom, 0px));
    background:
      radial-gradient(120% 60% at 80% 100%, rgba(45, 212, 191, 0.12), transparent 70%),
      var(--bg);
    border-top: 1px solid var(--hairline);
  }
  .site-menu ul { flex-direction: column; align-items: stretch; gap: 0; counter-reset: menu; }
  .site-menu li { counter-increment: menu; }
  .site-menu li a {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--hairline);
    font-family: var(--font-head);
    font-size: clamp(1.6rem, 7.5vw, 2.4rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
  }
  /* The second `content` adds empty alt text so the number is not read out as
     part of the link's name; browsers without that syntax keep the first. */
  .site-menu li a::before {
    content: counter(menu, decimal-leading-zero);
    content: counter(menu, decimal-leading-zero) / "";
    color: var(--quiet);
    font-family: var(--font-body);
    font-size: var(--fs-label);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.1em;
  }
  .site-menu li a::after { display: none; }
  .site-menu li a[aria-current="page"] { border-bottom-color: var(--cta); }
  .site-menu .btn { width: 100%; min-height: 3.25rem; }
  /* With JS the menu is collapsed until the hamburger opens it.
     Without JS it stays open so the links are never unreachable. */
  .js .site-menu { display: none; }
  .js .site-menu.is-open { display: flex; animation: menu-in 0.35s var(--ease) both; }
  .js .site-menu.is-open li,
  .js .site-menu.is-open .btn { animation: menu-link 0.7s var(--ease-out) both; }
  .js .site-menu.is-open li:nth-child(2) { animation-delay: 0.04s; }
  .js .site-menu.is-open li:nth-child(3) { animation-delay: 0.08s; }
  .js .site-menu.is-open li:nth-child(4) { animation-delay: 0.12s; }
  .js .site-menu.is-open li:nth-child(5) { animation-delay: 0.16s; }
  .js .site-menu.is-open .btn { animation-delay: 0.22s; }
  /* relative, not static: the header stays in the flow but keeps its place
     above the fixed mountain backdrop (static would put it underneath). */
  html:not(.js) .site-header { position: relative; }
  html:not(.js) .site-menu { position: static; height: auto; padding: 0 0 0.5rem; border: 0; background: none; }
  html:not(.js) .site-header__inner { flex-wrap: wrap; }
  html:not(.js) .nav-toggle { display: none; }
}
@keyframes menu-in {
  from { opacity: 0; }
}
@keyframes menu-link {
  from { opacity: 0; transform: translateY(18px); }
}

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.35rem;
  border: 0;
  border-radius: 999px;
  background: var(--cta);
  color: var(--cta-text);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.25s var(--ease), box-shadow 0.25s ease;
}
.btn:hover {
  background: var(--cta-hover);
  color: var(--cta-text);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px rgba(45, 212, 191, 0.55);
}
.btn:active { transform: translateY(0) scale(0.98); }
/* Large calls to action lean a few pixels toward the pointer (js/site.js sets
   `translate`, which composes with the hover lift above). */
.btn--magnet { transition: background-color 0.2s ease, transform 0.25s var(--ease), box-shadow 0.25s ease, translate 0.5s var(--ease-out); }
/* Decorative arrows carry empty alt text so they are not read as "right arrow". */
.btn--arrow::after {
  content: "→";
  content: "→" / "";
  transition: transform 0.25s var(--ease);
}
.btn--arrow:hover::after { transform: translateX(4px); }
.btn--nav { min-height: 2.6rem; padding: 0.5rem 1.1rem; font-size: 0.9rem; white-space: nowrap; }
.btn--ghost {
  background: rgba(7, 16, 24, 0.35);
  color: var(--heading);
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.45);
}
.btn--ghost:hover {
  background: rgba(226, 232, 240, 0.1);
  color: var(--heading);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.center .btn-row { justify-content: center; }

/* ---------- Bands (content sections over the mountain) ---------- */

.band {
  position: relative;
  padding: var(--s-section) 0;
  background: var(--veil);
}
.band + .band { border-top: 1px solid var(--hairline); }
/* The first band fades in from the open hero instead of starting with an edge. */
.hero + .band,
.page-head + .band { background: linear-gradient(rgba(7, 16, 24, 0), var(--veil) 16rem); }
/* On an inner page the title already supplies the space above the first band. */
.page-head + .band { padding-top: clamp(1.5rem, 4vw, 3rem); }
/* A "window": a lighter veil so the mountain reads clearly behind it. */
.band--window { background: rgba(7, 16, 24, 0.46); }
.band--window h2, .band--window p { text-shadow: 0 0 20px rgba(7, 16, 24, 0.95), 0 0 6px rgba(7, 16, 24, 0.9); }
.band--window .diff-mark { text-shadow: none; }

.band-inner { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
/* A narrow reading column that still starts on the shared left edge (it used
   to be centred, which put it out of line with the page title above it). The
   space to its right is where the mountain shows. */
.band-inner.narrow > * { max-width: var(--narrow); }
.center { text-align: center; }
.band h2 {
  margin: 0 0 1.15rem;
  font-size: var(--fs-h2);
  letter-spacing: -0.035em;
  line-height: 1.08;
}
.lede { margin: 0; color: var(--lede); font-size: var(--fs-lede); line-height: 1.65; }
.lede + .lede { margin-top: 1rem; }
.quiet { margin: 0.5rem 0 0; color: var(--quiet); font-size: var(--fs-small); line-height: 1.55; }
.kicker-label {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1rem;
  color: var(--kicker);
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.45;
  text-transform: uppercase;
}
.kicker-label::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  flex: none;
  background: var(--cta);
}
.center > .kicker-label { justify-content: center; }
/* Section index on Home: "01 —— Our mission". Decorative numbering only
   (empty alt text keeps it out of the heading's spoken name). */
.kicker-label[data-index]::after {
  content: attr(data-index);
  content: attr(data-index) / "";
  order: -1;
  color: var(--quiet);
  font-family: var(--font-head);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}
.band h2.kicker-label { font-size: var(--fs-label); letter-spacing: 0.16em; line-height: 1.45; }
.section-head {
  display: grid;
  gap: 0.5rem 3rem;
  margin-bottom: var(--s-block);
}
.section-head h2 { margin: 0; }
.section-head .btn { justify-self: start; margin-top: 0.75rem; }
@media (max-width: 640px) {
  .section-head .btn { justify-self: stretch; }   /* full width on a phone, like the hero button */
}
@media (min-width: 900px) {
  .section-head { grid-template-columns: 1fr auto; align-items: end; }
  .section-head .btn { margin-top: 0; }
}

/* ---------- Home hero ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--header-h) + 2.25rem) 0 5rem;
}
/* --hero runs 0 → 1 over the first screen of scroll (js/site.js): the copy
   travels a little slower than the page and dims slightly as it leaves, so the
   mountain takes over. It only dims to 78%: measured, the button label and
   the paragraph still clear AA contrast at that level, so they stay readable
   for as long as they are on screen. */
.hero__inner {
  width: 100%;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
  transform: translate3d(0, calc(var(--hero, 0) * 90px), 0);
  opacity: clamp(0.78, calc(1.4 - var(--hero, 0) * 1.2), 1);
}
.hero-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 0 0 1.25rem;
  color: var(--kicker);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.45;
  text-transform: uppercase;
}
.hero-kicker span { white-space: nowrap; }
.hero-title {
  margin: 0;
  font-size: var(--fs-display);
  letter-spacing: -0.05em;
  line-height: 0.95;
}
/* Each line rises out of its own mask on load. */
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.hero-title .line > span {
  display: block;
  animation: line-up 1s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 0.12s + 0.1s);
}
/* "excellence." — white-to-teal, with one pass of light across it after it
   lands (the first background layer; parked off the right edge at rest). */
.hero-title .accent {
  background:
    linear-gradient(100deg, transparent 42%, rgba(255, 255, 255, 0.85) 50%, transparent 58%) 0 0 / 250% 100% no-repeat,
    linear-gradient(95deg, #f8fafc 5%, #99f6e4 45%, #2dd4bf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-title .line > .accent {
  animation: line-up 1s var(--ease) both, sheen 1.9s ease-in-out both;
  animation-delay: calc(var(--i, 0) * 0.12s + 0.1s), 1.5s;
}
@keyframes line-up {
  from { transform: translateY(110%); }
}
@keyframes sheen {
  from { background-position: 100% 0, 0 0; }
  to { background-position: 0 0, 0 0; }
}
.hero-lede {
  max-width: 35rem;
  margin: 1.6rem 0 0;
  color: var(--text);
  font-size: var(--fs-lede);
  line-height: 1.6;
  text-shadow: 0 0 22px rgba(7, 16, 24, 0.9), 0 0 4px rgba(7, 16, 24, 0.8);
}
.hero-kicker, .hero-lede, .hero .btn-row { animation: fade-up 0.9s var(--ease) 0.55s both; }
.hero-kicker { animation-delay: 0.05s; }
.hero .btn-row { animation-delay: 0.7s; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
}
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.4rem;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--lede);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transform: translateX(-50%);
  opacity: calc(1 - var(--hero, 0) * 5);
}
.mountain-live .scroll-cue { display: flex; }
.scroll-cue::after {
  content: "";
  width: 1px;
  height: 2.2rem;
  background: linear-gradient(var(--accent), transparent);
  transform-origin: top;
  animation: cue 2.4s ease-in-out infinite;
}
@keyframes cue {
  0% { transform: scaleY(0); opacity: 0; }
  40% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}
@media (max-width: 640px) {
  .hero .btn { width: 100%; }
}
@media (min-width: 900px) {
  .hero { align-items: center; padding-bottom: 7rem; }
}

/* ---------- Mission statement (words light up as you scroll) ---------- */

.statement {
  max-width: 66rem;
  margin: 0;
  color: var(--heading);
  font-family: var(--font-head);
  font-size: var(--fs-h3);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.22;
  text-wrap: pretty;
}
/* Unlit words rest at 42%, not lower: measured against the band behind them
   that keeps them above 3:1 (AA for text this size) before they light up. */
.js .scroll-words .word { opacity: 0.42; transition: opacity 0.5s ease; }
.js .scroll-words .word.is-on { opacity: 1; }

/* ---------- Cards ---------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1.75rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 0.75rem;
  background: var(--glass);
  transition: transform 0.45s var(--ease), border-color 0.3s ease, background-color 0.3s ease;
}
/* Pointer-following glow (position set by js/site.js). */
.glow::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), rgba(94, 234, 212, 0.17), transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.glow:hover::before { opacity: 1; }
.card--link:hover, .card--link:focus-within {
  transform: translateY(-5px);
  border-color: rgba(153, 246, 228, 0.42);
  background: rgba(12, 40, 50, 0.5);
}
.card > * { position: relative; }
/* The whole card is the link: the heading link's ::after is stretched over the
   card. For that the heading itself must NOT be positioned (otherwise the
   overlay only covers the heading, which is what v2 did by accident). */
.card--link > h3 { position: static; }
.card--link h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card--link h3 a:focus-visible { outline: none; }
.card--link:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.card h2 { margin: 0 0 0.75rem; font-size: 1.5rem; letter-spacing: -0.025em; }
.card p { margin: 0 0 0.9rem; color: var(--lede); }
.card .btn-row { margin-top: auto; padding-top: 0.6rem; }
.card-grid { display: grid; gap: var(--s-gap); }
@media (min-width: 800px) { .card-grid.two { grid-template-columns: 1fr 1fr; } }

/* ---------- Services ---------- */

.service-grid { display: grid; gap: var(--s-gap); counter-reset: service; }
@media (min-width: 700px) { .service-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .service-grid { grid-template-columns: repeat(4, 1fr); } }
.service { min-height: 15rem; counter-increment: service; }
/* Card number, top right. On hover it steps aside and an arrow takes its place. */
.service::after {
  content: counter(service, decimal-leading-zero);
  content: counter(service, decimal-leading-zero) / "";
  position: absolute;
  top: 1.6rem;
  right: 1.75rem;
  color: var(--quiet);
  font-family: var(--font-head);
  font-size: var(--fs-fine);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  transition: transform 0.4s var(--ease), color 0.3s ease;
}
.service h3::after {
  content: "→";
  content: "→" / "";
  position: absolute;
  top: 1.5rem;
  right: 1.75rem;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s ease, transform 0.4s var(--ease);
}
.service:hover::after, .service:focus-within::after { color: var(--accent); transform: translateX(-1.6rem); }
.service:hover h3::after, .service:focus-within h3::after { opacity: 1; transform: none; }
.service svg {
  display: block;
  width: 1.9rem;
  height: 1.9rem;
  color: var(--accent);
  transition: transform 0.5s var(--ease);
}
.service:hover svg { transform: translateY(-3px) scale(1.08); }
/* Icons draw their strokes in when the card is revealed (js/site.js gives each
   shape pathLength=1). The 1 2 pattern with a 1.5 offset keeps the hidden
   state clear of both ends of a dash, so round line caps leave no stray dot. */
.draw-icon.is-drawable * {
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1.5;
  transition: stroke-dashoffset 1.8s var(--ease-out);
  transition-delay: calc(var(--stagger, 0) * 90ms + 0.2s);
}
.is-visible .draw-icon.is-drawable * { stroke-dashoffset: 0; }
.service h3 {
  margin: auto 0 0.4rem;
  padding-top: 2.5rem;
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.service h3 a { color: inherit; text-decoration: none; }
.service p { margin: 0; color: var(--lede); font-size: var(--fs-small); line-height: 1.55; }
/* One column on a phone: no need to hold the cards to a common height, so
   they close up around their content instead of leaving a gap in the middle. */
@media (max-width: 699px) {
  .service { min-height: 0; }
  .service h3 { padding-top: 1.4rem; }
}

/* Services page: one row per service. The rule above each row draws itself
   in; the number is a large outlined numeral (the same motif as the Past
   Performance frames and the footer wordmark). */
.service-list { counter-reset: service; }
.service-detail {
  position: relative;
  display: grid;
  gap: 1rem 3rem;
  padding: var(--s-block) 0;
  counter-increment: service;
}
.service-detail::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--hairline-strong);
  transform-origin: left;
  transition: transform 1.3s var(--ease-out) 0.1s;
}
.js .service-detail.reveal:not(.is-visible)::before { transform: scaleX(0); }
.service-detail:last-child { padding-bottom: 0; }
.service-detail__head { display: grid; align-content: start; gap: 0.9rem; }
.service-detail__head::before {
  content: counter(service, decimal-leading-zero);
  content: counter(service, decimal-leading-zero) / "";
  color: transparent;
  font-family: var(--font-head);
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 0.9;
  -webkit-text-stroke: 1px rgba(94, 234, 212, 0.6);
}
@supports not (-webkit-text-stroke: 1px black) {
  .service-detail__head::before { color: var(--accent); }
}
.service-detail h2 { margin: 0; font-size: var(--fs-h3); }
.service-detail .lede { margin-bottom: 1.1rem; }
.tick-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.tick-list li {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: var(--glass);
  color: var(--text);
  font-size: var(--fs-small);
  transition: border-color 0.25s ease;
}
.tick-list li:hover { border-color: rgba(153, 246, 228, 0.5); }
/* Chips follow their row in, one after another. */
.js .reveal .tick-list li {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s var(--ease-out), border-color 0.25s ease;
  transition-delay: calc(var(--chip, 0) * 70ms + 0.3s), calc(var(--chip, 0) * 70ms + 0.3s), 0s;
}
.js .reveal.is-visible .tick-list li { opacity: 1; transform: none; }
.tick-list li:nth-child(2) { --chip: 1; }
.tick-list li:nth-child(3) { --chip: 2; }
.tick-list li:nth-child(4) { --chip: 3; }
.tick-list li:nth-child(n + 5) { --chip: 4; }
@media (min-width: 800px) { .service-detail { grid-template-columns: 1fr 1fr; } }

/* ---------- Our Difference ---------- */

/* "AI" and "Execution" travel in from either side and meet at the "+" as the
   section scrolls into view (--p from js/site.js, eased here; 1 = resting,
   the default). The visible words are a decorative copy; the text is read
   from the visually hidden span beside them. */
.diff-mark {
  margin: 0.5rem 0 0;
  font-family: var(--font-head);
  font-size: clamp(2.6rem, 9vw, 7rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.02;
}
[data-scroll] { transition: --p 0.6s var(--ease-out); }
.dm { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 0.26em; }
.dm span {
  display: inline-block;
  padding-bottom: 0.06em;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  will-change: transform;
}
.dm-a {
  background-image: linear-gradient(95deg, #f8fafc 20%, #ccfbf1);
  opacity: calc(0.15 + 0.85 * var(--p, 1));
  transform: translate3d(calc((1 - var(--p, 1)) * -1.1em), 0, 0);
}
.dm-b {
  background-image: linear-gradient(95deg, #99f6e4 10%, #2dd4bf);
  opacity: calc(0.15 + 0.85 * var(--p, 1));
  transform: translate3d(calc((1 - var(--p, 1)) * 1.1em), 0, 0);
}
.dm-plus {
  background-image: linear-gradient(#5eead4, #2dd4bf);
  transform: rotate(calc((1 - var(--p, 1)) * -270deg)) scale(calc(0.3 + 0.7 * var(--p, 1)));
}
.diff-sub { margin: 0.9rem 0 0; color: var(--lede); font-size: var(--fs-lede); }
.diff-grid { display: grid; gap: var(--s-gap); margin-top: var(--s-block); text-align: left; }
.diff-grid .lede {
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 0.75rem;
  background: rgba(7, 16, 24, 0.62);
  text-shadow: none;
}
@media (min-width: 800px) { .diff-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Work teaser cards (Home) ---------- */

.work-grid { display: grid; gap: var(--s-gap); counter-reset: work; }
@media (min-width: 800px) { .work-grid { grid-template-columns: repeat(3, 1fr); } }
.work-card { padding: 0; counter-increment: work; }
.work-card__art {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: radial-gradient(120% 90% at 70% 40%, rgba(12, 40, 50, 0.9), var(--void));
}
.work-card__art::after {
  content: counter(work, decimal-leading-zero);
  content: counter(work, decimal-leading-zero) / "";
  position: absolute;
  left: 1.1rem;
  top: 0.9rem;
  color: var(--kicker);
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
}
.work-card__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 66% 50%;
  transition: transform 0.9s var(--ease);
}
.work-card:hover .work-card__art img { transform: scale(1.06); }
.work-card h3 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 0;
  padding: 1.1rem 1.25rem 1.25rem;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.work-card h3::after {
  content: "→";
  content: "→" / "";
  color: var(--accent);
  font-family: var(--font-body);
  transition: transform 0.35s var(--ease);
}
.work-card:hover h3::after, .work-card:focus-within h3::after { transform: translateX(5px); }
.work-card h3 a { color: var(--heading); text-decoration: none; }

/* ---------- Big closing call to action ---------- */

.band h2.cta-title {
  margin: 0;
  font-size: var(--fs-xl);
  letter-spacing: -0.045em;
  line-height: 1;
}
.contact-lead { margin: 1.25rem 0 0; color: var(--lede); font-size: var(--fs-lede); }

/* ---------- Inner-page heading ---------- */

.page-head { padding: calc(var(--header-h) + clamp(3.5rem, 9vw, 7rem)) 0 clamp(2.5rem, 6vw, 4.5rem); }
.page-head h1 {
  margin: 0;
  max-width: 18ch;
  font-size: var(--fs-h1);
  letter-spacing: -0.05em;
  line-height: 0.98;
}
.page-head .center h1 { margin-left: auto; margin-right: auto; }
.page-head .lede {
  max-width: 38rem;
  margin-top: 1.5rem;
  text-shadow: 0 0 22px rgba(7, 16, 24, 0.9);
}
.page-head .center .lede { margin-left: auto; margin-right: auto; }
.page-head .kicker-label, .page-head h1, .page-head .lede, .page-head .btn-row { animation: fade-up 0.9s var(--ease) both; }
.page-head h1 { animation-delay: 0.08s; }
.page-head .lede { animation-delay: 0.35s; }
.page-head .btn-row { animation-delay: 0.45s; }
.page-head h1.rise { animation: none; }   /* its words rise instead (see Reveals) */

/* ---------- Steps (How We Work): the rail fills as you scroll ---------- */

.steps { position: relative; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps::before, .steps::after {
  content: "";
  position: absolute;
  left: 1.5rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: var(--hairline-strong);
}
.steps::after {
  background: var(--cta);
  transform: scaleY(var(--p, 1));
  transform-origin: top;
}
.steps li {
  position: relative;
  padding: 0 0 clamp(2.5rem, 6vw, 4rem) 5rem;
  counter-increment: step;
}
.steps li:last-child { padding-bottom: 0; }
/* The step number: outlined until the rail reaches it, then filled. */
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: -0.2rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.45s ease, border-color 0.45s ease, color 0.45s ease, box-shadow 0.6s ease;
}
.steps li.is-reached::before {
  border-color: var(--cta);
  background: var(--cta);
  color: var(--cta-text);
  box-shadow: 0 0 0 6px rgba(45, 212, 191, 0.14);
}
.steps h2 { margin: 0 0 0.5rem; font-size: var(--fs-h3); letter-spacing: -0.03em; }
.steps p { margin: 0; max-width: 34rem; color: var(--lede); font-size: var(--fs-lede); }

/* ---------- Opportunities / Contact pieces ---------- */

.notice {
  margin: 0 0 2rem;
  padding: 1.1rem 1.35rem;
  border-left: 3px solid var(--cta);
  border-radius: 0 0.5rem 0.5rem 0;
  background: rgba(12, 40, 50, 0.5);
  color: var(--text);
}

.after-list { margin: 1.5rem 0 0; padding: 0; list-style: none; counter-reset: after; text-align: left; }
.after-list li {
  position: relative;
  padding: 1.1rem 0 1.1rem 3.25rem;
  border-top: 1px solid var(--hairline);
  color: var(--lede);
  font-size: var(--fs-lede);
  counter-increment: after;
}
.after-list li::before {
  content: counter(after);
  position: absolute;
  left: 0;
  top: 1rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 600;
}

.contact-form {
  display: grid;
  gap: var(--s-gap);
  margin-top: 2rem;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  border: 1px solid var(--hairline-strong);
  border-radius: 0.75rem;
  background: var(--glass);
  text-align: left;
}
.contact-form .grid { display: grid; gap: var(--s-gap); }
@media (min-width: 700px) { .contact-form .grid.two { grid-template-columns: 1fr 1fr; } }
.contact-form label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--lede);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}
/* The label of the field being typed in lights up. */
.contact-form div:focus-within > label { color: var(--kicker); }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(226, 232, 240, 0.4);
  border-radius: 0.4rem;
  background: rgba(7, 16, 24, 0.55);
  color: var(--heading);
  font: inherit;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.25s ease;
}
.contact-form textarea { min-height: 8rem; resize: vertical; }
.contact-form input:hover, .contact-form textarea:hover { border-color: var(--accent); }
.contact-form input:focus, .contact-form textarea:focus {
  border-color: var(--accent);
  background: rgba(7, 16, 24, 0.8);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.14);
}
/* Only after the visitor has interacted with a field, never on first load. */
.contact-form input:user-invalid, .contact-form textarea:user-invalid { border-color: #fda4af; }
.contact-form ::placeholder { color: var(--quiet); opacity: 1; }
.contact-form input:focus-visible,
.contact-form textarea:focus-visible { outline-offset: 2px; }
.contact-form .btn { width: 100%; }
.contact-form .hp { position: absolute; left: -9999px; }
.fine { margin: 1rem 0 0; color: var(--quiet); font-size: var(--fs-fine); text-align: center; }
.fine a { color: var(--lede); }

/* ---------- Footer ---------- */

.site-footer {
  overflow: hidden;
  padding: clamp(3rem, 7vw, 5rem) var(--gutter) 2rem;
  background: rgba(7, 16, 24, 0.86);
  border-top: 1px solid var(--hairline);
  color: var(--quiet);
  font-size: var(--fs-fine);
  text-align: center;
}
/* Outlined wordmark that fills from the bottom, like poured metal, as the
   footer scrolls into view (--p from js/site.js; filled when at rest). */
.footer-mark {
  margin: 0 0 clamp(1.5rem, 4vw, 3rem);
  padding-bottom: 0.17em;  /* keeps the descender of the "g" clear of the links */
  color: transparent;
  font-family: var(--font-head);
  font-size: clamp(2.6rem, 13vw, 12rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.9;
  white-space: nowrap;
  -webkit-text-stroke: 1px rgba(153, 246, 228, 0.3);
  user-select: none;
  background: linear-gradient(0deg,
    rgba(45, 212, 191, 0.2) calc(var(--p, 1) * 115% - 15%),
    rgba(45, 212, 191, 0) calc(var(--p, 1) * 115%));
  -webkit-background-clip: text;
  background-clip: text;
}
@supports not (-webkit-text-stroke: 1px black) {
  .footer-mark { color: rgba(153, 246, 228, 0.14); }
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}
.site-footer a { color: var(--lede); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer p { margin: 0; }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.9rem 1.5rem;
}
.site-footer a.to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.to-top::after {
  content: "↑";
  content: "↑" / "";
  transition: transform 0.35s var(--ease);
}
.site-footer a.to-top:hover { border-color: var(--accent); color: var(--heading); text-decoration: none; }
.to-top:hover::after { transform: translateY(-3px); }

/* ---------- Reveals (once; stagger set by js/site.js) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: calc(var(--stagger, 0) * 90ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
/* Cards take back their own hover transition once they have appeared. */
.js .card.reveal.is-settled {
  transition: transform 0.45s var(--ease), border-color 0.3s ease, background-color 0.3s ease;
  transition-delay: 0s;
}

/* Display headings rise word by word out of a mask (js/site.js splits them
   and keeps the full text as the heading's accessible name). The small
   padding / negative margin pair gives descenders and letter overhang room
   inside the mask without changing the layout. */
.rise .rise__w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0 0.08em 0.16em;
  margin: 0 -0.08em -0.16em;
}
.rise .rise__w > span {
  display: inline-block;
  transform: translateY(112%);
  transition: transform 0.95s var(--ease-out);
  transition-delay: calc(var(--w, 0) * 45ms + var(--stagger, 0) * 90ms);
}
.rise.is-visible .rise__w > span { transform: none; }
/* A soft halo behind text over the mountain would be cut off square by the
   word masks, so it waits until the words have landed and the masks are off. */
.rise { transition: text-shadow 0.5s ease; }
.rise:not(.is-settled) { text-shadow: none; }
.rise.is-settled .rise__w { overflow: visible; }

/* ---------- Past performance: frames slide over each other ---------- */

/* This page is full-bleed, so its header and its frame copy share an edge
   measured from the screen (the other pages measure from the content width). */
.page-pp { --pp-edge: max(1.25rem, 4vw); }
.page-pp body { background: var(--void); }
.page-pp .site-header__inner { max-width: none; padding-left: var(--pp-edge); padding-right: var(--pp-edge); }

/* Each frame sticks at the top while the next one glides up over it.
   The page scrolls natively the whole time: no snapping, nothing is held. */
.pp-stack { position: relative; }
.frame {
  --in: 1;    /* 0 → 1 as the frame arrives (set by js/past-performance.js) */
  --out: 0;   /* 0 → 1 as the next frame covers it */
  --tint: #5eead4;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 34rem;
  overflow: hidden;
  scroll-margin-top: 0;
  background:
    radial-gradient(90% 80% at 72% 45%, color-mix(in srgb, var(--tint) 13%, transparent), transparent 70%),
    linear-gradient(#04101a, var(--void));
  /* The shadow a frame casts on the one it is covering. Kept light on purpose:
     at this strength, text just above the incoming edge still measures above
     AA contrast, so it is readable right up to the moment it is covered. */
  box-shadow: 0 -24px 60px rgba(2, 6, 23, 0.5);
}
.frame__art {
  position: absolute;
  inset: 0;
  opacity: calc(0.25 + 0.75 * var(--in));
  transform: translate3d(0, calc((1 - var(--in)) * 7%), 0) scale(calc(1 + 0.07 * var(--out)));
  will-change: transform, opacity;
}
/* Engineering-paper grid behind the drawing, strongest around the subject. */
.frame__art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(153, 246, 228, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(153, 246, 228, 0.05) 1px, transparent 1px);
  background-size: 4rem 4rem;
  background-position: center;
  -webkit-mask-image: radial-gradient(70% 75% at 50% 50%, #000 12%, transparent 72%);
  mask-image: radial-gradient(70% 75% at 50% 50%, #000 12%, transparent 72%);
}
.frame__art svg, .frame__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
/* The drawing is uncovered left to right as its frame arrives, as if plotted.
   The first frame has nothing to scroll in from, so it plays once on load. */
@media (prefers-reduced-motion: no-preference) {
  .frame:not(.frame--first) .frame__art {
    -webkit-mask-image: linear-gradient(100deg, #000 calc(var(--in) * 150% - 50%), transparent calc(var(--in) * 150%));
    mask-image: linear-gradient(100deg, #000 calc(var(--in) * 150% - 50%), transparent calc(var(--in) * 150%));
  }
  .frame--first .frame__art { animation: plot 2.2s var(--ease-out) 0.15s both; }
  .frame--first .frame__copy > * { animation: fade-up 0.9s var(--ease) 0.3s both; }
  .frame--first .frame__copy > .kicker-label { animation-delay: 0.05s; }
  .frame--first .frame__copy > h2 { animation-delay: 0.12s; }
  .frame--first .frame__copy > .lede { animation-delay: 0.2s; }
  .frame--first .frame__copy > .body { animation-delay: 0.28s; }
  .frame--first .frame__copy > .move { animation-delay: 0.36s; }
  .frame--first .frame__copy > .frame__num { animation-duration: 1.4s; }
}
@keyframes plot {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
/* Keeps the left / bottom dark enough for AA text over the line art. */
.frame__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.6) 36%, rgba(2, 6, 23, 0) 62%);
}
/* Dims the picture while the next frame covers this one. It sits under the
   copy (see the build order in js/past-performance.js), so the words are not
   dimmed with it. */
.frame__shade {
  position: absolute;
  inset: 0;
  background: var(--void);
  opacity: calc(0.8 * var(--out));
  pointer-events: none;
}
/* Drawing-sheet chrome: crop marks in the four corners (also on the close
   frame) and a sheet counter bottom right. */
.frame__chrome, .frame--end::after {
  --m: clamp(0.9rem, 2vw, 1.5rem);
  --c: rgba(153, 246, 228, 0.5);
  content: "";
  position: absolute;
  inset: calc(var(--header-h) + 0.25rem) var(--m) var(--m) var(--m);
  pointer-events: none;
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / 14px 1px,
    linear-gradient(var(--c), var(--c)) 0 0 / 1px 14px,
    linear-gradient(var(--c), var(--c)) 100% 0 / 14px 1px,
    linear-gradient(var(--c), var(--c)) 100% 0 / 1px 14px,
    linear-gradient(var(--c), var(--c)) 0 100% / 14px 1px,
    linear-gradient(var(--c), var(--c)) 0 100% / 1px 14px,
    linear-gradient(var(--c), var(--c)) 100% 100% / 14px 1px,
    linear-gradient(var(--c), var(--c)) 100% 100% / 1px 14px;
  background-repeat: no-repeat;
}
.frame__chrome { opacity: calc(var(--in) * (1 - var(--out))); }
.frame--end::after { opacity: var(--in); }
.frame__count {
  position: absolute;
  right: 1.1rem;
  bottom: 0.8rem;
  color: var(--kicker);
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.14em;
}
/* The copy drifts with the hand-over but is never faded by it. v2 faded the
   outgoing copy out and the incoming copy in, which left text half-faded
   (below AA contrast) whenever the page was stopped between two frames. Now
   the words stay at full strength until the next frame physically covers
   them, and are already at full strength when they come into view. */
.frame__copy {
  position: absolute;
  left: var(--pp-edge);
  right: 3.25rem;
  bottom: clamp(1.25rem, 5vh, 3rem);
  max-width: 40rem;
  transform: translate3d(0, calc((1 - var(--in)) * 48px - var(--out) * 40px), 0);
  will-change: transform;
}
/* Large outlined frame number standing on top of the copy block. Wide screens
   only, and only when the screen is tall enough to give it room: it is sized
   from the space left above the tallest copy block so it never runs under the
   header. */
.frame__num { display: none; }
@media (min-width: 860px) and (min-height: 680px) {
  .frame__num {
    position: absolute;
    left: -0.04em;
    bottom: calc(100% + 0.75rem);
    display: block;
    color: transparent;
    font-family: var(--font-head);
    font-size: clamp(6rem, min(21vw, calc((90vh - 31rem) * 1.25)), 20rem);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.06em;
    line-height: 0.8;
    -webkit-text-stroke: 1px color-mix(in srgb, var(--tint) 38%, transparent);
    opacity: calc(var(--in) * (1 - var(--out)));   /* decorative, so it may fade */
    transform: translate3d(0, calc((1 - var(--in)) * 60px - var(--out) * 40px), 0);
    pointer-events: none;
    user-select: none;
  }
  @supports not (-webkit-text-stroke: 1px black) {
    .frame__num { color: rgba(153, 246, 228, 0.08); }
  }
}
.frame .kicker-label { margin-bottom: 0.9rem; }
/* One step under --fs-xl on purpose: at this size the longest pair of words in
   a frame title ("engineering process") still fits the copy column at every
   width, so titles break into two lines, not three. */
.frame h2 {
  margin: 0;
  font-size: clamp(2rem, 5.2vw, 4.2rem);
  letter-spacing: -0.045em;
  line-height: 1;
}
.frame p.lede, .frame p.body {
  max-width: 34rem;
  margin: 1.1rem 0 0;
  color: var(--text);
  font-size: var(--fs-lede);
  line-height: 1.55;
}
.frame p.lede { color: var(--heading); font-weight: 500; }
.move { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }
.move button {
  min-height: 2.75rem;
  padding: 0.4rem 1.1rem;
  border: 1px solid rgba(226, 232, 240, 0.45);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.4);
  color: var(--heading);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.25s var(--ease);
}
.move button:hover:not(:disabled) { background: rgba(226, 232, 240, 0.1); border-color: var(--accent); transform: translateY(-2px); }
.move button:disabled { opacity: 0.4; cursor: default; }

/* Phone: art sits in the upper part of the frame, centred on its subject. */
@media (max-width: 859px) {
  .frame__art { inset: var(--header-h) 0 auto 0; height: 56%; }
  .frame__art svg, .frame__art img {
    left: 50%;
    width: auto;
    height: 100%;
    aspect-ratio: 16 / 9;
    transform: translateX(-65.6%);
  }
}
@media (min-width: 860px) {
  /* A little bleed so the pointer lean (js) never shows the drawing's edge. */
  .frame__art { inset: -16px; }
  .frame__art::before {
    -webkit-mask-image: radial-gradient(60% 75% at 66% 50%, #000 12%, transparent 72%);
    mask-image: radial-gradient(60% 75% at 66% 50%, #000 12%, transparent 72%);
  }
  .frame__scrim {
    background:
      linear-gradient(90deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.7) 30%, rgba(2, 6, 23, 0) 62%),
      linear-gradient(0deg, rgba(2, 6, 23, 0.6) 0%, rgba(2, 6, 23, 0) 30%);
  }
  .frame__copy { right: auto; bottom: 10vh; width: min(42rem, 50vw); }
}

/* A screen too short to show a whole frame (a phone held sideways, a very
   small window): stacking frames on top of each other would leave the bottom
   of each one, with its buttons, permanently out of reach. There the frames
   are an ordinary stack and scroll past in full. */
@media (max-height: 34rem) {
  .frame { position: relative; }
  .frame__shade { display: none; }
}

/* Slow ambient motion inside the artwork, only on the frame in view. */
.frame.is-active .flow path { animation: flow 2.4s linear infinite; }
.frame.is-active .spin-a { animation: spin 180s linear infinite; }
.frame.is-active .spin-b { animation: spin 90s linear infinite reverse; }
.frame.is-active .spin-c { animation: spin 60s linear infinite reverse; }
.frame.is-active .spin-vane { animation: spin 9s linear infinite; }
.frame.is-active .sun path { animation: sun 6s ease-in-out infinite; }
.frame.is-active .sun path:nth-child(2n) { animation-delay: -3s; }
@keyframes flow { to { stroke-dashoffset: -7; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sun { 50% { stroke-opacity: 0.45; } }
@media (max-width: 859px), (pointer: coarse) {
  .frame.is-active .flow path { animation: none; } /* the costly one; phones keep it still */
}

/* Close frame: the same composition as the industry frames (copy on the left,
   picture on the right), and the picture is the site's own mountain standing
   on a glowing horizon. On a phone the mountain sits along the bottom and the
   copy is centred in the space above it. */
.frame--end {
  --glow-x: 50%;
  display: grid;
  align-items: center;
  justify-items: start;
  height: auto;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--header-h) + 2rem) 3.25rem calc(46vw + 1rem) var(--pp-edge);
  background:
    radial-gradient(900px 520px at 70% 30%, rgba(94, 168, 176, 0.16), transparent 62%),
    linear-gradient(#04101a, var(--void));
}
.frame--end::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background: radial-gradient(60% 100% at var(--glow-x) 100%, rgba(45, 212, 191, 0.22), transparent 70%);
  opacity: var(--in);
  pointer-events: none;
}
.end-mountain {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 150%;
  max-width: none;
  opacity: calc(0.55 * var(--in));
  transform: translate3d(-50%, calc((1 - var(--in)) * 22%), 0);
  -webkit-mask-image: linear-gradient(#000 60%, transparent);
  mask-image: linear-gradient(#000 60%, transparent);
  pointer-events: none;
}
.end-card {
  position: relative;
  width: min(46rem, 100%);
  transform: translate3d(0, calc((1 - var(--in)) * 48px), 0);   /* drifts in; never faded (see .frame__copy) */
}
.end-card h2 { margin: 0 0 1.25rem; font-size: var(--fs-xl); }
.end-card p.body { margin: 0; color: var(--lede); }
.end-card h2, .end-card p { text-shadow: 0 0 22px rgba(2, 6, 23, 0.95), 0 0 6px rgba(2, 6, 23, 0.9); }
@media (min-width: 860px) {
  .frame--end { --glow-x: 66%; padding: calc(var(--header-h) + 2rem) var(--pp-edge) 3rem; }
  .end-card { width: min(44rem, 54%); }
  .end-mountain {
    left: auto;
    right: -4%;
    width: min(74%, 78rem);
    transform: translate3d(0, calc((1 - var(--in)) * 22%), 0);
  }
}

.frame-dots {
  position: fixed;
  right: 0.4rem;
  top: 50%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transform: translateY(-50%);
}
.frame-dots button {
  position: relative;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.frame-dots button::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border: 2px solid var(--heading);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.55);
  transition: background-color 0.3s ease, height 0.4s var(--ease), border-color 0.3s ease;
}
.frame-dots button:hover::before { border-color: var(--accent); }
.frame-dots button[aria-current="true"]::before {
  height: 1.5rem;
  border-color: var(--cta);
  background: var(--cta);
}
.frame-dots .dot-label {
  position: absolute;
  right: 2.2rem;
  top: 50%;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 0.3rem;
  background: var(--bg);
  color: var(--heading);
  font-size: 0.78rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(6px, -50%);
  transition: opacity 0.2s ease, transform 0.25s var(--ease);
}
.frame-dots button:hover .dot-label,
.frame-dots button:focus-visible .dot-label { opacity: 1; transform: translate(0, -50%); }
@media (min-width: 860px) { .frame-dots { right: 1rem; } }
/* Once the last frame has scrolled away the dots step back, so they do not
   hang over the footer. Keyboard focus brings them back. */
.frame-dots { transition: opacity 0.35s ease; }
.frame-dots.is-past:not(:focus-within) { opacity: 0; pointer-events: none; }

.page-pp .site-footer { background: var(--void); }
.pp-noscript { max-width: 40rem; margin: 0 auto; padding: calc(var(--header-h) + 2rem) 1.25rem 2rem; }

/* ---------- Reduced motion: everything in place, nothing moves ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .reveal .tick-list li { opacity: 1; transform: none; }
  .js .scroll-words .word { opacity: 1; }
  .scroll-cue { display: none !important; }
  .frame { position: relative; --in: 1 !important; --out: 0 !important; }
  .steps::after { transform: none; }
}

/* ---------- More contrast, if the visitor asks for it ---------- */

@media (prefers-contrast: more) {
  :root {
    --veil: rgba(7, 16, 24, 0.94);
    --quiet: #cbd5e1;
    --hairline: rgba(226, 232, 240, 0.3);
    --hairline-strong: rgba(226, 232, 240, 0.5);
  }
  .band--window { background: rgba(7, 16, 24, 0.88); }
  .hero + .band,
  .page-head + .band { background: linear-gradient(rgba(7, 16, 24, 0.6), var(--veil) 16rem); }
}

/* Less see-through, if the visitor asks for it: bands and the header go
   (nearly) solid, so nothing shows through behind text. */
@media (prefers-reduced-transparency: reduce) {
  :root {
    --veil: rgba(7, 16, 24, 0.95);
    --glass: rgba(12, 40, 50, 0.9);
  }
  .band--window { background: rgba(7, 16, 24, 0.9); }
  .site-header.is-scrolled {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Forced colours (Windows High Contrast) replaces background colours, so a
   filled button would be left as bare text. An outline keeps it looking like
   a button. (Checked: gradient and outlined text need no help there, the
   browser gives them a plain text colour by itself.) */
@media (forced-colors: active) {
  .btn { border: 1px solid ButtonText; }
  .scroll-progress { background: Highlight; }
}
