/* ==========================================================================
   bayrkdar.com
   tokens → base → stage → nav → buttons → sections → demos → motion states
   ========================================================================== */

/* Tokens ------------------------------------------------------------------ */
:root {
  color-scheme: dark;

  --bg: #060608;
  --bg-raised: #0d0d11;
  --ink: #f3f1ec;
  --ink-2: rgba(243, 241, 236, 0.68);
  --ink-3: rgba(243, 241, 236, 0.52); /* ≥ 4.5:1 on the page background */
  --line: rgba(243, 241, 236, 0.1);
  --line-strong: rgba(243, 241, 236, 0.2);
  --accent: #ff5a1f;
  --accent-soft: #ffb08a;
  --glow: #8d9bff;

  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Instrument Serif', ui-serif, Georgia, serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --pad: clamp(20px, 5vw, 80px);
  --max: 1560px;
  --radius: 28px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

::selection { background: var(--accent); color: #fff; }

h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, svg, canvas { display: block; max-width: 100%; }

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  padding-right: 0.06em;
  background: linear-gradient(100deg, var(--accent-soft) 0%, var(--accent) 55%, #ff3f5e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

strong { font-weight: 500; color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-200%);
  transition: transform 0.3s var(--ease);
}
.skip-link:focus { transform: none; }

/* Stage: the fixed WebGL layer --------------------------------------------- */
.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* Fallback when WebGL is unavailable: a quiet ember glow. */
  background:
    radial-gradient(40% 50% at 72% 45%, rgba(255, 90, 31, 0.16), transparent 70%),
    radial-gradient(30% 40% at 80% 60%, rgba(141, 155, 255, 0.1), transparent 70%);
}
.stage__canvas { width: 100%; height: 100%; opacity: 0; transition: opacity 1.6s ease; }
.stage.is-ready .stage__canvas { opacity: 1; }

/* Keeps text readable when a 3D form sits behind a reading column. */
.stage__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(6, 6, 8, 0.86) 0%, rgba(6, 6, 8, 0.55) 38%, rgba(6, 6, 8, 0) 62%);
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
:root[data-chapter="rtms"] .stage__veil,
:root[data-chapter="devices"] .stage__veil,
:root[data-chapter="player"] .stage__veil,
:root[data-chapter="products"] .stage__veil,
:root[data-chapter="engine"] .stage__veil { opacity: 1; }
:root[data-chapter="snapshot"] .stage__veil,
:root[data-chapter="labhead"] .stage__veil,
:root[data-chapter="workhead"] .stage__veil { opacity: 0.7; }
:root[data-chapter="capabilities"] .stage__veil,
:root[data-chapter="principles"] .stage__veil { opacity: 0.6; }

@media (max-width: 860px) {
  /* On a phone the text column covers the full width, so the 3D sits behind every
     paragraph: dim it more, and keep it fully dimmed wherever there is reading to do. */
  .stage__veil { background: rgba(6, 6, 8, 0.8); opacity: 1; }
  :root[data-chapter="hero"] .stage__veil { opacity: 0.25; }
  :root[data-chapter="statement"] .stage__veil { opacity: 0.5; }
  :root[data-chapter="contact"] .stage__veil { opacity: 0.35; }
}

main, .footer { position: relative; z-index: 1; }

/* Navigation -------------------------------------------------------------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 22px var(--pad);
  transition: transform 0.6s var(--ease);
}
.nav::before {
  content: "";
  position: absolute;
  inset: 0 0 -40px;
  z-index: -1;
  background: linear-gradient(180deg, rgba(6, 6, 8, 0.9), rgba(6, 6, 8, 0));
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.nav.is-scrolled::before { opacity: 1; }
.nav.is-hidden { transform: translateY(-110%); }

.nav__brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.nav__mark {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, var(--accent), var(--accent-soft), var(--glow), var(--accent));
  box-shadow: 0 0 24px rgba(255, 90, 31, 0.5);
}
.nav__mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--bg);
}
@media (prefers-reduced-motion: no-preference) {
  .nav__mark { animation: spin 8s linear infinite; }
}
@keyframes spin { to { transform: rotate(360deg); } }

.nav__links { display: flex; gap: 6px; }
.nav__links a {
  position: relative;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  transition: color 0.3s ease, background-color 0.3s ease;
}
.nav__links a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.nav__links a[aria-current="true"] { color: var(--ink); }
.nav__links a[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
}
.nav__mobile-only { display: none; }

.nav__cta { justify-self: end; }
.nav__toggle { display: none; }

@media (max-width: 860px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav .nav__cta { display: none; }

  .nav__toggle {
    display: grid;
    place-items: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    align-content: center;
  }
  .nav__toggle span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: var(--ink);
    transition: transform 0.5s var(--ease);
  }
  .nav.is-open .nav__toggle span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .nav.is-open .nav__toggle span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

  .nav__links {
    position: fixed;
    inset: 0;
    z-index: -1;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 0 var(--pad);
    background: var(--bg);
    clip-path: circle(0% at calc(100% - var(--pad) - 22px) 44px);
    /* Closed links leave the tab order once the reveal has finished collapsing. */
    visibility: hidden;
    transition: clip-path 0.8s var(--ease-in-out), visibility 0s linear 0.8s;
  }
  .nav.is-open .nav__links {
    clip-path: circle(150% at calc(100% - var(--pad) - 22px) 44px);
    visibility: visible;
    transition: clip-path 0.8s var(--ease-in-out), visibility 0s;
  }
  .nav__links a {
    padding: 8px 0;
    border-radius: 0;
    font-size: clamp(2.5rem, 12vw, 4rem);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: var(--ink);
  }
  .nav__links a:hover { background: none; }
  .nav__links a[aria-current="true"]::after { display: none; }
  .nav__mobile-only { display: block; }
}

/* Pill buttons ------------------------------------------------------------ */
.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 500;
  overflow: hidden;
  isolation: isolate;
  will-change: transform;
}
.pill::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform 0.6s var(--ease);
}
.pill:hover::before,
.pill:focus-visible::before { transform: none; }
.pill:hover,
.pill:focus-visible { color: #fff; }

/* Label roll: the text slides up and its copy (a text-shadow) takes its place. */
.pill__label {
  display: inline-block;
  height: 1.3em;
  overflow: hidden;
  line-height: 1.3;
}
.pill__label > span {
  display: block;
  text-shadow: 0 1.3em currentColor;
  transition: transform 0.6s var(--ease);
}
.pill:hover .pill__label > span,
.pill:focus-visible .pill__label > span { transform: translateY(-1.3em); }
.pill { transition: color 0.3s ease; }

.pill--small { padding: 11px 20px; font-size: 0.9375rem; }
.pill--large {
  padding: 14px 14px 14px clamp(22px, 3vw, 36px);
  font-size: clamp(1rem, 0.8rem + 0.9vw, 1.375rem);
}

.pill__icon {
  display: grid;
  place-items: center;
  width: clamp(44px, 4vw, 56px);
  height: clamp(44px, 4vw, 56px);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  transition: transform 0.6s var(--ease);
}
.pill__icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.pill:hover .pill__icon { transform: rotate(45deg); }

.text-button {
  position: relative;
  color: var(--ink-2);
  font-size: 0.9375rem;
  padding: 6px 0;
  transition: color 0.3s ease;
}
.text-button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}
.text-button:hover { color: var(--ink); }
.text-button:hover::after { transform: scaleX(1); }

/* Shared section scaffolding ----------------------------------------------- */
.hero, .intro, .work, .products, .capabilities, .lab, .principles, .contact, .footer {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.display {
  font-size: clamp(3.25rem, 1rem + 9vw, 10.5rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.055em;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: clamp(48px, 8vw, 120px);
}
.section-head__text { max-width: 30rem; color: var(--ink-2); font-size: 1.125rem; }

/* Hero -------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding-top: 120px;
  padding-bottom: 40px;
}

.hero__top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--ink-2);
  font-size: 0.9375rem;
}
.hero__role { display: flex; align-items: center; gap: 10px; }
.hero__role::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.18), 0 0 18px var(--accent);
}
.hero__focus { text-align: right; line-height: 1.5; }

.hero__title {
  align-self: end;
  font-size: clamp(3.4rem, 0.6rem + 11.4vw, 13.5rem);
  font-weight: 500;
  line-height: 0.86;
  letter-spacing: -0.06em;
  margin: 40px 0 clamp(28px, 4vw, 48px) -0.04em;
}
.hero__title em { letter-spacing: -0.03em; }

.hero__bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
}
.hero__lead { max-width: 30rem; color: var(--ink-2); font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); }

.hero__scroll {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-2);
  font-size: 0.875rem;
}
.hero__scroll-line {
  position: relative;
  width: 1px;
  height: 56px;
  background: var(--line-strong);
  overflow: hidden;
}
.hero__scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateY(-100%);
}
@media (prefers-reduced-motion: no-preference) {
  .hero__scroll-line::after { animation: scroll-hint 2.2s var(--ease-in-out) infinite; }
}
@keyframes scroll-hint {
  0% { transform: translateY(-100%); }
  50% { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

@media (max-width: 860px) {
  .hero { padding-top: 100px; }
  .hero__focus { display: none; }
  .hero__bottom { flex-direction: column; align-items: flex-start; }
  .hero__scroll { display: none; }
}

/* Intro ------------------------------------------------------------------- */
.intro { padding-top: clamp(120px, 22vh, 260px); padding-bottom: clamp(120px, 20vh, 240px); }

.intro__statement {
  max-width: 22em;
  font-size: clamp(1.75rem, 0.9rem + 3.4vw, 4.25rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

/* Work -------------------------------------------------------------------- */
.work { padding-top: clamp(80px, 12vh, 160px); }

.case { padding-top: clamp(40px, 10vh, 120px); padding-bottom: clamp(80px, 14vh, 180px); }

.case__intro {
  max-width: 40rem;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10vh 0;
}

.case__kicker,
.case__stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 4px;
  color: var(--ink-2);
  font-size: 0.9375rem;
}
.case__kicker i,
.case__stack i,
.adapter__items i {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 0.85em;
  border-radius: 50%;
  background: var(--accent);
}

.case__title {
  margin-top: 20px;
  font-size: clamp(3.5rem, 1rem + 8.4vw, 9.5rem);
  font-weight: 500;
  line-height: 0.88;
  letter-spacing: -0.06em;
}
.case__subtitle {
  margin-top: 18px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
  line-height: 1.15;
  color: var(--ink);
}
.case__lede {
  margin-top: clamp(32px, 4vw, 48px);
  font-size: clamp(1.25rem, 1rem + 0.7vw, 1.625rem);
  line-height: 1.4;
  letter-spacing: -0.015em;
}
.case__text { margin-top: 20px; color: var(--ink-2); }
.case__stack { margin-top: 32px; font-size: 0.875rem; color: var(--ink-3); }

.decisions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 5vw, 72px) clamp(32px, 6vw, 96px);
}
.decisions li { padding-top: 28px; border-top: 1px solid var(--line-strong); }
.decisions h4 {
  font-size: clamp(1.375rem, 1.1rem + 0.8vw, 1.875rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.decisions p { margin-top: 14px; color: var(--ink-2); max-width: 34rem; }
@media (max-width: 760px) { .decisions { grid-template-columns: 1fr; } }

.facts { max-width: 46rem; }
.facts li {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  font-size: clamp(1.25rem, 1rem + 0.9vw, 1.875rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink-2);
}
.facts li:last-child { border-bottom: 1px solid var(--line); }

.also {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 48px;
  padding: clamp(80px, 12vw, 160px) 0 clamp(120px, 16vw, 220px);
}
.also__title {
  font-size: clamp(2.5rem, 1.4rem + 3.6vw, 5rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.05em;
}
.also__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px clamp(24px, 4vw, 64px); }
.also__list dt { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.02em; }
.also__list dd { margin-top: 8px; color: var(--ink-2); }
@media (max-width: 860px) {
  .also { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .also__list { grid-template-columns: 1fr; }
}

/* Demos (one interactive surface per case) --------------------------------- */
.demo {
  position: relative;
  padding: clamp(20px, 3vw, 44px);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255, 90, 31, 0.08), transparent 50%),
    linear-gradient(180deg, rgba(20, 20, 26, 0.92), rgba(10, 10, 14, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 40px 120px -40px rgba(0, 0, 0, 0.8);
}

.demo__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  margin-bottom: clamp(24px, 3vw, 40px);
}
.demo__title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem);
  line-height: 1;
}
.demo__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.demo__note { margin-top: 24px; color: var(--ink-3); font-size: 0.875rem; }

/* Tabs with a travelling indicator */
.tabs {
  position: relative;
  display: flex;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative;
  z-index: 1;
  flex: none;
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  transition: color 0.4s ease;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--bg); }
.tabs__indicator,
.switch__thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--ink);
  transition: transform 0.6s var(--ease), width 0.6s var(--ease);
}

/* Segmented switch */
.switch {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}
.switch__thumb { top: 4px; height: calc(100% - 8px); }
.switch button {
  position: relative;
  z-index: 1;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  transition: color 0.4s ease;
}
.switch button:hover { color: var(--ink); }
.switch button[aria-checked="true"] { color: var(--bg); }

/* Lifecycle diagram */
.lifecycle__scroll { overflow-x: auto; overscroll-behavior-x: contain; margin: 0 -8px; border-radius: 12px; }
.lifecycle__hint { display: none; }
@media (max-width: 700px) {
  /* The diagram keeps a legible size and scrolls sideways; say so, and fade the cut edge. */
  .lifecycle__hint { display: block; margin-bottom: 12px; color: var(--ink-3); font-size: 0.875rem; }
  .lifecycle__scroll {
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .lifecycle__scroll.is-scrolled-end { -webkit-mask-image: none; mask-image: none; }
}
.lifecycle__svg { display: block; width: 100%; max-width: 900px; min-width: 600px; height: auto; margin: 0 auto; overflow: visible; }
.lifecycle__svg text { font-family: var(--font-sans); font-size: 12px; fill: var(--ink-2); }
.lifecycle__svg .actor-name { fill: var(--ink); font-size: 13px; font-weight: 500; }
.lifecycle__svg .actor-dot { fill: var(--ink); }
.lifecycle__svg .actor-dot--rtms { fill: var(--accent); filter: url(#glow); }
.lifecycle__svg .lifeline { stroke: url(#lifeline-fade); stroke-width: 1; }
.lifecycle__svg .msg { fill: none; stroke: rgba(243, 241, 236, 0.4); stroke-width: 1.25; }
.lifecycle__svg .msg--accent { stroke: var(--accent); stroke-width: 1.75; filter: url(#glow); }
.lifecycle__svg .msg--return { stroke-dasharray: 3 5; }
.lifecycle__svg .msg-head { fill: rgba(243, 241, 236, 0.55); }
.lifecycle__svg .msg-head--accent { fill: var(--accent); }
.lifecycle__svg .msg-head--open { fill: none; stroke: rgba(243, 241, 236, 0.55); stroke-width: 1.25; stroke-linejoin: round; }
.lifecycle__svg .msg-label { fill: var(--ink); font-family: var(--font-mono); font-size: 11px; }
.lifecycle__svg .msg-label--muted { fill: var(--ink-3); }
.lifecycle__svg .pulse { fill: #fff; filter: url(#glow); }
.lifecycle__svg .activation { fill: url(#activation-fill); }

.lifecycle__copy {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 16px clamp(24px, 4vw, 64px);
  margin-top: clamp(16px, 2vw, 28px);
  padding-top: clamp(20px, 2.5vw, 32px);
  border-top: 1px solid var(--line);
}
.lifecycle__text { font-size: 1.125rem; line-height: 1.5; }
.lifecycle__guarantee { color: var(--ink-2); padding-left: 20px; border-left: 2px solid var(--accent); }
@media (max-width: 760px) { .lifecycle__copy { grid-template-columns: 1fr; } }

/* Adapter diagram */
.adapter__core {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 1.125rem;
}
.adapter__layer { font-family: var(--font-serif); font-style: italic; font-size: 1.5rem; }
.adapter__items { display: flex; flex-wrap: wrap; align-items: center; color: var(--ink-2); }

.adapter__flow {
  position: relative;
  height: 56px;
  margin: 16px 0;
  overflow: hidden;
}
.adapter__flow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(var(--line-strong), var(--accent));
}
.adapter__flow span {
  position: absolute;
  left: 50%;
  top: 0;
  width: 7px;
  height: 7px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .adapter__flow span { animation: flow-down 1.8s var(--ease-in-out) infinite; }
}
@keyframes flow-down {
  from { transform: translateY(-10px); opacity: 0; }
  30% { opacity: 1; }
  to { transform: translateY(60px); opacity: 0; }
}

.adapter__cols {
  display: flex;
  justify-content: space-between;
  padding-bottom: 12px;
  color: var(--ink-3);
  font-size: 0.875rem;
}
.adapter__cols [data-adapter-name] { color: var(--accent-soft); }

.adapter__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.adapter__row dt { font-family: var(--font-mono); font-size: 0.9375rem; color: var(--ink); }
.adapter__row dd { font-family: var(--font-mono); font-size: 0.9375rem; color: var(--ink-2); text-align: right; }
.adapter__leader {
  height: 1px;
  align-self: center;
  background-image: linear-gradient(90deg, var(--line-strong) 40%, transparent 40%);
  background-size: 6px 1px;
  transform-origin: left;
}
@media (max-width: 560px) {
  .adapter__row { grid-template-columns: 1fr; gap: 4px; }
  .adapter__leader { display: none; }
  .adapter__row dd { text-align: left; color: var(--accent-soft); }
}

/* Quadtree */
.qt__stage {
  position: relative;
  aspect-ratio: 16 / 8;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.qt__canvas { width: 100%; height: 100%; }
@media (max-width: 640px) { .qt__stage { aspect-ratio: 1 / 1; } }

.range { display: flex; align-items: center; gap: 14px; color: var(--ink-2); font-size: 0.9375rem; }
.range output { display: inline-block; min-width: 3.2em; color: var(--ink); font-variant-numeric: tabular-nums; }
input[type="range"] {
  width: clamp(120px, 16vw, 200px);
  height: 24px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: var(--line-strong); }
input[type="range"]::-moz-range-track { height: 2px; border-radius: 2px; background: var(--line-strong); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 5px rgba(255, 90, 31, 0.35);
  transition: box-shadow 0.3s ease;
}
input[type="range"]:hover::-webkit-slider-thumb { box-shadow: 0 0 0 8px rgba(255, 90, 31, 0.35); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--ink); }

.qt__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px clamp(20px, 3vw, 40px);
  margin-bottom: 20px;
}
.qt__control { display: flex; flex-direction: column; gap: 8px; }
.qt__control-label { color: var(--ink-3); font-size: 0.8125rem; }
.qt__explain {
  min-height: 3em;
  margin-bottom: 20px;
  max-width: 52rem;
  color: var(--ink-2);
}

.readout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-top: clamp(24px, 3vw, 36px);
}
.readout dt { color: var(--ink-3); font-size: 0.875rem; }
.readout dd {
  margin-top: 6px;
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.5rem);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) { .readout { grid-template-columns: 1fr 1fr; } }

/* Capabilities ------------------------------------------------------------ */
.capabilities { padding-top: clamp(80px, 14vh, 180px); padding-bottom: clamp(80px, 14vh, 180px); }

.disciplines { border-top: 1px solid var(--line-strong); }

.discipline {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 0.9fr);
  align-items: baseline;
  gap: 12px clamp(24px, 4vw, 64px);
  padding: clamp(28px, 3.4vw, 48px) 0;
  border-bottom: 1px solid var(--line-strong);
  isolation: isolate;
}
.discipline::before {
  content: "";
  position: absolute;
  inset: 0 calc(var(--pad) * -1);
  z-index: -1;
  background: linear-gradient(90deg, rgba(255, 90, 31, 0.14), rgba(255, 90, 31, 0) 70%);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.discipline:hover::before { opacity: 1; }

.discipline h3 {
  font-size: clamp(1.875rem, 1rem + 2.6vw, 3.75rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
  transition: transform 0.7s var(--ease);
}
.discipline:hover h3 { transform: translateX(clamp(8px, 1.5vw, 24px)); }
.discipline p { color: var(--ink-2); }
.discipline__tools { font-size: 0.9375rem; color: var(--ink-3) !important; transition: color 0.4s ease; }
.discipline:hover .discipline__tools { color: var(--ink-2) !important; }

@media (max-width: 960px) {
  .discipline { grid-template-columns: 1fr; }
  .discipline:hover h3 { transform: none; }
}

/* Principles -------------------------------------------------------------- */
.principles { padding-top: clamp(40px, 8vh, 120px); padding-bottom: clamp(80px, 14vh, 180px); }

.principle {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(24px, 3vw, 40px);
}
.principle:nth-child(2) { align-items: flex-end; text-align: right; }

.principle__title {
  font-size: clamp(3rem, 0.8rem + 8.6vw, 10rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.06em;
}
.principle__text { max-width: 30rem; color: var(--ink-2); font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); }

@media (max-width: 760px) {
  .principle { min-height: 0; padding: 12vh 0; }
  .principle:nth-child(2) { align-items: flex-start; text-align: left; }
}

/* Contact ----------------------------------------------------------------- */
.contact {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 120px;
  padding-bottom: 120px;
}
.contact__kicker { color: var(--ink-2); font-size: 1.125rem; }
.contact__title {
  max-width: 9.5em;
  margin: 28px 0 clamp(40px, 5vw, 64px);
  font-size: clamp(3rem, 0.6rem + 7.6vw, 9rem);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.055em;
}
.contact__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 36px; }
@media (max-width: 480px) {
  .pill--large .pill__label { font-size: 0.9375rem; }
}

/* Footer ------------------------------------------------------------------ */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 32px;
  padding-top: 32px;
  padding-bottom: 40px;
  color: var(--ink-3);
  font-size: 0.875rem;
}
.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--pad);
  right: var(--pad);
  height: 1px;
  background: var(--line);
}
.footer__top { display: inline-block; padding: 12px 0; color: var(--ink-2); transition: color 0.3s ease; }
.footer__top:hover { color: var(--ink); }

/* Motion: initial states, only when JS runs and motion is allowed ----------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-fade],
  .js [data-fade-up],
  .js [data-split],
  .js [data-split-hero] {
    opacity: 0;
    /* Never leave content hidden if scripts fail to load. */
    animation: reveal-failsafe 0.01s linear 3.5s forwards;
  }
  .js.is-ready [data-fade],
  .js.is-ready [data-fade-up],
  .js.is-ready [data-split],
  .js.is-ready [data-split-hero] { animation: none; }
}
@keyframes reveal-failsafe { to { opacity: 1; } }

/* SplitText line masks. Each line is wrapped in a clipping mask sized to its line box,
   but at these tight line-heights the glyphs overhang it (ascenders, descenders and the
   italic's slant). Pad the mask outward and pull it back with negative margins, so the
   whole glyph shows during the reveal and nothing shifts when the split is reverted. */
.split-mask {
  padding: 0.16em 0.14em 0.2em 0.04em;
  margin: -0.16em -0.14em -0.2em -0.04em;
}
/* While split, lay the masks out as flex items: unlike sibling blocks, their negative
   margins don't collapse, so the padding above is cancelled exactly. */
.is-split { display: flex; flex-direction: column; }
/* SplitText can leave an empty duplicate <em> where a line breaks; its padding would
   nudge the real word sideways until the split is reverted. */
.is-split em:empty { display: none; }

/* Scroll-scrubbed words */
.scrub-word { opacity: 0.16; }
@media (prefers-reduced-motion: reduce) { .scrub-word { opacity: 1; } }

/* ==========================================================================
   Content components
   ========================================================================== */

.case__detail {
  display: flex;
  flex-direction: column;
  gap: clamp(64px, 8vw, 120px);
}
.case--compact .case__intro { min-height: 76vh; }
.demo__hint { color: var(--ink-3); font-size: 0.9375rem; }

/* Engineering snapshot ------------------------------------------------------ */
.snapshot {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 2fr);
  gap: 48px clamp(32px, 5vw, 80px);
  margin-top: clamp(120px, 16vw, 220px);
  padding-top: 32px;
  border-top: 1px solid var(--line-strong);
}
.snapshot__title {
  font-size: clamp(2rem, 1.2rem + 2.4vw, 3.5rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.045em;
}
.snapshot__hint { margin-top: 16px; color: var(--ink-2); max-width: 20rem; }

.snapshot__body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 32px clamp(32px, 4vw, 64px);
  align-items: start;
}

.snapshot__list { display: flex; flex-direction: column; }
.snapshot__list button {
  position: relative;
  padding: 16px 0 16px 28px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: clamp(1.25rem, 0.95rem + 1.1vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink-3);
  transition: color 0.4s ease, padding-left 0.6s var(--ease);
}
.snapshot__list button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent);
  transform: scale(0);
  transition: transform 0.5s var(--ease);
}
.snapshot__list button:hover { color: var(--ink-2); }
.snapshot__list button[aria-selected="true"] { color: var(--ink); padding-left: 36px; }
.snapshot__list button[aria-selected="true"]::before { transform: scale(1); }

.snapshot__panel {
  position: sticky;
  top: 120px;
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 90, 31, 0.1), transparent 55%),
    linear-gradient(180deg, rgba(20, 20, 26, 0.85), rgba(10, 10, 14, 0.85));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.snapshot__text { font-size: clamp(1.125rem, 1rem + 0.4vw, 1.375rem); line-height: 1.45; letter-spacing: -0.01em; }
.snapshot__stack { margin-top: 20px; color: var(--ink-3); font-size: 0.9375rem; }
.snapshot__link {
  display: inline-flex;
  gap: 10px;
  margin-top: 28px;
  color: var(--accent-soft);
  font-size: 0.9375rem;
  transition: gap 0.5s var(--ease);
}
.snapshot__link:hover { gap: 16px; }

@media (max-width: 960px) {
  .snapshot, .snapshot__body { grid-template-columns: 1fr; }
  .snapshot__panel { position: static; }
}

/* Constraints --------------------------------------------------------------- */
.constraints {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px clamp(24px, 4vw, 64px);
}
.constraints li {
  padding-top: 20px;
  border-top: 1px solid var(--line-strong);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.5rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.constraints span {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--accent-soft);
  letter-spacing: 0;
}
@media (max-width: 760px) { .constraints { grid-template-columns: 1fr; } }

/* Architecture diagram ------------------------------------------------------ */
.arch { display: flex; flex-direction: column; }
.arch__row {
  display: flex;
  align-items: stretch;
  gap: 12px;
}
.arch__layer {
  flex: 0 0 7.5rem;
  align-self: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink-2);
}
.arch__node {
  flex: 1 1 0;
  min-width: 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  font-size: 0.9375rem;
  line-height: 1.3;
  transition: background-color 0.4s ease, box-shadow 0.4s ease, color 0.4s ease, transform 0.5s var(--ease);
}
.arch__node--wide { flex-grow: 1.6; }
.arch__node small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 0.8125rem; }
.arch__node--accent { color: var(--accent-soft); }
.arch__node:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.07); }
.arch__node.is-active {
  background: rgba(255, 90, 31, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 90, 31, 0.7), 0 0 32px -8px rgba(255, 90, 31, 0.6);
  color: var(--ink);
}

.arch__link {
  position: relative;
  height: 36px;
  margin-left: calc(7.5rem + 16px);
  overflow: hidden;
}
.arch__link::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(var(--line-strong), rgba(255, 90, 31, 0.6));
}
.arch__link span {
  position: absolute;
  left: 50%;
  top: 0;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .arch__link span { animation: flow-down 1.6s var(--ease-in-out) infinite; }
  .arch__link:nth-of-type(4) span { animation-delay: 0.4s; }
  .arch__link:nth-of-type(6) span { animation-delay: 0.8s; }
}

.arch__caption {
  margin-top: clamp(24px, 3vw, 36px);
  padding-left: 20px;
  border-left: 2px solid var(--accent);
  color: var(--ink-2);
  font-size: 1.0625rem;
  max-width: 48rem;
  min-height: 3.2em;
}
.arch__caption strong { display: block; margin-bottom: 4px; }

@media (max-width: 760px) {
  .arch__row { flex-wrap: wrap; }
  .arch__layer { flex-basis: 100%; }
  .arch__node { flex: 1 1 40%; }
  .arch__link { margin-left: 0; height: 28px; }
}

/* Verified results ---------------------------------------------------------- */
.evidence__title {
  font-size: clamp(2rem, 1.2rem + 2.4vw, 3.5rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.045em;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.evidence__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px clamp(20px, 3vw, 48px);
}
.evidence__list li {
  position: relative;
  padding-top: 28px;
  border-top: 1px solid var(--line-strong);
}
.evidence__list li::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}
.evidence__list strong {
  display: block;
  font-size: clamp(1.375rem, 1.1rem + 0.9vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.evidence__list span { display: block; margin-top: 12px; color: var(--ink-2); }
@media (max-width: 960px) { .evidence__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .evidence__list { grid-template-columns: 1fr; } }

/* Operator flow ------------------------------------------------------------- */
.flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: clamp(28px, 4vw, 44px);
}
.flow__track {
  position: absolute;
  top: 9px;
  left: 9px;
  right: calc(20% - 9px);
  height: 2px;
  background: var(--line-strong);
}
.flow__progress {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.8s var(--ease);
}
.flow__step {
  position: relative;
  min-height: 44px; /* comfortable touch target even when the label is hidden on phones */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  text-align: left;
  color: var(--ink-3);
  transition: color 0.4s ease;
}
.flow__step:hover { color: var(--ink-2); }
.flow__dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 2px var(--line-strong);
  transition: box-shadow 0.4s ease, background-color 0.4s ease, transform 0.5s var(--ease);
}
.flow__name {
  font-size: clamp(1.125rem, 0.9rem + 1vw, 1.875rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}
.flow__step.is-done { color: var(--ink-2); }
.flow__step.is-done .flow__dot { box-shadow: inset 0 0 0 2px var(--accent); }
.flow__step[aria-selected="true"] { color: var(--ink); }
.flow__step[aria-selected="true"] .flow__dot {
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(255, 90, 31, 0.2), 0 0 24px var(--accent);
  transform: scale(1.1);
}

.flow__panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px clamp(24px, 4vw, 64px);
  padding-top: clamp(20px, 2.5vw, 32px);
  border-top: 1px solid var(--line);
}
.flow__label { font-family: var(--font-serif); font-style: italic; font-size: 1.25rem; color: var(--accent-soft); }
.flow__text { margin-top: 8px; font-size: 1.125rem; line-height: 1.5; }
@media (max-width: 640px) {
  /* Five labels don't fit side by side on a phone: show only the current step's name. */
  .flow { margin-bottom: 56px; }
  .flow__name { position: absolute; top: 36px; left: 0; font-size: 1.125rem; white-space: nowrap; opacity: 0; transition: opacity 0.4s ease; }
  .flow__step:last-of-type .flow__name { left: auto; right: 0; }
  .flow__step[aria-selected="true"] .flow__name { opacity: 1; }
  .flow__panel { grid-template-columns: 1fr; }
}

/* Application engineering --------------------------------------------------- */
.products { padding-top: clamp(80px, 12vh, 160px); padding-bottom: clamp(40px, 8vh, 120px); }
.products__stack {
  margin-bottom: clamp(24px, 3vw, 40px);
  color: var(--ink-3);
  font-size: 0.9375rem;
}
.products__stack span { color: var(--ink-2); }
.products__list { border-top: 1px solid var(--line-strong); }

.product { border-bottom: 1px solid var(--line-strong); }
.product__head { margin: 0; font-size: inherit; font-weight: inherit; }
.product__toggle {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 32px;
  width: 100%;
  padding: clamp(24px, 3vw, 40px) 0;
  text-align: left;
}
.product__name {
  font-size: clamp(1.5rem, 1rem + 2vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
  transition: transform 0.7s var(--ease), color 0.4s ease;
}
.product__toggle:hover .product__name { transform: translateX(clamp(6px, 1.2vw, 18px)); }
.product__domain {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.375rem);
  color: var(--ink-2);
}
.product__icon {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  transition: background-color 0.4s ease, transform 0.6s var(--ease);
}
.product__icon::before,
.product__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 1.5px;
  margin: -0.75px 0 0 -7px;
  background: var(--ink);
  transition: transform 0.6s var(--ease);
}
.product__icon::after { transform: rotate(90deg); }
.product__toggle[aria-expanded="true"] .product__icon { background: var(--accent); transform: rotate(180deg); }
.product__toggle[aria-expanded="true"] .product__icon::after { transform: rotate(0deg); }

.product__body { overflow: hidden; }
.product__inner {
  display: grid;
  gap: 24px;
  max-width: 52rem;
  padding-bottom: clamp(32px, 4vw, 48px);
  color: var(--ink-2);
  font-size: 1.125rem;
}
.product__themes { color: var(--ink-3); font-size: 0.9375rem; }

@media (max-width: 760px) {
  .product__toggle { grid-template-columns: minmax(0, 1fr) auto; }
  .product__domain { grid-column: 1; grid-row: 2; }
  .product__icon { grid-column: 2; grid-row: 1 / span 2; }
}

/* Drill-down */
.drill {
  padding: clamp(20px, 2.5vw, 32px);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px var(--line);
}
.drill__crumbs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; }
.drill__crumbs button {
  font-size: 0.9375rem;
  color: var(--accent-soft);
  transition: color 0.3s ease;
}
.drill__crumbs button:not(:last-child)::after { content: "/"; margin-left: 8px; color: var(--ink-3); }
.drill__crumbs button:hover:not(:disabled) { color: var(--ink); }
.drill__crumbs button:disabled { color: var(--ink); cursor: default; }

.drill__row {
  display: grid;
  grid-template-columns: minmax(6rem, 1fr) minmax(0, 2.4fr) 3.5rem 1rem;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  color: var(--ink);
  font-size: 0.9375rem;
}
button.drill__row:hover .drill__go { transform: translateX(4px); color: var(--accent); }
.drill__bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.drill__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  transform-origin: left;
}
.drill__value { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.drill__go { color: var(--ink-3); transition: transform 0.4s var(--ease), color 0.3s ease; }
.drill__note { margin-top: 12px; color: var(--ink-3); font-size: 0.8125rem; }

/* Capabilities: the secondary row reads quieter ---------------------------- */
.discipline--secondary h3 { font-size: clamp(1.5rem, 1rem + 1.6vw, 2.5rem); color: var(--ink-2); }

/* Lab ----------------------------------------------------------------------- */
.lab { padding-top: clamp(80px, 12vh, 160px); }
.lab .case { padding-bottom: clamp(60px, 10vh, 120px); }

/* Without JavaScript, demos that are drawn entirely by script would be empty boxes. */
html:not(.js) [data-lifecycle],
html:not(.js) [data-flow],
html:not(.js) [data-adapter],
html:not(.js) [data-quadtree] { display: none; }

/* ==========================================================================
   Phones: essentials first
   Each case shows its title, lead, main demo and results. Supporting detail sits
   behind a "Show more" button, and repeated small print is dropped.
   ========================================================================== */

.more-toggle { display: none; }

@media (max-width: 760px) {
  /* Collapsible detail (only when JS can open it again). */
  .js .case__detail:not(.show-more) .is-secondary { display: none; }

  .js .more-toggle {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    align-self: flex-start;
    padding: 12px 14px 12px 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.9375rem;
    color: var(--ink);
  }
  .more-toggle__icon {
    position: relative;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    transition: transform 0.5s var(--ease);
  }
  .more-toggle__icon::before,
  .more-toggle__icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 1.5px;
    margin: -0.75px 0 0 -5px;
    background: #fff;
    transition: transform 0.5s var(--ease);
  }
  .more-toggle__icon::after { transform: rotate(90deg); }
  .more-toggle[aria-expanded="true"] .more-toggle__icon { transform: rotate(180deg); }
  .more-toggle[aria-expanded="true"] .more-toggle__icon::after { transform: rotate(0deg); }

  /* Repeated small print: the lead sentence and the demos already carry this. */
  .case__text,
  .case__stack,
  .products__stack,
  .product__themes,
  .snapshot__hint,
  .snapshot__stack,
  .demo__hint,
  .demo__note,
  .discipline > p:not(.discipline__tools),
  .evidence__list span { display: none; }

  /* Calmer rhythm: less vertical travel between blocks. */
  .case__intro { min-height: 0; padding: 12vh 0 6vh; }
  .case--compact .case__intro { min-height: 0; }
  .case { padding-bottom: 64px; }
  .case__detail { gap: 48px; }
  .case__lede { margin-top: 24px; font-size: 1.125rem; }
  .section-head { margin-bottom: 40px; }
  .intro { padding-top: 80px; padding-bottom: 80px; }
  .snapshot { margin-top: 96px; }
  .discipline { padding: 22px 0; gap: 6px; }
  .discipline h3 { font-size: 1.625rem; }
  .discipline--secondary h3 { font-size: 1.375rem; }
  .evidence__list { gap: 20px; }
  .evidence__list li { padding-top: 16px; }
  .evidence__list strong { font-size: 1.25rem; }
  .principle { padding: 9vh 0; }
  .work, .products, .capabilities, .lab { padding-top: 72px; }
  .products { padding-bottom: 56px; }
}
