/* site.css — "Quiet Precision" design system for the portfolio prototype v2.
   Dark/light scenes that cross-fade on scroll, one aurora accent used as light only, system SF/Segoe type. No libraries. */

/* ---------- Tokens ---------- */
:root {
  --dark: #08090b; --dark-2: #101216; --dark-3: #171a1f;
  --light: #f5f4f1; --light-2: #ecebe7; --white: #ffffff;
  --ink: #0b0c0e; --ink-2: #4c5058; --ink-3: #6b7079;
  --snow: #f3f2ee; --snow-2: rgba(243, 242, 238, .68); --snow-3: rgba(243, 242, 238, .5);
  --a1: #8fe3cf; --a2: #8db4ff; --a3: #c7b8ff;
  --aurora: linear-gradient(100deg, var(--a1), var(--a2) 55%, var(--a3));
  --ok: #3fbf8f; --warn: #e2a948; --bad: #ef7a62;
  --display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Inter", "Helvetica Neue", Arial, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  --serif: "New York", "Iowan Old Style", "Charter", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --maxw: 1240px; --gutter: clamp(16px, 4.2vw, 56px);
  --ease: cubic-bezier(.22, .8, .16, 1); --spring: cubic-bezier(.2, 1.2, .3, 1);
  --r-lg: 28px; --r-md: 18px; --r-sm: 12px;
  /* scene-driven colours; JS flips data-tone on <html> as scenes enter */
  --bg: var(--dark); --fg: var(--snow); --fg-2: var(--snow-2); --fg-3: var(--snow-3);
  --line: rgba(255, 255, 255, .1); --card: rgba(255, 255, 255, .04); --card-line: rgba(255, 255, 255, .09);
  color-scheme: dark;
}
html[data-tone="light"] {
  --bg: var(--light); --fg: var(--ink); --fg-2: var(--ink-2); --fg-3: var(--ink-3);
  --line: rgba(11, 12, 14, .1); --card: var(--white); --card-line: rgba(11, 12, 14, .07);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.55 var(--text); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background-color .9s var(--ease), color .9s var(--ease);
}
img { display: block; max-width: 100%; height: auto; }
svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--a2); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(141, 180, 255, .35); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; letter-spacing: -.03em; line-height: 1.05; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 10px; z-index: 200; background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.grad { background: var(--aurora); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { font: 500 13px/1 var(--text); letter-spacing: .02em; color: var(--fg-3); }
.muted { color: var(--fg-2); }

/* ---------- Navigation ---------- */
.nav { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 100; width: min(calc(100% - 24px), 980px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 8px 8px 18px; border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 72%, transparent); border: 1px solid var(--line);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  transition: background-color .9s var(--ease), border-color .9s var(--ease), transform .5s var(--ease); }
.nav.hide { transform: translate(-50%, -120%); }
.mark { display: flex; align-items: center; gap: 10px; font: 600 15px var(--display); letter-spacing: -.01em; white-space: nowrap; }
.mark i { width: 22px; height: 22px; border-radius: 7px; background: var(--aurora); display: block; box-shadow: 0 0 18px rgba(141, 180, 255, .45); }
.links { display: flex; gap: 4px; }
.links a { padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--fg-2); transition: color .25s, background-color .25s; }
.links a:hover, .links a[aria-current="true"] { color: var(--fg); background: var(--card); }
.nav-cta { padding: 9px 16px; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: 14px; font-weight: 500; white-space: nowrap; transition: transform .3s var(--spring), background-color .9s, color .9s; }
.nav-cta:hover { transform: scale(1.04); }
.menu { display: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; place-items: center; }

/* ---------- Buttons & pills ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 22px; border-radius: 999px; font-weight: 500; font-size: 15.5px; border: 1px solid transparent; cursor: pointer; transition: transform .35s var(--spring), background-color .3s, border-color .3s, box-shadow .3s; }
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -12px rgba(141, 180, 255, .55); }
.btn-ghost { border-color: var(--line); color: var(--fg); background: transparent; }
.btn-ghost:hover { border-color: var(--fg-3); transform: translateY(-2px); }
.btn .arr { transition: transform .35s var(--spring); }
.btn:hover .arr, .link-arrow:hover .arr { transform: translateX(4px); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 500; border: 1px solid var(--line); color: var(--fg-2); background: var(--card); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.pill.live .dot { background: var(--ok); } .pill.ship .dot { background: var(--a2); box-shadow: 0 0 10px var(--a2); }
.pill.wip .dot { background: var(--warn); box-shadow: 0 0 10px var(--warn); } .pill.research .dot { background: var(--a3); box-shadow: 0 0 10px var(--a3); }
.link-arrow { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; font-size: 15px; }

/* ---------- Scenes & section heads ---------- */
.scene { position: relative; padding: clamp(96px, 13vw, 168px) 0; }
.head { max-width: 760px; margin-bottom: clamp(44px, 6vw, 80px); }
.head h2 { font-size: clamp(38px, 5.6vw, 72px); margin: 14px 0 20px; }
.head p { font-size: clamp(18px, 1.6vw, 21px); color: var(--fg-2); max-width: 58ch; }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; padding: 140px 0 0; overflow: hidden; isolation: isolate; }
.aurora { position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1; pointer-events: none; }
.aurora span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; animation: drift 22s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { width: 46vw; height: 46vw; left: 8%; top: 4%; background: radial-gradient(circle, rgba(143, 227, 207, .55), transparent 65%); }
.aurora span:nth-child(2) { width: 52vw; height: 52vw; right: 4%; top: -6%; background: radial-gradient(circle, rgba(141, 180, 255, .5), transparent 65%); animation-duration: 28s; animation-delay: -6s; }
.aurora span:nth-child(3) { width: 34vw; height: 34vw; left: 40%; top: 30%; background: radial-gradient(circle, rgba(199, 184, 255, .38), transparent 65%); animation-duration: 25s; animation-delay: -12s; }
@keyframes drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(6%, 8%, 0) scale(1.12); } }
.grain { position: absolute; inset: 0; z-index: -1; opacity: .06; pointer-events: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.hero-grid { position: absolute; inset: 0 0 30%; z-index: -1; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 72px 72px; mask-image: radial-gradient(ellipse 70% 55% at 50% 30%, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 30%, #000 20%, transparent 75%); opacity: .35; }
.hero-copy { text-align: center; max-width: 980px; margin: 0 auto; }
.hero h1 { font-size: clamp(46px, 8.4vw, 112px); letter-spacing: -.038em; line-height: .98; margin: 26px 0 26px; }
.hero h1 .serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.02em; }
.hero-lede { font-size: clamp(18px, 1.7vw, 22px); color: var(--fg-2); max-width: 46ch; margin: 0 auto 36px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.word { display: inline-block; opacity: 0; transform: translateY(.35em); filter: blur(8px); animation: word-in 1s var(--ease) forwards; animation-delay: calc(var(--i) * 70ms + 120ms); }
@keyframes word-in { to { opacity: 1; transform: none; filter: blur(0); } }
.fade-up { opacity: 0; transform: translateY(16px); animation: fade-up 1s var(--ease) forwards; animation-delay: var(--d, .6s); }
@keyframes fade-up { to { opacity: 1; transform: none; } }

/* Product constellation: real screens floating in perspective */
.stage { position: relative; height: clamp(400px, 44vw, 600px); margin-top: clamp(56px, 7vw, 96px); perspective: 1800px; }
.stage-inner { position: absolute; inset: 0; transition: transform .8s var(--ease); }
/* 2D layering only (z-index + scale): 3D translateZ made back cards miss clicks */
.shot { position: absolute; padding: 0; border-radius: 22px; overflow: hidden; background: #000; border: 1px solid rgba(255, 255, 255, .12); cursor: pointer;
  box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .85), 0 0 0 1px rgba(0, 0, 0, .4); transform: translateY(var(--y, 0)) rotate(var(--r, 0)) scale(var(--s, 1)); transition: transform 1.2s var(--ease), box-shadow .5s, border-color .5s; }
.shot:hover { border-color: rgba(255, 255, 255, .35); box-shadow: 0 60px 110px -40px rgba(0, 0, 0, .9), 0 0 0 1px rgba(141, 180, 255, .35), 0 0 40px -6px rgba(141, 180, 255, .35); }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.shot.s-main { width: 18%; aspect-ratio: 9 / 19.5; left: 41%; top: 0; z-index: 7; border-radius: 30px; }
.shot.s-xl { width: 15.5%; aspect-ratio: 9 / 19.5; left: 27%; top: 9%; --r: -6deg; z-index: 6; border-radius: 28px; }
.shot.s-xr { width: 15.5%; aspect-ratio: 9 / 19.5; left: 57.5%; top: 9%; --r: 6deg; z-index: 6; border-radius: 28px; }
.shot.s-rail { width: 30%; aspect-ratio: 16 / 10; left: 70%; top: 26%; --r: 3deg; --s: .96; z-index: 3; opacity: .9; }
.shot.s-fuel { width: 13%; aspect-ratio: 9 / 19.5; left: 13.5%; top: 22%; --r: -9deg; z-index: 4; border-radius: 26px; }
.shot.s-paws { width: 12%; aspect-ratio: 9 / 19.5; left: 1%; top: 34%; --r: -12deg; --s: .95; z-index: 3; border-radius: 26px; }
.stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 46%; background: linear-gradient(transparent, var(--bg)); z-index: 6; pointer-events: none; transition: background .9s; }

/* Proof bar */
.proof { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; z-index: 7; background: var(--bg); transition: background-color .9s var(--ease); }
.proof div { padding: 26px 20px; }
.proof div + div { border-left: 1px solid var(--line); }
.proof b { display: block; font: 600 clamp(22px, 2.3vw, 30px)/1.1 var(--display); letter-spacing: -.03em; }
.proof span { display: block; margin-top: 6px; font-size: 13.5px; color: var(--fg-2); line-height: 1.4; }

/* ---------- Work: feature cards ---------- */
.features { display: grid; gap: 24px; }
.feature { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: stretch; border-radius: var(--r-lg); overflow: hidden;
  background: var(--card); border: 1px solid var(--card-line); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 30px 60px -40px rgba(0, 0, 0, .25);
  cursor: pointer; transition: transform .6s var(--ease), box-shadow .6s var(--ease); }
.feature:hover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 50px 80px -40px rgba(0, 0, 0, .35); }
.feature.flip { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.feature.flip .f-media { order: -1; }
.f-copy { padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; gap: 18px; }
.f-copy h3 { font-size: clamp(32px, 3.6vw, 48px); }
.f-copy p { color: var(--fg-2); font-size: 17px; margin: 0; max-width: 46ch; }
.f-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.facts span { font-size: 13px; padding: 6px 11px; border-radius: 999px; background: var(--light-2); color: var(--ink-2); }
.f-media { position: relative; min-height: 420px; overflow: hidden; display: grid; place-items: center; padding: 40px 32px 0; }
.f-media img { transition: transform 1.2s var(--ease); }
.feature:hover .f-media img { transform: translateY(-8px) scale(1.015); }
.tint-x { background: radial-gradient(120% 90% at 50% 0%, #1b2440, #0b0e17 70%); }
.tint-f { background: radial-gradient(120% 90% at 50% 0%, #dff3ea, #c9e6da 70%); }
.tint-r { background: radial-gradient(120% 90% at 50% 0%, #142238, #070b14 70%); padding: 0; }
.tint-p { background: radial-gradient(120% 90% at 50% 0%, #f3ead9, #e7dcc5 70%); }
.tint-z { background: linear-gradient(135deg, #fde3e3, #e2e6ff); }
.tint-g { background: radial-gradient(120% 90% at 50% 0%, #1f1a2e, #0c0b12 70%); }
.device { width: min(62%, 300px); border-radius: 30px 30px 0 0; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .14); border-bottom: 0; align-self: end; }
.device.pair { width: min(44%, 230px); }
.devices { display: flex; gap: 18px; align-items: end; justify-content: center; width: 100%; height: 100%; }
.devices .device:first-child { transform: translateY(28px); }
.screen { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.panel-shot { width: 88%; align-self: end; border-radius: 14px 14px 0 0; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); border: 1px solid rgba(255, 255, 255, .14); border-bottom: 0; }

/* Smaller work tiles */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 24px; }
.tile { border-radius: var(--r-lg); overflow: hidden; background: var(--card); border: 1px solid var(--card-line); cursor: pointer; transition: transform .6s var(--ease), box-shadow .6s var(--ease); display: flex; flex-direction: column; }
.tile:hover { transform: translateY(-4px); box-shadow: 0 40px 70px -40px rgba(0, 0, 0, .35); }
.tile .t-media { height: 260px; display: grid; place-items: end center; padding: 28px 28px 0; overflow: hidden; }
.tile .t-copy { padding: 26px 30px 30px; display: grid; gap: 10px; }
.tile h3 { font-size: 28px; }
.tile p { margin: 0; color: var(--fg-2); font-size: 16px; }

/* ---------- Principles (sticky storytelling) ---------- */
.principles { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); }
.principles .sticky { position: sticky; top: 120px; align-self: start; }
.p-list { display: grid; gap: 18px; }
.principle { padding: 34px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--card-line); transition: border-color .5s, background-color .5s; position: relative; overflow: hidden; }
.principle::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(141, 180, 255, .12), transparent 60%); opacity: 0; transition: opacity .4s; }
.principle:hover::before { opacity: 1; }
.principle .n { font: 500 13px var(--mono); color: var(--fg-3); }
.principle h3 { font-size: 28px; margin: 14px 0 12px; }
.principle p { color: var(--fg-2); margin: 0; }
.principle .where { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.principle .where span { font-size: 12.5px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg-2); }

/* ---------- Field prototypes ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 14px; color: var(--fg-2); cursor: pointer; transition: all .3s var(--ease); }
.filters button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.protos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.proto { cursor: pointer; padding: 28px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--card-line); display: flex; flex-direction: column; gap: 12px; min-height: 250px; transition: opacity .4s var(--ease), transform .5s var(--ease), box-shadow .5s; }
.proto:hover { transform: translateY(-3px); box-shadow: 0 30px 60px -40px rgba(0, 0, 0, .35); }
.proto.out { display: none; }
.proto .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--light-2); color: var(--ink); }
.proto h3 { font-size: 21px; letter-spacing: -.02em; line-height: 1.2; }
.proto p { margin: 0; color: var(--fg-2); font-size: 15px; }
.proto .meta { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.proto .meta span { font-size: 12px; color: var(--fg-3); }
.proto .meta span + span::before { content: "·"; margin-right: 6px; }
.note { margin-top: 22px; font-size: 13.5px; color: var(--fg-3); }

/* ---------- Research ---------- */
.research { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 24px; }
.paper { display: grid; grid-template-columns: 170px 1fr; gap: 28px; padding: 32px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--card-line); transition: transform .6s var(--ease), border-color .4s; }
.paper:hover { transform: translateY(-4px); border-color: var(--fg-3); }
.paper img { border-radius: 6px; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .6); }
.paper h3 { font-size: 24px; line-height: 1.18; letter-spacing: -.02em; margin: 12px 0; }
.paper p { color: var(--fg-2); font-size: 15px; }
.ledger { padding: 32px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--card-line); display: flex; flex-direction: column; gap: 22px; }
.ledger h3 { font-size: 24px; letter-spacing: -.02em; }
.dots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 10px; }
.dots button { aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; padding: 0; transition: transform .3s var(--spring), box-shadow .3s; }
.dots button:hover, .dots button:focus-visible, .dots button[aria-pressed="true"] { transform: scale(1.25); }
.dots .pass { background: var(--ok); box-shadow: 0 0 14px rgba(63, 191, 143, .5); }
.dots .part { background: var(--warn); box-shadow: 0 0 14px rgba(226, 169, 72, .45); }
.dots .fail { background: var(--bad); box-shadow: 0 0 14px rgba(239, 122, 98, .45); }
.dots .none { background: transparent; border: 1.5px dashed var(--fg-3); }
.readout { min-height: 92px; padding: 18px 20px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .04); border: 1px solid var(--line); font-size: 15px; color: var(--fg-2); }
.readout b { color: var(--fg); font-weight: 600; display: block; margin-bottom: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--fg-3); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.quote { grid-column: 1 / -1; padding: clamp(32px, 5vw, 64px); border-radius: var(--r-lg); background: linear-gradient(135deg, rgba(143, 227, 207, .08), rgba(199, 184, 255, .08)); border: 1px solid var(--card-line); }
.quote blockquote { margin: 0; font: 400 italic clamp(28px, 3.6vw, 48px)/1.15 var(--serif); letter-spacing: -.02em; max-width: 26ch; }
.quote p { margin: 20px 0 0; color: var(--fg-2); max-width: 70ch; }
.posts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 8px; }
.post { padding: 24px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--card-line); display: flex; flex-direction: column; gap: 14px; min-height: 200px; transition: transform .5s var(--ease), border-color .4s; }
.post:hover { transform: translateY(-3px); border-color: var(--fg-3); }
.post h4 { font: 600 18px/1.25 var(--display); letter-spacing: -.015em; }
.post .src { margin-top: auto; font-size: 13px; color: var(--fg-3); display: flex; justify-content: space-between; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); }
.about .lead { font: 500 clamp(24px, 2.4vw, 32px)/1.3 var(--display); letter-spacing: -.02em; }
.about .bio p { color: var(--fg-2); font-size: 17.5px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 130px 1fr; gap: 18px; padding: 22px 0; border-top: 1px solid var(--line); }
.timeline .when { font-size: 14px; color: var(--fg-3); padding-top: 3px; }
.timeline h4 { font: 600 20px/1.25 var(--display); letter-spacing: -.015em; }
.timeline .org { color: var(--fg-2); font-size: 15px; margin: 2px 0 8px; }
.timeline p { color: var(--fg-2); font-size: 15px; margin: 0; }
.caps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: clamp(48px, 6vw, 80px); }
.cap { padding: 24px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--card-line); }
.cap h4 { font: 600 17px var(--display); margin-bottom: 8px; letter-spacing: -.01em; }
.cap p { margin: 0; font-size: 14.5px; color: var(--fg-2); }
.certs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }

/* ---------- Contact ---------- */
.contact { text-align: center; overflow: hidden; isolation: isolate; }
.contact h2 { font-size: clamp(46px, 8vw, 108px); letter-spacing: -.045em; line-height: .98; margin: 18px auto 28px; max-width: 13ch; }
.contact .aurora { top: 10%; height: 90%; opacity: .7; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 30px; }
footer { padding: 34px 0 44px; color: var(--fg-3); font-size: 13.5px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line); }

/* ---------- Case sheet (dialog) ---------- */
dialog.sheet { --fg: var(--ink); --fg-2: var(--ink-2); --fg-3: var(--ink-3); --line: rgba(11, 12, 14, .1); --card: var(--light); --card-line: rgba(11, 12, 14, .07); color-scheme: light;
  width: min(1100px, 100%); max-width: none; max-height: none; height: calc(100% - 28px); margin: 28px auto 0; padding: 0; border: 0; border-radius: 28px 28px 0 0;
  background: var(--white); color: var(--ink); overflow: hidden; box-shadow: 0 -40px 100px -20px rgba(0, 0, 0, .5); }
dialog.sheet[open] { animation: sheet-in .65s var(--ease); }
dialog.sheet.closing { animation: sheet-out .38s var(--ease) forwards; }
dialog.sheet::backdrop { background: rgba(5, 6, 8, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fade .5s var(--ease); }
@keyframes sheet-in { from { transform: translateY(70px); opacity: 0; } }
@keyframes sheet-out { to { transform: translateY(70px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.sheet-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: rgba(255, 255, 255, .82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid rgba(11, 12, 14, .06); }
.sheet-bar .crumbs { font-size: 13.5px; color: var(--ink-3); }
.x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--light-2); cursor: pointer; display: grid; place-items: center; transition: transform .3s var(--spring); }
.x:hover { transform: rotate(90deg); }
.case-hero { padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 72px) 0; }
.case-hero h2 { font-size: clamp(40px, 6vw, 76px); letter-spacing: -.04em; margin: 18px 0 16px; }
.case-hero .dek { font-size: clamp(19px, 1.9vw, 24px); color: var(--ink-2); max-width: 40ch; }
.case-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 34px 0 0; border-top: 1px solid rgba(11, 12, 14, .1); }
.case-meta div { padding: 16px 16px 0 0; font-size: 14.5px; }
.case-meta b { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 500; margin-bottom: 4px; }
.case-media { margin: clamp(28px, 4vw, 48px) clamp(20px, 5vw, 72px) 0; border-radius: 22px; overflow: hidden; display: grid; place-items: end center; padding: 44px 32px 0; min-height: clamp(320px, 42vw, 480px); }
.case-body { padding: clamp(32px, 5vw, 64px) clamp(20px, 5vw, 72px) clamp(56px, 7vw, 96px); display: grid; gap: clamp(36px, 5vw, 56px); }
.case-sec { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px 48px; }
.case-sec h3 { font-size: 22px; letter-spacing: -.02em; }
.case-sec p, .case-sec li { color: var(--ink-2); font-size: 17.5px; }
.case-sec ul { margin: 0; padding-left: 20px; }
.case-sec li { margin-bottom: 8px; }
.case-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.case-stats div { padding: 22px; border-radius: 16px; background: var(--light); }
.case-stats b { display: block; font: 600 30px/1.05 var(--display); letter-spacing: -.03em; color: var(--ink); }
.case-stats span { display: block; margin-top: 8px; font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.case-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.case-gallery img { border-radius: 14px; border: 1px solid rgba(11, 12, 14, .08); }
.case-gallery.wide { grid-template-columns: 1fr; }
.case-next { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 26px 0 0; border-top: 1px solid rgba(11, 12, 14, .1); }
.case-next button { border: 0; background: none; cursor: pointer; text-align: right; }
.case-next .t { display: block; font: 600 26px var(--display); letter-spacing: -.02em; margin-top: 4px; }

/* ---------- Reveal on scroll ---------- */
.js .rv { opacity: 0; transform: translateY(28px) scale(.985); transition: opacity 1s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0s); }
.js .rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aurora span { animation: none !important; }
  .word, .fade-up, dialog.sheet[open], dialog.sheet.closing { animation: none !important; opacity: 1; transform: none; filter: none; }
  .js .rv { opacity: 1; transform: none; transition: none; }
  .shot, .stage-inner, .feature, .tile { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .links { display: none; }
  .menu { display: grid; }
  .links.open { display: flex; position: fixed; top: 64px; left: 0; right: 0; flex-direction: column; padding: 10px; border-radius: 22px; background: color-mix(in srgb, var(--bg) 94%, transparent); border: 1px solid var(--line); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
  .links.open a { padding: 14px 16px; font-size: 17px; }
  .proof { grid-template-columns: repeat(2, 1fr); }
  .proof div:nth-child(odd) { border-left: 0; }
  .proof div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .proof div:last-child { grid-column: 1 / -1; }
  .feature, .feature.flip { grid-template-columns: minmax(0, 1fr); }
  .feature.flip .f-media { order: 0; }
  .f-media { min-height: 340px; }
  .principles, .research, .about { grid-template-columns: minmax(0, 1fr); }
  .principles .sticky { position: static; }
  .protos { grid-template-columns: repeat(2, 1fr); }
  .posts { grid-template-columns: repeat(2, 1fr); }
  .caps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { top: 10px; }
  .nav-cta { display: none; }
  .hero { padding-top: 120px; }
  .stage { height: 420px; }
  .shot.s-main { width: 40%; left: 30%; }
  .shot.s-xl { width: 34%; left: 2%; top: 10%; }
  .shot.s-xr { width: 34%; left: 64%; top: 10%; }
  .shot.s-fuel, .shot.s-paws, .shot.s-rail { display: none; }
  .tiles, .protos, .posts, .caps { grid-template-columns: minmax(0, 1fr); }
  .paper { grid-template-columns: 96px 1fr; gap: 18px; padding: 22px; }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .case-meta { grid-template-columns: repeat(2, 1fr); }
  .case-sec { grid-template-columns: minmax(0, 1fr); }
  .case-stats, .case-gallery { grid-template-columns: minmax(0, 1fr); }
  dialog.sheet { height: calc(100% - 12px); margin-top: 12px; border-radius: 22px 22px 0 0; }
  .dots { gap: 8px; }
}

/* AgentGuard ladder: the decision order as four quiet bars (deny always wins) */
.ag-ladder { display: grid; gap: 10px; width: min(78%, 360px); align-self: center; margin-bottom: 28px; }
.ag-ladder span { padding: 14px 18px; border-radius: 14px; font: 500 14px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: rgba(243, 242, 238, .78); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); }
.ag-ladder .deny { color: var(--bad); border-color: rgba(239, 122, 98, .35); background: rgba(239, 122, 98, .08); }
.ag-ladder .rev { color: var(--warn); border-color: rgba(226, 169, 72, .3); }
.ag-ladder .auto { color: var(--a1); border-color: rgba(143, 227, 207, .3); }
.case-media .ag-ladder { margin: 40px 0; }

.devices.three .device.pair { width: min(31%, 220px); }
.devices.three .device:nth-child(2) { transform: translateY(-18px); }
.devices.three .device:first-child { transform: translateY(14px); }
.case-gallery img { width: 100%; }
/* Step flow inside case sheets */
.flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; counter-reset: f; }
.flow li { counter-increment: f; padding: 18px; border-radius: 14px; background: var(--light); font-size: 15px; color: var(--ink-2); line-height: 1.45; }
.flow li::before { content: counter(f, decimal-leading-zero); display: block; font: 500 12px var(--mono); color: var(--ink-3); margin-bottom: 10px; }
.flow b { display: block; font: 600 17px var(--display); color: var(--ink); margin-bottom: 4px; letter-spacing: -.01em; }
/* Glyph panel for demos without public screenshots */
.glyph-panel { display: grid; place-items: center; gap: 18px; text-align: center; padding: 30px 20px 44px; color: rgba(243, 242, 238, .85); }
.case-media.tint-f .glyph-panel { color: var(--ink-2); }
.glyph-panel span { font-size: clamp(64px, 9vw, 120px); line-height: 1; background: var(--aurora); -webkit-background-clip: text; background-clip: text; color: transparent; }
.glyph-panel small { font: 500 13px var(--mono); letter-spacing: .04em; max-width: 46ch; opacity: .85; }
@media (max-width: 640px) { .flow { grid-template-columns: minmax(0, 1fr); } }
