/* ViVi AI Lab
 * Light theme = the lightbox (dark-on-light PET reading).
 * Dark theme  = the reading room (the PET "hot iron" scale the logo is drawn in).
 * Accent colours are used only where something is being pointed at.
 */

:root {
  --paper: #F3F5F4;
  --paper-2: #E8ECEA;
  --ink: #0E1215;
  --graphite: #525A61;
  --rule: #D3D9D6;
  --uptake: #DE3F28;
  --uptake-ink: #BE321D;
  --star: #F2B233;
  --star-ink: #8F5E07;
  --band: #0E1215;
  --band-2: #1A2025;
  --band-ink: #E6EBE9;
  --band-dim: #8D979D;
  --band-rule: #2A3238;
  --scan-bg: #F3F5F4;
  --portrait-blend: multiply;
  --portrait-filter: none;

  --f-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --f-body: 'Source Serif 4', Georgia, serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 64px;
  --out: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0A0D10;
    --paper-2: #11161A;
    --ink: #E6EBE9;
    --graphite: #99A2A8;
    --rule: #252C31;
    --uptake: #FF5A3D;
    --uptake-ink: #FF7A61;
    --star: #F5BD45;
    --star-ink: #F5BD45;
    --band: #11161A;
    --band-2: #182026;
    --band-rule: #29323A;
    --scan-bg: #0A0D10;
    --portrait-blend: screen;
    --portrait-filter: invert(1);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0A0D10;
  --paper-2: #11161A;
  --ink: #E6EBE9;
  --graphite: #99A2A8;
  --rule: #252C31;
  --uptake: #FF5A3D;
  --uptake-ink: #FF7A61;
  --star: #F5BD45;
  --star-ink: #F5BD45;
  --band: #11161A;
  --band-2: #182026;
  --band-rule: #29323A;
  --scan-bg: #0A0D10;
  --portrait-blend: screen;
  --portrait-filter: invert(1);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .3s ease, color .3s ease;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--uptake); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.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: -48px; z-index: 300; padding: 8px 14px; background: var(--ink); color: var(--paper); font: 500 14px/1 var(--f-display); text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Type ---------- */
.eyebrow {
  font: 500 12px/1.2 var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--graphite);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ''; width: 7px; height: 7px; background: var(--uptake); border-radius: 50%; flex: none;
  animation: blip 2.8s ease-in-out infinite;
}
@keyframes blip { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--uptake) 45%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }

.display, .h2, .contact__title {
  font-family: var(--f-display);
  font-stretch: 116%;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.display { font-size: clamp(2.6rem, 5vw, 4.6rem); font-weight: 650; line-height: 0.98; }
.h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); font-weight: 620; line-height: 1.05; }
.h2 .dim { color: var(--graphite); }
.lede { font-size: clamp(1.08rem, 1.4vw, 1.24rem); line-height: 1.55; color: var(--graphite); max-width: 30em; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 22px;
  font: 560 15px/1 var(--f-display); font-stretch: 108%;
  text-decoration: none; border-radius: 3px;
  border: 1.5px solid var(--ink);
  transition: color .25s var(--out), border-color .25s var(--out), transform .2s var(--out);
  isolation: isolate;
}
.btn::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  transform: translateY(101%); transition: transform .35s var(--out);
}
.btn:hover::before { transform: translateY(0); }
.btn:active { transform: translateY(1px); }
.btn__arrow { display: inline-block; transition: transform .3s var(--out); }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid::before { background: var(--uptake); }
.btn--solid:hover { border-color: var(--uptake); color: #fff; }
.btn--line { color: var(--ink); }
.btn--line::before { background: var(--ink); }
.btn--line:hover { color: var(--paper); }
.btn--light { background: var(--band-ink); color: var(--band); border-color: var(--band-ink); }
.btn--light::before { background: var(--uptake); }
.btn--light:hover { border-color: var(--uptake); color: #fff; }
.btn--lg { height: 56px; padding: 0 28px; font-size: 16px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 100;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background-color .3s ease;
}
.nav.is-scrolled { border-bottom-color: var(--rule); }
.nav__inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { width: 32px; height: 32px; transition: transform .5s var(--out); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.brand__name { font: 650 18px/1 var(--f-display); font-stretch: 116%; letter-spacing: -0.02em; }
.brand__name span { font-weight: 450; color: var(--graphite); }
.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__links a { position: relative; font: 500 15px/1 var(--f-display); text-decoration: none; color: var(--graphite); transition: color .2s; }
.nav__links a:not(.nav__cta)::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -7px; height: 1.5px; background: var(--uptake);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--out);
}
.nav__links a:hover, .nav__links a.is-current { color: var(--ink); }
.nav__links a:hover::after, .nav__links a.is-current::after { transform: scaleX(1); }
.nav__links .nav__cta { color: var(--ink); border: 1.5px solid var(--ink); padding: 10px 16px; border-radius: 3px; transition: background-color .25s, color .25s; }
.nav__links .nav__cta:hover { background: var(--ink); color: var(--paper); }
.nav__tools { display: flex; align-items: center; gap: 4px; }
.theme-toggle, .nav__menu {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 50%; color: var(--ink); cursor: pointer;
  transition: background-color .2s;
}
.theme-toggle:hover, .nav__menu:hover { background: var(--paper-2); }
.theme-toggle svg { width: 20px; height: 20px; transition: transform .6s var(--out); }
.theme-toggle:hover svg { transform: rotate(180deg); }
.nav__menu svg { width: 20px; height: 20px; }
.nav__menu { display: none; }

/* ---------- Load & scroll motion ---------- */
.js .load-in { opacity: 0; transform: translateY(14px); animation: rise .9s var(--out) forwards; animation-delay: calc(var(--i, 0) * 90ms + 100ms); }
.js .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .06em; margin-bottom: -.06em; }
.js .w > span { display: inline-block; transform: translateY(105%); animation: word .9s var(--out) forwards; animation-delay: calc(var(--i) * 70ms + 120ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes word { to { transform: none; } }

.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--out), transform .8s var(--out); transition-delay: calc(var(--i, 0) * 90ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero {
  min-height: min(100svh, 940px);
  padding-top: calc(var(--nav-h) + clamp(32px, 6vh, 72px));
  padding-bottom: clamp(48px, 7vh, 88px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 4vw, 64px);
  align-items: center;
}
.hero__copy .display { margin-bottom: 28px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* Scan figure. The overlay's 760x672 box shares the canvas's 446x672 frame
 * on the left; callouts and the status readout use the space to the right. */
.scan { position: relative; width: 100%; max-width: 640px; justify-self: end; }
.scan__stage { position: relative; aspect-ratio: 760 / 672; }
.scan__canvas {
  position: absolute; left: 0; top: 0;
  width: calc(446 / 760 * 100%); height: 100%;
  background: var(--scan-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  opacity: 0; transition: opacity .8s ease;
}
.scan.is-loaded .scan__canvas { opacity: 1; }
.scan__overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }

.scan__status {
  position: absolute; left: calc(478 / 760 * 100%); top: 1.5%;
  display: grid; gap: 6px;
  font: 400 11.5px/1.3 var(--f-mono); color: var(--graphite);
}
.scan__row { display: flex; gap: 12px; }
.scan__k { width: 44px; text-transform: uppercase; letter-spacing: .06em; font-size: 10px; line-height: 15px; }
[data-angle] { color: var(--ink); font-variant-numeric: tabular-nums; }
.scan__state { color: var(--ink); display: inline-flex; align-items: center; gap: 7px; }
.scan__state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--graphite); }
.scan.is-reading .scan__state::before { background: var(--uptake); animation: blip 1.2s ease-in-out infinite; }

.scan__sweep { stroke: var(--uptake); stroke-width: 1.2; opacity: 0; }
.finding__box { fill: none; stroke: var(--uptake); stroke-width: 2; stroke-dasharray: 600; stroke-dashoffset: 600; }
.finding__box--flag { stroke: var(--star); stroke-width: 2.2; }
.finding__box--calm { stroke: var(--graphite); stroke-dasharray: 600; }
.finding__tag { font: 500 14px var(--f-mono); fill: var(--ink); opacity: 0; }
.finding__lead { fill: none; stroke: var(--graphite); stroke-width: 1.1; stroke-dasharray: 600; stroke-dashoffset: 600; }

.callouts { position: absolute; left: calc(478 / 760 * 100%); right: 0; top: 0; bottom: 0; }
.callout {
  position: absolute; top: var(--top); left: 0; right: 0;
  display: grid; grid-template-columns: 18px 1fr; column-gap: 8px;
  opacity: 0; transform: translateY(-50%);
}
.callout__id { grid-row: span 2; font: 500 11px/18px var(--f-mono); color: var(--graphite); }
.callout__site { font: 620 15px/18px var(--f-display); font-stretch: 106%; }
.callout__data { font: 500 12px/1.5 var(--f-mono); color: var(--uptake-ink); margin-top: 3px; }
.callout--flag .callout__data { color: var(--star-ink); }
.callout--flag .callout__data::before { content: '⚑ '; }
.callout--calm .callout__data { color: var(--graphite); }
.scan__caption { margin-top: 14px; font: 400 11px/1.4 var(--f-mono); color: var(--graphite); }
.scan__caption a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--rule); transition: color .2s, text-decoration-color .2s; }
.scan__caption a:hover { color: var(--ink); text-decoration-color: var(--uptake); }

.scan.is-reading .scan__sweep { animation: sweep 1.8s cubic-bezier(.45,.05,.35,1) both; }
.scan.is-reading .finding__box { animation: draw .7s var(--out) both; animation-delay: calc(var(--d) * 650ms + 500ms); }
.scan.is-reading .finding__tag { animation: fade .3s ease-out both; animation-delay: calc(var(--d) * 650ms + 900ms); }
.scan.is-reading .finding__lead { animation: draw .6s ease-in-out both; animation-delay: calc(var(--d) * 650ms + 950ms); }
.scan.is-reading .callout { animation: callout .5s var(--out) both; animation-delay: calc(var(--d) * 650ms + 1350ms); }
.finding, .callouts { transition: opacity .6s ease; }
.scan.is-clearing .finding, .scan.is-clearing .callouts { opacity: 0; }
@keyframes sweep { 0% { opacity: 0; transform: translateY(0); } 10% { opacity: .9; } 85% { opacity: .9; } 100% { opacity: 0; transform: translateY(672px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes callout { from { opacity: 0; transform: translate(-6px, -50%); } to { opacity: 1; transform: translate(0, -50%); } }

/* ---------- Sections ---------- */
.section { padding-top: clamp(88px, 12vw, 152px); padding-bottom: clamp(88px, 12vw, 152px); }
.section__head { max-width: 820px; margin-bottom: clamp(44px, 6vw, 72px); }
.section__intro { margin-top: 20px; color: var(--graphite); max-width: 36em; }

/* ---------- Why now: two figures ---------- */
#why { padding-bottom: clamp(40px, 6vw, 72px); }
.now { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.now__line { margin-top: 20px; color: var(--graphite); max-width: 26em; }
.stat { border-top: 1.5px solid var(--ink); padding-top: 22px; }
.stat__viz { display: block; width: 100%; max-width: 320px; height: auto; overflow: visible; margin-bottom: 14px; }
.stat__num { font: 650 clamp(2rem, 3.4vw, 2.8rem)/1 var(--f-display); font-stretch: 112%; letter-spacing: -0.02em; }
.stat__cap { margin-top: 10px; color: var(--graphite); font-size: 15.5px; line-height: 1.5; }
.stat__src { margin-top: 10px; font: 400 11.5px/1.4 var(--f-mono); color: var(--graphite); }
.stat__axis { stroke: var(--ink); stroke-width: 1.2; }
.stat__t { font: 400 10.5px var(--f-mono); fill: var(--graphite); text-anchor: middle; }
.stat__v { font: 500 12px var(--f-mono); fill: var(--ink); text-anchor: middle; }
.stat__v--hot { fill: var(--uptake-ink); }
.stat__bar { fill: color-mix(in srgb, var(--graphite) 38%, transparent); transform-box: fill-box; transform-origin: bottom; }
.stat__bar--hot { fill: var(--uptake); }
.stat__cell { fill: color-mix(in srgb, var(--graphite) 22%, transparent); }
.stat__cell--hot { fill: var(--uptake); }

.js .stat .stat__bar { transform: scaleY(0); transition: transform 1.1s var(--out); }
.js .stat .stat__bar--hot { transition-delay: .25s; }
.js .stat .stat__v { opacity: 0; transition: opacity .4s ease; }
.js .stat .stat__cell--hot { fill: color-mix(in srgb, var(--graphite) 22%, transparent); transition: fill .35s ease; transition-delay: calc(var(--n) * 22ms + 200ms); }
.js .stat.is-in .stat__bar { transform: none; }
.js .stat.is-in .stat__v { opacity: 1; transition-delay: .9s; }
.js .stat.is-in .stat__cell--hot { fill: var(--uptake); }

/* ---------- Principles + mini diagrams ---------- */
.principles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); }
.principle {
  padding: 18px 18px 26px;
  border: 1px solid var(--rule); border-radius: 6px;
  background: var(--paper);
  transition: border-color .3s, transform .4s var(--out), box-shadow .4s var(--out);
}
.principle:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--rule)); transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(0,0,0,.25); }
.principle h3 { font: 620 1.14rem/1.2 var(--f-display); font-stretch: 108%; letter-spacing: -0.01em; margin: 18px 0 8px; }
.principle p { color: var(--graphite); font-size: 15.5px; line-height: 1.5; }

.viz { display: block; width: 100%; height: auto; aspect-ratio: 240 / 140; background: var(--paper-2); border-radius: 4px; overflow: visible; }
.viz text { font-family: var(--f-mono); font-size: 9px; letter-spacing: .06em; fill: var(--graphite); text-anchor: middle; }
.viz * { animation-play-state: paused !important; }
.principle.is-playing .viz * { animation-play-state: running !important; }

/* 1: context flows in */
.viz__src rect { fill: var(--paper); stroke: var(--rule); }
.viz__path { fill: none; stroke: var(--rule); stroke-width: 1.2; stroke-dasharray: 3 4; }
.viz__dot { fill: var(--uptake); offset-rotate: 0deg; animation: travel 2.4s cubic-bezier(.5,0,.3,1) infinite; animation-delay: var(--t); opacity: 0; }
@keyframes travel { 0% { offset-distance: 0%; opacity: 0; } 10% { opacity: 1; } 80% { offset-distance: 100%; opacity: 1; } 90%, 100% { offset-distance: 100%; opacity: 0; } }
@supports not (offset-path: path('M0 0')) { .viz__dot { display: none; } }
.viz__hub { fill: var(--ink); }
.viz__hub-ring { fill: none; stroke: var(--uptake); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ring 2.4s ease-out infinite; animation-delay: 1.5s; opacity: 0; }
@keyframes ring { 0% { transform: scale(1); opacity: .8; } 60%, 100% { transform: scale(1.7); opacity: 0; } }
.viz .viz__hub-t { fill: var(--paper); font-family: var(--f-display); font-size: 15px; font-weight: 650; letter-spacing: 0; }
.viz__cap { font-size: 9px; }
.viz .viz__cap--l { text-anchor: start; }

/* 2: a measurement is taken */
.viz__frame { fill: var(--paper); stroke: var(--rule); }
.viz__g0 { stop-color: var(--ink); stop-opacity: .75; }
.viz__g1 { stop-color: var(--ink); stop-opacity: .3; }
.viz__g2 { stop-color: var(--ink); stop-opacity: 0; }
.viz__caliper { stroke: var(--uptake); stroke-width: 1.6; stroke-dasharray: 68; stroke-dashoffset: 68; animation: caliper 3.6s var(--out) infinite; }
.viz__tick { stroke: var(--uptake); stroke-width: 1.6; opacity: 0; animation: tick 3.6s linear infinite; }
.viz__tick--end { animation-name: tickEnd; }
.viz__readout { opacity: 0; animation: readout 3.6s var(--out) infinite; }
.viz__readout rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.viz .viz__fx { text-anchor: start; font-size: 8.5px; }
.viz .viz__num { text-anchor: start; fill: var(--ink); font-size: 13px; font-weight: 500; letter-spacing: 0; }
@keyframes caliper { 0%, 8% { stroke-dashoffset: 68; opacity: 1; } 34%, 86% { stroke-dashoffset: 0; opacity: 1; } 96%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes tick { 0%, 7% { opacity: 0; } 9%, 86% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes tickEnd { 0%, 33% { opacity: 0; } 35%, 86% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes readout { 0%, 38% { opacity: 0; transform: translateX(-6px); } 48%, 86% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: none; } }

/* 3: a statement links to its region */
.viz__line { fill: var(--rule); }
.viz__hl { fill: color-mix(in srgb, var(--uptake) 22%, transparent); stroke: var(--uptake); stroke-width: 1; opacity: 0; animation: hl 3.8s var(--out) infinite; }
.viz__blob { fill: var(--ink); opacity: .75; }
.viz__blob--faint { opacity: .25; }
.viz__link { fill: none; stroke: var(--uptake); stroke-width: 1.4; stroke-dasharray: 90; stroke-dashoffset: 90; animation: link 3.8s ease-in-out infinite; }
.viz__target { fill: none; stroke: var(--uptake); stroke-width: 1.6; stroke-dasharray: 104; stroke-dashoffset: 104; animation: target 3.8s var(--out) infinite; }
@keyframes hl { 0%, 6% { opacity: 0; } 18%, 86% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes link { 0%, 20% { stroke-dashoffset: 90; opacity: 1; } 44%, 86% { stroke-dashoffset: 0; opacity: 1; } 96%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes target { 0%, 42% { stroke-dashoffset: 104; opacity: 1; } 58%, 86% { stroke-dashoffset: 0; opacity: 1; } 96%, 100% { stroke-dashoffset: 0; opacity: 0; } }

/* 4: confidence drops below threshold, a flag goes up */
.viz__track { fill: var(--paper); stroke: var(--rule); }
.viz__fill { fill: var(--ink); transform-box: fill-box; transform-origin: left center; animation: conf 5s cubic-bezier(.6,0,.3,1) infinite; }
.viz__thresh { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 3; }
.viz__flag rect { fill: color-mix(in srgb, var(--star) 22%, var(--paper)); stroke: var(--star); }
.viz__flag path { fill: none; stroke: var(--star-ink); stroke-width: 1.4; stroke-linejoin: round; }
.viz .viz__flag text { fill: var(--star-ink); font-size: 10.5px; letter-spacing: .02em; font-weight: 500; }
.viz__flag { opacity: 0; animation: flag 5s var(--out) infinite; }
.viz__ok circle { fill: none; stroke: var(--graphite); stroke-width: 1.3; }
.viz__ok path { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.viz__ok { animation: ok 5s var(--out) infinite; }
@keyframes conf {
  0%, 22% { transform: scaleX(.86); fill: var(--ink); }
  40%, 76% { transform: scaleX(.34); fill: var(--star); }
  94%, 100% { transform: scaleX(.86); fill: var(--ink); }
}
@keyframes flag { 0%, 36% { opacity: 0; transform: translateY(4px); } 44%, 76% { opacity: 1; transform: none; } 84%, 100% { opacity: 0; transform: none; } }
@keyframes ok { 0%, 26% { opacity: 1; } 32%, 84% { opacity: 0; } 92%, 100% { opacity: 1; } }

/* ---------- Lab loop ---------- */
.lab { background: var(--band); color: var(--band-ink); padding: clamp(88px, 11vw, 144px) 0; }
.lab__inner { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.lab .eyebrow, .lab__lede { color: var(--band-dim); }
.lab .h2 { color: var(--band-ink); }
.lab__lede { margin-top: 20px; max-width: 28em; }
.lab__areas { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 8px; }
.lab__areas li {
  font: 500 12.5px/1 var(--f-mono); color: var(--band-ink);
  padding: 9px 12px; border: 1px solid var(--band-rule); border-radius: 999px;
  transition: border-color .25s, background-color .25s;
}
.lab__areas li:hover { border-color: var(--uptake); background: color-mix(in srgb, var(--uptake) 12%, transparent); }

.loop { position: relative; width: 100%; max-width: 520px; aspect-ratio: 1; justify-self: center; }
.loop__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.loop__ring { fill: none; stroke: var(--band-rule); stroke-width: 1.5; }
.loop__trail { fill: none; stroke: var(--uptake); stroke-width: 2.5; stroke-linecap: round; }
.loop__arrows path { fill: var(--band-dim); }
.loop__head { fill: var(--uptake); }
.loop__glow { fill: var(--uptake); opacity: .22; filter: blur(4px); }

.loop__node {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 8px;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--band-dim);
}
.loop__node svg {
  width: 58px; height: 58px; padding: 16px; box-sizing: border-box;
  border-radius: 50%; background: var(--band-2); border: 1.5px solid var(--band-rule);
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: background-color .45s var(--out), border-color .45s var(--out), color .45s, transform .45s var(--out);
}
.loop__node span {
  position: absolute; top: calc(100% + 10px); white-space: nowrap;
  font: 500 12px/1 var(--f-mono); letter-spacing: .02em;
  padding: 4px 6px; border-radius: 3px; background: var(--band);
  transition: color .45s;
}
.loop__node:hover svg { border-color: var(--band-dim); transform: scale(1.06); }
.loop__node.is-active { color: #fff; }
.loop__node.is-active svg { background: var(--uptake); border-color: var(--uptake); transform: scale(1.12); }
.loop__node.is-active span { color: var(--band-ink); }
.loop__node[data-node="0"] span { top: auto; bottom: calc(100% + 10px); }

.loop__center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 46%; text-align: center;
  transition: opacity .2s ease, transform .3s var(--out);
}
.loop__center.is-swapping { opacity: 0; transform: translate(-50%, calc(-50% + 6px)); }
.loop__title { font: 620 clamp(1.15rem, 2vw, 1.5rem)/1.15 var(--f-display); font-stretch: 110%; letter-spacing: -0.01em; color: var(--band-ink); }
.loop__text { margin-top: 10px; font-size: 15.5px; line-height: 1.45; color: var(--band-dim); }

/* ---------- Roadmap ---------- */
.stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; position: relative; }
.stages::before, .stages::after { content: ''; position: absolute; left: 0; right: 0; top: 7px; height: 1.5px; }
.stages::before { background: var(--rule); }
.stages::after {
  background: linear-gradient(90deg, var(--uptake), var(--uptake) 22%, transparent 34%);
  transform: scaleX(0); transform-origin: left; transition: transform 1.6s var(--out) .2s;
}
.stages.is-in::after { transform: scaleX(1); }
.stage { position: relative; padding-top: 38px; opacity: 0; transform: translateY(16px); transition: opacity .7s var(--out), transform .7s var(--out); transition-delay: calc(var(--i) * 160ms + 250ms); }
.stages.is-in .stage { opacity: 1; transform: none; }
.stage::before {
  content: ''; position: absolute; left: 0; top: 0; width: 16px; height: 16px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--ink); box-sizing: border-box;
}
.stage--now::before { background: var(--uptake); border-color: var(--uptake); }
.stage--now::after {
  content: ''; position: absolute; left: 0; top: 0; width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--uptake); animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }
.stage--later::before { border-style: dashed; border-color: var(--graphite); }
.stage__when { font: 500 12px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--graphite); margin-bottom: 12px; }
.stage--now .stage__when { color: var(--uptake-ink); }
.stage h3 { font: 620 1.3rem/1.15 var(--f-display); font-stretch: 110%; margin-bottom: 10px; }
.stage p { font-size: 16px; line-height: 1.5; color: var(--graphite); }
.stages__note { margin-top: clamp(40px, 6vw, 64px); font: 400 13px/1.5 var(--f-mono); color: var(--graphite); }

/* ---------- Team ---------- */
.team { border-top: 1px solid var(--rule); padding-top: clamp(88px, 12vw, 152px); padding-bottom: clamp(56px, 7vw, 88px); }
.founders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.founder__portrait { position: relative; aspect-ratio: 1; background: var(--paper-2); border-radius: 6px; overflow: hidden; margin-bottom: 18px; }
.founder__portrait img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: var(--portrait-blend); filter: var(--portrait-filter); }
.founder__portrait::after {
  content: ''; position: absolute; inset: 45% 0 0; pointer-events: none;
  background: linear-gradient(to top, var(--paper-2) 18%, transparent);
  opacity: 0; transition: opacity .35s var(--out);
}
.founder__tags { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.founder__tags li {
  font: 500 11.5px/1 var(--f-mono); padding: 7px 10px; border-radius: 999px;
  background: var(--paper); color: var(--ink); border: 1px solid var(--rule);
  opacity: 0; transform: translateY(8px);
  transition: opacity .35s var(--out), transform .45s var(--out);
}
.founder__tags li:nth-child(2) { transition-delay: 50ms; }
.founder__tags li:nth-child(3) { transition-delay: 100ms; }
.founder:hover .founder__portrait::after, .founder:focus-within .founder__portrait::after { opacity: 1; }
.founder:hover .founder__tags li, .founder:focus-within .founder__tags li { opacity: 1; transform: none; }
.founder__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.founder h3 { font: 620 1.3rem/1.15 var(--f-display); font-stretch: 110%; }
.founder__role { font: 500 12.5px/1.4 var(--f-mono); color: var(--uptake-ink); margin-top: 6px; }
.founder__links { display: flex; gap: 6px; }
.founder__links a {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  color: var(--graphite); border: 1px solid var(--rule);
  transition: color .2s, border-color .2s, background-color .2s, transform .3s var(--out);
}
.founder__links a:hover { color: #fff; background: var(--ink); border-color: var(--ink); transform: translateY(-2px); }
.founder__links svg { width: 14px; height: 14px; fill: currentColor; }
/* Touch screens have no hover: show the keywords all the time. */
@media (hover: none) {
  .founder__portrait::after { opacity: 1; }
  .founder__tags li { opacity: 1; transform: none; }
}

.affiliations { margin-top: clamp(64px, 8vw, 104px); padding-top: 32px; border-top: 1px solid var(--rule); display: grid; gap: 10px; }
.affiliations__label { font: 500 12px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--graphite); margin-bottom: 18px; text-align: center; }
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee var(--dur, 60s) linear infinite; }
.marquee--reverse .marquee__track { animation-direction: reverse; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__set { display: flex; gap: 72px; padding-right: 72px; }
@keyframes marquee { to { transform: translateX(-50%); } }
.logo { height: 60px; flex: none; display: grid; place-items: center; }
.logo img { max-height: 40px; width: auto; filter: grayscale(1); opacity: .75; }
.logo__word { font: 600 clamp(19px, 2vw, 24px)/1 var(--f-display); font-stretch: 112%; letter-spacing: -0.015em; color: var(--graphite); white-space: nowrap; transition: color .25s; }
.logo:hover .logo__word { color: var(--ink); }

/* ---------- Contact ---------- */
.contact { background: var(--band); color: var(--band-ink); padding: clamp(96px, 12vw, 160px) 0; overflow: hidden; }
.contact__inner { display: grid; justify-items: start; }
.contact .eyebrow { color: var(--band-dim); }
.contact__title { font-size: clamp(2.4rem, 6vw, 5rem); font-weight: 650; line-height: 1; max-width: 12em; }
.contact__who { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.contact__who li {
  font: 500 13px/1 var(--f-mono); padding: 10px 14px; border-radius: 999px;
  border: 1px solid var(--band-rule); color: var(--band-ink);
  opacity: 0; transform: translateY(8px); transition: opacity .5s var(--out), transform .5s var(--out), border-color .25s, background-color .25s;
  transition-delay: calc(var(--i) * 70ms + 300ms), calc(var(--i) * 70ms + 300ms), 0s, 0s;
}
.contact__inner.is-in .contact__who li { opacity: 1; transform: none; }
.contact__who li:hover { border-color: var(--uptake); background: color-mix(in srgb, var(--uptake) 14%, transparent); }
.contact__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 44px; }
.copy {
  display: inline-flex; align-items: center; gap: 14px; height: 56px; padding: 0 8px 0 20px;
  background: transparent; border: 1px solid var(--band-rule); border-radius: 3px; cursor: pointer;
  color: var(--band-ink); transition: border-color .25s;
}
.copy:hover { border-color: var(--band-dim); }
.copy__addr { font: 400 14px/1 var(--f-mono); }
.copy__state {
  font: 500 11px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em;
  padding: 10px 12px; border-radius: 2px; background: var(--band-2); color: var(--band-dim);
  min-width: 72px; text-align: center; transition: background-color .25s, color .25s;
}
.copy.is-copied .copy__state { background: var(--uptake); color: #fff; }

/* ---------- Footer ---------- */
.footer { padding: 32px 0; border-top: 1px solid var(--rule); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.footer__brand { display: flex; align-items: center; gap: 10px; font: 650 15px/1 var(--f-display); font-stretch: 112%; }
.footer__legal { font: 400 12px/1.5 var(--f-mono); color: var(--graphite); }
.footer__legal { margin-right: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .now { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .now__head { grid-column: 1 / -1; }
  .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 48px; }
  .stages::before, .stages::after { display: none; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .scan { justify-self: center; }
  .lab__inner { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  .nav__menu { display: grid; }
  .nav__links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    box-shadow: 0 16px 32px rgba(0,0,0,.08);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .25s var(--out), transform .25s var(--out), visibility 0s .25s;
  }
  .nav.is-open .nav__links { visibility: visible; opacity: 1; transform: none; transition: opacity .25s var(--out), transform .25s var(--out); }
  .nav__links a { padding: 14px 0; font-size: 17px; border-bottom: 1px solid var(--rule); }
  .nav__links a:not(.nav__cta)::after { display: none; }
  .nav__links .nav__cta { margin-top: 16px; text-align: center; border-bottom: 1.5px solid var(--ink); }

  /* Scan collapses to the image; callouts become a list under it. */
  .scan__stage { aspect-ratio: 446 / 672; width: min(320px, 82vw); margin: 0 auto; overflow: hidden; border-radius: 4px; }
  .scan__canvas { width: 100%; }
  .scan__overlay { width: calc(760 / 446 * 100%); }
  .finding__lead { display: none; }
  .scan__status { left: 10px; top: 10px; gap: 3px; font-size: 10px; }
  .scan__k { width: 38px; font-size: 9px; line-height: 13px; }
  .callouts { position: static; margin-top: 20px; display: grid; gap: 14px; }
  .callout { position: static; transform: none; }
  @keyframes callout { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
  .scan__caption { text-align: center; }

  .principles, .now { grid-template-columns: 1fr; }
  .stat__viz { max-width: 250px; }
  .stages { grid-template-columns: 1fr; }
  .loop { max-width: 300px; margin: 24px auto; }
  .loop__node svg { width: 46px; height: 46px; padding: 12px; }
  .loop__node span { font-size: 10.5px; white-space: normal; width: 92px; text-align: center; line-height: 1.25; }
  .loop__text { font-size: 14px; }
  .founders { grid-template-columns: 1fr; gap: 20px; }
  .founders { gap: 36px; }
  .founder__portrait { max-width: 360px; }
  .marquee__set { gap: 44px; padding-right: 44px; }
  .contact__actions { width: 100%; }
  .copy { width: 100%; min-width: 0; justify-content: space-between; padding-left: 14px; }
  .copy__addr { font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .load-in, .js .reveal, .stage, .contact__who li { opacity: 1; transform: none; }
  .js .w > span { transform: none; }
  .viz * { animation: none !important; }
  .viz__dot, .viz__hub-ring { display: none; }
  .viz__caliper, .viz__link, .viz__target { stroke-dashoffset: 0; }
  .viz__tick, .viz__readout, .viz__hl { opacity: 1; }
  .viz__fill { transform: scaleX(.34); fill: var(--star); }
  .viz__flag { opacity: 1; }
  .viz__ok { opacity: 0; }
  .marquee__track { animation: none; width: 100%; justify-content: center; }
  .marquee__set { flex-wrap: wrap; justify-content: center; row-gap: 12px; }
  .marquee__set[aria-hidden="true"] { display: none; }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .loop__glow { display: none; }
}
