/* ════════════════════════════════════════════════════════════════════════════
   HOME — THE FOUR STAGES HERO (2026-09-24)
   ════════════════════════════════════════════════════════════════════════════

   Front page only (functions.php) and last in the cascade. Two halves: the hero, scoped under
   .hero--stages; then the rest of the page, scoped under :where(#main) (see that block).

   The hero replaced the orbit at the founder's direction: a headline that says what the company
   does, and one 3D object, pinned while the visitor scrolls, that becomes each line of work in
   turn with its caption (stages.js draws it; the Blender stills stand in wherever it cannot run).

   Two layouts:
     · Default (no JavaScript): one screen — headline, the first still, the four stages as a row
       of links, the buttons. Nothing is hidden and nothing depends on scroll.
     · html[data-stages-js]: the section grows to a scroll run and .stages__pin sticks to the
       viewport while the stages change. html[data-stages] is 'live' (WebGL) or 'still' (the
       stills swap instead: no WebGL, reduced motion). */

/* overflow: clip, not the .hero default of hidden. Both cut off what spills, but hidden also
   makes the section a scroll container, and a sticky child then sticks to the section instead of
   the viewport: the pin would scroll away with the page. */
.hero--stages {
  position: relative;
  display: block;
  min-height: 0;
  padding: 0;
  overflow: clip;
  text-align: left;
}

.stages__pin {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(var(--space-4), 4vh, var(--space-7)));
  padding-bottom: var(--space-6);
}

/* A soft pool of light under the object: the ground it stands over, drawn by CSS so it costs
   the GPU nothing. */
.stages__pin::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 62%;
  width: min(70vw, 900px);
  height: min(22vh, 220px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-decorative) 16%, transparent), transparent);
  opacity: 0.7;
}

.stages__canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-deliberate) var(--ease-standard);
}
html[data-stages='live'] .stages__canvas { opacity: 1; }

/* ── The stills ─────────────────────────────────────────────────────────────── */
.stages__stills {
  position: relative;
  z-index: 1;
  height: clamp(280px, 52vh, 620px);
  pointer-events: none;
}
.stages__still {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 128%;
  width: auto;
  max-width: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-standard);
}
.stages__still[data-still-index='0'] { opacity: 1; }

/* ── Headline ───────────────────────────────────────────────────────────────── */
.stages__ui { position: relative; z-index: 2; }

.stages__headline {
  max-width: 24ch;
  margin: 0 auto;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 1.1rem + 2.1vw, 3.2rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-align: center;
  text-wrap: balance;
  color: var(--text-primary);
}

/* ── The four stages ────────────────────────────────────────────────────────── */
.stages__count {
  margin: 0 0 var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}
.stages__count [data-stage-count] { color: var(--accent-interactive); }
.stages__count-sep { margin: 0 0.5em; }

.stages__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-5);
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
}

.stage__link {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  color: var(--text-primary);
  text-decoration: none;
}
.stage__num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--accent-decorative);
}
.stage__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.stage__text {
  max-width: 34ch;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text-secondary);
}
.stage__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-1);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-interactive);
}
.stage__arrow { width: 10px; height: 10px; transition: transform var(--duration-normal) var(--ease-standard); }
.stage__link:hover .stage__arrow,
.stage__link:focus-visible .stage__arrow { transform: translate(2px, -2px); }
.stage__link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 6px; border-radius: 4px; }

.stages__rail { display: none; }

.hero--stages .hero__actions {
  position: relative;
  z-index: 2;
  justify-content: center;
  margin-top: var(--space-6);
}
.hero--stages .hero__actions .btn--ghost {
  background-color: color-mix(in srgb, var(--surface-base) 72%, transparent);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}

.hero__cue { display: none; }

/* ══ Scroll run: stages.js is running ═════════════════════════════════════════ */

html[data-stages-js] .stages__run { height: 460vh; }

/* The ecosystem zoom (stages.js, a tap on the software stage): the words step back while it is close.
   filter, not opacity: the headline's opacity already follows the scroll. */
.hero--stages .stages__headline, .hero--stages .stages__caption, .hero--stages .hero__actions, .hero--stages .stages__rail {
  transition: filter 0.5s ease;
}
.hero--stages[data-zoom] .stages__headline, .hero--stages[data-zoom] .stages__caption,
.hero--stages[data-zoom] .hero__actions, .hero--stages[data-zoom] .stages__rail { filter: opacity(0.14); }

html[data-stages-js] .stages__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  padding: 0;
}
html[data-stages-js] .stages__pin::before { top: 64%; }

html[data-stages-js] .stages__stills {
  position: absolute;
  inset: 0;
  height: auto;
}
html[data-stages-js] .stages__still { top: 52%; height: min(84vh, 112vw); }
html[data-stages-js] .stages__still[data-still-index='0'] { opacity: 0; }
/* Stills mode, or live with this stage's mesh still on its way: the still for the current stage. */
html[data-stages='still'] .hero--stages[data-stage='0'] .stages__still[data-still-index='0'],
html[data-stages='still'] .hero--stages[data-stage='1'] .stages__still[data-still-index='1'],
html[data-stages='still'] .hero--stages[data-stage='2'] .stages__still[data-still-index='2'],
html[data-stages='still'] .hero--stages[data-stage='3'] .stages__still[data-still-index='3'],
html[data-stages-js]:not([data-stages]) .hero--stages .stages__still[data-still-index='0'],
.hero--stages[data-still='0'] .stages__still[data-still-index='0'],
.hero--stages[data-still='1'] .stages__still[data-still-index='1'],
.hero--stages[data-still='2'] .stages__still[data-still-index='2'],
.hero--stages[data-still='3'] .stages__still[data-still-index='3'] { opacity: 1; }

html[data-stages-js] .stages__ui {
  position: absolute;
  inset: 0;
  padding-top: calc(var(--header-h) + clamp(var(--space-3), 3vh, var(--space-6)));
  padding-bottom: clamp(var(--space-5), 6vh, var(--space-8));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    'head head'
    '.    rail'
    'cap  act';
  align-items: end;
  pointer-events: none;
}
html[data-stages-js] .stages__ui a,
html[data-stages-js] .stages__ui .btn { pointer-events: auto; }

/* The headline eases back as the stages take over, never all the way: it is the page's h1. */
html[data-stages-js] .stages__headline {
  grid-area: head;
  align-self: start;
  opacity: max(0.16, calc(1 - var(--stages-p, 0) * 5));
  transform: translateY(calc(var(--stages-p, 0) * -40px)) scale(calc(1 - min(var(--stages-p, 0) * 1.2, 0.14)));
  transform-origin: 50% 0;
}

html[data-stages-js] .stages__caption { grid-area: cap; align-self: end; }
html[data-stages-js] .stages__list {
  position: relative;
  display: block;
  min-height: 11.5rem;
  margin: 0;
}
html[data-stages-js] .stage {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  visibility: hidden;
  transition: visibility 0s linear var(--duration-slow);
}
html[data-stages-js] .stage[data-active] { visibility: visible; transition-delay: 0s; }

/* Each line of the caption rises into place, the title first. */
html[data-stages-js] .stage__link > * {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity var(--duration-slow) var(--ease-standard),
    transform var(--duration-slow) var(--ease-cinematic);
}
html[data-stages-js] .stage[data-active] .stage__link > * { opacity: 1; transform: none; }
html[data-stages-js] .stage[data-active] .stage__title { transition-delay: 60ms; }
html[data-stages-js] .stage[data-active] .stage__text { transition-delay: 140ms; }
html[data-stages-js] .stage[data-active] .stage__cta { transition-delay: 220ms; }
html[data-stages-js] .stage__num { display: none; }
html[data-stages-js] .stage__title {
  font-size: clamp(2.2rem, 1.2rem + 3.2vw, 4.4rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
}
html[data-stages-js] .stage__text { font-size: var(--text-base); max-width: 38ch; }

/* The rail: the four names down the right edge, the current one lit, a hairline filling with the run. */
html[data-stages-js] .stages__rail {
  grid-area: rail;
  align-self: center;
  justify-self: end;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-left: var(--space-4);
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.stages__tick { transition: color var(--duration-normal) var(--ease-standard); }
.hero--stages[data-stage='0'] .stages__tick[data-tick='0'],
.hero--stages[data-stage='1'] .stages__tick[data-tick='1'],
.hero--stages[data-stage='2'] .stages__tick[data-tick='2'],
.hero--stages[data-stage='3'] .stages__tick[data-tick='3'] { color: var(--accent-interactive); }
.stages__bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-subtle);
}
.stages__bar-fill {
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(var(--stages-p, 0) * 100%);
  background: var(--accent-decorative);
}

html[data-stages-js] .hero--stages .hero__actions { grid-area: act; align-self: end; margin: 0; }

/* The cue, only until the visitor starts: the rail takes over from there. */
html[data-stages-js] .hero__cue {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  transform: translateX(-50%);
  opacity: max(0, calc(1 - var(--stages-p, 0) * 12));
  pointer-events: none;
}
.hero__cue .scroll-cue { position: relative; left: auto; bottom: auto; transform: none; }
.hero__cue-text {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  line-height: 1.8;
  text-align: center;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hero__cue-text br { display: none; }

/* ── Section index ──────────────────────────────────────────────────────────── */
.page-index {
  position: fixed;
  right: var(--gutter);
  bottom: var(--space-6);
  z-index: 40;
  margin: 0;
  display: none;
  gap: 0.55em;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  pointer-events: none;
}
.page-index[data-ready] { display: flex; }
.page-index [data-page-index-current] { color: var(--text-primary); }
@media (max-width: 1000px) {
  .page-index[data-ready] { display: none; }
}

/* ── Foot ───────────────────────────────────────────────────────────────────── */
.hero--stages .hero__foot {
  position: relative;
  z-index: 2;
  padding-top: var(--space-7);
}

/* ── Small screens ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stages__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[data-stages-js] .stages__run { height: 400vh; }
  html[data-stages-js] .stages__ui {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'head' '.' 'cap' 'act';
    grid-template-rows: auto 1fr auto auto;
    row-gap: var(--space-4);
    text-align: center;
  }
  html[data-stages-js] .stages__rail { display: none; }
  html[data-stages-js] .stages__list { min-height: 9.5rem; }
  html[data-stages-js] .stage__link { align-items: center; }
  html[data-stages-js] .stage__text { margin: 0 auto; font-size: var(--text-sm); }
  html[data-stages-js] .stages__count { text-align: center; }
  html[data-stages-js] .hero--stages .hero__actions { justify-content: center; }
  html[data-stages-js] .hero__cue { display: none; }
  html[data-stages-js] .stages__still { top: 42%; height: min(64vh, 110vw); }
  html[data-stages-js] .stages__pin::before { top: 50%; }
}
@media (max-width: 520px) {
  html[data-stages-js] .hero--stages .hero__actions .btn { flex: 1 1 auto; padding-inline: var(--space-4); }
  html[data-stages-js] .stage__title { font-size: 2.1rem; }
}

@media print {
  .stages__canvas, .hero__cue, .page-index, .stages__rail { display: none !important; }
}

/* ════════════════════════════════════════════════════════════════════════════
   THE REST OF THE PAGE — the orbit language (2026-09)
   ════════════════════════════════════════════════════════════════════════════

   The seven sections under the hero, restyled to belong to it. Copy, structure and
   every honesty label are untouched: this is a visual layer only, and it lives here
   rather than in site.css so the products, research and company pages — which share
   .card, .panel, .sec-head and the rest — do not change.

   Scoped with :where(#main). The id keeps every rule inside the homepage's <main> (the
   header's mega menu and the footer carry .eyebrow and .card too), and :where() gives
   the id zero specificity, so each rule ties site.css and wins on order — and never
   outranks motion.css's [data-hover] states. A plain #main prefix would silently beat
   the hover lift's border and shadow, which is exactly what those rules exist to own.

   The vocabulary, all of it taken from the hero:
     · one continuous ground — no banded sections; the atmosphere runs through the whole
       page, with a faint pool of gold light where a band used to change colour
     · glass orbs as ordinals — section indices, pillar numbers, chain nodes, tenets
     · glass panels with a gold rim catching the light along one edge
     · fading gold hairlines in place of the dotted rules
     · display type at 500, not 700 — the hero's register, engraved rather than stamped

   No backdrop-filter below the hero, on purpose: the atmosphere canvas repaints every
   frame, and every blurred panel over it would be re-blurred every frame. The fills are
   translucent enough to read as glass without it. */

:where(#main) {
  --glass-edge: color-mix(in srgb, var(--text-primary) 9%, transparent);
  --glass-fill: color-mix(in srgb, var(--surface-raised) 46%, transparent);
  --gold-hair: color-mix(in srgb, var(--accent-decorative) 55%, transparent);
}

/* ── Ground ─────────────────────────────────────────────────────────────────── */

:where(#main) > .section--raised,
:where(#main) > .section--sunken { background: transparent; }

/* A pool of light per section, placed off-centre and alternating sides down the page,
   so the eye travels. At 7% it is felt as warmth rather than seen as a shape. */
:where(#main) > .section::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(52% 42% at var(--pool-x, 80%) var(--pool-y, 24%),
    color-mix(in srgb, var(--accent-decorative) 7%, transparent), transparent 72%);
}

/* Sections meet at a hairline that fades at both ends — an orbit seen edge-on — instead
   of at a change of background colour. */
:where(#main) > .section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: min(1080px, 86%);
  height: 1px;
  transform: translateX(-50%);
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--gold-hair) 50%, transparent);
  opacity: 0.45;
}

:where(#main) > .section > .shell { position: relative; }

#who-we-are { --pool-x: 90%; --pool-y: 40%; }
#what-we-do { --pool-x: 8%;  --pool-y: 18%; }
#products   { --pool-x: 50%; --pool-y: 4%; }
#studionoir { --pool-x: 22%; --pool-y: 62%; }
#research   { --pool-x: 82%; --pool-y: 34%; }
#principles { --pool-x: 12%; --pool-y: 30%; }

/* ── Glass orbs: the ordinals ─────────────────────────────────────────────────
   The hero's orb in CSS: a dark translucent body, a gold rim, a warm caustic low right
   and one specular point high left. Sized by --orb so one description serves four
   components. Every ordinal it replaces was already aria-hidden. */
:where(#main) :is(.sec-head__index, .ledger__index, .tenet__index, .chain__node) {
  --orb: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: var(--orb);
  min-width: 0;
  height: var(--orb);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: max(0.6rem, calc(var(--orb) * 0.3));
  letter-spacing: 0;
  line-height: 1;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 23% 20%, rgb(255 255 255 / 0.85) 0 1px, rgb(255 255 255 / 0) 2.5px),
    radial-gradient(circle at 66% 74%, color-mix(in srgb, var(--accent-decorative) 26%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface-base) 55%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent-decorative) 52%, transparent),
    inset 0 0 calc(var(--orb) * 0.35) color-mix(in srgb, var(--accent-decorative) 16%, transparent),
    0 0 calc(var(--orb) * 0.6) calc(var(--orb) * -0.2) var(--accent-glow);
}
:where(#main) .ledger__index { --orb: 52px; }
:where(#main) .tenet__index  { --orb: 40px; }
:where(#main) .chain__node   { --orb: 30px; }

/* ── Section heads ────────────────────────────────────────────────────────────── */

:where(#main) .sec-head__band .eyebrow { letter-spacing: 0.24em; }

/* The dotted phase rule becomes a gold hairline fading out toward the shell's edge —
   the underline the orbit labels carry, drawn to full width. */
:where(#main) .sec-head__band .phase-rule {
  background-image: linear-gradient(90deg, var(--gold-hair), transparent);
  -webkit-mask-image: none;
          mask-image: none;
  opacity: 1;
}

:where(#main) .sec-head__title {
  font-size: clamp(2.25rem, 1.05rem + 3.2vw, 4.25rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

/* ── Glass panels ─────────────────────────────────────────────────────────────
   One material for every panel on the page. The rim is a masked gradient border drawn
   just inside the glass edge: bright gold at the upper left where the light catches,
   gone along the middle, a faint return at the lower right. ::before rather than
   ::after, because motion.css draws its pointer-tracking rim light on ::after. */
:where(#main) :is(.readout, .card--product, .ledger__row, .chain__link, .tenet) {
  position: relative;
  background: linear-gradient(180deg, var(--glass-fill), color-mix(in srgb, var(--surface-base) 22%, transparent));
  border: 1px solid var(--glass-edge);
}

:where(#main) :is(.readout, .card--product, .ledger__row, .chain__link, .tenet)::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(155deg,
    color-mix(in srgb, var(--accent-decorative) 60%, transparent),
    transparent 32%,
    transparent 72%,
    color-mix(in srgb, var(--accent-decorative) 22%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
}

/* ── Who we are ───────────────────────────────────────────────────────────────── */

:where(#main) .readout { border-radius: 26px; }

/* The honesty line: the gold bar becomes a hairline fading downward with an orb at its
   head — a small orbit stood on end. */
:where(#main) .about__pull {
  position: relative;
  border-left: 0;
  padding-left: var(--space-6);
  font-weight: 400;
}
:where(#main) .about__pull::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.55em;
  bottom: 0.2em;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent-decorative), transparent);
}
:where(#main) .about__pull::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, rgb(255 255 255 / 0.9) 0 1px, var(--accent-decorative) 2.5px);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ── What we do: the pillars ──────────────────────────────────────────────────── */

:where(#main) .ledger {
  display: grid;
  gap: var(--space-4);
  border-top: 0;
}

:where(#main) .ledger__row {
  border-radius: 22px;
  padding: clamp(var(--space-5), 3.4vw, var(--space-7));
}

:where(#main) .ledger__title { font-weight: 500; }

:where(#main) .ledger__arrow {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-accent);
  background: color-mix(in srgb, var(--surface-base) 50%, transparent);
}
:where(#main) .ledger__arrow .arrow { width: 16px; height: 12px; }

/* The chain: four links as glass tiles in two columns, each pair of orbs joined by a
   hairline with a spark travelling along it — the direction of the link, shown moving
   rather than printed as an arrow glyph. The glyph stays in the DOM (aria-hidden, as it
   was) and is only sized out of sight. */
:where(#main) .chain {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  padding-top: 0;
  border-top: 0;
}
:where(#main) .chain__label,
:where(#main) .chain__close { grid-column: 1 / -1; }

:where(#main) .chain__link {
  grid-template-columns: 1fr;
  gap: var(--space-4);
  align-items: start;
  padding: var(--space-5) var(--space-6);
  border-radius: 18px;
}

:where(#main) .chain__pair { gap: var(--space-3); }

:where(#main) .chain__arrow {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 1px;
  font-size: 0;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--accent-decorative) 70%, transparent),
    color-mix(in srgb, var(--accent-decorative) 15%, transparent));
}
:where(#main) .chain__arrow::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-decorative);
  box-shadow: 0 0 8px var(--accent-glow);
}
/* Raw durations here, so the reduced-motion token collapse cannot reach them — hence
   the explicit query. Staggered per link so the four sparks never travel in lockstep. */
@media (prefers-reduced-motion: no-preference) {
  :where(#main) .chain__arrow::after { animation: chain-spark 2.8s var(--ease-standard) infinite; }
  :where(#main) .chain__link:nth-of-type(3) .chain__arrow::after { animation-delay: 0.7s; }
  :where(#main) .chain__link:nth-of-type(4) .chain__arrow::after { animation-delay: 1.4s; }
  :where(#main) .chain__link:nth-of-type(5) .chain__arrow::after { animation-delay: 2.1s; }
}
@keyframes chain-spark {
  0%   { transform: translateX(0);    opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateX(41px); opacity: 0; }
}

:where(#main) .chain__close {
  max-width: none;
  margin-top: var(--space-3);
  padding: var(--space-6) var(--space-7);
  border: 1px solid var(--border-accent);
  border-radius: 18px;
  background: radial-gradient(120% 160% at 0% 0%,
    color-mix(in srgb, var(--accent-decorative) 10%, transparent), transparent 60%);
}

/* ── Products ─────────────────────────────────────────────────────────────────── */

:where(#main) .card--product { border-radius: 24px; }
:where(#main) .card__name { font-weight: 500; }
:where(#main) .status { background: color-mix(in srgb, var(--surface-base) 55%, transparent); }

/* The featured product (2026-10-03, Advocate OS on its launch): one wide card above the
   grid, copy on the left and the product's object and mini schematic on the right. Same
   glass and rim as the other cards, with a gold light pool on the visual side. */
:where(#main) .card--feature {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: var(--space-7);
  margin-bottom: var(--space-5);
  padding: var(--space-8) var(--space-7) var(--space-8) var(--space-8);
  background:
    radial-gradient(70% 90% at 82% 46%, color-mix(in srgb, var(--accent-decorative) 11%, transparent), transparent 70%),
    linear-gradient(180deg, var(--glass-fill), color-mix(in srgb, var(--surface-base) 22%, transparent));
}
.card-feature__copy { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.card--feature .card__top { justify-content: flex-start; }
.card--feature .card__name { font-size: var(--text-3xl); letter-spacing: var(--track-2xl); }
.card-feature__new {
  margin-left: var(--space-2);
  padding: 2px 8px;
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  color: var(--accent-decorative);
}
.card-feature__tagline {
  margin-top: calc(var(--space-2) * -1);
  font-size: var(--text-lg);
  color: var(--text-primary);
}
.card--feature .card__body { max-width: 58ch; font-size: var(--text-base); }
.card-feature__points {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.card-feature__points li {
  padding: 5px 12px;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-base) 45%, transparent);
}
.card-feature__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  margin-top: var(--space-3);
}
.card-feature__visual { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.card--feature .obj3d--card { aspect-ratio: 4 / 3; max-height: 300px; margin: 0; }
.card--feature .prod-mini { max-height: 96px; opacity: 0.85; }

/* Every second featured card mirrors (2026-10-09, when Dental HMS joined Advocate OS):
   visual on the left, light pool following it. */
:where(#main) .card--feature--flip {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  padding: var(--space-8) var(--space-8) var(--space-8) var(--space-7);
  background:
    radial-gradient(70% 90% at 18% 46%, color-mix(in srgb, var(--accent-decorative) 11%, transparent), transparent 70%),
    linear-gradient(180deg, var(--glass-fill), color-mix(in srgb, var(--surface-base) 22%, transparent));
}
.card--feature--flip .card-feature__visual { order: -1; }

@media (max-width: 900px) {
  :where(#main) .card--feature {
    grid-template-columns: 1fr;
    gap: var(--space-5);
    padding: var(--space-6);
  }
  .card-feature__visual { order: -1; }
  .card--feature .obj3d--card { max-height: 220px; }
  .card--feature .card__name { font-size: var(--text-3xl); }
}

/* The hero's smoked-glass ghost button, for every ghost button on the page: over a
   continuous ground they no longer sit on a solid band. */
:where(#main) > :is(.section, .cta-band) .btn--ghost {
  background-color: color-mix(in srgb, var(--surface-base) 62%, transparent);
}

/* ── StudioNoir ───────────────────────────────────────────────────────────────
   The panel is the studio's own: its wordmark over its reel (2026-09-14, at the founder's
   direction; the orbits drawn in this panel's ground earlier were removed). Three
   layers, back to front — the clip, a scrim, the mark. The ground colour stays under all
   three for the moment before the clip's first frame arrives, and for any browser that
   cannot play it. */
:where(#main) .panel__media.noir-panel {
  border-radius: 28px;
  border-color: var(--glass-edge);
  background: var(--surface-sunken);
}

:where(#main) .noir-panel__video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* The scrim. The wordmark is an unfilled hairline outline — the most fragile type there
   is over moving footage — so the clip is darkened most where the word sits and least at
   the edges, where it can still be seen for what it is. ::before, because site.css's
   sheen and motion.css's rim light both live on ::after. */
:where(#main) .panel__media.noir-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(72% 58% at 50% 46%, rgb(0 0 0 / 0.58), rgb(0 0 0 / 0.22) 100%),
    linear-gradient(to bottom, rgb(0 0 0 / 0.05), rgb(0 0 0 / 0.35));
}

:where(#main) .noir-mark { z-index: 2; }

/* The Studio Noir wordmark — the studio's own mark, set as studionoir.in sets it.
   Instrument Serif (SIL Open Font License) is self-hosted like every other face on this
   site, so the panel costs no request to a third party. Declared here rather than in
   base.css because this panel is the only place it is used and only the front page loads
   this sheet. `swap`, because the fallback serif is close enough to read while it loads. */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/instrument-serif-400.woff2') format('woff2');
}

:where(#main) .noir-mark__word {
  font-family: 'Instrument Serif', 'Times New Roman', Times, serif;
  font-weight: 400;
  font-size: clamp(3rem, 1.4rem + 4.4vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.005em;
  white-space: nowrap;
  /* Unfilled, with a one-pixel outline: the studio's treatment. Its own site draws the
     line at 28% platinum over flat black; this monolith carries a gold glow and two
     orbits behind the word, so the line is lifted to 50% to hold its edge against them. */
  color: transparent;
  -webkit-text-stroke: 1px rgb(245 245 242 / 0.5);
}

/* Transparent text with no stroke support would be no text at all: fall back to the
   plain wordmark in platinum. */
@supports not (-webkit-text-stroke: 1px black) {
  :where(#main) .noir-mark__word { color: var(--sync-base); }
}

/* The panel is footage under a dark scrim on both themes, so on Horizon it keeps
   Cosmos's colours — a slate outline or a steel caption would vanish into the clip. */
:root[data-theme='horizon'] :where(#main) .panel__media.noir-panel {
  color-scheme: dark;
  --surface-sunken: #000000;
  --text-primary: #F5F5F2;
  --text-secondary: #C2C8D0;
  --text-muted: #838C99;
  --accent-interactive: #D4AF37;
  --accent-decorative: #D4AF37;
  --glass-edge: rgb(245 245 242 / 0.12);
}

@media print {
  :where(#main) .noir-mark__word { color: #000; -webkit-text-stroke: 0; }
}

/* ── Research ─────────────────────────────────────────────────────────────────
   The ghost numerals become engraved: an outline in gold with a light fill falling off
   downward, as if cut into glass and lit from above. Still aria-hidden decoration. */
:where(#main) .research-item {
  position: relative;
  border-top: 0;
}
:where(#main) .research-item:last-of-type { border-bottom: 0; }
:where(#main) .research-item::before,
:where(#main) .research-item:last-of-type::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--gold-hair), transparent 85%);
  opacity: 0.7;
}
:where(#main) .research-item::before { top: 0; }
:where(#main) .research-item:last-of-type::after { bottom: 0; }

:where(#main) .research-item__index {
  font-family: var(--font-display);
  font-weight: 300;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--accent-decorative) 75%, transparent);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent-decorative) 30%, transparent), transparent 75%);
  -webkit-background-clip: text;
          background-clip: text;
}

:where(#main) .research-item__title { font-weight: 500; }

/* ── Principles ───────────────────────────────────────────────────────────────── */

:where(#main) .tenets { gap: var(--space-4); }

:where(#main) .tenet {
  padding: var(--space-6);
  border-radius: 20px;
}
:where(#main) .tenet__title { margin-top: var(--space-5); font-weight: 500; }

@media (hover: hover) and (pointer: fine) {
  :where(#main) .tenet:hover,
  :where(#main) .chain__link:hover { border-color: var(--border-accent); }
}

/* ── Closing band ─────────────────────────────────────────────────────────────
   The page ends on the system it opened with: two faint orbits and two orbs behind the
   closing line, fading out at the sides. The existing warm glow (site.css ::before)
   stays underneath. */
:where(#main) .cta-band::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 0;
  width: min(1180px, 96vw);
  height: min(420px, 38vw);
  transform: translate(-50%, -50%);
  pointer-events: none;
  background:
    radial-gradient(circle at 26% 92%, rgb(255 255 255 / 0.9) 0 1px,
      color-mix(in srgb, var(--accent-decorative) 85%, transparent) 2.5px, transparent 7px),
    radial-gradient(circle at 78% 31%, rgb(255 255 255 / 0.9) 0 1px,
      color-mix(in srgb, var(--accent-decorative) 85%, transparent) 2px, transparent 6px),
    radial-gradient(ellipse 50% 50% at 50% 50%, transparent calc(100% - 3px),
      color-mix(in srgb, var(--accent-decorative) 26%, transparent) calc(100% - 1.5px), transparent 100%),
    radial-gradient(ellipse 36% 34% at 50% 52%, transparent calc(100% - 3px),
      color-mix(in srgb, var(--accent-decorative) 18%, transparent) calc(100% - 1.5px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
:where(#main) .cta-band > .shell { z-index: 1; }

:where(#main) .cta-band__title {
  font-size: clamp(2.6rem, 1rem + 4.4vw, 5.25rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

/* ── Small screens ────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  :where(#main) .ledger__index { --orb: 42px; }
  :where(#main) .chain { grid-template-columns: 1fr; }
  :where(#main) .chain__close { padding: var(--space-5); }
  :where(#main) .cta-band::after { height: 62vw; }
}
