/* ==========================================================================
   Nishant · portfolio. Hand-written CSS, no framework.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #07080a;
  --bg-1: #0c0d10;
  --bg-2: #111317;
  --bg-3: #171a1f;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-3: rgba(255, 255, 255, 0.2);
  --text: #eef0f3;
  --text-2: #b4b9c2;
  --muted: #7d838e;
  --faint: #545a64;
  --bad: #ff5d5d;
  --bad-bg: rgba(255, 93, 93, 0.08);
  --bad-line: rgba(255, 93, 93, 0.28);
  --good: #3ee09a;
  --good-bg: rgba(62, 224, 154, 0.08);
  --good-line: rgba(62, 224, 154, 0.28);
  --warn: #ffc163;
  --warn-bg: rgba(255, 193, 99, 0.08);
  --warn-line: rgba(255, 193, 99, 0.26);
  --accent: #8ea8ff;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --wrap: 1180px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
code, kbd, output { font-family: var(--mono); font-size: 0.9em; }
p code, small code, b code, .lab-brief code {
  padding: 0.1em 0.38em;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: var(--bg-3);
  font-size: 0.84em;
}
::selection { background: rgba(142, 168, 255, 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: var(--r-sm); background: var(--text); color: var(--bg); font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

.i {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.i-xs { width: 11px; height: 11px; display: inline-block; vertical-align: -1px; margin-left: 3px; opacity: 0.6; }
.sep { color: var(--faint); margin: 0 0.2em; }

/* ---------------------------------------------------------------- backdrop */

.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.backdrop-grid {
  position: absolute; inset: -1px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.backdrop-glow {
  position: absolute; left: 50%; top: -340px; width: 1100px; height: 700px; transform: translateX(-50%);
  background:
    radial-gradient(closest-side, rgba(142, 168, 255, 0.16), transparent 70%),
    radial-gradient(closest-side at 70% 60%, rgba(255, 93, 93, 0.08), transparent 70%);
  filter: blur(20px);
  animation: glow 14s ease-in-out infinite alternate;
}
.backdrop-spot {
  position: absolute; width: 560px; height: 560px; left: var(--mx, 50%); top: var(--my, 30%);
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.045), transparent 70%);
  transition: left 0.6s var(--ease), top 0.6s var(--ease);
}
@keyframes glow {
  from { transform: translateX(-52%) scale(1); opacity: 0.85; }
  to { transform: translateX(-48%) scale(1.08); opacity: 1; }
}

/* ---------------------------------------------------------------- buttons */

.btn {
  --h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 16px;
  border: 1px solid transparent; border-radius: 999px;
  font-size: 14px; font-weight: 550; letter-spacing: -0.005em; white-space: nowrap;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn-small { --h: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { --h: 48px; padding: 0 22px; font-size: 15px; }
.btn-light { background: var(--text); color: #0a0b0d; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 24px -8px rgba(255, 255, 255, 0.25); }
.btn-light:hover { background: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 10px 30px -8px rgba(255, 255, 255, 0.35); }
.btn-light .i { transition: transform 0.2s var(--ease); }
.btn-light:hover .i:last-child { transform: translateX(2px); }
.btn-ghost { background: rgba(255, 255, 255, 0.03); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--line-3); }
.btn-quiet { background: transparent; color: var(--muted); }
.btn-quiet:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.btn code { font-size: 12.5px; color: var(--text-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-col { display: grid; gap: 8px; justify-items: start; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--muted);
  transition: color 0.18s, border-color 0.18s, transform 0.4s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-3); transform: rotate(-90deg); }

/* ---------------------------------------------------------------- nav */

#site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.25s, border-color 0.25s, backdrop-filter 0.25s;
}
#site-header.scrolled {
  background: rgba(7, 8, 10, 0.72);
  border-bottom-color: var(--line);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}
.nav {
  max-width: var(--wrap); margin: 0 auto; height: 64px; padding: 0 24px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; }
.brand-mark {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(145deg, #fff, #c9cdd4); color: #0a0b0d; font-size: 14px; font-weight: 800;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 6px 18px -6px rgba(255, 255, 255, 0.35);
}
.nav-links { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav-links a {
  display: block; padding: 6px 12px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 500;
  transition: color 0.18s, background 0.18s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.status-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--text-2); font: 500 12px var(--mono); white-space: nowrap;
  transition: border-color 0.2s;
}
.status-pill:hover { border-color: var(--line-3); }
.dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.status-pill.ok .dot, .dot.ok { background: var(--good); }
.status-pill.bad .dot, .dot.bad { background: var(--bad); }
.status-pill.ok .dot::after, .status-pill.bad .dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid currentColor;
  color: var(--good); animation: ping 2.2s var(--ease) infinite;
}
.status-pill.bad .dot::after { color: var(--bad); }
@keyframes ping { 0% { transform: scale(0.4); opacity: 0.9; } 80%, 100% { transform: scale(1.6); opacity: 0; } }

/* ---------------------------------------------------------------- layout */

main > section { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
main > section + section { margin-top: 160px; }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-kicker, .kicker, .control-label, .output-title, .lab-kicker {
  font: 500 12px/1.4 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
.section-kicker { margin: 0 0 14px; color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.035em; line-height: 1.05; text-wrap: balance; }
h2 { font-size: clamp(34px, 4.6vw, 54px); }
.section-lede { margin: 16px 0 0; color: var(--text-2); font-size: 17px; line-height: 1.65; text-wrap: pretty; }

/* ---------------------------------------------------------------- hero */

#hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 56px; align-items: center;
  min-height: calc(100vh - 64px); min-height: calc(100svh - 64px); padding-top: 40px; padding-bottom: 80px;
}
.kicker { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin: 0 0 28px; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text-2); }
.kicker-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(62, 224, 154, 0.15); margin-right: 6px; }
#hero h1 { font-size: clamp(52px, 6.4vw, 92px); line-height: 0.95; letter-spacing: -0.055em; font-weight: 700; }
.h1-line { display: block; white-space: nowrap; }
.h1-dim {
  background: linear-gradient(180deg, #8d939d 0%, #4a4f57 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-bottom: 0.08em;
}
.crack { position: relative; display: inline-block; }
.crack-a { position: relative; display: inline-block; color: var(--text); }
.crack-b {
  position: absolute; inset: 0; color: var(--bad);
  clip-path: inset(0 0 100% 0);
  animation: crack 5.5s steps(1) infinite 1.2s;
}
.crack-a { animation: crack-main 5.5s steps(1) infinite 1.2s; }
@keyframes crack {
  0%, 86%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  87% { clip-path: inset(18% 0 52% 0); transform: translate(-6px, 0); }
  89% { clip-path: inset(58% 0 12% 0); transform: translate(5px, 0); }
  91% { clip-path: inset(32% 0 40% 0); transform: translate(-3px, 0); }
  93% { clip-path: inset(70% 0 4% 0); transform: translate(4px, 0); }
  95% { clip-path: inset(0 0 100% 0); }
}
@keyframes crack-main {
  0%, 86%, 96%, 100% { transform: none; opacity: 1; }
  88% { transform: translate(3px, 0) skewX(-6deg); }
  90% { transform: translate(-2px, 0); opacity: 0.85; }
  92% { transform: translate(2px, 0) skewX(4deg); }
}
.lede { max-width: 560px; margin: 30px 0 0; color: var(--text-2); font-size: 18.5px; line-height: 1.65; text-wrap: pretty; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.proof { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 24px; margin: 44px 0 0; padding: 22px 0 0; list-style: none; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.proof b { display: block; color: var(--text); font: 600 22px/1.2 var(--mono); letter-spacing: -0.03em; margin-bottom: 2px; }

/* monitor */
.monitor {
  position: relative; border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(23, 26, 31, 0.9), rgba(12, 13, 16, 0.92));
  box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, 0.6), 0 40px 120px -40px rgba(142, 168, 255, 0.25);
  overflow: hidden; font-family: var(--mono);
}
.monitor::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 0, rgba(255, 255, 255, 0.025) 50%, transparent 100%);
  background-size: 100% 6px; opacity: 0.6;
}
.monitor-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.rec { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: rec 1.6s ease-in-out infinite; }
@keyframes rec { 50% { opacity: 0.25; } }
.monitor-title { color: var(--text); font-weight: 600; }
.monitor-sub { margin-left: auto; color: var(--faint); }
.monitor-rows { margin: 0; padding: 8px; list-style: none; }
.monitor-row {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 11px 10px; border-radius: 10px; font-size: 12.5px; color: var(--text-2);
  transition: background 0.2s;
}
.monitor-row:hover { background: rgba(255, 255, 255, 0.035); }
.monitor-row .n { color: var(--faint); }
.monitor-row .inv { min-width: 0; }
.monitor-row .inv b { display: block; color: var(--text); font: 550 13.5px/1.35 var(--sans); letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monitor-row .inv code { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border: 1px solid var(--line-2); border-radius: 999px; font: 600 10.5px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.broken { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
.badge.held { color: var(--good); border-color: var(--good-line); background: var(--good-bg); }
.badge.tried { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }
.monitor-foot { display: flex; align-items: center; gap: 24px; padding: 14px 18px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); }
.score { display: grid; }
.score-value { font: 650 22px/1.1 var(--mono); letter-spacing: -0.03em; color: var(--text); display: inline-block; }
.score-value.broken { color: var(--bad); }
.score-value.held { color: var(--good); }
.score-label { font-size: 11px; color: var(--muted); }
.monitor-foot .icon-btn { margin-left: auto; }
.bump { animation: bump 0.26s var(--ease); }
@keyframes bump { 50% { transform: scale(1.35); } }

/* ---------------------------------------------------------------- labs layout */

.labs-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; align-items: start; }
.lab-rail { position: sticky; top: 96px; }
.lab-rail ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.rail-item {
  position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 6px; align-items: center;
  padding: 9px 12px; margin-left: -1px; border-left: 1px solid transparent;
  color: var(--muted); font-size: 13.5px; font-weight: 500; transition: color 0.2s, border-color 0.2s;
}
.rail-item .n { font: 500 11.5px var(--mono); color: var(--faint); }
.rail-item:hover { color: var(--text); }
.rail-item.active { color: var(--text); border-left-color: var(--text); }
.rail-item::after {
  content: ""; position: absolute; right: 0; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: transparent; transition: background 0.2s;
}
.rail-item[data-state="broken"]::after { background: var(--bad); }
.rail-item[data-state="held"]::after { background: var(--good); }
.rail-item[data-state="tried"]::after { background: var(--warn); }
.rail-hint { margin: 18px 0 0 13px; font-size: 12px; color: var(--faint); }
kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: var(--bg-2);
  color: var(--text-2); font-size: 11px;
}
.lab-stack { display: grid; gap: 28px; min-width: 0; }

/* ---------------------------------------------------------------- lab card */

.lab {
  position: relative; border: 1px solid var(--line); border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(17, 19, 23, 0.85), rgba(10, 11, 13, 0.9));
  box-shadow: var(--shadow);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  overflow: hidden;
}
.lab::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}
.lab.is-broken { border-color: var(--bad-line); box-shadow: var(--shadow), 0 0 0 1px rgba(255, 93, 93, 0.06), 0 30px 80px -40px rgba(255, 93, 93, 0.35); }
.lab.is-held { border-color: var(--good-line); box-shadow: var(--shadow), 0 30px 80px -40px rgba(62, 224, 154, 0.3); }
.lab.shake { animation: shake 0.45s var(--ease); }
@keyframes shake {
  20% { transform: translateX(-5px); } 40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); } 80% { transform: translateX(2px); }
}
.lab-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: start; padding: 28px 30px 24px; border-bottom: 1px solid var(--line); }
.lab-index {
  font: 600 13px var(--mono); color: var(--faint);
  width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2);
}
.lab-kicker { margin: 0 0 8px; text-transform: none; letter-spacing: 0; }
.lab-kicker a { color: var(--text-2); border-bottom: 1px dashed var(--line-3); transition: color 0.18s, border-color 0.18s; }
.lab-kicker a:hover { color: var(--text); border-color: var(--text); }
.lab h3 { font-size: clamp(22px, 2.5vw, 28px); letter-spacing: -0.03em; line-height: 1.15; }
.assert {
  display: inline-block; margin-top: 12px; max-width: 100%; padding: 5px 10px;
  border-radius: 8px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.35);
  font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere;
}
.assert .kw { color: var(--accent); margin-right: 4px; }
.lab-state {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px;
  border: 1px solid var(--line-2); border-radius: 999px;
  font: 600 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); white-space: nowrap;
  transition: all 0.3s var(--ease);
}
.lab-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.lab-state[data-state="broken"] { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
.lab-state[data-state="held"] { color: var(--good); border-color: var(--good-line); background: var(--good-bg); }
.lab-state[data-state="tried"] { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }

.lab-body { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); }
.lab-controls { padding: 26px 30px 30px; border-right: 1px solid var(--line); display: grid; gap: 14px; align-content: start; }
.lab-brief { margin: 0 0 6px; color: var(--text-2); font-size: 15px; line-height: 1.65; }
.lab-brief b { color: var(--text); }
.control-label { margin: 8px 0 0; padding: 0; font-size: 11px; color: var(--faint); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 8px; }
legend { padding: 0; margin-bottom: 8px; }
.hint { margin: 0; font-size: 13.5px; color: var(--muted); }
.lab-output { padding: 22px 26px 26px; display: grid; gap: 14px; align-content: start; min-width: 0; background: rgba(0, 0, 0, 0.18); }
.output-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.output-title { font-size: 11px; color: var(--faint); }
.output-meta {
  font: 500 11.5px var(--mono); color: var(--muted); padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.04);
  max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.output-meta.bad { color: var(--bad); background: var(--bad-bg); }
.output-meta.good { color: var(--good); background: var(--good-bg); }

.empty-state {
  display: grid; place-items: center; gap: 10px; min-height: 200px; padding: 24px; text-align: center;
  border: 1px dashed var(--line-2); border-radius: var(--r);
  background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(255, 255, 255, 0.012) 10px 20px);
}
.empty-glyph { font: 500 13px var(--mono); color: var(--text-2); padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; }
.empty-state p { margin: 0; max-width: 300px; color: var(--muted); font-size: 13.5px; }

/* ---------------------------------------------------------------- controls */

.mode, .actor { position: relative; display: block; cursor: pointer; }
.mode input, .actor input, .toggle-card input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mode-card {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r); background: rgba(255, 255, 255, 0.015);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.mode-card b { grid-column: 1; grid-row: 1; font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.mode-card small { grid-column: 1 / -1; color: var(--muted); font-size: 13px; line-height: 1.45; }
.mode-card .tag { grid-column: 2; grid-row: 1; }
.mode:hover .mode-card { border-color: var(--line-2); background: rgba(255, 255, 255, 0.03); }
.mode input:checked + .mode-card { border-color: var(--line-3); background: rgba(255, 255, 255, 0.055); box-shadow: 0 0 0 1px var(--line-3) inset; }
.mode input:focus-visible + .mode-card, .actor input:focus-visible + .actor-card, .toggle-card input:focus-visible ~ .toggle-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.tag { align-self: center; padding: 2px 7px; border-radius: 5px; font: 600 10px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.tag-bad { color: var(--bad); background: var(--bad-bg); }
.tag-good { color: var(--good); background: var(--good-bg); }

.toggle-card {
  display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r); background: rgba(255, 255, 255, 0.015);
  transition: border-color 0.2s, background 0.2s;
}
.toggle-card:hover { border-color: var(--line-2); }
.toggle-ui { position: relative; width: 36px; height: 21px; margin-top: 1px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line-2); transition: background 0.22s var(--ease), border-color 0.22s; }
.toggle-ui::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--muted); transition: transform 0.25s var(--ease), background 0.22s;
}
.toggle-card input:checked ~ .toggle-ui { background: var(--good); border-color: var(--good); }
.toggle-card input:checked ~ .toggle-ui::after { transform: translateX(15px); background: #04130c; }
.toggle-text b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.toggle-text small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.45; }

.slider-card { display: grid; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: rgba(255, 255, 255, 0.015); }
.slider-top { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.slider-top b { font-weight: 600; }
.slider-top output { min-width: 28px; text-align: center; padding: 2px 8px; border-radius: 6px; background: var(--bg-3); font-weight: 600; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--text) var(--fill, 66%), var(--bg-3) var(--fill, 66%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--bg-3); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--text); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; }

.sql {
  display: block; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: #050607;
  color: var(--text-2); font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere;
}
.sql .k { color: var(--accent); }

.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset {
  height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent;
  font: 500 12.5px var(--mono); color: var(--text-2); transition: all 0.18s var(--ease);
}
.preset:hover { color: var(--text); border-color: var(--line-3); }
.preset.active { color: #0a0b0d; background: var(--text); border-color: var(--text); }
.fields { display: grid; grid-template-columns: 1fr 88px; gap: 10px; }
.field { display: grid; gap: 6px; }
.field-wide { grid-column: 1 / -1; }
.field span { font: 500 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em; }
.field input, .chain input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #050607;
  font: 500 14px var(--mono); color: var(--text); outline: none; transition: border-color 0.18s, box-shadow 0.18s;
}
.field input:focus, .chain input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(142, 168, 255, 0.18); }

.actors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.actors legend { grid-column: 1 / -1; }
.actor-card {
  display: grid; justify-items: center; gap: 2px; padding: 12px 6px 10px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--r); background: rgba(255, 255, 255, 0.015); transition: all 0.2s;
}
.actor-card b { font-size: 13px; font-weight: 600; }
.actor-card small { font-size: 11px; color: var(--muted); }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 4px; border-radius: 50%; font-size: 13px; font-weight: 700; color: #0a0b0d; }
.av-a { background: linear-gradient(135deg, #b9c7ff, #7f97ff); }
.av-b { background: linear-gradient(135deg, #a8f0cf, #3ee09a); }
.av-c { background: linear-gradient(135deg, #ffe0a8, #ffc163); }
.av-m { background: linear-gradient(135deg, #ffb3b3, #ff5d5d); }
.actor:hover .actor-card { border-color: var(--line-2); }
.actor input:checked + .actor-card { border-color: var(--line-3); background: rgba(255, 255, 255, 0.055); box-shadow: 0 0 0 1px var(--line-3) inset; }
.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.action-grid .btn { width: 100%; padding: 0 8px; }

/* ---------------------------------------------------------------- verdicts */

.verdict:empty { display: none; }
.verdict-box {
  position: relative; padding: 14px 16px 14px 18px; border: 1px solid var(--line-2); border-radius: var(--r); background: rgba(255, 255, 255, 0.03);
  animation: rise 0.4s var(--ease) both; overflow: hidden;
}
.verdict-box::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--muted); }
.verdict-box.bad { border-color: var(--bad-line); background: var(--bad-bg); }
.verdict-box.bad::before { background: var(--bad); }
.verdict-box.good { border-color: var(--good-line); background: var(--good-bg); }
.verdict-box.good::before { background: var(--good); }
.verdict-box.info { border-color: var(--warn-line); background: var(--warn-bg); }
.verdict-box.info::before { background: var(--warn); }
.verdict-tag { display: inline-block; margin-bottom: 6px; font: 700 11px var(--mono); letter-spacing: 0.1em; color: var(--muted); }
.bad .verdict-tag { color: var(--bad); }
.good .verdict-tag { color: var(--good); }
.info .verdict-tag { color: var(--warn); }
.verdict-box p { margin: 0; font-size: 14px; line-height: 1.55; }
.verdict-box p b { font-weight: 600; }
.verdict-box .why { margin-top: 6px; color: var(--text-2); font-size: 13.5px; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- lab 01 output */

.race-lanes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.race-lane { min-width: 0; border: 1px solid var(--line); border-radius: var(--r); background: #050607; overflow: hidden; }
.race-lane h4 {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 10px 12px;
  border-bottom: 1px solid var(--line); font: 600 12.5px var(--mono); color: var(--text);
}
.outcome { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; color: var(--muted); background: var(--bg-3); }
.outcome.approved { color: var(--good); background: var(--good-bg); }
.outcome.rejected { color: var(--warn); background: var(--warn-bg); }
.race-lane ol { margin: 0; padding: 6px; list-style: none; display: grid; gap: 2px; }
.race-lane li {
  display: grid; grid-template-columns: 28px 1fr; gap: 6px; padding: 6px 8px; border-radius: 7px;
  font: 12px/1.45 var(--mono); color: var(--text-2); animation: rise 0.35s var(--ease) both; overflow-wrap: anywhere;
}
.race-lane li .t { color: var(--faint); }
.race-lane .op-read { background: rgba(142, 168, 255, 0.07); }
.race-lane .op-write { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.race-lane .op-dispense { background: var(--good-bg); color: var(--good); }
.race-lane .op-reject { background: var(--warn-bg); color: var(--warn); }
.race-lane .op-wait, .race-lane .op-lock, .race-lane .op-unlock { color: var(--muted); }
.race-meter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.race-meter > div {
  display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: #050607;
  font-size: 11.5px; color: var(--muted);
}
.race-meter b { font: 650 22px/1.1 var(--mono); letter-spacing: -0.03em; color: var(--text); }
.race-meter .bad { border-color: var(--bad-line); background: var(--bad-bg); }
.race-meter .bad b { color: var(--bad); }
.race-meter .good b { color: var(--good); }
.histogram { display: flex; height: 44px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: #050607; }
.histogram span { height: 100%; transition: width 0.9s var(--ease); }
.h-bad { background: repeating-linear-gradient(-45deg, var(--bad) 0 6px, #e04848 6px 12px); }
.h-good { background: linear-gradient(90deg, rgba(62, 224, 154, 0.55), rgba(62, 224, 154, 0.3)); }

/* ---------------------------------------------------------------- lab 02 output */

.seq { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.seq ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; position: relative; }
.seq ol::before { content: ""; position: absolute; left: 70px; top: 6px; bottom: 6px; width: 1px; background: var(--line-2); }
.seq li {
  position: relative; display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: start;
  font: 12.5px/1.5 var(--mono); color: var(--text-2); animation: rise 0.35s var(--ease) both;
}
.seq li::before { content: ""; position: absolute; left: 67px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--muted); }
.seq .who { color: var(--muted); font-size: 11.5px; text-align: right; padding-right: 14px; padding-top: 1px; }
.seq .msg { padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: #050607; overflow-wrap: anywhere; }
.seq .from-client .msg { color: var(--text); }
.seq .from-network .msg { color: var(--warn); border-style: dashed; border-color: var(--warn-line); }
.seq .from-network::before { border-color: var(--warn); }
.seq .charged .msg { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
.seq .charged::before { border-color: var(--bad); background: var(--bad); }
.seq .replayed .msg { color: var(--good); border-color: var(--good-line); background: var(--good-bg); }
.seq .replayed::before { border-color: var(--good); background: var(--good); }
.statement:empty { display: none; }
.statement { border: 1px solid var(--line); border-radius: var(--r); background: #050607; overflow: hidden; animation: rise 0.4s var(--ease) both; }
.statement-head { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); font: 500 11px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); }
.statement ul { margin: 0; padding: 4px 0; list-style: none; }
.statement li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 14px; font: 13px var(--mono); color: var(--text-2); }
.statement li.dup { color: var(--bad); }
.statement li.dup span:first-child::after { content: " duplicate"; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; margin-left: 6px; padding: 1px 5px; border-radius: 4px; background: var(--bad-bg); }
.statement .total { display: flex; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line); font: 600 14px var(--mono); }
.statement .total.bad b { color: var(--bad); }
.statement .total.good b { color: var(--good); }

/* ---------------------------------------------------------------- lab 03 output */

.money-compare { display: grid; gap: 10px; }
.money-col { border: 1px solid var(--line); border-radius: var(--r); background: #050607; overflow: hidden; animation: rise 0.35s var(--ease) both; }
.money-col h4 {
  display: flex; justify-content: space-between; gap: 10px; margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line);
  font: 500 11.5px var(--mono); color: var(--muted);
}
.money-col h4 span:last-child { font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 10.5px; }
.money-col.bad { border-color: var(--bad-line); }
.money-col.bad h4 span:last-child { color: var(--bad); }
.money-col.good h4 span:last-child { color: var(--good); }
.shares { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px 4px; }
.shares span { padding: 4px 9px; border-radius: 7px; background: var(--bg-3); font: 500 13px var(--mono); color: var(--text); }
.money-col .total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 14px 12px; font-size: 12.5px; color: var(--muted); }
.money-col .total b { font: 650 20px var(--mono); letter-spacing: -0.02em; color: var(--text); }
.money-col.bad .total b { color: var(--bad); }
.money-col.good .total b { color: var(--good); }
.sum-line { padding: 9px 14px; border-top: 1px solid var(--line); font: 12.5px var(--mono); color: var(--text-2); overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- lab 04 output */

.chain { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.chain-row {
  position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) 104px; gap: 4px 12px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: #050607;
  transition: border-color 0.25s, background 0.25s;
}
.chain-row + .chain-row { margin-top: 14px; }
.chain-row + .chain-row::before {
  content: ""; position: absolute; left: 26px; top: -15px; width: 2px; height: 14px; background: var(--line-2);
}
.chain-row.bad + .chain-row::before, .chain-row + .chain-row.bad::before { background: var(--bad); }
.chain-row .seqno { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--bg-3); font: 600 12px var(--mono); color: var(--text-2); }
.chain-row .memo { min-width: 0; }
.chain-row .memo b { display: block; font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-row .memo small { display: block; font: 11px var(--mono); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-row input { height: 34px; padding: 0 10px; text-align: right; font-size: 13px; }
.chain-row .hashes { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; font: 11px var(--mono); color: var(--faint); }
.chain-row .hashes span b { font-weight: 500; color: var(--muted); }
.chain-row.bad { border-color: var(--bad-line); background: var(--bad-bg); }
.chain-row.bad .seqno { background: var(--bad); color: #1a0505; }
.chain-row.bad .hashes span b { color: var(--bad); }
.chain-row.missing { border-style: dashed; color: var(--bad); font-size: 13px; grid-template-columns: 30px 1fr; }
.chain-row.flash { animation: flash 0.9s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 3px rgba(255, 193, 99, 0.5); } 100% { box-shadow: 0 0 0 0 rgba(255, 193, 99, 0); } }
.checkpoint { padding: 10px 14px; border: 1px dashed var(--line-2); border-radius: var(--r); font: 12px/1.55 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.checkpoint b { color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------- lab 05 output */

.incident { display: grid; gap: 10px; }
.incident-card { border: 1px solid var(--line); border-radius: var(--r); background: #050607; padding: 14px; }
.incident-card h4 { margin: 0 0 12px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-bottom: 14px; }
.flow span {
  position: relative; padding: 18px 0 0; text-align: center; font: 500 10.5px var(--mono); color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.flow span::before { content: ""; position: absolute; top: 4px; left: 0; right: 0; height: 4px; border-radius: 4px; background: var(--bg-3); transition: background 0.3s; }
.flow span.done { color: var(--text-2); }
.flow span.done::before { background: var(--text-2); }
.flow span.now { color: var(--text); font-weight: 700; }
.flow span.now::before { background: var(--accent); box-shadow: 0 0 12px rgba(142, 168, 255, 0.6); }
.kv { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 12.5px; }
.kv dt { color: var(--faint); font-family: var(--mono); font-size: 11.5px; padding-top: 1px; }
.kv dd { margin: 0; font-family: var(--mono); color: var(--text-2); overflow-wrap: anywhere; }
.muted { color: var(--faint); }
.approvals-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.approvals-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 8px; background: var(--bg-2); font: 12.5px var(--mono); }
.approvals-list li.self { color: var(--bad); }
.approvals-list li.stale { text-decoration: line-through; text-decoration-color: var(--warn); color: var(--muted); }
.responses { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; max-height: 220px; overflow: auto; }
.responses:empty { display: none; }
.responses li {
  display: grid; grid-template-columns: 42px minmax(0, 0.8fr) minmax(0, 1.4fr); gap: 10px; align-items: baseline;
  padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: #050607;
  font: 12px/1.45 var(--mono); color: var(--text-2); animation: rise 0.3s var(--ease) both;
}
.responses .code { font-weight: 700; }
.responses .s2 .code { color: var(--good); }
.responses .s4 .code { color: var(--bad); }
.responses li span:last-child { color: var(--muted); overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- status */

.status-wrap { border: 1px solid var(--line); border-radius: var(--r-xl); background: linear-gradient(180deg, rgba(17, 19, 23, 0.85), rgba(10, 11, 13, 0.9)); box-shadow: var(--shadow); overflow: hidden; }
.status-summary { display: flex; align-items: center; gap: 22px; padding: 26px 30px; border-bottom: 1px solid var(--line); }
.status-summary .big { font: 700 44px/1 var(--mono); letter-spacing: -0.05em; }
.status-summary .big.ok { color: var(--good); }
.status-summary .big.bad { color: var(--bad); }
.status-summary p { margin: 0; color: var(--text-2); }
.status-list { margin: 0; padding: 8px 18px; list-style: none; }
.status-list li { display: grid; grid-template-columns: 220px minmax(0, 1fr) 210px; gap: 20px; align-items: center; padding: 14px 12px; border-bottom: 1px solid var(--line); }
.status-list li:last-child { border-bottom: 0; }
.status-name { display: inline-flex; align-items: center; gap: 10px; font: 500 13.5px var(--mono); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-name:hover { color: #fff; }
.bars { display: flex; gap: 3px; height: 28px; align-items: stretch; }
.bars > * { flex: 1; min-width: 2px; border-radius: 3px; background: var(--good); opacity: 0.85; transform-origin: bottom; animation: grow 0.5s var(--ease) both; transition: opacity 0.15s, transform 0.15s; }
.bars > a:hover { opacity: 1; transform: scaleY(1.15); }
.bars .bad { background: var(--bad); }
.bars .other { background: var(--warn); }
.bars .empty { background: var(--bg-3); opacity: 1; }
@keyframes grow { from { transform: scaleY(0.2); opacity: 0; } }
.status-meta { font: 12px var(--mono); color: var(--muted); text-align: right; }
.status-meta b { color: var(--text); }
.fineprint { margin: 0; padding: 14px 30px 18px; border-top: 1px solid var(--line); font: 11.5px var(--mono); color: var(--faint); }

/* ---------------------------------------------------------------- work */

.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.work-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 24px; min-height: 280px;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(17, 19, 23, 0.85), rgba(10, 11, 13, 0.9));
  transition: border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s; overflow: hidden;
}
.work-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(400px circle at var(--cx, 50%) var(--cy, 0%), rgba(255, 255, 255, 0.06), transparent 50%);
}
.work-card:hover { border-color: var(--line-3); transform: translateY(-3px); box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9); }
.work-card:hover::after { opacity: 1; }
.work-card h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 19px; letter-spacing: -0.02em; }
.work-card h3 .i { opacity: 0; transform: translate(-4px, 4px); transition: all 0.25s var(--ease); color: var(--muted); }
.work-card:hover h3 .i { opacity: 1; transform: none; }
.work-card p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
.work-card .hard { color: var(--muted); font-size: 13.5px; }
.ci-chip { display: inline-flex; align-items: center; gap: 6px; font: 600 10.5px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ci-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ci-chip.ok { color: var(--good); }
.ci-chip.bad { color: var(--bad); }
.work-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lab-link { align-self: flex-start; padding: 3px 8px; border-radius: 6px; background: rgba(142, 168, 255, 0.1); color: var(--accent); font: 500 11.5px var(--mono); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.tags span { padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; font: 11.5px var(--mono); color: var(--muted); }

/* ---------------------------------------------------------------- contact */

#contact { margin-bottom: 120px; }
.contact-card {
  position: relative; overflow: hidden; padding: clamp(36px, 6vw, 80px); text-align: center;
  border: 1px solid var(--line-2); border-radius: 32px;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(142, 168, 255, 0.12), transparent 70%), linear-gradient(180deg, #101216, #0a0b0d);
  box-shadow: var(--shadow);
}
.contact-glow {
  position: absolute; left: 50%; top: 0; width: 60%; height: 1px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
}
.contact-card h2 { max-width: 760px; margin: 0 auto; font-size: clamp(32px, 5vw, 60px); }
.contact-copy { max-width: 520px; margin: 18px auto 0; color: var(--text-2); font-size: 17px; }
.email-block {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin-top: 36px; padding: 8px 8px 8px 22px;
  border: 1px solid var(--line-2); border-radius: 999px; background: rgba(0, 0, 0, 0.4);
}
.email-link {
  font: 600 clamp(16px, 2.6vw, 26px)/1.2 var(--mono); letter-spacing: -0.03em; min-width: 0; overflow-wrap: anywhere;
  background: linear-gradient(90deg, #fff, #aab3c2); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.email-link:hover { background: #fff; -webkit-background-clip: text; background-clip: text; }
#copy-email.copied { color: var(--good); border-color: var(--good-line); }
.contact-card .cta-row { justify-content: center; }

/* ---------------------------------------------------------------- footer */

#site-footer { border-top: 1px solid var(--line); }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 36px 24px 48px; display: grid; grid-template-columns: auto 1fr; gap: 14px 24px; align-items: center; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; font-size: 14px; }
.footer-brand .brand-mark { width: 24px; height: 24px; font-size: 12px; border-radius: 7px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 22px; margin: 0; font-size: 13.5px; }
.footer-links a { color: var(--muted); transition: color 0.18s; }
.footer-links a:hover { color: var(--text); }
.footer-note { grid-column: 1 / -1; margin: 0; color: var(--faint); font-size: 12.5px; }
.footer-note code { font-size: 0.95em; }

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 80; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; background: var(--text); color: #0a0b0d; font-size: 14px; font-weight: 600;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.8);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: transform 0.3s var(--ease), opacity 0.3s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast:empty { display: none; }

/* ---------------------------------------------------------------- reveal */

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js #hero .reveal:nth-child(2) { transition-delay: 0.08s; }
.js #hero .reveal:nth-child(3) { transition-delay: 0.16s; }
.js #hero .reveal:nth-child(4) { transition-delay: 0.24s; }
.js #hero .reveal:nth-child(5) { transition-delay: 0.32s; }
.js #hero .monitor.reveal { transition-delay: 0.2s; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  #hero { grid-template-columns: 1fr; min-height: 0; padding-top: 56px; gap: 48px; }
  .monitor { max-width: 620px; }
  .labs-layout { grid-template-columns: 1fr; }
  .lab-rail { display: none; }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-list li { grid-template-columns: 180px minmax(0, 1fr); }
  .status-meta { grid-column: 1 / -1; text-align: left; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .lab-body { grid-template-columns: 1fr; }
  .lab-controls { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .nav { padding: 0 16px; gap: 12px; }
  .status-pill .label { display: none; }
  .status-pill { padding: 0 10px; }
  .nav-email span { display: none; }
  .nav-email { width: 32px; padding: 0; }
  main > section { padding: 0 16px; }
  main > section + section { margin-top: 110px; }
  #hero { padding-top: 32px; padding-bottom: 40px; }
  #hero h1 { font-size: clamp(46px, 14vw, 64px); }
  .lede { font-size: 16.5px; }
  .cta-row .btn-lg { width: 100%; }
  .proof { gap: 12px 14px; font-size: 12px; line-height: 1.4; }
  .proof b { font-size: 19px; }
  .monitor-foot { gap: 16px; }
  .lab { border-radius: var(--r-lg); }
  .lab-head { grid-template-columns: minmax(0, 1fr) auto; padding: 20px 18px 18px; gap: 12px; }
  .lab-index { display: none; }
  .lab-controls, .lab-output { padding: 18px; }
  .race-lanes { grid-template-columns: 1fr; }
  .race-meter b { font-size: 18px; }
  .actors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chain-row { grid-template-columns: 30px minmax(0, 1fr) 88px; padding: 10px; }
  .seq ol::before { left: 58px; }
  .seq li { grid-template-columns: 64px 1fr; gap: 12px; }
  .seq li::before { left: 55px; }
  .responses li { grid-template-columns: 38px 1fr; }
  .responses li span:last-child { grid-column: 1 / -1; }
  .work-grid { grid-template-columns: 1fr; }
  .work-card { min-height: 0; }
  .status-summary { padding: 20px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .status-list { padding: 4px 8px; }
  .status-list li { grid-template-columns: 1fr; gap: 10px; }
  .fineprint { padding: 14px 20px; }
  .email-block { flex-direction: column; padding: 16px; border-radius: var(--r-lg); width: 100%; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  .crack-b { display: none; }
}

/* ---------------------------------------------------------------- how the labs work */

.guide {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 0; margin: -16px 0 40px;
  border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(180deg, rgba(17, 19, 23, 0.85), rgba(10, 11, 13, 0.9));
}
.guide-note { display: flex; gap: 12px; align-items: flex-start; padding: 22px 24px; border-right: 1px solid var(--line); background: rgba(142, 168, 255, 0.05); }
.guide-note .i { width: 20px; height: 20px; color: var(--accent); margin-top: 2px; }
.guide-note p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.guide-note b { color: var(--text); }
.guide-steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.guide-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 22px 20px; }
.guide-steps li + li { border-left: 1px solid var(--line); }
.step-n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-3); font: 600 12px var(--mono); color: var(--text); }
.guide-steps b { display: block; font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.guide-steps small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.guide-steps .tag, .toggle-text .tag { display: inline-block; vertical-align: 1px; }
.toggle-text b .tag { margin-left: 6px; }

.lab-steps { margin: -4px 0 4px; padding: 12px 14px 12px 34px; border-radius: var(--r); background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line); color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.lab-steps li + li { margin-top: 6px; }
.lab-steps li::marker { color: var(--faint); font-family: var(--mono); font-size: 12px; }
.lab-steps b { color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------------- 1,000-race comparison */

.compare { display: grid; gap: 8px; }
.compare-row {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: #050607;
  animation: rise 0.35s var(--ease) both;
}
.compare-row:nth-child(2) { animation-delay: 0.08s; }
.compare-row:nth-child(3) { animation-delay: 0.16s; }
.compare-row.picked { border-color: var(--line-3); box-shadow: 0 0 0 1px var(--line-3) inset; }
.compare-row.bad.picked { border-color: var(--bad-line); box-shadow: 0 0 0 1px var(--bad-line) inset; }
.compare-name { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.compare-name b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.compare-bar { height: 10px; border-radius: 999px; background: var(--good-bg); border: 1px solid var(--good-line); overflow: hidden; }
.compare-row.bad .compare-bar { background: var(--bg-3); border-color: var(--line-2); }
.compare-bar span { display: block; height: 100%; border-radius: 999px; transition: width 0.9s var(--ease); background: repeating-linear-gradient(-45deg, var(--bad) 0 6px, #e04848 6px 12px); }
.compare-num { font: 12px var(--mono); color: var(--muted); white-space: nowrap; text-align: right; }
.compare-num b { font-size: 16px; font-weight: 650; color: var(--text); }
.compare-row.bad .compare-num b { color: var(--bad); }
.compare-row.good .compare-num b { color: var(--good); }
.compare-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }

@media (max-width: 1080px) {
  .guide { grid-template-columns: 1fr; }
  .guide-note { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .guide { margin-top: -8px; }
  .guide-steps { grid-template-columns: 1fr; }
  .guide-steps li + li { border-left: 0; border-top: 1px solid var(--line); }
  .guide-steps li, .guide-note { padding: 16px 18px; }
  .compare-row { grid-template-columns: minmax(0, 1fr) auto; }
  .compare-bar { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------------------------------------------------------------- resume links */

.nav-resume { margin-left: 0; }
.resume-card {
  display: flex; align-items: center; gap: 16px; max-width: 640px; margin: 22px auto 0; padding: 16px 16px 16px 20px; text-align: left;
  border: 1px solid var(--line-2); border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.03);
}
.resume-icon { width: 28px; height: 28px; color: var(--accent); }
.resume-text { flex: 1; min-width: 0; }
.resume-text b { display: block; font-size: 15px; font-weight: 600; }
.resume-text small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.resume-actions { display: flex; gap: 8px; flex: none; }
@media (max-width: 1080px) { .nav-resume span { display: none; } .nav-resume { width: 32px; padding: 0; } }
@media (max-width: 640px) {
  .resume-card { flex-wrap: wrap; }
  .resume-actions { width: 100%; }
  .resume-actions .btn { flex: 1; }
}
