/* Ayvid AI v7: one story from the scanned room to the team.
   Dark chapters (hero, hardware, circuit) share one blue-graphite night;
   light chapters (robots, work, healthcare) sit in a studio white.
   One accent, marigold, used sparingly in both. One type family, Archivo. */
:root {
  /* night: v5's blue-black and v1's graphite, reconciled */
  --night: #080c15;
  --night-2: #0e1420;
  --night-3: #161e2d;
  --night-line: rgba(196, 210, 236, 0.13);
  --frost: #e8ecf3;
  --frost-2: #a6b0c2;
  /* studio: v4 */
  --studio: #eff0ed;
  --paper: #fbfbf9;
  --fog: #e3e5e1;
  --ink: #1d2125;
  --ink-2: #50575e;
  --line: #d3d6d1;
  /* the one accent: the robot's bumper */
  --marigold: #f2b200;
  --marigold-hi: #ffc933;
  --marigold-deep: #c98f00;
  /* inside the PCB illustration only */
  --mask: #0e3a31;
  --mask-deep: #0a2c25;
  --mask-trace: #1b5244;
  --copper: #c8804b;
  --copper-hi: #f2b47c;
  --gold: #d9b766;
  --silk: #eef2ea;
  --silk-dim: #a9c2b7;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1240px;
  --gut: clamp(16px, 4vw, 48px);
  --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--night); }
body {
  margin: 0; background: var(--studio); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.55; font-stretch: 100%;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
h2, .h2like { font-size: clamp(1.9rem, 3.4vw, 2.75rem); line-height: 1.05; font-stretch: 125%; letter-spacing: -0.02em; font-weight: 600; }
h3 { font-size: 1.25rem; line-height: 1.25; font-stretch: 112%; letter-spacing: -0.005em; }
p { margin: 0; }
ul, ol, dl, dd, figure { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }
[data-theme="dark"] :focus-visible { outline-color: var(--marigold); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--marigold); color: var(--ink); padding: 10px 14px; border-radius: 6px; font-weight: 600; }
.skip:focus { top: 12px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
section[id] { scroll-margin-top: var(--nav-h); }

[data-theme="dark"] { background: var(--night); color: var(--frost); }

/* ---------- buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-stretch: 108%; font-size: 1rem; text-decoration: none;
  border: 1.5px solid transparent; transition: background-color .15s, border-color .15s, color .15s;
}
.btn-sm { min-height: 44px; padding: 0 18px; font-size: .95rem; }
.btn-accent { background: var(--marigold); color: var(--ink); }
.btn-accent:hover { background: var(--marigold-hi); }
.btn-line { border-color: currentColor; }
.btn-line:hover { background: var(--frost); color: var(--night); border-color: var(--frost); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.text-link {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; font-weight: 600; font-stretch: 108%;
  text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--marigold); text-underline-offset: 5px;
}
.lede { font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.55; max-width: 36em; }
.ticks { list-style: none; margin-top: 14px; }
.ticks li { position: relative; padding-left: 20px; margin-top: 6px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .78em; width: 9px; height: 2px; background: var(--marigold); }
.built { font-size: .95rem; color: var(--ink-2); }
[data-theme="dark"] .built { color: var(--frost-2); }

.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 16px 56px; align-items: end; margin-bottom: clamp(32px, 4vw, 52px); }
.sec-head p { color: var(--ink-2); max-width: 40em; }
[data-theme="dark"] .sec-head p { color: var(--frost-2); }

/* ---------- nav: one header, recoloured per chapter ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; transition: background-color .3s, border-color .3s, color .3s; border-bottom: 1px solid transparent; color: var(--frost); }
.nav-in { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); height: var(--nav-h); display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-stretch: 118%; font-size: 1.1rem; min-height: 44px; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-links a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; padding: 0 11px; text-decoration: none; font-size: .97rem; opacity: .78; }
.nav-links a:not(.btn):hover { opacity: 1; }
.nav-links .nav-cta { margin-left: 10px; }
.menu-btn { display: none; }
.nav.solid[data-theme="dark"], .nav.open[data-theme="dark"] { background: rgba(8, 12, 21, .86); border-bottom-color: var(--night-line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.nav[data-theme="light"] { color: var(--ink); background: rgba(239, 240, 237, .9); border-bottom-color: var(--line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.nav[data-theme="light"] :focus-visible { outline-color: var(--ink); }
.nav[data-theme="dark"] :focus-visible { outline-color: var(--marigold); }

/* ================= 1. hero: point cloud ================= */
.hero { position: relative; height: 230vh; height: 230svh; }
.hero-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  background: radial-gradient(70% 70% at 64% 46%, #0d1a38 0%, rgba(8, 12, 21, .6) 45%, transparent 75%), var(--night); }
#cloud { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(8, 12, 21, .84) 0%, rgba(8, 12, 21, .35) 36%, transparent 56%),
              linear-gradient(0deg, var(--night) 0%, transparent 18%); }
.hero-copy { position: absolute; left: max(var(--gut), calc((100vw - var(--wrap)) / 2 + var(--gut))); bottom: clamp(56px, 12vh, 120px); max-width: min(640px, 50vw); }
.hero-copy h1 { font-size: clamp(2.5rem, 5.4vw, 5rem); line-height: .98; font-stretch: 125%; font-weight: 650; letter-spacing: -0.035em; max-width: 11ch; margin-bottom: 24px; }
.b-title { font-size: clamp(2rem, 4vw, 3.6rem); line-height: 1.02; font-stretch: 125%; font-weight: 650; letter-spacing: -0.03em; margin-bottom: 18px; max-width: 13ch; }
.hero-copy .lede { color: #c7cfdd; margin-bottom: 28px; max-width: 30em; }
.hero-a { opacity: calc(1 - clamp(0, (var(--p, 0) - .04) * 5, 1)); transform: translateY(calc(clamp(0, (var(--p, 0) - .04) * 5, 1) * -24px)); }
.hero-b { opacity: clamp(0, (var(--p, 0) - .72) * 6, 1); pointer-events: none; }
.hero-cap { position: absolute; right: max(var(--gut), calc((100vw - var(--wrap)) / 2 + var(--gut))); bottom: 32px; font-size: .9rem; color: var(--frost-2); font-variant-numeric: tabular-nums; }
.hero-cap .cap-a { opacity: calc(1 - clamp(0, (var(--p, 0) - .2) * 5, 1)); }
.hero-cap .cap-b { position: absolute; right: 0; white-space: nowrap; opacity: clamp(0, (var(--p, 0) - .72) * 6, 1); }
.scroll-hint { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); font-size: .85rem; color: var(--frost-2); opacity: calc(.8 - var(--p, 0) * 6); }
.scroll-hint::after { content: ""; display: block; width: 1px; height: 28px; margin: 8px auto 0; background: linear-gradient(var(--frost-2), transparent); }
.no-webgl .hero-stage { background: radial-gradient(60% 60% at 66% 45%, #13285a 0%, #07102a 50%, var(--night) 85%); }
.no-webgl .hero-cap, .no-webgl .hero-b { display: none; }
.no-webgl .hero { height: 100vh; height: 100svh; }

/* stats */
.stats { padding: 8px 0 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; border-top: 1px solid var(--night-line); padding-top: 28px; padding-bottom: 8px; }
.stats-grid div { display: flex; flex-direction: column; }
.stats-grid dt { order: 2; font-size: .95rem; color: var(--frost); font-weight: 600; margin-top: 4px; }
.stats-grid dd { order: 1; font-size: clamp(1.7rem, 2.6vw, 2.4rem); font-stretch: 125%; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats-grid p { order: 3; font-size: .95rem; color: var(--frost-2); line-height: 1.45; max-width: 22em; }

/* ================= 2. hardware: exploded camera ================= */
.hw { position: relative; }
.hw-scroll { position: relative; height: 320vh; }
.hw-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  background: radial-gradient(110% 85% at 70% 48%, #121a2a 0%, var(--night) 62%); }
.hw-glow { position: absolute; left: 0; top: 0; width: 900px; height: 900px; margin: -450px 0 0 -450px; pointer-events: none; opacity: .5; will-change: transform, opacity;
  background: radial-gradient(closest-side, rgba(242, 178, 0, .16), rgba(242, 178, 0, .05) 45%, transparent 72%), radial-gradient(closest-side, rgba(120, 170, 230, .07), transparent 60%);
  mix-blend-mode: screen; }
#seq, .hw-poster { position: absolute; inset: 0; width: 100%; height: 100%; }
.hw-poster { object-fit: contain; object-position: right center; }
.js .hw-poster { visibility: hidden; }
.hw-copy { position: absolute; left: max(var(--gut), calc((100vw - var(--wrap)) / 2 + var(--gut))); top: 50%; transform: translateY(-46%); width: min(38vw, 480px); z-index: 3; }
.hw-copy h2 { font-size: clamp(2rem, 3.6vw, 3.2rem); line-height: 1.02; font-stretch: 125%; letter-spacing: -0.03em; }
.hw-copy p { margin-top: 20px; color: #c7cfdd; font-size: 1.08rem; max-width: 34ch; }
.scrub { position: absolute; left: max(var(--gut), calc((100vw - var(--wrap)) / 2 + var(--gut))); bottom: 30px; z-index: 3; display: flex; align-items: center; gap: 16px; color: var(--frost-2); font-size: .92rem; font-stretch: 90%; }
.scrub-track { width: 140px; height: 1px; background: var(--night-line); position: relative; }
.scrub-fill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: var(--marigold); }

.tags { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.tag { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity .35s ease; will-change: transform; }
.tag.on { opacity: 1; }
.tag i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--marigold); box-shadow: 0 0 0 4px rgba(242, 178, 0, .18); }
.tag i::after { content: ""; position: absolute; left: 3.5px; width: 1px; background: rgba(232, 236, 243, .45); }
.tag > div { position: absolute; width: max-content; max-width: 230px; font-size: .95rem; line-height: 1.35; }
.tag b { display: block; font-weight: 600; font-stretch: 110%; color: var(--frost); }
.tag span { display: block; color: var(--frost-2); font-stretch: 92%; }
.tag.up i::after { bottom: 8px; height: 64px; }
.tag.up > div { bottom: 80px; left: -2px; }
.tag.down i::after { top: 8px; height: 70px; }
.tag.down > div { top: 86px; left: -2px; }
.tag.right > div { left: auto; right: -2px; text-align: right; }
.tag[data-k="sensor"] i::after { height: 120px; }
.tag[data-k="sensor"] > div { bottom: 136px; }
.js.reduce .hw-scroll { height: auto; }
.js.reduce .hw-stage { position: relative; }
.js.reduce .scrub { display: none; }


/* ================= 3. circuit ================= */
.circuit { padding: clamp(72px, 9vw, 120px) 0; border-top: 1px solid var(--night-line); }
.pcb { position: relative; }
.pcb-board { position: relative; padding: clamp(20px, 3vw, 44px); border-radius: 18px;
  background: radial-gradient(120% 120% at 30% 20%, #10443a 0%, var(--mask) 45%, var(--mask-deep) 100%);
  box-shadow: inset 0 0 0 1px rgba(217, 183, 102, .25), 0 40px 80px -50px rgba(0, 0, 0, .8); }
.hole { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: var(--night); box-shadow: 0 0 0 5px var(--gold), 0 0 0 6px #8f7838; }
.h-tl { left: 18px; top: 18px; } .h-tr { right: 18px; top: 18px; } .h-bl { left: 18px; bottom: 18px; } .h-br { right: 18px; bottom: 18px; }
#circuit { width: 100%; max-width: min(960px, calc((100vh - 250px) * 1.407)); margin: 0 auto; height: auto; overflow: visible; }
.bgt { fill: none; stroke: var(--mask-trace); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bgv { fill: var(--mask); stroke: var(--mask-trace); stroke-width: 2; }
.tr { fill: none; stroke: var(--copper); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: .55; transition: opacity .25s, stroke .25s, stroke-width .25s; }
.tr.lit { opacity: 1; stroke: var(--copper-hi); stroke-width: 4; }
#circuit.focus .tr:not(.lit) { opacity: .2; }
.via { fill: var(--mask); stroke: var(--gold); stroke-width: 2.5; }
.pulse { fill: #ffe2c2; }
.pulse-halo { fill: var(--copper-hi); }
.blk { cursor: pointer; }
.blk .body { fill: #10211c; stroke: #2c5c4e; stroke-width: 1.5; transition: stroke .25s; }
.blk .pad { fill: var(--gold); opacity: .8; }
.blk .silk { fill: none; stroke: var(--silk); stroke-width: 1.5; opacity: .75; }
.blk .silk-fill { fill: var(--silk); opacity: .75; }
.blk .glass { fill: #071713; stroke: #4c6f64; stroke-width: 1.5; }
.blk text { font-family: var(--font); fill: var(--silk); }
.blk .ref { font-size: 13px; font-weight: 600; font-stretch: 80%; fill: var(--gold); letter-spacing: .02em; }
.blk .name { font-size: 16px; font-weight: 600; font-stretch: 108%; fill: var(--silk); }
.blk .outline { fill: none; stroke: var(--silk); stroke-width: 1; stroke-dasharray: 4 4; opacity: 0; transition: opacity .2s; }
.blk:hover .outline, .blk:focus .outline, .blk.on .outline { opacity: .9; }
.blk:hover .body, .blk:focus .body, .blk.on .body { stroke: var(--copper-hi); }
.blk:focus { outline: none; }
.blk:focus-visible .outline { opacity: 1; stroke: var(--marigold); stroke-width: 2; stroke-dasharray: none; }
.probe { margin-top: 14px; display: flex; gap: 16px; align-items: baseline; min-height: 64px; padding: 14px 18px; border: 1px solid var(--night-line); border-radius: 10px; background: var(--night-2); }
.probe-ref { font-weight: 600; font-stretch: 80%; font-size: .9rem; color: var(--marigold); white-space: nowrap; flex: none; min-width: 5ch; }
.probe-text { font-size: 1rem; line-height: 1.45; color: var(--frost); }
.chain { display: none; }
.cx-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px clamp(24px, 4vw, 48px); margin-top: clamp(40px, 5vw, 64px); }
.cx-notes article { border-top: 1px solid var(--night-line); padding-top: 18px; scroll-margin-top: 90px; }
.cx-notes h3 { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.cx-notes .ref, .chain .ref { font-weight: 600; font-stretch: 80%; font-size: .85rem; color: var(--marigold); }
.cx-notes p { color: var(--frost-2); }
.cx-notes article:target h3 { color: var(--marigold-hi); }

/* ================= 4. robots ================= */
.robots { padding: clamp(72px, 9vw, 120px) 0 clamp(40px, 5vw, 64px); }
.rb-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(16px, 4vw, 48px); align-items: center; }
.rb-copy h2 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.0; letter-spacing: -0.03em; max-width: 13ch; }
.rb-copy .lede { margin-top: 22px; color: var(--ink-2); }
.rb-copy .ticks { color: var(--ink-2); }
.rb-stage { position: relative; }
.rb-media { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--studio);
  -webkit-mask-image: radial-gradient(closest-side at 50% 50%, #000 72%, transparent 100%); mask-image: radial-gradient(closest-side at 50% 50%, #000 72%, transparent 100%); }
.rb-stage figcaption { position: relative; margin: -36px auto 0; max-width: 30em; display: flex; gap: 10px; align-items: baseline; font-size: .9rem; line-height: 1.45; color: var(--ink-2); }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--marigold); box-shadow: 0 0 0 2px var(--ink); transform: translateY(1px); }
.sees { padding-top: clamp(48px, 6vw, 88px); }
.sees-body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; background: var(--paper); border-radius: 22px; overflow: hidden; box-shadow: 0 1px 0 rgba(29, 33, 37, .06), 0 30px 60px -40px rgba(29, 33, 37, .35); }
.map-frame { position: relative; background: var(--fog); }
#map { width: 100%; aspect-ratio: 16 / 10; }
.map-toggle, .chip { min-height: 44px; padding: 0 16px; font: 600 .95rem var(--font); font-stretch: 105%; color: var(--ink); background: var(--paper); border: 1.5px solid var(--ink); border-radius: 999px; cursor: pointer; }
.map-toggle { position: absolute; right: 14px; bottom: 14px; }
.readout { padding: 24px; display: flex; flex-direction: column; justify-content: center; gap: 22px; border-left: 1px solid var(--line); }
.readout dt { font-size: .875rem; color: var(--ink-2); }
.readout dd { margin-top: 2px; font-size: 1.75rem; font-weight: 600; font-stretch: 112%; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }

/* ================= 5. work ================= */
.work { padding: clamp(72px, 9vw, 120px) 0 0; border-top: 1px solid var(--line); }

.show { margin-bottom: clamp(64px, 9vw, 128px); }
.show-stage { position: relative; background: var(--night); color: var(--frost); border-radius: 22px; overflow: hidden; }
.show h3 { font-size: 1rem; font-stretch: 100%; font-weight: 600; color: var(--ink-2); letter-spacing: 0; margin-bottom: 10px; }
.fact { font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1.04; font-stretch: 125%; font-weight: 650; letter-spacing: -0.03em; color: var(--ink); max-width: 15ch; }
.show-text > p:not(.fact):not(.built), .show-text .cols p:not(.fact):not(.built) { color: var(--ink-2); }
.show .built { margin-top: 0; }
.show .ticks { color: var(--ink-2); font-size: 1rem; }
.illus { position: absolute; left: 22px; bottom: 12px; font-size: .8rem; color: var(--frost-2); }
.show-wide .show-text.cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 20px clamp(24px, 4vw, 48px); margin-top: 28px; }
.show-wide .cols > div > p + p { margin-top: 10px; }
.show-wide .fact { max-width: 17ch; }
.show-split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px clamp(28px, 5vw, 64px); align-items: center; }
.show-split.flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); }
.show-split.flip .show-stage { order: 2; }
.show-split .show-text .fact { margin-bottom: 18px; }
.show-split .show-text > p + p { margin-top: 12px; }
.show-split .built { margin-top: 18px !important; }

/* prediction stage */
.stage-pred { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; min-height: 380px;
  background: radial-gradient(80% 100% at 20% 0%, #13203a 0%, var(--night) 70%); }
.pred-chart { position: relative; min-height: 340px; }
#pred { position: absolute; inset: 0; width: 100%; height: 100%; }
.pred-read { position: absolute; left: 22px; top: 20px; display: flex; flex-direction: column; }
.pred-k { font-size: .85rem; color: var(--frost-2); }
.pred-v { font-size: clamp(2.2rem, 4vw, 3.4rem); font-stretch: 125%; font-weight: 650; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--marigold); margin-top: 4px; }
.pred-n { font-size: .85rem; color: var(--frost-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.pred-board { align-self: center; padding: 24px 24px 24px 0; }
.pred-board img { width: 100%; border-radius: 10px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 30px 60px -30px rgba(0, 0, 0, .8); }
.pred-board figcaption { margin-top: 8px; font-size: .85rem; color: var(--frost-2); }

/* phones */
.phone { position: relative; width: 250px; flex: none; padding: 9px; border-radius: 40px; background: #05070c; box-shadow: inset 0 0 0 1.5px #2a3242, 0 40px 70px -30px rgba(0, 0, 0, .9); }
.phone::before { content: ""; position: absolute; top: 17px; left: 50%; width: 64px; height: 16px; margin-left: -32px; border-radius: 10px; background: #05070c; z-index: 2; }
.phone-screen { position: relative; border-radius: 31px; overflow: hidden; aspect-ratio: 540 / 1125; background: #111; }
.phone-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .6s ease; }
.phone-screen img.on { opacity: 1; }
.phone-sm { width: 220px; }
.phone-sm .phone-screen { aspect-ratio: 511 / 900; }

.stage-gym { padding: clamp(28px, 4vw, 48px); background: radial-gradient(70% 90% at 30% 40%, #1a2436 0%, var(--night) 70%); }
.gym { display: flex; gap: clamp(24px, 4vw, 48px); align-items: center; justify-content: center; }
.gym-side { min-width: 0; flex: 1; max-width: 280px; }
.gym-list { list-style: none; counter-reset: g; }
.gym-list button { display: flex; width: 100%; align-items: center; gap: 12px; min-height: 34px; padding: 4px 0; background: none; border: 0; color: var(--frost-2); font: 500 .95rem var(--font); text-align: left; cursor: pointer; }
.gym-list button::before { content: ""; width: 14px; height: 2px; background: var(--night-line); flex: none; transition: width .3s, background-color .3s; }
.gym-list button[aria-current="true"] { color: var(--frost); font-weight: 600; }
.gym-list button[aria-current="true"]::before { width: 26px; background: var(--marigold); }
.gym-list button:hover { color: var(--frost); }
.gym-ctl { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.gym-now { font-size: .88rem; color: var(--frost-2); }
.stage-gym .chip { background: transparent; color: var(--frost); border-color: rgba(232, 236, 243, .5); }

.stage-cricket { padding: clamp(16px, 3vw, 36px); background: radial-gradient(70% 90% at 70% 30%, #182236 0%, var(--night) 70%); }
.cs-host { --accent: var(--marigold); color: var(--frost); background: transparent !important; }
.cs-loading { color: var(--frost-2); padding: 40px 0; }
.cricket-showcase .cs-metric dt, .cricket-showcase .cs-badge { text-transform: none; letter-spacing: 0; }
.cricket-showcase .cs-metric dt { font-size: .85rem; }
.cricket-showcase .cs-badge { font-size: .72rem; }
.cricket-showcase .cs-tab { font-size: .9rem; min-height: 40px; padding: 0 16px; }
.cricket-showcase .cs-foot { font-size: .82rem; }
.cols-cricket { grid-template-columns: 1.3fr 1.4fr auto !important; align-items: start; }
.cricket-app figcaption { margin-top: 10px; font-size: .85rem; color: var(--ink-2); text-align: center; }
.cricket-app .phone-sm { width: 170px; padding: 7px; border-radius: 30px; }
.cricket-app .phone-sm .phone-screen { border-radius: 24px; }
.cricket-app .phone::before { top: 13px; width: 48px; height: 12px; margin-left: -24px; }

.stage-supply { background: #070b14; }
.stage-supply img { width: 100%; }
.nda { color: var(--ink-2); max-width: 60ch; }


/* robotics: past work, two renders */
.robotics { padding: 0 0 clamp(72px, 9vw, 120px); }
.robotics .show-robots { margin-bottom: clamp(48px, 6vw, 72px); }
.show-robots .rob-head { margin-bottom: 24px; }
.rob-label { font-size: 1rem; font-stretch: 100%; font-weight: 600; color: var(--ink-2); letter-spacing: 0; line-height: 1.25; margin-bottom: 10px; }
.rob-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px clamp(20px, 3vw, 32px); align-items: start; }
.rob-stage { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; background: radial-gradient(80% 90% at 50% 40%, #1a2436 0%, var(--night) 75%); }
.rob-stage img, .rob-stage video { width: 100%; height: 100%; object-fit: cover; }
.rob figcaption { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; }
.rob figcaption b { font-size: 1.15rem; font-stretch: 112%; }
.rob figcaption span { color: var(--ink-2); }
.rob .render-note { font-size: .85rem; margin-top: 4px; }
@media (max-width: 760px) { .rob-grid { grid-template-columns: 1fr; } }

/* ================= 6. healthcare (v4) ================= */
.health { padding: clamp(72px, 9vw, 120px) 0; border-top: 1px solid var(--night-line); }
.health[data-theme="dark"] .hx-lead { border-bottom-color: var(--night-line); }
.health[data-theme="dark"] .hx-lead p, .health[data-theme="dark"] .hx-item p, .health[data-theme="dark"] .hx-clip figcaption { color: var(--frost-2); }
.health[data-theme="dark"] .pill { border-color: rgba(232, 236, 243, .6); }
.health[data-theme="dark"] .hx-media { background: var(--night-2); box-shadow: 0 0 0 1px var(--night-line); }
.health[data-theme="dark"] .hx-media.stack { background: var(--night-line); }
.health[data-theme="dark"] .hx-item img { box-shadow: 0 0 0 1px var(--night-line); background: var(--night-2); }
.health[data-theme="dark"] .hx-item:nth-child(n+3) { border-top-color: var(--night-line); }
.hx-lead { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px clamp(24px, 4vw, 48px); align-items: start; padding-bottom: clamp(40px, 5vw, 64px); margin-bottom: clamp(40px, 5vw, 64px); border-bottom: 1px solid var(--line); }
.hx-lead h3 { font-size: clamp(1.6rem, 2.6vw, 2rem); font-stretch: 120%; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 12px; }
.hx-lead p { color: var(--ink-2); max-width: 40em; }
.hx-lead .built { margin-top: 14px; }
.hx-tag { margin-bottom: 12px; }
.hx-media { border-radius: 16px; overflow: hidden; background: var(--studio); }
.hx-media img { width: 100%; }
.hx-media.dark { background: #0f2427; }
.hx-media.stack { display: grid; gap: 1px; background: var(--line); }
.hx-clip { margin-top: 22px; }
.hx-video { width: 100%; max-width: 360px; aspect-ratio: 720 / 498; border-radius: 12px; background: #0f2427; object-fit: cover; }
.hx-clip figcaption { margin-top: 8px; font-size: .88rem; color: var(--ink-2); }
.pill { display: inline-block; font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1.5px solid var(--ink); }
.pill-sm { font-size: .75rem; padding: 1px 8px; }
.hx-more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px clamp(20px, 3vw, 36px); }
.hx-item img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: left top; border-radius: 10px; background: var(--studio); margin-bottom: 14px; box-shadow: 0 0 0 1px var(--line); }
.hx-item img.crop-right { object-position: 100% 8%; }
.hx-item h4 { margin: 0 0 6px; font-size: 1.1rem; font-stretch: 110%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.hx-item p { font-size: 1rem; color: var(--ink-2); }
.hx-item:nth-child(n+3) { padding-top: 18px; border-top: 1px solid var(--line); align-self: start; }
.hx-item:nth-child(-n+2) { grid-row: span 2; }

/* ================= 7. services, team, contact ================= */
.services, .team { padding: clamp(72px, 9vw, 120px) 0; border-top: 1px solid var(--line); }
.svc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px clamp(24px, 4vw, 56px); }
.svc h3 { font-size: 1.6rem; font-stretch: 125%; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.svc > p { margin-top: 12px; color: var(--ink-2); }
.svc ul { list-style: none; margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.svc li { padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.people { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; }
.ph { aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: var(--fog); margin-bottom: 16px; }
.ph img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.02); }
.people h3 { font-size: 1.2rem; font-stretch: 115%; }
.people p { color: var(--ink-2); font-size: 1rem; margin-top: 2px; }
.people a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: .95rem; text-decoration-thickness: 2px; text-decoration-color: var(--marigold); text-underline-offset: 5px; }

.contact { padding: clamp(72px, 9vw, 120px) 0; }
.contact-in { display: grid; grid-template-columns: minmax(0, 1.3fr) auto; gap: 32px 64px; align-items: end; }
.contact h2 { font-size: clamp(2.2rem, 4.6vw, 4rem); line-height: 1.0; letter-spacing: -0.035em; max-width: 13ch; }
.contact .contact-mail { flex-basis: 100%; margin-top: 4px; }
.contact-mail a { color: var(--frost); text-decoration-color: var(--marigold); text-underline-offset: 4px; display: inline-block; padding: 10px 0; }
.contact p { margin-top: 18px; color: var(--frost-2); max-width: 38em; }

.foot { padding: 28px 0 40px; font-size: .95rem; color: var(--frost-2); border-top: 1px solid var(--night-line); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; align-items: center; }
.foot strong { color: var(--frost); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; }
.foot-note { flex-basis: 100%; font-size: .88rem; max-width: 70em; }

/* ================= responsive ================= */
@media (max-width: 1020px) {
  .stage-pred { grid-template-columns: 1fr; }
  .pred-board { padding: 0 22px 24px; }
  .show-split, .show-split.flip { grid-template-columns: 1fr; }
  .show-split.flip .show-stage { order: 0; }
  .show-wide .show-text.cols { grid-template-columns: 1fr 1fr; }
  .show-wide .show-text.cols > div:first-child { grid-column: 1 / -1; }
  .cols-cricket { grid-template-columns: 1fr auto !important; }
}
@media (max-width: 900px) {
  .sec-head { grid-template-columns: 1fr; }
  .rb-in { grid-template-columns: 1fr; }
  .rb-stage { order: -1; max-width: 520px; width: 100%; margin: 0 auto; }
  .sees-body { grid-template-columns: 1fr; }
  #map { aspect-ratio: 4 / 5; }
  .readout { flex-direction: row; flex-wrap: wrap; gap: 16px 0; border-left: 0; border-top: 1px solid var(--line); padding: 18px 20px; }
  .readout div { width: 50%; }
  .readout dd { font-size: 1.35rem; }
  .cx-notes { grid-template-columns: 1fr; }
  .hx-lead { grid-template-columns: 1fr; }
  .hx-more { grid-template-columns: 1fr 1fr; }
  .hx-item:nth-child(-n+2) { grid-row: auto; }
  .svc-cols { grid-template-columns: 1fr; }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .contact-in { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 24px 20px; }
}
@media (max-width: 760px) {
  :root { --nav-h: 60px; }
  body { font-size: 16.5px; }
  .nav-in { gap: 10px; }
  .menu-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; margin-left: auto; font: 600 1rem var(--font); color: inherit; background: transparent; border: 1.5px solid currentColor; border-radius: 999px; cursor: pointer; }
  .nav-links { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gut) 20px; }
  .nav[data-theme="dark"] .nav-links { background: rgba(8, 12, 21, .97); border-bottom: 1px solid var(--night-line); }
  .nav[data-theme="light"] .nav-links { background: var(--studio); border-bottom: 1px solid var(--line); }
  .nav.open .nav-links { display: flex; }
  .nav-links a:not(.btn) { min-height: 50px; padding: 0; font-size: 1.1rem; opacity: 1; border-bottom: 1px solid var(--night-line); }
  .nav[data-theme="light"] .nav-links a:not(.btn) { border-bottom-color: var(--line); }
  .nav-links .nav-cta { margin: 16px 0 0; }

  /* hero */
  .hero-copy { left: var(--gut); right: var(--gut); max-width: none; bottom: 56px; }
  .hero-copy h1 { font-size: clamp(2.2rem, 10.5vw, 2.9rem); margin-bottom: 16px; }
  .hero-copy .lede { font-size: 1.02rem; margin-bottom: 22px; }
  .b-title { font-size: 2rem; }
  .hero-shade { background: linear-gradient(0deg, rgba(8, 12, 21, .97) 0%, rgba(8, 12, 21, .78) 42%, transparent 64%); }
  .hero-cap, .scroll-hint { display: none; }

  /* hardware */
  .hw-stage { background: radial-gradient(120% 70% at 50% 35%, #141c2b 0%, var(--night) 62%); }
  .hw-poster { object-position: center top; height: auto; top: 64px; aspect-ratio: 3 / 4; }
  .hw-copy { top: auto; bottom: 58px; transform: none; width: auto; left: var(--gut); right: var(--gut); }
  .hw-copy h2 { font-size: 1.75rem; }
  .hw-copy p { font-size: 1rem; margin-top: 10px; }
  .scrub { left: var(--gut); bottom: 18px; font-size: .875rem; }
  .scrub-track { width: 80px; }
  .tag > div { max-width: 150px; font-size: .875rem; }
  .tag span { display: none; }
  .tag.up i::after { height: 34px; }
  .tag.up > div { bottom: 48px; }
  .tag.down i::after { height: 34px; }
  .tag.down > div { top: 48px; }
  .tag[data-k="sensor"] i::after { height: 34px; }
  .tag[data-k="sensor"] > div { bottom: 48px; }
  .tag[data-k="compute"] i::after { top: 3.5px; left: auto; right: 8px; width: 16px; height: 1px; }
  .tag[data-k="compute"] > div { top: -10px; left: auto; right: 30px; text-align: right; max-width: 96px; }
  .tag[data-k="lens"] > div { right: auto; left: -40px; text-align: left; }

  /* circuit: a vertical trace */
  .pcb { display: none; }
  .chain { display: block; list-style: none; position: relative; padding-left: 34px; }
  .chain::before { content: ""; position: absolute; left: 12px; top: 22px; bottom: 22px; width: 3px; background: var(--copper); border-radius: 2px; }
  .chain li { position: relative; }
  .chain li + li { margin-top: 10px; }
  .chain li::before { content: ""; position: absolute; top: 24px; left: -22px; width: 22px; height: 3px; background: var(--copper); }
  .chain li::after { content: ""; position: absolute; top: 18px; left: -29px; width: 15px; height: 15px; border-radius: 50%; background: var(--mask); border: 3px solid var(--gold); }
  .chain a { display: grid; grid-template-columns: 46px 1fr; gap: 2px 8px; padding: 12px 14px; min-height: 44px; background: var(--mask-deep); border: 1px solid #2c5c4e; border-radius: 8px; text-decoration: none; color: var(--silk); }
  .chain a:hover { border-color: var(--copper-hi); }
  .chain .ref { grid-row: span 2; color: var(--gold); line-height: 1.7; }
  .chain b { font-weight: 600; font-size: 1.02rem; line-height: 1.3; font-stretch: 108%; }
  .chain span:not(.ref) { font-size: .92rem; line-height: 1.4; color: var(--silk-dim); }

  /* work */
  .show-wide .show-text.cols { grid-template-columns: 1fr; }
  .pred-chart { min-height: 280px; }
  .stage-gym { padding: 24px 16px; }
  .gym { flex-direction: column; gap: 18px; }
  .gym .phone { width: 210px; }
  .gym-list { display: none; }
  .gym-side { max-width: none; width: 100%; }
  .gym-ctl { margin-top: 0; justify-content: center; gap: 16px; }
  .stage-cricket { padding: 14px; }
  .cols-cricket { grid-template-columns: 1fr !important; }
  .cricket-app { justify-self: start; }
  .phone-sm { width: 190px; }

  /* health and the rest */
  .hx-more { grid-template-columns: 1fr; }
  .hx-item:nth-child(n+2) { padding-top: 18px; border-top: 1px solid var(--line); }
  .health[data-theme="dark"] .hx-item:nth-child(n+2) { border-top-color: var(--night-line); }
  .svc ul { grid-template-columns: 1fr; }
  .contact .btn { width: 100%; }
}
@media (max-height: 640px) and (max-width: 760px) { .hero-copy .lede, .hw-copy p { display: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero { height: 100vh; height: 100svh; }
  .hero-a { opacity: 1; transform: none; }
  .hero-b, .hero-cap .cap-b, .scroll-hint { display: none; }
  .hero-cap .cap-a { opacity: 1; }
  .tag, .btn, .nav, .tr, .phone-screen img { transition: none; }
}

/* Hero: no camera morph; the point cloud hands straight to the exploded camera */
.hero { height: 100vh; height: 100svh; }
.hero-a { opacity: 1; transform: none; }
.hero-cap .cap-a { opacity: 1; }

/* Hardware: static exploded view (no scroll scrub) */
.hw-scroll { height: auto; }
.hw-stage { position: relative; }
.scrub { display: none; }

/* Stats: each line stays on one line on wider screens */
@media (min-width: 900px) { .stats-grid p, .stats-grid dt { white-space: nowrap; } }
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; gap: 18px; } .stats-grid p, .stats-grid dt { white-space: nowrap; } }

/* Team: cards (as in the proposal deck) */
.people { gap: 24px; align-items: stretch; }
.people .tcard { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 36px 20px 32px; display: flex; flex-direction: column; align-items: center; text-align: center; box-shadow: 0 10px 28px rgba(29, 33, 37, .06); }
.people .tcard img { width: min(100%, 200px); aspect-ratio: 1; object-fit: cover; border-radius: 18px; background: var(--fog, #e3e5e1); margin-bottom: 22px; }
.people .tcard h3 { font-size: clamp(1.15rem, 1.6vw, 1.45rem); font-stretch: 112%; }
.people .tcard h3 a { color: inherit; text-decoration: none; min-height: 0; display: inline; font-weight: inherit; font-size: inherit; }
.people .tcard h3 a:hover, .people .tcard h3 a:focus-visible { text-decoration: underline; text-decoration-color: var(--marigold); text-underline-offset: 5px; }
.people .tcard .t-role { color: #8a6200; font-weight: 600; font-size: 1.02rem; margin-top: 8px; }
.people .tcard .t-tag { color: var(--ink-2); font-weight: 600; font-size: .95rem; margin-top: 6px; }
@media (max-width: 480px) { .people .tcard { padding: 22px 12px 20px; } .people .tcard .t-role { font-size: .92rem; } .people .tcard .t-tag { font-size: .85rem; } }

/* Services: Build only */
.svc-cols { grid-template-columns: 1fr; }
.svc ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1020px) { .svc ul { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .svc ul { grid-template-columns: 1fr; } }

/* Services: one list with a line each */
.svc-domains { color: var(--ink-2); font-size: 1.08rem; max-width: 60ch; margin: -8px 0 28px; }
.svc-list { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 48px); border-top: 2px solid var(--ink); }
.svc-list li { padding: 20px 0 22px; border-bottom: 1px solid var(--line); }
.svc-list h3 { font-size: 1.1rem; font-stretch: 112%; font-weight: 650; }
.svc-list p { color: var(--ink-2); margin-top: 6px; font-size: .98rem; line-height: 1.5; }
@media (max-width: 1020px) { .svc-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .svc-list { grid-template-columns: 1fr; } .svc-list li { padding: 16px 0; } }
@media (min-width: 1021px) { .svc-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Services: more air */
.svc-domains { margin: 4px 0 44px; font-size: 1.12rem; line-height: 1.6; }
.svc-list { gap: 0 clamp(40px, 6vw, 96px); }
.svc-list li { padding: 30px 0 32px; }
.svc-list h3 { font-size: 1.2rem; }
.svc-list p { margin-top: 10px; line-height: 1.6; max-width: 46ch; }
@media (max-width: 560px) { .svc-domains { margin-bottom: 32px; } .svc-list li { padding: 24px 0 26px; } }
