:root {
  --bg: #05060a;
  --bg-2: #0a0d16;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --text: #e8ecf5;
  --muted: #8b93a7;
  --dim: #5a6175;
  --cyan: #38e8ff;
  --amber: #ffb547;
  --violet: #9b7bff;
  --green: #3dffa8;
  --red: #ff5d6c;
  --blue: #4d8dff;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 18px;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
code { font-family: var(--font-mono); font-size: 0.88em; color: var(--cyan); }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.02em; line-height: 1.05; }
h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
em { font-style: normal; }
::selection { background: var(--cyan); color: var(--bg); }

.grad {
  background: linear-gradient(100deg, var(--cyan), var(--violet) 55%, var(--amber));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: gradShift 8s ease-in-out infinite alternate;
}
@keyframes gradShift { to { background-position: 100% 0; } }

/* ---------- ambient layers ---------- */
.grain {
  position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px;
  border-radius: 50%; pointer-events: none; z-index: 1;
  background: radial-gradient(circle, rgba(56, 232, 255, 0.07), transparent 60%);
  transform: translate3d(-999px, -999px, 0);
}
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; }
.scroll-progress span {
  display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--amber));
}

#bench3d {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block;
  transition: opacity 0.2s linear;
}
#bench3d-labels { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.no-webgl #bench3d { display: none; }
.no-webgl .hero {
  background: radial-gradient(ellipse at 75% 45%, rgba(56, 232, 255, 0.18), transparent 55%),
              radial-gradient(ellipse at 90% 80%, rgba(155, 123, 255, 0.16), transparent 50%);
}

.lbl {
  font-family: var(--font-mono); font-size: 11px; line-height: 1.3; color: var(--text);
  padding: 6px 9px; border-radius: 8px; white-space: nowrap;
  background: rgba(5, 6, 10, 0.88); border: 1px solid var(--line);
  transition: opacity 0.25s;
  /* Own small layer each: the 3D scene moves labels every frame, which would
     otherwise repaint a full-screen layer and blend it over the canvas. */
  will-change: transform, opacity;
}
.lbl b { display: block; font-weight: 700; color: var(--c, var(--cyan)); font-size: 12px; }
.lbl span { color: var(--muted); }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 50;
  width: min(calc(100% - 2 * 16px), var(--max));
  display: flex; align-items: center; gap: 24px; padding: 10px 10px 10px 18px;
  border-radius: 999px; border: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.nav.scrolled { background: rgba(8, 10, 18, 0.9); border-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; }
.brand svg { width: 30px; height: 30px; }
.brand svg rect { fill: #0c1020; stroke: var(--line); }
.brand svg path { fill: none; stroke: var(--cyan); stroke-width: 2.4; stroke-dasharray: 60; animation: logoTrace 4s ease-in-out infinite; }
@keyframes logoTrace { 0% { stroke-dashoffset: 60; } 50% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -60; } }
.nav-links { display: flex; gap: 22px; margin-left: auto; font-size: 0.9rem; color: var(--muted); }
.nav-links a { position: relative; transition: color 0.2s; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: var(--cyan); transform: scaleX(0); transition: transform 0.3s; }
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; border: 1px solid var(--line); position: relative; overflow: hidden;
  transition: transform 0.25s, box-shadow 0.3s, background 0.3s, border-color 0.3s;
  will-change: transform;
}
.btn.small { padding: 9px 18px; font-size: 0.85rem; }
.btn.big { padding: 18px 34px; font-size: 1.05rem; }
.btn.primary { background: var(--cyan); color: #031016; border-color: var(--cyan); box-shadow: 0 0 0 0 rgba(56, 232, 255, 0.5); }
.btn.primary:hover { box-shadow: 0 10px 40px -6px rgba(56, 232, 255, 0.6); }
.btn.primary::before {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.6) 50%, transparent 70%);
  animation: shine 3.6s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.btn.ghost { background: rgba(14, 17, 28, 0.75); }
.btn.ghost:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.07); }
.btn .arrow { transition: transform 0.25s; }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- hero ---------- */
.hero {
  position: relative; z-index: 3; min-height: 100vh; min-height: 100svh;
  padding: 140px var(--gutter) 60px; max-width: var(--max); margin: 0 auto;
  display: flex; flex-direction: column; justify-content: center;
  pointer-events: none;
}
.hero a, .hero button { pointer-events: auto; }
.hero::before {
  content: ""; position: absolute; inset: 0 calc(50% - 50vw); z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(5, 6, 10, 0.85) 0%, rgba(5, 6, 10, 0.55) 45%, transparent 62%),
              linear-gradient(0deg, var(--bg) 0%, transparent 18%);
}
.hero-copy { max-width: 620px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 26px; padding: 7px 14px 7px 10px;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; background: rgba(5, 6, 10, 0.8);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(61, 255, 168, 0.6); animation: live 1.8s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 9px rgba(61, 255, 168, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 255, 168, 0); } }
.hero-title { font-size: clamp(2.8rem, 7.4vw, 6rem); font-weight: 700; line-height: 0.98; letter-spacing: -0.045em; }
.hero-title em { color: var(--cyan); text-shadow: 0 0 40px rgba(56, 232, 255, 0.35); }
.hero-title em:last-of-type { color: var(--amber); text-shadow: 0 0 40px rgba(255, 181, 71, 0.3); }
.split-word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split-char { display: inline-block; will-change: transform; }
.lede { font-size: clamp(1.02rem, 1.4vw, 1.18rem); color: #b7bfd2; margin: 28px 0 34px; max-width: 560px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-ticker { margin-top: 38px; display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 14px; color: var(--muted); }
.ticker-label::after { content: " ›"; color: var(--dim); }
.ticker-window { height: 1.6em; overflow: hidden; display: inline-block; }
.ticker-words { display: flex; flex-direction: column; color: var(--text); animation: ticker 12.5s cubic-bezier(.7, 0, .2, 1) infinite; }
.ticker-words span { height: 1.6em; line-height: 1.6em; }
@keyframes ticker {
  0%, 16% { transform: translateY(0); } 20%, 36% { transform: translateY(-1.6em); } 40%, 56% { transform: translateY(-3.2em); }
  60%, 76% { transform: translateY(-4.8em); } 80%, 96% { transform: translateY(-6.4em); } 100% { transform: translateY(-8em); }
}
.hero-stats { display: flex; gap: 34px; margin-top: 56px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; border-left: 1px solid var(--line); padding-left: 14px; }
.hero-stats b { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; }
.hero-stats div > span { font-size: 0.8rem; color: var(--muted); }
.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase;
}
.mouse { width: 22px; height: 34px; border: 1.5px solid var(--muted); border-radius: 12px; position: relative; }
.mouse span { position: absolute; left: 50%; top: 6px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--cyan); animation: wheel 1.6s infinite; }
@keyframes wheel { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- marquee ---------- */
.marquee { position: relative; z-index: 3; overflow: hidden; padding: 26px 0; border-block: 1px solid var(--line); background: var(--bg); }
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee span { font-family: var(--font-display); font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-weight: 600; padding: 0 28px; color: transparent; -webkit-text-stroke: 1px rgba(232, 236, 245, 0.35); white-space: nowrap; }
.marquee span:nth-child(3n + 1) { color: var(--text); -webkit-text-stroke: 0; }
.marquee span::after { content: "✦"; margin-left: 56px; font-size: 0.5em; vertical-align: middle; color: var(--cyan); -webkit-text-stroke: 0; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- section scaffolding ---------- */
.section { position: relative; z-index: 3; background: var(--bg); padding: clamp(90px, 12vw, 160px) var(--gutter); }
.section > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.section-head { text-align: center; margin-bottom: clamp(48px, 7vw, 84px); }
.section-head.left { text-align: left; margin-bottom: 0; }
.kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); margin: 0 0 16px; }
.sub { max-width: 640px; margin: 22px auto 0; color: var(--muted); font-size: 1.05rem; }
.section-head.left .sub { margin-left: 0; }

/* ---------- loop ---------- */
.loop { background: radial-gradient(ellipse at 50% 0%, rgba(56, 232, 255, 0.07), transparent 60%), var(--bg); }
.loop-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(30px, 6vw, 90px); align-items: center; }
.loop-svg { width: 100%; max-width: 540px; display: block; margin: 0 auto; overflow: visible; }
.loop-track { fill: none; stroke: rgba(255, 255, 255, 0.06); stroke-width: 22; }
.loop-ticks { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 6; stroke-dasharray: 1 11; animation: spin 60s linear infinite; transform-origin: 260px 260px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loop-base { fill: none; stroke: rgba(255, 255, 255, 0.18); stroke-width: 2; }
.loop-gap { fill: none; stroke: var(--red); stroke-width: 3; stroke-dasharray: 6 9; opacity: 0.85; animation: gapBlink 1.2s steps(2) infinite; }
@keyframes gapBlink { 50% { opacity: 0.3; } }
.loop.connected .loop-gap { animation: none; opacity: 0; transition: opacity 0.6s 0.8s; }
.loop-arc { fill: none; stroke: url(#arcGrad); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 8px rgba(56, 232, 255, 0.7)); transition: stroke-dashoffset 1.6s cubic-bezier(.6, 0, .2, 1); }
.loop.connected .loop-arc { stroke-dashoffset: 0; }
.loop-orb { fill: #fff; }
.loop-node circle.bg { fill: var(--bg-2); stroke: rgba(255, 255, 255, 0.2); stroke-width: 1.5; transition: stroke 0.3s, fill 0.3s; }
.loop-node.hw circle.bg { stroke: rgba(56, 232, 255, 0.5); }
.loop-node.on circle.bg { stroke: var(--cyan); fill: #0d2630; }
.loop-node text { font-family: var(--font-mono); font-size: 13px; fill: var(--text); text-anchor: middle; dominant-baseline: middle; }
.loop-node text.n { font-size: 11px; fill: var(--muted); }
.loop-node .halo { fill: none; stroke: var(--cyan); stroke-width: 2; opacity: 0; }
.loop-node.on .halo { animation: halo 0.9s ease-out; }
@keyframes halo { 0% { opacity: 0.9; r: 34; } 100% { opacity: 0; r: 58; } }
.lc-small { font-family: var(--font-mono); font-size: 13px; fill: var(--muted); text-anchor: middle; letter-spacing: 0.15em; text-transform: uppercase; }
.lc-big { font-family: var(--font-display); font-size: 46px; font-weight: 700; fill: var(--text); text-anchor: middle; }
.lc-verdict { font-family: var(--font-mono); font-size: 14px; font-weight: 700; fill: var(--green); text-anchor: middle; letter-spacing: 0.3em; }
.lc-verdict.fail { fill: var(--red); }
.loop-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; counter-reset: s; }
.loop-steps li { position: relative; padding: 14px 18px 14px 58px; border-radius: 14px; border: 1px solid transparent; transition: background 0.35s, border-color 0.35s, transform 0.35s; }
.loop-steps li::before { counter-increment: s; content: "0" counter(s); position: absolute; left: 18px; top: 15px; font-family: var(--font-mono); font-size: 12px; color: var(--dim); }
.loop-steps li b { display: block; font-family: var(--font-display); font-size: 1.15rem; }
.loop-steps li span { color: var(--muted); font-size: 0.93rem; }
.loop-steps li.hw b::after { content: "bench"; margin-left: 10px; padding: 2px 8px; border-radius: 6px; font-family: var(--font-mono); font-size: 10px; font-weight: 500; vertical-align: middle; color: var(--cyan); border: 1px solid rgba(56, 232, 255, 0.35); }
.loop-steps li.on { background: var(--panel); border-color: var(--line); transform: translateX(6px); }
.loop-steps li.on::before { color: var(--cyan); }
.rails { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 90px !important; }
.rail-card { padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.rail-card .ri { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; margin-bottom: 14px; background: rgba(56, 232, 255, 0.1); color: var(--cyan); font-size: 18px; }
.rail-card b { font-family: var(--font-display); font-size: 1.05rem; }
.rail-card p { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; }

/* ---------- problems ---------- */
.problem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.problem {
  position: relative; padding: 30px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg-2); transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  overflow: hidden;
}
/* A hairline that draws across the top when the card scrolls in (main.js adds .in). */
.js .problem::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--cyan), transparent); transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.9s cubic-bezier(.2, .8, .2, 1) var(--d, 0s); }
.js .problem.in::before { transform: scaleX(1); }
.problem:hover { border-color: rgba(255, 255, 255, 0.18); transform: translateY(-2px); box-shadow: 0 12px 32px -18px rgba(0, 0, 0, 0.8); }
.p-num { font-family: var(--font-mono); font-size: 12px; color: var(--dim); margin-bottom: 40px; }
.problem h3 { font-size: 1.35rem; margin-bottom: 14px; }
.pain { color: var(--muted); font-size: 0.95rem; margin: 0 0 18px; }
.fix { margin: 0; font-size: 0.97rem; padding-top: 18px; border-top: 1px solid var(--line); }
.js .problem .fix { opacity: 0; transform: translateY(8px); transition: opacity 0.6s calc(var(--d, 0s) + 0.35s), transform 0.6s calc(var(--d, 0s) + 0.35s); }
.js .problem.in .fix { opacity: 1; transform: none; }
.fix span { color: var(--cyan); font-weight: 700; margin-right: 6px; }

/* ---------- stats ---------- */
.achieves { background: linear-gradient(180deg, var(--bg), var(--bg-2) 50%, var(--bg)); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--bg-2); padding: 34px 28px; position: relative; transition: background 0.3s; }
.stat:hover { background: #0e1220; }
.stat-val { font-family: var(--font-display); font-size: clamp(2.6rem, 4.4vw, 3.6rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.stat-val small { font-size: 0.42em; color: var(--cyan); margin-left: 6px; letter-spacing: 0; }
.stat p { color: var(--muted); font-size: 0.9rem; margin: 14px 0 18px; min-height: 2.9em; }
.tag-measured, .tag-target { display: inline-block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.tag-measured { color: var(--green); background: rgba(61, 255, 168, 0.08); border: 1px solid rgba(61, 255, 168, 0.25); }
.tag-target { color: var(--amber); background: rgba(255, 181, 71, 0.08); border: 1px solid rgba(255, 181, 71, 0.25); }

/* ---------- architecture ---------- */
.architecture { background: radial-gradient(ellipse at 50% 40%, rgba(155, 123, 255, 0.08), transparent 60%), var(--bg); }
.arch { max-width: 900px !important; display: flex; flex-direction: column; align-items: stretch; }
.tier { padding: 26px 28px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(10, 13, 22, 0.85); position: relative; transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s; }
.tier:hover { transform: translateY(-3px); box-shadow: 0 24px 60px -30px var(--tc); border-color: color-mix(in srgb, var(--tc) 50%, transparent); }
.t-client { --tc: var(--violet); }
.t-bench { --tc: var(--cyan); }
.t-mod { --tc: var(--amber); }
.tier header { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.tier-n { font-family: var(--font-mono); font-size: 11px; color: var(--tc); padding: 3px 8px; border: 1px solid color-mix(in srgb, var(--tc) 40%, transparent); border-radius: 6px; }
.tier h3 { font-size: 1.5rem; }
.tier-where { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-left: auto; }
.tier p { margin: 16px 0 0; color: var(--muted); font-size: 0.94rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { font-size: 0.83rem; padding: 6px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); transition: border-color 0.2s, color 0.2s; }
.chips span:hover { border-color: var(--tc); color: #fff; }
.chips code { font-size: 0.95em; }
.link { position: relative; height: 84px; display: flex; justify-content: center; }
.link svg { width: 20px; height: 100%; }
.link line { stroke: rgba(255, 255, 255, 0.2); stroke-width: 2; stroke-dasharray: 4 6; animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -10; } }
.link em { position: absolute; left: calc(50% + 22px); right: 0; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.pkt { position: absolute; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 2px; }
.pkt.down { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); animation: pktDown 1.8s cubic-bezier(.6, 0, .4, 1) infinite; }
.pkt.up { background: var(--amber); box-shadow: 0 0 12px var(--amber); animation: pktUp 1.8s cubic-bezier(.6, 0, .4, 1) infinite 0.9s; }
@keyframes pktDown { 0% { top: 0; opacity: 0; } 15%, 85% { opacity: 1; } 100% { top: calc(100% - 8px); opacity: 0; } }
@keyframes pktUp { 0% { top: calc(100% - 8px); opacity: 0; } 15%, 85% { opacity: 1; } 100% { top: 0; opacity: 0; } }
.mod-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.mcu { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 6px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.mcu i { width: 30px; height: 30px; border-radius: 5px; background: #121626; border: 1px solid rgba(255, 255, 255, 0.15); position: relative; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.02); }
.mcu i::after { content: ""; position: absolute; right: 5px; top: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: blink 1.6s infinite; }
.mcu:nth-child(2) i::after { animation-delay: 0.3s; } .mcu:nth-child(3) i::after { animation-delay: 0.7s; }
.mcu:nth-child(4) i::after { animation-delay: 0.2s; } .mcu:nth-child(5) i::after { animation-delay: 1.1s; }
.mcu.ghost { border-style: dashed; }
.mcu.ghost i { background: transparent; border-style: dashed; }
.mcu.ghost i::after { background: var(--green); box-shadow: 0 0 8px var(--green); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
.backplane { margin-top: 22px; padding: 22px 26px; border-radius: var(--radius); border: 1px solid rgba(255, 181, 71, 0.2); background: linear-gradient(180deg, rgba(14, 40, 30, 0.35), rgba(10, 13, 22, 0.9)); position: relative; overflow: hidden; }
.bp-line { position: relative; height: 2px; margin: 9px 0; background: rgba(255, 255, 255, 0.08); }
.bp-line span { position: absolute; left: 0; top: -15px; font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.bp-line::after { content: ""; position: absolute; top: -1px; left: 0; height: 4px; width: 18%; border-radius: 2px; animation: travel 2.6s linear infinite; will-change: transform; }
.bp-line.clk { margin-top: 18px; }
.bp-line.clk::after { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); width: 4%; --run: 2500%; animation-duration: 1s; }
.bp-line.clk { background: repeating-linear-gradient(90deg, rgba(56, 232, 255, 0.45) 0 6px, transparent 6px 14px); }
.bp-trig { margin-top: 26px; }
.bp-trig .bp-line { margin: 7px 0; }
.bp-trig .bp-line span { top: -6px; left: auto; right: 0; font-size: 9px; }
.bp-line.trig::after { background: var(--amber); box-shadow: 0 0 10px var(--amber); opacity: 0; animation: trigFire 4s infinite; width: 100%; left: 0; }
.bp-trig .bp-line:nth-child(1)::after { animation-delay: 0.2s; } .bp-trig .bp-line:nth-child(2)::after { animation-delay: 1.9s; }
.bp-trig .bp-line:nth-child(3)::after { animation-delay: 0.9s; } .bp-trig .bp-line:nth-child(4)::after { animation-delay: 3.1s; }
.bp-trig .bp-line:nth-child(5)::after { animation-delay: 2.4s; } .bp-trig .bp-line:nth-child(6)::after { animation-delay: 1.3s; }
.bp-trig .bp-line:nth-child(7)::after { animation-delay: 3.6s; } .bp-trig .bp-line:nth-child(8)::after { animation-delay: 0.5s; }
@keyframes trigFire { 0%, 8% { opacity: 0; } 10% { opacity: 1; } 22%, 100% { opacity: 0; } }
.bp-line.evt { margin-top: 26px; }
.bp-line.evt::after { background: var(--violet); box-shadow: 0 0 10px var(--violet); }
@keyframes travel { from { transform: translateX(-100%); } to { transform: translateX(var(--run, 556%)); } }
.bp-label { margin: 22px 0 0; font-family: var(--font-mono); font-size: 11.5px; color: var(--amber); }

.timing { max-width: 900px !important; margin-top: 90px !important; padding: 34px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.timing-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.timing-head h3 { font-size: 1.35rem; }
.timing-head p { margin: 0; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.t-axis, .t-track { margin-left: 270px; margin-right: 96px; }
.t-axis { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.t-axis span { width: 0; display: flex; justify-content: center; white-space: nowrap; }
.t-rows { display: grid; gap: 4px; margin-top: 10px; }
.t-row { position: relative; display: flex; align-items: center; min-height: 44px; }
.t-row b { position: absolute; left: 0; width: 256px; font-weight: 500; font-size: 0.88rem; }
.t-row em { position: absolute; right: 0; width: 86px; text-align: right; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.t-track { position: relative; flex: 1; height: 14px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px calc(100% / 6)); border-radius: 4px; }
.t-bar { position: absolute; top: 0; bottom: 0; border-radius: 4px; left: var(--l, 0); width: var(--w, 0); transform-origin: 0 50%; transform: scaleX(var(--s, 1)); transition: transform 1.2s cubic-bezier(.2, .8, .2, 1); }
.t-bar.gray { background: linear-gradient(90deg, #5a6175, #8b93a7); }
.t-bar.cyan { background: var(--cyan); box-shadow: 0 0 16px rgba(56, 232, 255, 0.5); }
.t-bar.amber { background: var(--amber); box-shadow: 0 0 16px rgba(255, 181, 71, 0.5); }
.t-bar.green { background: var(--green); box-shadow: 0 0 16px rgba(61, 255, 168, 0.5); }

/* ---------- bento ---------- */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.b-card { position: relative; padding: 28px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); overflow: hidden; padding-top: 172px; display: flex; flex-direction: column; justify-content: flex-start; }
.b-card.span2 { grid-column: span 2; }
.b-card { transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s; }
.b-card:hover { border-color: rgba(255, 255, 255, 0.18); }
.b-card h3 { margin-bottom: 10px; position: relative; }
.b-card p { margin: 0; color: var(--muted); font-size: 0.92rem; position: relative; }
.b-anim { position: absolute; top: 26px; left: 28px; right: 28px; height: 120px; }
.timeline-anim { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.timeline-anim i { position: relative; display: block; height: 2px; background: rgba(255, 255, 255, 0.08); }
.timeline-anim i::before { content: ""; position: absolute; top: -5px; width: 12px; height: 12px; border-radius: 3px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); left: var(--x); animation: tickIn 3.2s infinite; animation-delay: var(--d); }
.timeline-anim i:nth-child(1) { --x: 12%; --d: 0s; } .timeline-anim i:nth-child(2) { --x: 34%; --d: 0.3s; }
.timeline-anim i:nth-child(3) { --x: 34%; --d: 0.3s; } .timeline-anim i:nth-child(4) { --x: 61%; --d: 0.6s; }
.timeline-anim i:nth-child(5) { --x: 82%; --d: 0.9s; }
.timeline-anim i:nth-child(3)::before { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.timeline-anim::after { content: "t0"; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1px dashed var(--green); padding-left: 6px; font-family: var(--font-mono); font-size: 10px; color: var(--green); animation: t0 3.2s infinite; }
@keyframes tickIn { 0%, 10% { opacity: 0; transform: translateY(-14px); } 25%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes t0 { 0% { left: 0; } 100% { left: 100%; } }
.or-anim { display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.or-anim i { display: block; height: 3px; border-radius: 2px; background: rgba(255, 181, 71, 0.15); position: relative; overflow: hidden; }
.or-anim i::after { content: ""; position: absolute; inset: 0; background: var(--amber); box-shadow: 0 0 14px var(--amber); animation: trigFire 2.4s infinite; }
.or-anim i:nth-child(2)::after { animation-delay: 0.8s; } .or-anim i:nth-child(3)::after { animation-delay: 1.6s; }
.spec-anim { display: grid; grid-template-columns: auto 1fr; grid-template-rows: repeat(4, 1fr); column-gap: 18px; align-items: center; font-family: var(--font-mono); font-size: 11px; }
.spec-anim span { grid-row: 1 / 5; padding: 8px 10px; border: 1px solid var(--green); border-radius: 8px; color: var(--green); }
.spec-anim i { font-style: normal; color: var(--muted); opacity: 0; animation: specOut 4s infinite; }
.spec-anim i:nth-of-type(2) { animation-delay: 0.3s; } .spec-anim i:nth-of-type(3) { animation-delay: 0.6s; } .spec-anim i:nth-of-type(4) { animation-delay: 0.9s; }
@keyframes specOut { 0% { opacity: 0; transform: translateX(-12px); } 15%, 80% { opacity: 1; transform: none; color: var(--text); } 100% { opacity: 0; } }
.shield-anim { display: flex; justify-content: flex-start; }
.shield-anim svg { width: 90px; height: 90px; fill: none; stroke: var(--violet); stroke-width: 2; filter: drop-shadow(0 0 10px rgba(155, 123, 255, 0.6)); }
.shield-anim .tick { stroke: var(--green); stroke-dasharray: 30; stroke-dashoffset: 30; animation: tickDraw 2.4s ease-in-out infinite; }
@keyframes tickDraw { 0%, 20% { stroke-dashoffset: 30; } 50%, 80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -30; } }
.twin-anim { display: flex; align-items: center; gap: 14px; font-family: var(--font-mono); font-size: 12px; }
.twin-anim span { padding: 18px 16px; border-radius: 10px; border: 1px solid var(--line); }
.twin-anim .hw { border-color: var(--amber); color: var(--amber); animation: float 3s ease-in-out infinite; }
.twin-anim .sim { border-color: var(--cyan); color: var(--cyan); border-style: dashed; animation: float 3s ease-in-out infinite 1.5s; }
.twin-anim .eq { border: 0; font-size: 22px; color: var(--muted); padding: 0; }
@keyframes float { 50% { transform: translateY(-8px); } }
.trace-anim { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11.5px; flex-wrap: nowrap; }
.trace-anim span { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); white-space: nowrap; opacity: 0.35; animation: traceOn 4s infinite; }
.trace-anim i { flex: 1; min-width: 14px; height: 1px; background: linear-gradient(90deg, var(--cyan), transparent); opacity: 0.35; animation: traceOn 4s infinite; }
.trace-anim > :nth-child(2) { animation-delay: 0.3s; } .trace-anim > :nth-child(3) { animation-delay: 0.6s; } .trace-anim > :nth-child(4) { animation-delay: 0.9s; }
.trace-anim > :nth-child(5) { animation-delay: 1.2s; } .trace-anim > :nth-child(6) { animation-delay: 1.5s; } .trace-anim > :nth-child(7) { animation-delay: 1.8s; }
.trace-anim .ok { color: var(--green); border-color: rgba(61, 255, 168, 0.4); }
@keyframes traceOn { 0%, 5% { opacity: 0.35; } 15%, 85% { opacity: 1; } 100% { opacity: 0.35; } }
.slot-anim { display: flex; gap: 10px; align-items: flex-end; height: 110px; }
.slot-anim i { width: 26px; height: 96px; border-radius: 4px; border: 1px solid var(--line); background: var(--panel-2); }
.slot-anim i.new { border: 1px dashed var(--green); background: rgba(61, 255, 168, 0.08); animation: slotIn 3s cubic-bezier(.5, 0, .2, 1) infinite; }
@keyframes slotIn { 0% { transform: translateY(-60px); opacity: 0; } 40%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; } }

/* ---------- use cases ---------- */
.usecases { position: relative; z-index: 3; background: var(--bg); overflow: hidden; }
.uc-pin { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 110px 0 70px; }
.uc-head { padding: 0 var(--gutter); max-width: var(--max); width: 100%; margin: 0 auto 50px; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px 30px; }
.uc-head .kicker { grid-column: 1 / -1; margin: 0; }
.uc-progress { width: 200px; height: 2px; background: var(--line); }
.uc-progress span { display: block; height: 100%; background: var(--cyan); transform-origin: 0 50%; transform: scaleX(0); }
.uc-track { display: flex; gap: 20px; padding: 0 var(--gutter); width: max-content; will-change: transform; }
.uc {
  width: min(380px, 80vw); flex: 0 0 auto; padding: 30px; border-radius: 22px; border: 1px solid var(--line);
  background: var(--bg-2); position: relative; overflow: hidden;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.uc:hover { border-color: rgba(255, 255, 255, 0.18); transform: translateY(-2px); box-shadow: 0 12px 32px -18px rgba(0, 0, 0, 0.8); }
.uc-icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--panel); margin-bottom: 70px; position: relative; }
.uc-icon svg { width: 30px; height: 30px; fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 200; stroke-dashoffset: 0; }
.uc:hover .uc-icon svg { animation: iconDraw 1.2s ease-out; }
@keyframes iconDraw { from { stroke-dashoffset: 200; } to { stroke-dashoffset: 0; } }
.uc-n { position: absolute; top: 30px; right: 30px; font-family: var(--font-mono); font-size: 13px; color: var(--dim); }
.uc h3 { font-size: 1.45rem; margin-bottom: 14px; }
.uc p { color: var(--muted); font-size: 0.95rem; margin: 0 0 22px; min-height: 7.6em; }
.uc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.uc-tags span { font-family: var(--font-mono); font-size: 11px; padding: 4px 9px; border-radius: 6px; border: 1px solid var(--line); color: var(--text); }

/* ---------- code ---------- */
.code-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(30px, 5vw, 70px); align-items: center; }
.ticks { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 30px; color: #b7bfd2; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 16px; height: 9px; border-left: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan); transform: rotate(-45deg); }
.terminal { border-radius: 16px; border: 1px solid var(--line); background: #070910; box-shadow: 0 40px 120px -40px rgba(56, 232, 255, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.02) inset; overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #0b0e18; }
.dots { display: flex; gap: 7px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #2a2f3e; }
.dots i:nth-child(1) { background: #ff5f57; } .dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.term-tabs { display: flex; gap: 4px; overflow-x: auto; }
.term-tabs button { font-family: var(--font-mono); font-size: 12px; color: var(--muted); background: none; border: 1px solid transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.term-tabs button[aria-selected="true"] { color: var(--text); background: var(--panel-2); border-color: var(--line); }
.term-body { margin: 0; padding: 22px 24px; height: 470px; overflow: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.65; color: #c9d1e4; white-space: pre; }
.term-body code { color: inherit; font-size: inherit; }
.caret { display: inline-block; width: 8px; height: 1.1em; vertical-align: text-bottom; background: var(--cyan); animation: blink 1s steps(2) infinite; }
.tk-k { color: #c792ea; } .tk-s { color: #c3e88d; } .tk-c { color: #5a6175; font-style: italic; } .tk-n { color: #f78c6c; }
.tk-f { color: #82aaff; } .tk-d { color: #ffcb6b; } .tk-ok { color: var(--green); } .tk-bad { color: var(--red); } .tk-dim { color: var(--dim); }
.tk-p { color: var(--cyan); } .tk-a { color: var(--amber); }

/* ---------- modules ---------- */
.mod-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mod { padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s; }
.mod:hover { border-color: color-mix(in srgb, var(--c) 40%, transparent); transform: translateY(-2px); box-shadow: 0 12px 32px -18px rgba(0, 0, 0, 0.8); }
.mod.roadmap { border-style: dashed; grid-column: span 2; }
.panel { height: 110px; border-radius: 10px; margin-bottom: 20px; position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; background: linear-gradient(180deg, #1a1f2e, #10131d); border: 1px solid rgba(255, 255, 255, 0.08); }
.panel::before { content: ""; position: absolute; left: 10px; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--c); box-shadow: 0 0 12px var(--c); }
.panel i { position: absolute; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); animation: blink 1.4s infinite; }
.panel i:nth-of-type(1) { right: 26px; } .panel i:nth-of-type(2) { right: 14px; animation-delay: 0.5s; background: var(--green); box-shadow: 0 0 8px var(--green); }
.panel b { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle, #05060a 35%, #2b3142 40%, #1a1e2b 70%); border: 1px solid rgba(255, 255, 255, 0.12); }
.mod.roadmap .panel b, .mod.roadmap .panel::before { display: none; }
.mod-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-family: var(--font-mono); font-size: 11px; }
.cid { color: var(--c); }
.st { padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.st.hw { color: var(--green); border-color: rgba(61, 255, 168, 0.3); }
.st.sim { color: var(--cyan); border-color: rgba(56, 232, 255, 0.3); }
.st.spec { color: var(--violet); border-color: rgba(155, 123, 255, 0.3); }
.mod h3 { margin-bottom: 8px; font-size: 1.25rem; }
.mod p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* ---------- compare ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); }
.cmp { width: 100%; border-collapse: collapse; min-width: 720px; }
.cmp th, .cmp td { padding: 18px 20px; text-align: center; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.cmp th { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.cmp td:first-child, .cmp th:first-child { text-align: left; color: #b7bfd2; }
.cmp tr:last-child td { border-bottom: 0; }
.cmp .us { background: linear-gradient(180deg, rgba(56, 232, 255, 0.09), rgba(56, 232, 255, 0.04)); color: var(--cyan); }
.cmp th.us { color: var(--cyan); }
.cmp .price td { font-size: 0.85rem; color: var(--muted); }
.cmp .price td.us { color: var(--cyan); font-weight: 600; }
.cmp i, .legend i { display: inline-block; width: 22px; height: 22px; border-radius: 50%; position: relative; vertical-align: middle; }
.cmp i.y, .legend i.y { background: rgba(61, 255, 168, 0.15); }
.cmp i.y::after, .legend i.y::after { content: ""; position: absolute; left: 7px; top: 5px; width: 6px; height: 10px; border-right: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(45deg); }
.cmp i.n, .legend i.n { background: rgba(255, 93, 108, 0.1); }
.cmp i.n::after, .legend i.n::after { content: ""; position: absolute; left: 6px; top: 10px; width: 10px; height: 2px; background: var(--red); opacity: 0.7; }
.cmp i.m, .legend i.m { background: rgba(255, 181, 71, 0.12); }
.cmp i.m::after, .legend i.m::after { content: ""; position: absolute; left: 7px; top: 7px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--amber); clip-path: inset(0 50% 0 0); }
.legend { display: flex; gap: 20px; justify-content: flex-end; padding: 14px 20px; margin: 0; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 18px; height: 18px; transform: scale(0.85); }

/* ---------- status timeline ---------- */
.tl { position: relative; max-width: 760px !important; padding-left: 40px; }
.tl-line { position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-fill { position: absolute; inset: 0; background: linear-gradient(var(--green), var(--cyan) 70%, var(--violet)); transform-origin: top; transform: scaleY(0); }
.tl-item { position: relative; padding: 0 0 36px 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -36px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--dim); }
.tl-item.done .tl-dot { border-color: var(--green); background: var(--green); box-shadow: 0 0 14px rgba(61, 255, 168, 0.6); }
.tl-item.now .tl-dot { border-color: var(--cyan); animation: live 1.8s infinite; box-shadow: 0 0 0 0 rgba(56, 232, 255, 0.6); }
.tl-item.now .tl-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--cyan); }
.tl-item b { font-family: var(--font-display); font-size: 1.25rem; }
.tl-item.done b::after { content: "done"; margin-left: 10px; font-family: var(--font-mono); font-size: 10px; font-weight: 500; color: var(--green); vertical-align: middle; }
.tl-item.now b::after { content: "in progress"; margin-left: 10px; font-family: var(--font-mono); font-size: 10px; font-weight: 500; color: var(--cyan); vertical-align: middle; }
.tl-item p { margin: 6px 0 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- CTA ---------- */
.cta { position: relative; z-index: 3; background: var(--bg); padding: clamp(120px, 16vw, 200px) var(--gutter); text-align: center; overflow: hidden; }
.cta-inner { position: relative; max-width: 760px; margin: 0 auto; }
.cta h2 { font-size: clamp(2.4rem, 6vw, 4.8rem); margin-bottom: 26px; }
.cta p { color: #b7bfd2; font-size: 1.08rem; margin: 0 auto 40px; max-width: 600px; }
.rings { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.rings i { position: absolute; border-radius: 50%; border: 1px solid rgba(56, 232, 255, 0.14); left: 50%; top: 50%; transform: translate(-50%, -50%); animation: ring 9s linear infinite; }
.rings i::after { content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 16px var(--cyan); }
.rings i:nth-child(1) { width: 380px; height: 380px; }
.rings i:nth-child(2) { width: 580px; height: 580px; animation-duration: 14s; animation-direction: reverse; border-color: rgba(155, 123, 255, 0.12); }
.rings i:nth-child(2)::after { background: var(--violet); box-shadow: 0 0 16px var(--violet); }
.rings i:nth-child(3) { width: 800px; height: 800px; animation-duration: 22s; border-color: rgba(255, 181, 71, 0.08); }
.rings i:nth-child(3)::after { background: var(--amber); box-shadow: 0 0 16px var(--amber); }
.rings i:nth-child(4) { width: 1040px; height: 1040px; animation-duration: 34s; animation-direction: reverse; border-color: rgba(255, 255, 255, 0.05); }
@keyframes ring { to { transform: translate(-50%, -50%) rotate(360deg); } }

.footer { position: relative; z-index: 3; background: var(--bg); border-top: 1px solid var(--line); padding: 40px var(--gutter); display: flex; gap: 30px; align-items: center; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); }
.footer p { margin: 0; flex: 1; min-width: 260px; }
.footer .copy { flex: 0; white-space: nowrap; }

/* ---------- page transitions ---------- */
.page-curtain {
  position: fixed; inset: 0; z-index: 200; pointer-events: none; background: var(--bg);
  animation: curtainUp 0.7s 0.05s cubic-bezier(.7, 0, .2, 1) forwards;
}
.page-curtain::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--amber));
  animation: curtainLine 0.7s cubic-bezier(.7, 0, .2, 1) forwards;
}
@keyframes curtainUp { to { opacity: 0; visibility: hidden; } }
@keyframes curtainLine { 0% { transform: scaleX(0); } 60% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
body.leaving .page-curtain { animation: curtainDown 0.4s cubic-bezier(.7, 0, .2, 1) forwards; visibility: visible; }
body.leaving .page-curtain::after { animation: curtainLine 0.4s cubic-bezier(.7, 0, .2, 1) forwards; }
@keyframes curtainDown { from { opacity: 0; } to { opacity: 1; } }

.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- sub-page hero ---------- */
.page-hero { position: relative; z-index: 3; min-height: 78vh; display: flex; align-items: flex-end; padding: 150px var(--gutter) 90px; overflow: hidden; background: var(--bg); border-bottom: 1px solid var(--line); }
.ph-inner { position: relative; max-width: var(--max); width: 100%; margin: 0 auto; }
.page-hero h1 { font-size: clamp(2.6rem, 7vw, 5.6rem); font-weight: 700; letter-spacing: -0.045em; line-height: 1; max-width: 15ch; }
.page-hero h1 em { color: var(--cyan); text-shadow: 0 0 40px rgba(56, 232, 255, 0.35); }
.page-hero .lede { max-width: 640px; }
.ph-bg { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 64px 64px; mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 70%);
  animation: gridDrift 18s linear infinite; }
@keyframes gridDrift { to { background-position: 64px 64px, 64px 64px; } }
.ph-bg i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.55; }
.ph-bg i:nth-child(1) { width: 420px; height: 420px; right: 8%; top: 10%; background: rgba(56, 232, 255, 0.35); animation: blob 14s ease-in-out infinite alternate; }
.ph-bg i:nth-child(2) { width: 360px; height: 360px; right: 26%; top: 40%; background: rgba(155, 123, 255, 0.35); animation: blob 18s ease-in-out infinite alternate-reverse; }
.ph-bg i:nth-child(3) { width: 260px; height: 260px; right: 2%; top: 55%; background: rgba(255, 181, 71, 0.25); animation: blob 11s ease-in-out infinite alternate; }
@keyframes blob { 50% { transform: translate(-40px, 30px) scale(1.15); } 100% { transform: translate(30px, -20px) scale(0.9); } }

/* ---------- home: doors to the other pages ---------- */
.door-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.door {
  position: relative; display: flex; flex-direction: column; min-height: 400px; padding: 28px; border-radius: 22px;
  border: 1px solid var(--line); background: var(--bg-2); overflow: hidden;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.door:hover { border-color: color-mix(in srgb, var(--c) 40%, transparent); transform: translateY(-2px); box-shadow: 0 12px 32px -18px rgba(0, 0, 0, 0.8); }
.door-n { font-family: var(--font-mono); font-size: 12px; color: var(--dim); }
.door h3 { font-size: 1.5rem; margin: auto 0 10px; position: relative; }
.door p { color: var(--muted); font-size: 0.93rem; margin: 0 0 22px; position: relative; }
.door-go { font-family: var(--font-mono); font-size: 12px; color: var(--c); position: relative; }
.door-go b { display: inline-block; transition: transform 0.3s; }
.door:hover .door-go b { transform: translateX(6px); }
.door-art { position: relative; height: 130px; margin: 22px 0 0; display: block; }
.door-art i { position: absolute; display: block; }
.art-slots { display: flex !important; gap: 8px; align-items: stretch; padding: 14px 4px; }
.art-slots i { position: relative; flex: 1; border-radius: 4px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.art-slots i::after { content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 2px; border-radius: 1px; background: var(--c); opacity: 0.35; animation: slotLight 3.6s ease-in-out infinite; }
.art-slots i:nth-child(2)::after { animation-delay: 0.3s; } .art-slots i:nth-child(3)::after { animation-delay: 0.6s; }
.art-slots i:nth-child(4)::after { animation-delay: 0.9s; } .art-slots i:nth-child(5)::after { animation-delay: 1.2s; } .art-slots i:nth-child(6)::after { animation-delay: 1.5s; }
@keyframes slotLight { 0%, 60%, 100% { opacity: 0.35; } 20% { opacity: 1; } }
.art-tiers i { left: 10%; right: 10%; height: 26px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); background: color-mix(in srgb, var(--c) 8%, transparent); animation: tierPulse 3s ease-in-out infinite; }
.art-tiers i:nth-child(1) { top: 10px; } .art-tiers i:nth-child(2) { top: 52px; left: 16%; right: 16%; animation-delay: 0.4s; } .art-tiers i:nth-child(3) { top: 94px; left: 22%; right: 22%; animation-delay: 0.8s; }
@keyframes tierPulse { 50% { box-shadow: 0 0 22px -4px var(--c); transform: translateX(6px); } }
.art-grid { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; }
.art-grid i { position: relative; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); animation: gridLight 4s infinite; }
.art-grid i:nth-child(2) { animation-delay: 1s; } .art-grid i:nth-child(3) { animation-delay: 3s; } .art-grid i:nth-child(4) { animation-delay: 2s; }
@keyframes gridLight { 0%, 30%, 100% { border-color: var(--line); background: var(--panel); } 10%, 20% { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); } }
.art-road::before { content: ""; position: absolute; left: 6%; right: 6%; top: 64px; height: 2px; background: linear-gradient(90deg, var(--c) 55%, var(--line) 55%); }
.art-road i { top: 56px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--c); background: var(--bg); }
.art-road i:nth-child(1) { left: 6%; background: var(--c); } .art-road i:nth-child(2) { left: 30%; background: var(--c); }
.art-road i:nth-child(3) { left: 55%; animation: live 1.8s infinite; box-shadow: 0 0 0 0 rgba(61, 255, 168, 0.6); } .art-road i:nth-child(4) { left: 88%; border-color: var(--dim); }

/* ---------- next-page link ---------- */
.next-page {
  position: relative; z-index: 3; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 6px 28px;
  max-width: var(--max); margin: 0 auto; padding: 70px var(--gutter); border-top: 1px solid var(--line); background: var(--bg);
}
.np-k { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); }
.np-t { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.2rem, 6vw, 4.4rem); letter-spacing: -0.04em; line-height: 1; transition: color 0.3s; }
.np-arrow { display: inline-block; margin-left: 18px; color: var(--cyan); transition: transform 0.4s cubic-bezier(.2, .8, .2, 1); }
.np-b { grid-column: 2; color: var(--muted); }
.next-page:hover .np-t { color: var(--cyan); }
.next-page:hover .np-arrow { transform: translateX(16px); }

/* ---------- bench page: full-screen 3D tour ---------- */
.tour { position: relative; z-index: 3; height: 900vh; background: var(--bg); }
.tour-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.tour-frame { position: absolute; inset: 0; clip-path: inset(30vh 10vw 8vh 10vw round 28px); contain: strict; }
/* Full-screen overlays would be blended over the WebGL layer every frame. */
body[data-page="bench"] .grain, body[data-page="bench"] .cursor-glow { display: none; }
.tour-frame #bench3d, .tour-frame #bench3d-labels { position: absolute; }
.tour-intro { position: absolute; left: 0; right: 0; top: 0; height: 30vh; padding: 92px var(--gutter) 0; text-align: center; display: flex; flex-direction: column; justify-content: center; }
.tour-intro .kicker { margin-bottom: 10px; }
.tour-intro h1 { font-size: clamp(2rem, 5vw, 3.8rem); font-weight: 700; letter-spacing: -0.04em; }
.tour-hint { position: absolute; left: 50%; bottom: 2vh; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tour-caption {
  position: absolute; left: var(--gutter); bottom: 64px; max-width: 420px; padding: 20px 22px; border-radius: 16px;
  background: rgba(5, 6, 10, 0.85); border: 1px solid var(--line);
  opacity: 0; transform: translateY(20px); transition: opacity 0.5s, transform 0.5s; pointer-events: none;
}
.tour-caption.on { opacity: 1; transform: none; }
.tour-caption.swap .tc-t, .tour-caption.swap .tc-p { animation: capIn 0.6s cubic-bezier(.2, .8, .2, 1); }
@keyframes capIn { from { opacity: 0; transform: translateY(12px); filter: blur(4px); } }
.tc-n { font-family: var(--font-mono); font-size: 11px; color: var(--cyan); letter-spacing: 0.1em; }
.tc-t { display: block; font-family: var(--font-display); font-size: 1.6rem; letter-spacing: -0.02em; margin: 6px 0 6px; }
.tc-p { margin: 0; color: #b7bfd2; font-size: 0.95rem; }
.tour-progress { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 32px; height: 2px; background: var(--line); opacity: 0; transition: opacity 0.4s; }
.tour.expanded .tour-progress { opacity: 1; }
.tp-fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--cyan), var(--violet), var(--amber)); }
.tour-progress i { position: absolute; top: -4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--bg); border: 2px solid var(--muted); }
.fs-btn {
  position: absolute; right: var(--gutter); bottom: 56px; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  font: 500 12px var(--font-mono); color: var(--text); background: rgba(5, 6, 10, 0.85); border: 1px solid var(--line); cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.fs-btn:hover { border-color: var(--cyan); background: rgba(56, 232, 255, 0.08); }
.fs-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ---------- home: scope trace ---------- */
.signals { background: radial-gradient(ellipse at 50% 30%, rgba(56, 232, 255, 0.05), transparent 60%), var(--bg); }
.scope { max-width: 1000px !important; border: 1px solid var(--line); border-radius: var(--radius); background: #070910; overflow: hidden; }
.scope-bar { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.scope-live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(61, 255, 168, 0.6); animation: live 1.8s infinite; }
.scope-t { margin-left: auto; }
.scope-t b { color: var(--text); font-weight: 500; display: inline-block; min-width: 3.2em; text-align: right; }
.scope-scroll { overflow-x: auto; }
.scope-svg { display: block; width: 100%; min-width: 720px; }
.scope-grid line { stroke: rgba(255, 255, 255, 0.05); stroke-width: 1; }
.scope-labels text { font-family: var(--font-mono); font-size: 13px; fill: var(--text); }
.scope-labels text.sub { font-size: 10px; fill: var(--dim); }
.w { fill: none; stroke-width: 2.2; stroke-linejoin: round; }
.w-btn { stroke: var(--cyan); } .w-trig { stroke: var(--amber); } .w-led { stroke: var(--green); } .w-vcc { stroke: var(--red); }
.scope-head { stroke: rgba(232, 236, 245, 0.55); stroke-width: 1; stroke-dasharray: 3 4; transition: opacity 0.3s; }
.scope-tag { opacity: 0; transition: opacity 0.4s; }
.scope-tag.on { opacity: 1; }
.scope-tag rect { fill: rgba(5, 6, 10, 0.92); stroke: var(--tc); stroke-opacity: 0.5; }
.scope-tag text { font-family: var(--font-mono); font-size: 11px; fill: var(--text); }
.scope-tag path { fill: none; stroke: var(--tc); stroke-width: 1.2; }
.scope-tag:not(:has(rect)) text { fill: var(--tc); }
.t-cyan { --tc: var(--cyan); } .t-amber { --tc: var(--amber); } .t-green { --tc: var(--green); } .t-red { --tc: var(--red); }
.scope-note { margin: 0; padding: 12px 18px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; color: var(--dim); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .nav .btn { margin-left: auto; }
  .problem-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento .b-card:nth-child(6) { grid-column: span 2; }
  .mod-grid { grid-template-columns: repeat(2, 1fr); }
  .door-grid { grid-template-columns: repeat(2, 1fr); }
  .rails { grid-template-columns: repeat(2, 1fr); }
  .loop-grid, .code-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero { justify-content: flex-start; padding-top: 50svh; padding-bottom: 110px; }
  .hero::before { background: linear-gradient(180deg, transparent 0%, rgba(5, 6, 10, 0.55) 42%, rgba(5, 6, 10, 0.9) 60%, var(--bg) 100%); }
  .scroll-hint { display: none; }
  .hero-stats { gap: 18px; margin-top: 36px; }
  .hero-stats b { font-size: 1.25rem; }
  .problem-grid, .stat-grid, .bento, .mod-grid, .rails, .door-grid { grid-template-columns: 1fr; }
  .door { min-height: 320px; }
  .tour-caption { right: var(--gutter); bottom: 110px; max-width: none; }
  .fs-btn { bottom: 52px; }
  .next-page { grid-template-columns: 1fr; }
  .np-b { grid-column: 1; }
  .page-hero { min-height: 70vh; padding-top: 130px; }
  .b-card.span2, .bento .b-card:nth-child(6), .mod.roadmap { grid-column: auto; }
  .mod-row { grid-template-columns: repeat(3, 1fr); }
  .link em { position: static; transform: none; white-space: normal; text-align: center; align-self: center; padding-left: 14px; font-size: 10.5px; }
  .link { justify-content: flex-start; padding-left: 10px; }
  .link .pkt { left: 20px; }
  .t-axis, .t-track { margin-left: 0; margin-right: 0; }
  .t-row { flex-direction: column; align-items: stretch; gap: 6px; padding: 8px 0; }
  .t-row b, .t-row em { position: static; width: auto; text-align: left; }
  .tier-where { margin-left: 0; width: 100%; }
  .uc-pin { min-height: 0; padding: 90px 0 40px; }
  .uc-head { grid-template-columns: 1fr; }
  .uc-progress { display: none; }
  .uc-track { flex-direction: column; width: auto; }
  .uc { width: auto; }
  .uc p { min-height: 0; }
  .uc-icon { margin-bottom: 30px; }
  .term-body { height: 420px; font-size: 11.5px; padding: 16px; }
  .trace-anim { flex-wrap: wrap; }
  .trace-anim i { display: none; }
  .cursor-glow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}
