/* ============================================================
   Darshil Kothari — portfolio · light editorial + WebGL story
   ============================================================ */
:root {
  --paper: #F2EFE9;
  --ink: #111114;
  --ink-2: #3a3a40;
  --muted: #6f6b64;
  --line: rgba(17,17,20,0.12);
  --line-2: rgba(17,17,20,0.2);
  --blue: #2F54FF;
  --orange: #FF5A1F;
  --mint: #0FB77A;
  --violet: #6B4DFF;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --g: clamp(18px, 4.5vw, 72px);
  --maxw: 1360px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  font-family: var(--sans); background: var(--paper); color: var(--ink);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; line-height: 1.5;
}
body.loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
img, canvas, video { display: block; max-width: 100%; }
::selection { background: var(--blue); color: #fff; }
.mono { font-family: var(--mono); }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
code { font-family: var(--mono); font-size: .9em; padding: 1px 6px; border-radius: 5px; background: rgba(17,17,20,0.07); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ---------- loader ---------- */
.loader { position: fixed; inset: 0; z-index: 200; background: var(--paper); display: grid; grid-template-rows: auto 1fr auto auto; padding: var(--g); }
.loader-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.loader-log { align-self: end; font-size: 12px; line-height: 1.9; color: var(--ink-2); margin-bottom: 20px; min-height: 120px; }
.loader-log .ok { color: var(--mint); }
.loader-count { font-size: clamp(90px, 22vw, 300px); font-weight: 600; letter-spacing: -0.07em; line-height: .82; font-variant-numeric: tabular-nums; }
.loader-bar { height: 2px; background: var(--line); margin-top: 18px; }
.loader-bar i { display: block; height: 100%; width: 0; background: var(--ink); }

/* ---------- world canvas + cursor ---------- */
#world { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
.cursor { position: fixed; left: 0; top: 0; z-index: 150; pointer-events: none; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1px solid var(--ink); border-radius: 50%; transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background .3s, border-color .3s; mix-blend-mode: difference; border-color: #fff; display: none; }
.cursor i { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #fff; }
.cursor.hover { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: #fff; }
@media (pointer: fine) { .cursor { display: block; } }

/* ---------- header ---------- */
.hdr { position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 18px var(--g); pointer-events: none; }
.hdr > * { pointer-events: auto; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; font-size: 15px; }
.logo-dk { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 12px; transition: background .4s, transform .5s var(--ease); }
.logo:hover .logo-dk { background: var(--blue); transform: rotate(-8deg); }
.chapter { font-size: 12px; display: flex; gap: 8px; padding: 8px 14px; border-radius: 99px; background: rgba(255,255,255,0.55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); overflow: hidden; }
.chapter #chNum { color: var(--blue); }
.ch-sep { color: var(--muted); }
.hdr-r { justify-self: end; display: flex; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-size: 13px; font-weight: 500; transition: background .3s, color .3s, border-color .3s, transform .3s var(--ease); white-space: nowrap; }
.pill:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill-ink:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.pill.mono { font-size: 11.5px; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.eq i { width: 2px; height: 3px; background: currentColor; border-radius: 1px; }
.sound-on .eq i { animation: eq .9s ease-in-out infinite; }
.sound-on .eq i:nth-child(2) { animation-delay: .15s; } .sound-on .eq i:nth-child(3) { animation-delay: .3s; } .sound-on .eq i:nth-child(4) { animation-delay: .45s; }
@keyframes eq { 50% { height: 12px; } }

/* chapter rail */
.rail { position: fixed; right: calc(var(--g) * .5); top: 50%; transform: translateY(-50%); z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.rail a { display: flex; align-items: center; justify-content: flex-end; gap: 10px; font-size: 10.5px; color: var(--muted); }
.rail a span { opacity: 0; transform: translateX(6px); transition: opacity .3s, transform .3s var(--ease); white-space: nowrap; }
.rail a:hover span, .rail a.on span { opacity: 1; transform: none; }
.rail a i { width: 18px; height: 2px; background: currentColor; opacity: .35; transition: width .4s var(--ease), opacity .3s, background .3s; }
.rail a.on { color: var(--ink); }
.rail a.on i { width: 34px; opacity: 1; background: var(--blue); }
body.on-blue .rail a, body.on-blue .rail a.on { color: #fff; }
body.on-blue .rail a.on i { background: #fff; }

/* ---------- chapters ---------- */
main { position: relative; z-index: 1; }
.ch { position: relative; padding: 18vh var(--g); max-width: calc(var(--maxw) + 2 * var(--g)); margin: 0 auto; }
.kicker { font-size: 12px; color: var(--muted); letter-spacing: .02em; margin-bottom: 22px; display: flex; align-items: center; gap: 10px; }
.kicker::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.h2 { font-size: clamp(38px, 5.6vw, 88px); font-weight: 600; letter-spacing: -0.05em; line-height: .98; max-width: 14ch; }
.h2 em { font-size: 1.06em; color: var(--blue); }
.lead { font-size: clamp(16px, 1.3vw, 19px); line-height: 1.6; color: var(--ink-2); max-width: 58ch; margin-top: 26px; }
.lead b { color: var(--ink); font-weight: 600; }
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split .wi { display: inline-block; will-change: transform; }

/* hero */
.hero { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: 110px; padding-bottom: 80px; }
.hero-meta { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: clamp(24px, 4vh, 48px); }
.dot-live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); margin-right: 8px; box-shadow: 0 0 0 0 rgba(15,183,122,.5); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 9px rgba(15,183,122,0); } 100% { box-shadow: 0 0 0 0 rgba(15,183,122,0); } }
.hero-title { font-size: clamp(52px, 10.2vw, 188px); font-weight: 600; letter-spacing: -0.065em; line-height: .88; }
.ht-line { display: block; overflow: hidden; padding-bottom: .06em; }
.ht-in { display: inline-block; }
.hero-title em { font-weight: 400; letter-spacing: -0.035em; padding-right: .06em; }
.swap { color: var(--muted); }
.swap.ship { color: var(--blue); }
.swap .c { display: inline-block; }
.hero-foot { display: grid; grid-template-columns: auto 1fr auto; gap: 28px 40px; align-items: end; margin-top: clamp(32px, 6vh, 64px); }
.hero-sub { font-size: clamp(15px, 1.15vw, 18px); line-height: 1.55; color: var(--ink-2); max-width: 52ch; }
.hero-sub b { color: var(--ink); font-weight: 600; }
.lens { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 99px; background: rgba(255,255,255,0.6); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.lens-k { font-size: 10.5px; color: var(--muted); padding: 0 8px 0 10px; }
.lens button { height: 32px; padding: 0 14px; border-radius: 99px; font-size: 13px; font-weight: 500; color: var(--ink-2); transition: background .3s, color .3s; }
.lens button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.cta { display: inline-flex; align-items: center; gap: 12px; height: 58px; padding: 0 12px 0 26px; border-radius: 99px; background: var(--ink); color: var(--paper); font-weight: 500; font-size: 15px; white-space: nowrap; transition: background .3s, transform .4s var(--ease); }
.cta-arr { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--paper); color: var(--ink); transition: transform .4s var(--ease); }
.cta:hover { background: var(--blue); }
.cta:hover .cta-arr { transform: rotate(-45deg); }
.scroll-cue { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scroll-cue i { width: 1px; height: 44px; background: linear-gradient(var(--ink), transparent); animation: cue 2s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* gap (scrub text) */
.gap { min-height: 170vh; padding-top: 0; padding-bottom: 0; }
.gap-sticky { position: sticky; top: 0; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.scrub { font-size: clamp(28px, 3.9vw, 62px); font-weight: 500; letter-spacing: -0.04em; line-height: 1.12; max-width: 24ch; }
.scrub .sw { opacity: .14; transition: opacity .25s linear; }
.scrub .sw.on { opacity: 1; }
.gap-labels { display: flex; justify-content: space-between; margin-top: 48px; font-size: 12px; color: var(--muted); max-width: 900px; }
.gap-labels small { opacity: .6; margin: 0 6px; }

/* story chapters */
.story { min-height: 120vh; display: flex; align-items: center; }
.story-in { position: relative; max-width: 700px; }
.year { position: absolute; right: -40vw; top: -12vh; font-size: clamp(120px, 22vw, 360px); font-weight: 700; letter-spacing: -0.08em; line-height: 1; color: transparent; -webkit-text-stroke: 1.5px rgba(17,17,20,0.12); pointer-events: none; user-select: none; }
.beats { list-style: none; margin-top: 28px; display: grid; gap: 12px; max-width: 60ch; }
.beats li { position: relative; padding-left: 22px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.beats li::before { content: ""; position: absolute; left: 0; top: .65em; width: 10px; height: 2px; background: var(--blue); }
.beats b { color: var(--ink); font-weight: 600; }
.only-eng, .only-lead { display: none; }
.lens-engineer .only-eng, .lens-leader .only-lead { display: block; animation: fadeUp .6s var(--ease) both; }
.lens-recruiter .only-lead { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 26px; }
.chips span { font-size: 11.5px; padding: 6px 11px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.45); }
.pull { margin-top: 26px; font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.2vw, 32px); line-height: 1.25; color: var(--ink); max-width: 30ch; padding-left: 20px; border-left: 2px solid var(--blue); }
.run-row { display: flex; flex-wrap: wrap; gap: 10px; }
.run { margin-top: 30px; display: inline-flex; align-items: center; gap: 12px; height: 50px; padding: 0 22px 0 16px; border-radius: 99px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 500; transition: background .3s, transform .4s var(--ease); }
.run:hover { background: var(--blue); transform: translateY(-2px); }
.run-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--mint); position: relative; }
.run-dot::after { content: ""; position: absolute; left: 7px; top: 5px; border-left: 7px solid #fff; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.run-row .run { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.run-row .run:first-child { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.run-row .run:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

/* impact */
.impact { min-height: 100vh; }
.nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 60px; border-top: 1px solid var(--line-2); }
.num { padding: 28px 24px 28px 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.num + .num { padding-left: 24px; }
.num:last-child { border-right: 0; }
.num .n { font-size: clamp(48px, 6.4vw, 108px); font-weight: 600; letter-spacing: -0.06em; line-height: .9; font-variant-numeric: tabular-nums; }
.num .n .arrow { color: var(--blue); font-weight: 300; margin: 0 .06em; }
.num .l { font-size: 14px; color: var(--ink-2); line-height: 1.5; max-width: 26ch; }
.proof { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 48px; }
.proof-i { padding: 20px; border-radius: 18px; background: rgba(255,255,255,0.6); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 6px; transition: transform .5s var(--ease), box-shadow .5s; }
.proof-i:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -20px rgba(17,17,20,0.25); }
.proof-i span { font-size: 11px; color: var(--muted); }
.proof-i b { font-size: 20px; letter-spacing: -0.03em; font-weight: 600; }
.proof-i small { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }

/* thinking (horizontal) */
.thinking { max-width: none; padding: 0; }
.h-pin { height: 100vh; display: flex; align-items: center; overflow: hidden; }
.h-track { display: flex; gap: 20px; padding-right: var(--g); will-change: transform; }
.h-head { flex: none; width: min(460px, 80vw); padding: 0 40px 0 var(--g); }
.h-hint { font-size: 12px; color: var(--muted); margin-top: 26px; }
.note { flex: none; width: min(420px, 78vw); min-height: 360px; padding: 30px; border-radius: 24px; background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; box-shadow: 0 30px 60px -40px rgba(17,17,20,0.35); transition: transform .5s var(--ease); }
.note:hover { transform: translateY(-6px) rotate(-.6deg); }
.note > span { font-size: 11.5px; color: var(--muted); }
.note p { font-size: clamp(21px, 1.8vw, 27px); line-height: 1.28; letter-spacing: -0.025em; font-weight: 500; flex: 1; }
.note p em { color: var(--violet); font-size: 1.08em; }
.note small { font-size: 11.5px; color: var(--muted); }
.note-cta { background: var(--ink); color: var(--paper); }
.note-cta p em { color: #9fb2ff; }
.note-cta small, .note-cta > span { color: #a9a9b3; }
.h-thumb { position: absolute; left: var(--g); right: var(--g); bottom: 40px; height: 2px; background: var(--line); }

/* ---------- lab ---------- */
.lab { max-width: calc(1480px + 2 * var(--g)); }
.lab-head { margin-bottom: 48px; }
.lab-head .h2 { max-width: 16ch; }
.lab-grid { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.tabs { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 6px; }
.tabs button { display: flex; align-items: center; gap: 14px; text-align: left; padding: 12px 14px; border-radius: 16px; border: 1px solid transparent; transition: background .3s, border-color .3s, transform .4s var(--ease); }
.tabs button b { font-family: var(--mono); font-size: 11px; font-weight: 500; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: rgba(17,17,20,0.07); flex: none; transition: background .3s, color .3s; }
.tabs button span { display: flex; flex-direction: column; font-weight: 600; font-size: 14.5px; letter-spacing: -0.02em; }
.tabs button small { font-weight: 400; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.tabs button:hover { background: rgba(255,255,255,0.5); transform: translateX(3px); }
.tabs button[aria-selected="true"] { background: #fff; border-color: var(--line); box-shadow: 0 14px 30px -22px rgba(17,17,20,0.4); }
.tabs button[aria-selected="true"] b { background: var(--blue); color: #fff; }
.panel { animation: panelIn .6s var(--ease) both; min-width: 0; }
.panel[hidden] { display: none; }
@keyframes panelIn { from { opacity: 0; transform: translateY(14px) scale(.99); } }
.ctx { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.ctx p { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,0.65); border: 1px solid var(--line); }
.ctx b { color: var(--ink); }
.ctx .val { background: #E3F6EC; border-color: rgba(15,183,122,0.3); }
.ctx .val b { color: #07744c; }

/* ---------- contact ---------- */
.contact { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; color: #fff; }
.contact .kicker { color: rgba(255,255,255,0.7); }
.contact-title { font-size: clamp(52px, 9vw, 160px); font-weight: 600; letter-spacing: -0.065em; line-height: .9; max-width: 11ch; }
.contact-title em { color: #fff; }
.contact-row { display: flex; justify-content: space-between; align-items: end; gap: 30px; flex-wrap: wrap; margin-top: 56px; }
.big-link { display: inline-flex; align-items: center; gap: 18px; font-size: clamp(22px, 3vw, 44px); font-weight: 500; letter-spacing: -0.03em; border-bottom: 2px solid rgba(255,255,255,0.4); padding-bottom: 8px; transition: border-color .3s; }
.big-link:hover { border-color: #fff; }
.big-link .cta-arr { background: #fff; color: var(--blue); width: 48px; height: 48px; }
.big-link:hover .cta-arr { transform: rotate(45deg); }
.contact-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-w { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.4); color: #fff; }
.pill-w:hover { background: #fff; color: var(--blue); border-color: #fff; }
.foot { margin-top: 80px; font-size: 11.5px; line-height: 1.9; color: rgba(255,255,255,0.7); }
body.on-blue .hdr .chapter { background: rgba(255,255,255,0.14); color: #fff; border-color: rgba(255,255,255,0.3); }
body.on-blue .hdr .chapter #chNum { color: #fff; }
body.on-blue .logo { color: #fff; }
body.on-blue .logo-dk { background: #fff; color: var(--blue); }

/* ---------- live site health ---------- */
.hud { position: fixed; left: var(--g); bottom: 20px; z-index: 120; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.hud-pill { display: inline-flex; align-items: center; gap: 10px; height: 38px; padding: 0 14px; border-radius: 99px; background: rgba(255,255,255,0.7); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-size: 11.5px; color: var(--ink); transition: background .3s, border-color .3s; }
.hud-pill:hover { border-color: var(--ink); }
.hud-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(15,183,122,.18); transition: background .3s, box-shadow .3s; }
.hud-dot.bad { background: #E0282E; box-shadow: 0 0 0 3px rgba(224,40,46,.2); animation: live 1s infinite; }
.hud-fps { color: var(--muted); font-variant-numeric: tabular-nums; }
.hud-panel { width: min(380px, calc(100vw - 2 * var(--g))); padding: 18px; border-radius: 20px; background: rgba(255,255,255,0.88); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 30px 70px -30px rgba(17,17,20,0.4); animation: panelIn .45s var(--ease) both; }
.hud-panel[hidden] { display: none; }
.hud-h { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.hud-h b { font-size: 15px; letter-spacing: -0.02em; }
.hud-h span { font-size: 10.5px; color: var(--muted); }
.hud-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hud-grid div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: rgba(17,17,20,0.04); }
.hud-grid span { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.hud-grid b { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.hud-grid b.bad { color: #E0282E; }
.hud-log { margin-top: 12px; font-size: 11px; line-height: 1.6; max-height: 170px; overflow-y: auto; color: var(--ink-2); }
.hud-log div { animation: fadeUp .35s var(--ease) both; margin-bottom: 4px; }
.hud-log .t { display: inline-block; min-width: 50px; font-weight: 500; }
.hud-log .detect { color: #E0282E; } .hud-log .tool { color: var(--blue); } .hud-log .rca { color: #b7791f; } .hud-log .ok { color: #07744c; }
.hud-log .m { color: var(--muted); }
.hud-act { display: flex; gap: 8px; margin-top: 12px; }
.hud-btn { height: 36px; padding: 0 16px; border-radius: 99px; font-size: 13px; font-weight: 500; background: var(--ink); color: var(--paper); transition: background .3s, transform .3s var(--ease); }
.hud-btn:hover { background: var(--blue); }
.hud-btn.danger { background: #E0282E; color: #fff; }
.hud-btn.danger:hover { background: #b81d22; }
.hud-btn:disabled { opacity: .4; cursor: not-allowed; }
/* incident mode: the page itself degrades */
body.incident main .ch h2, body.incident .hero-title { animation: glitch .18s steps(2) infinite; }
body.incident main .lead, body.incident .hero-sub { filter: blur(.7px); }
body.incident .chips span, body.incident .proof-i { transform: rotate(var(--tilt, -1.5deg)); transition: transform .4s; }
@keyframes glitch { 0% { transform: translate(0,0); text-shadow: 2px 0 #E0282E, -2px 0 var(--blue); } 50% { transform: translate(-2px,1px); text-shadow: -2px 0 #E0282E, 2px 0 var(--blue); } 100% { transform: translate(1px,-1px); text-shadow: none; } }
body.on-blue .hud-pill { background: rgba(255,255,255,0.9); }

/* ---------- TL;DR ---------- */
.tldr { margin: auto; max-width: 640px; width: calc(100% - 32px); background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 24px; padding: 34px; box-shadow: 0 40px 120px -30px rgba(17,17,20,0.45); }
.tldr::backdrop { background: rgba(242,239,233,0.6); backdrop-filter: blur(12px); }
.tldr[open] { animation: panelIn .5s var(--ease) both; }
.tldr h3 { font-size: 26px; font-weight: 600; letter-spacing: -0.035em; margin-bottom: 18px; }
.tldr ul { list-style: none; display: grid; gap: 10px; font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
.tldr li { padding-left: 18px; position: relative; }
.tldr li::before { content: ""; position: absolute; left: 0; top: .7em; width: 8px; height: 2px; background: var(--blue); }
.tldr b { color: var(--ink); }
.tldr .close { position: absolute; top: 16px; right: 18px; font-size: 11px; color: var(--muted); }
.tldr-cta { display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap; }

/* ============================================================
   DEVICE (dark demo screens) — scoped tokens
   ============================================================ */
.device {
  --panel: rgba(255,255,255,0.03); --panel-2: rgba(255,255,255,0.06);
  --text: #fff; --muted: #9a9a9a; --dim: #6b6b6b;
  --border: rgba(255,255,255,0.16); --border-soft: rgba(255,255,255,0.09);
  --ok: #5ef2a0; --ok-dim: rgba(94,242,160,0.14); --warn: #f5c451; --bad: #ff5d62; --bad-dim: rgba(255,93,98,0.14); --info: #9fb8ff;
  color: #fff; background: linear-gradient(180deg, #121215, #0a0a0c); border-radius: 22px; overflow: hidden; min-width: 0;
  box-shadow: 0 50px 100px -40px rgba(17,17,20,0.55), 0 0 0 1px rgba(17,17,20,0.9), inset 0 1px 0 rgba(255,255,255,0.08);
}
.device em { color: inherit; }
.device .mono, .device.mono { font-family: var(--mono); }
.win-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); font-size: 11.5px; color: #8a8a8a; background: rgba(255,255,255,0.02); }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.win-status { margin-left: auto; color: var(--ok); white-space: nowrap; }
.win-status.bad { color: var(--bad); } .win-status.warn { color: var(--warn); }
.win-body { padding: clamp(14px, 2vw, 22px); display: grid; gap: 16px; }
.device .lbl { font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.metric { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-soft); background: var(--panel); min-width: 0; }
.metric .val { font-size: clamp(20px, 2vw, 26px); font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.metric .val.accent { color: var(--ok); }
.metric .sub { font-size: 10.5px; color: var(--dim); }
.select, .input { background: #17171a; color: #eee; border: 1px solid var(--border); border-radius: 8px; height: 34px; padding: 0 10px; font-size: 12.5px; outline: none; min-width: 0; }
.select:focus, .input:focus { border-color: #fff; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: #cfcfcf; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span { width: 30px; height: 17px; border-radius: 99px; background: #262626; border: 1px solid #3a3a3a; position: relative; transition: background .25s, border-color .25s; flex: none; }
.toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #888; transition: transform .25s var(--ease), background .25s; }
.toggle input:checked + span { background: var(--ok-dim); border-color: var(--ok); }
.toggle input:checked + span::after { transform: translateX(13px); background: var(--ok); }
.toggle input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }
.knob { display: grid; gap: 6px; font-size: 12px; color: #cfcfcf; }
.knob b { color: #fff; font-weight: 500; } .knob em { color: var(--dim); font-style: normal; font-family: var(--mono); }
.device input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; background: #2a2a2e; outline: none; }
.device input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; cursor: pointer; }
.device input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; cursor: pointer; }

/* device buttons */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 13px; border-radius: 8px; font-size: 12.5px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; cursor: pointer; border: 1px solid transparent; transition: background .3s, border-color .3s, box-shadow .3s, opacity .2s, transform .3s var(--ease); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-primary { background: #fff; color: #111; border-color: #fff; }
.btn-primary:hover:not(:disabled) { background: #dfe5ff; }
.btn-ghost { background: rgba(255,255,255,0.06); color: #fff; border-color: rgba(255,255,255,0.25); }
.btn-ghost:hover:not(:disabled) { border-color: #fff; background: rgba(255,255,255,0.1); }
.btn-danger { background: rgba(255,93,98,0.16); color: #ffd9da; border-color: rgba(255,93,98,0.55); }
.btn-danger:hover:not(:disabled) { border-color: #ff8b8f; box-shadow: 0 0 20px rgba(255,93,98,0.3); }
.btn-sm { height: 34px; }
.btn.wide { width: 100%; }

/* EXP 01 JRE */
.jre-top { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.jre-score { display: flex; flex-direction: column; }
.jre-score .val { font-size: clamp(28px, 3vw, 40px); font-weight: 500; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; transition: color .4s; }
.jre-score .val.bad { color: var(--bad); } .jre-score .val.warn { color: var(--warn); }
.jre-spark { width: 100%; height: 60px; }
.jre-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.jre-chain { display: grid; grid-template-columns: repeat(6, 1fr); }
.node { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; text-align: center; }
.node::after { content: ""; position: absolute; top: 28px; left: calc(50% + 20px); right: calc(-50% + 20px); height: 1px; background: repeating-linear-gradient(90deg, #555 0 4px, transparent 4px 8px); background-size: 16px 1px; animation: flow 1s linear infinite; }
.node:last-child::after { display: none; }
.node.bad::after { background: repeating-linear-gradient(90deg, var(--bad) 0 4px, transparent 4px 8px); animation-duration: 3s; }
@keyframes flow { to { background-position: 16px 0; } }
.node-ic { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); display: grid; place-items: center; background: #151518; font-size: 16px; transition: all .4s; position: relative; z-index: 1; }
.node.ok .node-ic { border-color: rgba(94,242,160,0.4); }
.node.warn .node-ic { border-color: var(--warn); box-shadow: 0 0 18px rgba(245,196,81,0.35); }
.node.bad .node-ic { border-color: var(--bad); box-shadow: 0 0 22px rgba(255,93,98,0.5); animation: shake .4s infinite; }
.node.focus .node-ic { outline: 2px dashed #fff; outline-offset: 4px; }
@keyframes shake { 25% { transform: translateX(-1px); } 75% { transform: translateX(1px); } }
.node-n { font-family: var(--mono); font-size: 10.5px; color: #cfcfcf; }
.node-m { font-family: var(--mono); font-size: 10px; color: var(--dim); font-variant-numeric: tabular-nums; }
.node.bad .node-m { color: var(--bad); } .node.warn .node-m { color: var(--warn); }
.jre-bottom { display: grid; grid-template-columns: 1fr 220px; gap: 14px; }
.jre-side { display: grid; gap: 10px; align-content: start; }
.agent-log { height: 300px; overflow-y: auto; border: 1px solid var(--border-soft); border-radius: 12px; background: #09090b; padding: 12px; font-size: 11.5px; line-height: 1.65; }
.log-idle { color: var(--dim); }
.log-line { display: grid; grid-template-columns: 64px 1fr; gap: 8px; animation: fadeUp .4s var(--ease) both; }
.log-line .tag { color: var(--dim); }
.log-line.t-detect .tag { color: var(--bad); } .log-line.t-plan .tag, .log-line.t-tool .tag { color: var(--info); }
.log-line.t-ground .tag { color: #c9a7ff; } .log-line.t-rca .tag { color: var(--warn); } .log-line.t-guard .tag { color: #ffa46b; }
.log-line.t-fix .tag, .log-line.t-ok .tag { color: var(--ok); }
.log-line .msg { color: #d4d4d4; word-break: break-word; }
.log-line pre { margin-top: 4px; padding: 8px 10px; border-radius: 6px; background: #121215; border: 1px solid var(--border-soft); color: #a8c7ff; white-space: pre-wrap; font-family: var(--mono); font-size: 11px; }
.cite { display: inline-block; padding: 0 5px; margin-left: 4px; border-radius: 4px; background: rgba(159,184,255,0.12); color: var(--info); font-size: 10px; }
.typing::after { content: "▍"; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* EXP 02 RAG */
.rag-ask { display: flex; gap: 8px; }
.rag-ask .input { flex: 1; height: 38px; }
.rag-samples { display: flex; flex-wrap: wrap; gap: 6px; }
.rag-samples button { font-family: var(--mono); font-size: 11px; padding: 5px 9px; border-radius: 99px; border: 1px solid var(--border-soft); background: var(--panel); color: #bdbdbd; transition: all .2s; }
.rag-samples button:hover { color: #fff; border-color: #fff; }
.rag-samples button.inj { border-color: rgba(255,93,98,0.35); color: #ffb3b5; }
.rag-pipe { display: flex; align-items: center; gap: 6px; font-size: 11px; flex-wrap: wrap; }
.rag-pipe span { padding: 5px 9px; border-radius: 6px; border: 1px solid var(--border-soft); color: #777; transition: all .3s; }
.rag-pipe span.on { color: #000; background: #fff; border-color: #fff; }
.rag-pipe span.done { color: var(--ok); border-color: rgba(94,242,160,0.4); }
.rag-pipe span.blocked { color: #fff; background: var(--bad); border-color: var(--bad); }
.rag-pipe i { flex: 1; min-width: 10px; height: 1px; background: #333; }
.rag-grid { display: grid; grid-template-columns: 1fr 260px; gap: 14px; }
.rag-answer { min-height: 180px; border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px 16px; background: #09090b; font-size: 14px; line-height: 1.65; color: #e6e6e6; }
.rag-answer .ph { color: var(--dim); font-family: var(--mono); font-size: 12px; }
.rag-answer .src { margin-top: 12px; display: grid; gap: 4px; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.rag-answer .blocked { color: #ffb3b5; }
.rag-answer mark { background: rgba(245,196,81,0.18); color: var(--warn); padding: 0 3px; border-radius: 3px; }
.rag-knobs { display: grid; gap: 14px; align-content: start; }
.rag-cost { font-size: 11px; color: #bdbdbd; display: grid; gap: 4px; padding: 10px; border-radius: 10px; border: 1px dashed var(--border-soft); }
.rag-cost b { color: #fff; font-weight: 500; }
.rag-table-wrap { overflow-x: auto; }
.rag-table { width: 100%; border-collapse: collapse; font-size: 11.5px; min-width: 560px; }
.rag-table th, .rag-table td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.rag-table th { color: var(--dim); font-weight: 400; text-transform: uppercase; font-size: 10px; letter-spacing: .06em; }
.rag-table td.t { white-space: normal; color: #cfcfcf; max-width: 280px; }
.rag-table tr.sel td { background: rgba(94,242,160,0.05); }
.rag-table tr.sel td:first-child { box-shadow: inset 2px 0 0 var(--ok); }
.sbar { display: inline-block; height: 5px; border-radius: 3px; background: #fff; vertical-align: middle; margin-right: 6px; }
.rag-eval { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.rag-eval-out { font-size: 11.5px; color: #bdbdbd; flex: 1; min-width: 240px; }
.rag-eval-out .row { display: flex; gap: 18px; flex-wrap: wrap; }
.rag-eval-out b { color: #fff; font-weight: 500; }
.rag-eval-out .delta-up { color: var(--ok); } .rag-eval-out .delta-down { color: var(--bad); }

/* EXP 03 CHAOS */
.chaos-canvas { width: 100%; height: 300px; border-radius: 12px; border: 1px solid var(--border-soft); background: radial-gradient(ellipse at center, #151518, #09090b); }
.chaos-row { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.chaos-attacks, .chaos-patterns { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chaos-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 1.6fr; gap: 10px; }
.chaos-chart { width: 100%; height: 100%; min-height: 70px; border-radius: 12px; border: 1px solid var(--border-soft); background: var(--panel); }

/* EXP 04 MIGRATION */
.race { display: grid; gap: 12px; }
.lane { border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px 14px; background: var(--panel); }
.lane-h { display: flex; justify-content: space-between; font-size: 11.5px; color: #bdbdbd; margin-bottom: 8px; }
.lane-t { color: #fff; font-weight: 500; font-variant-numeric: tabular-nums; }
.lane-steps { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; min-height: 22px; }
.lane-steps span { font-family: var(--mono); font-size: 10.5px; padding: 3px 7px; border-radius: 5px; border: 1px solid var(--border-soft); color: #666; transition: all .3s; }
.lane-steps span.on { color: #000; background: #fff; border-color: #fff; }
.lane-steps span.done { color: var(--ok); border-color: rgba(94,242,160,0.35); }
.lane-steps span.wait { color: var(--warn); border-color: rgba(245,196,81,0.4); }
.lane-bar { height: 6px; border-radius: 3px; background: #1d1d20; overflow: hidden; }
.lane-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #666, #fff); }
#laneAuto .lane-bar i { background: linear-gradient(90deg, #2c8a5a, var(--ok)); }
.race .btn { justify-self: start; }
.roi { display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px; }
.roi-inputs { display: grid; gap: 16px; align-content: start; padding: 14px; border: 1px solid var(--border-soft); border-radius: 12px; }
.roi-out { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.roi-chart { grid-column: 1 / -1; width: 100%; height: 120px; border-radius: 12px; border: 1px solid var(--border-soft); background: var(--panel); }

/* EXP 05 PIPELINE */
.pipe-stages { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.stg { padding: 10px 6px; border-radius: 10px; border: 1px solid var(--border-soft); background: var(--panel); text-align: center; font-family: var(--mono); font-size: 10.5px; color: #8a8a8a; transition: all .3s; min-width: 0; }
.stg .ic { display: block; font-size: 15px; margin-bottom: 4px; }
.stg.std { border-style: dashed; }
.stg.skip { opacity: .28; text-decoration: line-through; }
.stg.run { color: #000; background: #fff; border-color: #fff; }
.stg.pass { color: var(--ok); border-color: rgba(94,242,160,0.4); }
.stg.fail { color: #fff; background: var(--bad); border-color: var(--bad); }
.stg.prodfail { color: #fff; background: #7a1d20; border-color: var(--bad); animation: shake .3s 3; }
.pipe-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dora { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.pipe-log { height: 150px; overflow-y: auto; font-size: 11px; line-height: 1.7; border: 1px solid var(--border-soft); border-radius: 12px; padding: 10px 12px; background: #09090b; color: #aaa; }
.pipe-log .ok { color: var(--ok); } .pipe-log .bad { color: var(--bad); } .pipe-log .warn { color: var(--warn); }

/* EXP 06 ACCESS */
.acc-form { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; align-items: end; }
.acc-form label:not(.toggle) { display: grid; gap: 6px; }
.acc-form .btn { justify-self: start; }
.acc-grid { display: grid; grid-template-columns: 200px 1fr; gap: 14px; }
.acc-decision { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; border-radius: 12px; border: 1px solid var(--border-soft); background: var(--panel); padding: 18px; transition: all .4s; min-height: 150px; }
.acc-decision .val { font-size: 34px; font-weight: 600; letter-spacing: -0.04em; font-family: var(--mono); }
.acc-decision.allow { border-color: var(--ok); background: var(--ok-dim); } .acc-decision.allow .val { color: var(--ok); }
.acc-decision.deny { border-color: var(--bad); background: var(--bad-dim); } .acc-decision.deny .val { color: var(--bad); }
.acc-trace { font-size: 11.5px; line-height: 1.75; border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px; background: #09090b; min-height: 150px; }
.acc-trace .r { display: flex; gap: 8px; animation: fadeUp .35s var(--ease) both; }
.acc-trace .p { color: var(--ok); } .acc-trace .f { color: var(--bad); } .acc-trace .n { color: var(--dim); }
.acc-audit-list { margin-top: 8px; max-height: 120px; overflow-y: auto; font-size: 11px; line-height: 1.8; color: #9a9a9a; }
.acc-audit-list .a { color: var(--ok); } .acc-audit-list .d { color: var(--bad); }
.cert-list { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-top: 8px; }
.cert { border: 1px solid var(--border-soft); border-radius: 10px; padding: 10px; font-family: var(--mono); font-size: 10.5px; color: #bdbdbd; background: var(--panel); transition: all .4s; }
.cert b { display: block; font-size: 18px; color: #fff; font-weight: 500; margin: 4px 0 2px; font-family: var(--sans); letter-spacing: -0.03em; }
.cert.warn { border-color: var(--warn); } .cert.warn b { color: var(--warn); }
.cert.bad { border-color: var(--bad); } .cert.bad b { color: var(--bad); }
.cert.renewed { border-color: var(--ok); } .cert.renewed b { color: var(--ok); }

/* terminal */
.term-body { height: 440px; overflow-y: auto; padding: 16px 18px 4px; font-size: 13px; line-height: 1.7; color: #d4d4d4; font-family: var(--mono); }
.term-body .cmd { color: #fff; }
.term-body .cmd::before { content: "darshil@portfolio:~$ "; color: #5ef2a0; }
.term-body .o { color: #bdbdbd; white-space: pre-wrap; }
.term-body .k { color: #fff; } .term-body .g { color: #5ef2a0; } .term-body .m { color: #6b6b6b; }
.term-body a { color: #9fb8ff; text-decoration: underline; text-underline-offset: 3px; }
.term-input { display: flex; gap: 8px; padding: 6px 18px 16px; font-size: 13px; align-items: center; }
.ps1 { color: #5ef2a0; white-space: nowrap; }
.term-input input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: #fff; font-family: var(--mono); font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .lab-grid { grid-template-columns: 1fr; }
  .tabs { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .tabs button { flex: none; }
  .tabs button small { display: none; }
  .nums, .proof { grid-template-columns: repeat(2, 1fr); }
  .num:nth-child(2) { border-right: 0; }
  .num:nth-child(3) { padding-left: 0; }
  .num:nth-child(n+3) { border-top: 1px solid var(--line); }
  .year { right: -10vw; top: -8vh; }
  .rail { display: none; }
}
@media (max-width: 800px) {
  .hdr { grid-template-columns: 1fr auto; }
  .chapter { display: none; }
  .logo-name { display: none; }
  #soundLbl { display: none; }
  .hero-foot { grid-template-columns: 1fr; }
  .ctx { grid-template-columns: 1fr; }
  .jre-top { grid-template-columns: 1fr; }
  .jre-controls { justify-content: flex-start; }
  .jre-bottom, .rag-grid, .roi, .acc-grid { grid-template-columns: 1fr; }
  .jre-chain { grid-template-columns: repeat(3, 1fr); row-gap: 8px; }
  .node:nth-child(3)::after { display: none; }
  .chaos-metrics { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .chaos-chart { grid-column: 1 / -1; }
  .pipe-stages { grid-template-columns: repeat(4, 1fr); }
  .dora { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .acc-form { grid-template-columns: 1fr 1fr; }
  .cert-list, .roi-out { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .year { font-size: 34vw; right: -4vw; top: -6vh; }
  .h-pin { height: auto; flex-direction: column; align-items: stretch; overflow: visible; padding: 14vh 0; }
  .h-head { width: auto; padding: 0 var(--g) 28px; }
  .h-track { overflow-x: auto; padding: 0 var(--g) 20px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .note { scroll-snap-align: start; min-height: 300px; }
  .h-hint { display: none; }
  .hud { left: 12px; bottom: 12px; }
  .story { min-height: auto; }
  .ch { padding-top: 14vh; padding-bottom: 14vh; }
}
@media (max-width: 520px) {
  .nums, .proof { grid-template-columns: 1fr; }
  .num { border-right: 0; padding-left: 0 !important; border-top: 1px solid var(--line); }
  .lens { flex-wrap: wrap; border-radius: 18px; }
  .acc-form { grid-template-columns: 1fr; }
  .ps1 { display: none; }
  .cta { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ============================================================
   WAYFINDING — for visitors who aren't engineers
   ============================================================ */
.chapter { cursor: pointer; font: inherit; font-family: var(--mono); font-size: 12px; color: var(--ink); align-items: center; transition: border-color .3s, background .3s; }
.chapter:hover { border-color: var(--ink); background: #fff; }
.ch-caret { color: var(--muted); font-size: 10px; }
.burger-ic { display: inline-flex; flex-direction: column; gap: 3px; }
.burger-ic i { width: 12px; height: 1.5px; background: currentColor; border-radius: 1px; }
.rail:hover a span { opacity: 1; transform: none; }

/* plain English callout */
.plain { margin-top: 22px; max-width: 54ch; padding: 14px 18px; border-radius: 16px; background: rgba(255,255,255,0.72); border: 1px solid var(--line); font-size: clamp(16px, 1.25vw, 18px); line-height: 1.5; color: var(--ink); box-shadow: 0 16px 40px -30px rgba(17,17,20,0.4); }
.plain span { display: block; font-family: var(--mono); font-size: 11px; color: var(--blue); margin-bottom: 4px; letter-spacing: .02em; }
.lens-engineer .plain { display: none; }

/* hero CTAs */
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.cta-line { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.cta-line .cta-arr { background: var(--ink); color: var(--paper); font-size: 11px; }
.cta-line:hover { background: var(--ink); color: var(--paper); }
.cta-line:hover .cta-arr { background: var(--paper); color: var(--ink); transform: none; }

/* gap progress */
.gap-prog { height: 3px; max-width: 900px; margin-top: 40px; background: var(--line); border-radius: 3px; overflow: hidden; }
.gap-prog i { display: block; height: 100%; width: 0; background: var(--blue); }
.gap-labels { margin-top: 14px; }

/* experiment guides */
.guide { margin-bottom: 12px; padding: 16px 18px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: 0 18px 40px -32px rgba(17,17,20,0.4); }
.guide-what { font-size: 15.5px; font-weight: 500; letter-spacing: -0.01em; margin-bottom: 12px; }
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; counter-reset: s; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 7px; border-radius: 99px; background: rgba(17,17,20,0.05); font-size: 13px; color: var(--ink-2); transition: background .35s, color .35s, box-shadow .35s; }
.steps li i { font-style: normal; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 11px; transition: background .35s, color .35s, border-color .35s; }
.steps li.now { background: var(--blue); color: #fff; box-shadow: 0 8px 20px -10px rgba(47,84,255,0.7); }
.steps li.now i { background: #fff; color: var(--blue); border-color: #fff; }
.steps li.done { background: #E3F6EC; color: #07744c; }
.steps li.done i { background: var(--mint); color: #fff; border-color: var(--mint); font-size: 0; }
.steps li.done i::after { content: "✓"; font-size: 12px; }
.steps li + li::before { content: none; }
.device .nudge, .nudge { position: relative; z-index: 2; box-shadow: 0 0 0 0 rgba(47,84,255,.8); animation: nudge 1.6s ease-out infinite; border-radius: 10px; }
@keyframes nudge { 0% { box-shadow: 0 0 0 0 rgba(94,160,255,.85); } 100% { box-shadow: 0 0 0 14px rgba(94,160,255,0); } }

/* horizontal arrows */
.h-arrows { display: flex; gap: 8px; margin-top: 16px; }
.h-arrows button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--ink); font-size: 22px; line-height: 1; transition: background .3s, color .3s; }
.h-arrows button:hover { background: var(--ink); color: var(--paper); }

/* menu */
.menu { margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; border: 0; padding: clamp(20px, 5vw, 64px); background: var(--paper); color: var(--ink); overflow-y: auto; }
.menu[open] { animation: menuIn .5s var(--ease) both; display: flex; flex-direction: column; gap: 22px; }
@keyframes menuIn { from { opacity: 0; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
.menu::backdrop { background: transparent; }
.menu-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.menu-tour { display: flex; align-items: center; gap: 14px; text-align: left; padding: 18px 20px; border-radius: 20px; background: var(--ink); color: var(--paper); max-width: 640px; transition: background .3s, transform .4s var(--ease); }
.menu-tour:hover { background: var(--blue); transform: translateY(-2px); }
.menu-tour b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.menu-tour small { font-size: 13px; opacity: .75; }
.menu-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.menu-list li { border-top: 1px solid var(--line); }
.menu-list button { width: 100%; display: grid; grid-template-columns: 44px 1fr; gap: 4px 12px; text-align: left; padding: 16px 4px; transition: padding .35s var(--ease), color .3s; }
.menu-list button:hover { padding-left: 14px; color: var(--blue); }
.menu-list .n { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 8px; grid-row: span 2; }
.menu-list .t { font-size: clamp(22px, 2.6vw, 34px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; }
.menu-list .d { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.menu-list li.on .t { color: var(--blue); }
.menu-list li.on .t::after { content: "  · you are here"; font-family: var(--mono); font-size: 11px; letter-spacing: 0; color: var(--muted); font-weight: 400; }

/* next chapter */
.next-ch { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 110; display: inline-flex; align-items: center; gap: 12px; height: 44px; padding: 0 8px 0 18px; border-radius: 99px; background: rgba(255,255,255,0.8); border: 1px solid var(--line-2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-size: 13px; font-weight: 500; box-shadow: 0 14px 34px -22px rgba(17,17,20,0.5); transition: opacity .4s, transform .4s var(--ease), background .3s; }
.next-ch:hover { background: var(--ink); color: var(--paper); }
.next-arr { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--paper); transition: transform .4s var(--ease); }
.next-ch:hover .next-arr { background: var(--paper); color: var(--ink); transform: translateY(2px); }
.next-ch.top .next-arr { transform: rotate(180deg); }
.next-ch.hide { opacity: 0; pointer-events: none; transform: translate(-50%, 20px); }
body.loading .next-ch, body.touring .next-ch { opacity: 0; pointer-events: none; }

/* tour */
.tour { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 130; width: min(720px, calc(100vw - 24px)); border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: 0 30px 80px -30px rgba(17,17,20,0.5); overflow: hidden; animation: panelIn .5s var(--ease) both; }
.tour[hidden] { display: none; }
.tour-bar { height: 3px; background: var(--line); }
.tour-bar i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .6s var(--ease); }
.tour-body { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 16px 18px; }
.tour-step { font-size: 11px; color: var(--muted); }
.tour-body b { font-size: 16px; letter-spacing: -0.02em; }
.tour-body p { font-size: 14px; color: var(--ink-2); line-height: 1.45; margin-top: 2px; }
.tour-ctl { display: flex; gap: 6px; }
.tour-ctl .pill { height: 34px; padding: 0 12px; }
body.touring .hud { display: none; }

/* toast */
.toast { position: fixed; right: var(--g); bottom: 20px; z-index: 125; width: min(360px, calc(100vw - 24px)); padding: 18px; border-radius: 20px; background: #fff; border: 1px solid var(--line); box-shadow: 0 30px 70px -30px rgba(17,17,20,0.45); animation: panelIn .5s var(--ease) both; }
.toast[hidden] { display: none; }
.toast p { font-size: 14px; line-height: 1.5; color: var(--ink-2); margin-bottom: 12px; }
.toast b { color: var(--ink); }
.toast div { display: flex; gap: 8px; }

@media (max-width: 800px) {
  .hide-sm { display: none; }
  #soundLbl { display: none; }
  .hero-ctas { justify-content: stretch; }
  .hero-ctas .cta { flex: 1; justify-content: space-between; }
  .menu-list { grid-template-columns: 1fr; }
  .tour-body { grid-template-columns: 1fr; gap: 10px; }
  .next-ch { bottom: 14px; left: auto; right: 12px; transform: none; }
  .next-ch.hide { transform: translateY(20px); }
  #nextLbl { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .toast { right: 12px; bottom: 70px; }
  .steps li { font-size: 12.5px; }
}

/* hero layout + overlap fixes */
.hero-foot { grid-template-columns: auto 1fr; }
.hero-ctas { grid-column: 1 / -1; justify-content: flex-start; }
.scroll-cue { display: none; }
.toast { top: 82px; bottom: auto; }
@media (max-width: 800px) { .hero-foot { grid-template-columns: 1fr; } .toast { top: 72px; bottom: auto; right: 12px; } }

@media (max-width: 800px) { #soundBtn::before { content: "\266A"; font-size: 14px; } #soundBtn .eq { display: none; } #soundBtn.sound-on .eq { display: inline-flex; } #soundBtn.sound-on::before { content: none; } }
