:root {
  --bg: #071114;
  --bg-soft: #0a171b;
  --panel: #0d1d22;
  --panel-2: #10252b;
  --line: rgba(186, 220, 221, 0.13);
  --line-strong: rgba(186, 220, 221, 0.24);
  --text: #edf7f2;
  --muted: #90a9a5;
  --muted-2: #64807d;
  --lime: #c8f451;
  --lime-soft: rgba(200, 244, 81, 0.12);
  --cyan: #5dd6ff;
  --orange: #ffb36b;
  --red: #ff7474;
  --green: #83e6a7;
  --font-sans: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", "Liberation Mono", Consolas, monospace;
  --radius-lg: 26px;
  --radius-md: 18px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 94px;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(31, 80, 78, .18), transparent 38%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  color: var(--bg);
  background: var(--lime);
}

h1, h2, h3, h4, p, ul { margin: 0; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.035em; }
ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
code {
  padding: .08em .34em;
  border-radius: 5px;
  color: var(--lime);
  background: rgba(200, 244, 81, .08);
  font-family: var(--font-mono);
  font-size: .88em;
}
kbd {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-bottom-color: rgba(255, 255, 255, .28);
  border-radius: 6px;
  color: #dceee8;
  background: rgba(255, 255, 255, .06);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .22);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
}

.container {
  width: min(1240px, calc(100% - 80px));
  margin-inline: auto;
}

.sr-only {
  position: absolute !important;
  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;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--bg);
  background: var(--lime);
  transform: translateY(-150%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 44vw;
  height: 44vw;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(100px);
  opacity: .12;
}
.ambient-one {
  top: 20vh;
  left: -22vw;
  background: #2e7d70;
}
.ambient-two {
  top: 58vh;
  right: -26vw;
  background: #647d2e;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  width: 100%;
  border-bottom: 1px solid rgba(186, 220, 221, .09);
  background: rgba(7, 17, 20, .72);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 78px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
}
.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--lime);
}
.brand-mark svg { width: 100%; height: 100%; }
.brand-mark.small { width: 34px; height: 34px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 14px; letter-spacing: .02em; }
.brand-text small {
  margin-top: 3px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .2em;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.5vw, 36px);
  margin-left: auto;
}
.main-nav a {
  position: relative;
  padding: 6px 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .01em;
  transition: color .2s ease;
}
.main-nav a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--lime);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s var(--ease);
}
.main-nav a:hover,
.main-nav a.is-active { color: var(--text); }
.main-nav a:hover::after,
.main-nav a.is-active::after { transform: scaleX(1); transform-origin: left; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 4px;
}
.lesson-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 31px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  white-space: nowrap;
}
.lesson-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
}
.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  transition: .2s ease;
}
.icon-button:hover { color: var(--text); border-color: var(--line); background: rgba(255, 255, 255, .04); }
.icon-button svg { width: 16px; height: 16px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: transform .25s var(--ease), background .25s ease, border-color .25s ease, color .25s ease;
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }
.button svg { width: 18px; height: 18px; }
.button-primary {
  color: #0a1310;
  background: var(--lime);
  box-shadow: 0 10px 30px rgba(200, 244, 81, .13);
}
.button-primary:hover { background: #d7ff71; box-shadow: 0 14px 36px rgba(200, 244, 81, .2); }
.button-quiet {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(255, 255, 255, .02);
}
.button-quiet:hover { border-color: rgba(200, 244, 81, .4); background: rgba(200, 244, 81, .05); }
.button-small {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  color: #0a1310;
  background: var(--lime);
  font-size: 12px;
}
.button-small:hover { background: #d7ff71; }
.mobile-nav-button {
  display: none;
  width: 40px;
  height: 40px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: transparent;
}
.mobile-nav-button span {
  display: block;
  width: 16px;
  height: 1px;
  margin: 5px auto;
  background: currentColor;
  transition: transform .25s ease;
}
.mobile-nav-button[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
.mobile-nav-button[aria-expanded="true"] span:last-child { transform: translateY(-3px) rotate(-45deg); }
.mobile-nav {
  display: none;
  padding: 0 24px 18px;
  border-top: 1px solid var(--line);
}
.mobile-nav a {
  display: block;
  padding: 11px 0;
  border-bottom: 1px solid rgba(186, 220, 221, .08);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
}
.mobile-nav.is-open { display: block; }

/* ===== Reveal ===== */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: translateY(0); }
.js .reveal-delay-1 { transition-delay: .08s; }
.js .reveal-delay-2 { transition-delay: .16s; }
.js .reveal-delay-3 { transition-delay: .24s; }
.js .reveal-delay-4 { transition-delay: .32s; }

/* ===== Hero ===== */
.hero {
  position: relative;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 78px;
  overflow: hidden;
}
.hero::before {
  position: absolute;
  top: 78px;
  right: -8%;
  left: -8%;
  height: 80%;
  background-image:
    linear-gradient(rgba(150, 210, 200, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 210, 200, .045) 1px, transparent 1px);
  background-size: 62px 62px;
  content: "";
  mask-image: radial-gradient(ellipse at 60% 40%, black 0, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 60% 40%, black 0, transparent 72%);
}
.hero::after {
  position: absolute;
  top: 10%;
  right: -10%;
  width: 60%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 244, 81, .07), transparent 65%);
  content: "";
  pointer-events: none;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: 38px;
  align-items: center;
  padding-top: 48px;
  padding-bottom: 48px;
}
.hero-copy { position: relative; z-index: 2; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
}
.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
}
.eyebrow-slash { color: var(--muted-2); }
.hero h1 {
  max-width: 720px;
  font-size: clamp(4.2rem, 7.8vw, 7.1rem);
  font-weight: 800;
  line-height: .9;
  letter-spacing: -.075em;
  white-space: nowrap;
}
.title-accent {
  position: relative;
  display: inline-block;
  color: var(--lime);
  letter-spacing: -.09em;
}
.title-accent::after {
  position: absolute;
  right: .08em;
  bottom: -.02em;
  left: .08em;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  content: "";
  opacity: .3;
  filter: blur(4px);
}
.hero-lede {
  max-width: 570px;
  margin-top: 32px;
  color: var(--muted);
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  line-height: 1.9;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}
.hero-actions .button-primary { min-height: 54px; padding: 0 25px; }
.hero-facts {
  display: flex;
  gap: 38px;
  margin-top: 52px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.hero-facts li { display: flex; align-items: baseline; gap: 8px; }
.hero-facts strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.06em;
}
.hero-facts span { color: var(--muted-2); font-size: 11px; }

.hero-visual {
  position: relative;
  z-index: 1;
  padding: 12px 0 12px 4px;
}
.monitor-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(186, 220, 221, .18);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .045), transparent 45%),
    #0b1b20;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .07);
  transform: rotate(-1.25deg);
  transition: transform .7s var(--ease);
}
.hero-visual:hover .monitor-card { transform: rotate(0deg) translateY(-4px); }
.monitor-top,
.monitor-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
}
.monitor-top { border-bottom: 1px solid var(--line); color: var(--muted); }
.monitor-bottom { border-top: 1px solid var(--line); color: var(--muted); }
.monitor-title { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
  animation: blink 2.2s ease-in-out infinite;
}
.monitor-channel { color: var(--muted-2); }
.monitor-screen {
  position: relative;
  padding: 18px 18px 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(200, 244, 81, .06), transparent 55%),
    linear-gradient(180deg, rgba(5, 16, 18, .2), rgba(5, 16, 18, .5));
}
.screen-tag {
  position: absolute;
  top: 15px;
  right: 16px;
  z-index: 1;
  padding: 3px 7px;
  border: 1px solid rgba(200, 244, 81, .28);
  border-radius: 4px;
  color: var(--lime);
  background: rgba(200, 244, 81, .07);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .14em;
}
.hero-circuit { display: block; width: 100%; height: auto; overflow: visible; }
.hero-grid-lines path { fill: none; stroke: rgba(171, 215, 209, .055); stroke-width: 1; }
.hero-wires path {
  fill: none;
  stroke: rgba(200, 244, 81, .62);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 7 8;
  animation: wireFlow 1.6s linear infinite;
}
.hero-inputs circle {
  fill: #10262b;
  stroke: var(--lime);
  stroke-width: 1.6;
}
.hero-inputs text {
  fill: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  text-anchor: middle;
}
.hero-inputs .hero-bit {
  fill: var(--lime);
  font-size: 11px;
  text-anchor: start;
}
.hero-gate > path:first-child {
  stroke-width: 2.2;
  filter: drop-shadow(0 0 8px rgba(200, 244, 81, .15));
}
.hero-gate text { text-anchor: middle; }
.hero-gate .gate-name {
  fill: var(--lime);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .14em;
}
.hero-gate .gate-sub {
  fill: var(--muted);
  font-size: 11px;
  letter-spacing: .25em;
}
.hero-gate .gate-pin { fill: none; stroke: var(--lime); stroke-width: 2.4; }
.hero-output circle {
  fill: rgba(200, 244, 81, .16);
  stroke: var(--lime);
  stroke-width: 2;
  filter: drop-shadow(0 0 18px rgba(200, 244, 81, .5));
}
.hero-output .lamp-rays {
  fill: none;
  stroke: var(--lime);
  stroke-width: 1.8;
  stroke-linecap: round;
  opacity: .6;
  animation: rays 2.8s ease-in-out infinite;
}
.hero-output-label {
  fill: var(--lime);
  font-family: var(--font-mono);
  font-size: 13px;
  text-anchor: middle;
  letter-spacing: .08em;
}
.hero-pulse { fill: var(--lime); }
.hero-pulse-b { fill: var(--cyan); }
.hero-pulse-y { fill: var(--lime); }
.monitor-reading {
  display: flex;
  gap: 20px;
  padding: 2px 2px 16px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .06em;
}
.monitor-reading b { margin-left: 4px; color: var(--lime); font-weight: 500; }
.monitor-reading .reading-out { margin-left: auto; }
.formula-mini { color: var(--lime); font-size: 11px; letter-spacing: .05em; }
.monitor-state { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 8px; }
.monitor-state i { width: 5px; height: 5px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.floating-truth {
  position: absolute;
  right: -20px;
  bottom: -28px;
  width: 132px;
  padding: 11px 12px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(12, 30, 34, .94);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .38);
  font-family: var(--font-mono);
  font-size: 9px;
  transform: rotate(2deg);
  backdrop-filter: blur(8px);
}
.floating-truth-head,
.floating-truth-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  text-align: center;
}
.floating-truth-head {
  padding-bottom: 6px;
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: .08em;
}
.floating-truth-row { padding: 3px 0; border-radius: 4px; color: var(--muted); }
.floating-truth-row.active { color: var(--bg); background: var(--lime); font-weight: 600; }
.floating-chip {
  position: absolute;
  top: 12px;
  left: -18px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(10, 26, 30, .9);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .1em;
  transform: rotate(-3deg);
}
.floating-chip span { color: var(--lime); margin-right: 5px; }
.hero-strip {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 34px;
  min-height: 76px;
  border-top: 1px solid var(--line);
}
.strip-label {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .16em;
}
.strip-steps { display: flex; flex: 1; gap: clamp(16px, 3vw, 46px); }
.strip-steps span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.strip-steps b { color: var(--lime); font-family: var(--font-mono); font-size: 9px; font-weight: 500; }
.scroll-cue {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .12em;
  white-space: nowrap;
}
.scroll-cue i {
  position: relative;
  display: block;
  width: 34px;
  height: 1px;
  overflow: hidden;
  background: var(--line-strong);
}
.scroll-cue i::after {
  position: absolute;
  inset: 0;
  background: var(--lime);
  content: "";
  animation: cue 2.2s ease-in-out infinite;
}

/* ===== Section basics ===== */
.section { position: relative; padding: 120px 0; }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .7fr);
  gap: 60px;
  align-items: end;
  margin-bottom: 58px;
}
.section-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.section-kicker::before {
  width: 24px;
  height: 1px;
  background: var(--lime);
  content: "";
}
.section-kicker span { color: var(--lime); }
.section-head h2 {
  font-size: clamp(2.5rem, 4.4vw, 4.1rem);
  line-height: 1.08;
  letter-spacing: -.06em;
}
.section-intro { max-width: 440px; padding-bottom: 5px; }
.section-intro p { color: var(--muted); font-size: 14px; line-height: 1.9; }
.section-note {
  display: block;
  margin-top: 20px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .12em;
}
.mini-kicker {
  margin-bottom: 7px;
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .15em;
}
.section-head.lab-head,
.section-head.quiz-head { align-items: end; }

/* ===== Concept cards ===== */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}
.concept-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .035), transparent 50%),
    rgba(13, 29, 34, .74);
  transition: border-color .3s ease, transform .4s var(--ease), background .3s ease;
}
.concept-card::after {
  position: absolute;
  right: -44px;
  bottom: -58px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(200, 244, 81, .08);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.concept-card:hover {
  border-color: rgba(200, 244, 81, .25);
  background:
    linear-gradient(145deg, rgba(200, 244, 81, .045), transparent 50%),
    rgba(15, 36, 41, .86);
  transform: translateY(-4px);
}
.concept-card:nth-child(1) { grid-column: span 5; }
.concept-card:nth-child(2) { grid-column: span 7; }
.concept-card:nth-child(3) { grid-column: span 4; }
.concept-card:nth-child(4) { grid-column: span 8; }
.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .12em;
}
.card-topline span:last-child { color: var(--muted-2); }
.concept-card h3 {
  margin-bottom: 10px;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  letter-spacing: -.045em;
}
.concept-card p { color: var(--muted); font-size: 13px; line-height: 1.9; }
.concept-level-card { min-height: 330px; }
.concept-level-card h3 { margin-top: auto; }
.concept-level-card p { margin-top: 4px; max-width: 430px; }
.level-visual { margin: 10px 0 38px; padding: 22px 0 14px; }
.level-track {
  position: relative;
  display: flex;
  height: 46px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #09171a;
}
.level-high {
  width: 50%;
  background: repeating-linear-gradient(135deg, rgba(200, 244, 81, .18) 0 6px, rgba(200, 244, 81, .07) 6px 12px);
  border-right: 1px solid rgba(200, 244, 81, .55);
}
.level-low { width: 50%; background: rgba(255, 255, 255, .015); }
.level-track::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 32%;
  width: 1px;
  background: var(--muted-2);
  content: "";
  opacity: .45;
}
.level-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .04em;
}
.level-ticks span:first-child { color: var(--lime); }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 24px;
}
.card-chip {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .08em;
}
.card-index { color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; }
.mini-gate-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: auto;
  padding-top: 24px;
}
.mini-gate {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, .015);
  text-align: left;
  transition: .25s ease;
}
.mini-gate:hover { border-color: rgba(200, 244, 81, .3); color: var(--text); background: rgba(200, 244, 81, .04); }
.mini-gate .mini-icon { display: block; flex: 0 0 auto; width: 34px; height: 24px; color: var(--lime); }
.mini-gate .mini-icon svg { display: block; width: 100%; height: 100%; }
.mini-gate > span:last-child { display: flex; min-width: 0; flex-direction: column; line-height: 1.25; }
.mini-gate b { color: var(--text); font-size: 12px; font-weight: 600; }
.mini-gate small { margin-top: 4px; color: var(--muted-2); font-size: 9px; white-space: nowrap; }
.universal-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 28px;
}
.gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--lime);
  background: rgba(200, 244, 81, .04);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .07em;
  transition: .25s ease;
}
.gate-badge:hover { border-color: rgba(200, 244, 81, .42); background: rgba(200, 244, 81, .09); }
.gate-badge span { display: block; width: 30px; height: 22px; }
.gate-badge svg { display: block; width: 100%; height: 100%; }
.plus-sign { color: var(--muted-2); font-family: var(--font-mono); font-size: 12px; }
.concept-xor-card { background: linear-gradient(145deg, rgba(200, 244, 81, .05), transparent 52%), rgba(13, 29, 34, .74); }
.xor-copy { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.xor-copy p { max-width: 500px; }
.xor-glyph {
  flex: 0 0 auto;
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: clamp(4rem, 8vw, 7rem);
  font-weight: 300;
  line-height: .8;
  opacity: .8;
  text-shadow: 0 0 34px rgba(200, 244, 81, .22);
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  margin-top: auto;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid rgba(200, 244, 81, .32);
  color: var(--lime);
  background: transparent;
  font-size: 12px;
  transition: gap .25s ease, border-color .25s ease;
}
.text-link:hover { gap: 11px; border-color: var(--lime); }
.text-link span { font-family: var(--font-mono); }

/* ===== Lab ===== */
.lab-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 18% 10%, rgba(39, 91, 84, .16), transparent 48%),
    linear-gradient(180deg, rgba(10, 24, 28, .7), rgba(7, 17, 20, .4));
}
.lab-head-side { padding-bottom: 5px; }
.lab-head-side p { color: var(--muted); font-size: 14px; line-height: 1.9; }
.shortcut-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 17px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .06em;
}
.shortcut-note span { color: var(--line-strong); }
.gate-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 20px;
  padding: 7px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(9, 24, 28, .65);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.gate-tabs::-webkit-scrollbar { height: 4px; }
.gate-tabs::-webkit-scrollbar-thumb { border-radius: 4px; background: var(--line-strong); }
.gate-tab {
  display: flex;
  min-width: 104px;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  white-space: nowrap;
  transition: .25s ease;
}
.gate-tab .gate-tab-icon { display: block; width: 34px; height: 24px; color: var(--muted); transition: color .25s ease; }
.gate-tab .gate-tab-icon svg { display: block; width: 100%; height: 100%; }
.gate-tab small { color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; }
.gate-tab:hover { color: var(--text); background: rgba(255, 255, 255, .025); }
.gate-tab:hover .gate-tab-icon { color: var(--text); }
.gate-tab[aria-selected="true"] {
  border-color: rgba(200, 244, 81, .3);
  color: var(--text);
  background: rgba(200, 244, 81, .075);
  box-shadow: inset 0 0 24px rgba(200, 244, 81, .035);
}
.gate-tab[aria-selected="true"] .gate-tab-icon { color: var(--lime); }
.gate-tab[aria-selected="true"] small { color: var(--lime); }

.lab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(318px, .78fr);
  gap: 20px;
  align-items: stretch;
}
.lab-stage,
.truth-panel,
.wave-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .028), transparent 44%),
    rgba(11, 27, 32, .82);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .14);
}
.lab-stage {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 16px;
}
.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 1px 4px 14px;
}
.stage-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .13em;
}
.stage-live i,
.caption-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px rgba(200, 244, 81, .8);
  transition: background .2s ease, box-shadow .2s ease;
}
.stage-live i.is-low,
.caption-dot.is-low {
  background: var(--muted-2);
  box-shadow: none;
}
.stage-actions { display: flex; align-items: center; gap: 5px; }
.stage-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, .02);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .04em;
  transition: .2s ease;
}
.stage-button:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, .045); }
.stage-button[aria-pressed="true"] { border-color: rgba(200, 244, 81, .36); color: var(--lime); background: rgba(200, 244, 81, .08); }
.stage-button svg { width: 14px; height: 14px; }
.stage-button .stop-icon { display: none; }
.stage-button[aria-pressed="true"] .play-icon { display: none; }
.stage-button[aria-pressed="true"] .stop-icon { display: block; }
.stage-button-icon { width: 32px; padding: 0; }
.stage-button-icon svg { width: 15px; height: 15px; }

.circuit-area {
  position: relative;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 100px;
  gap: 4px;
  align-items: center;
  min-height: 348px;
  overflow: hidden;
  border: 1px solid rgba(186, 220, 221, .1);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 52% 50%, rgba(200, 244, 81, .045), transparent 44%),
    linear-gradient(180deg, rgba(6, 18, 21, .3), rgba(6, 18, 21, .68));
}
.circuit-area::before {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(166, 211, 204, .12) .7px, transparent .7px);
  background-size: 18px 18px;
  content: "";
  opacity: .42;
  pointer-events: none;
}
.circuit-area::after {
  position: absolute;
  top: 0;
  right: 10%;
  left: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 244, 81, .2), transparent);
  content: "";
}
.switch-column {
  position: relative;
  z-index: 1;
  display: flex;
  height: 300px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 0 22px 16px;
}
.input-switch {
  display: flex;
  width: 88px;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 0;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  transition: .25s ease;
}
.input-switch:hover { color: var(--text); }
.input-switch:hover .switch-track { border-color: rgba(200, 244, 81, .5); }
.switch-label {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .1em;
  white-space: nowrap;
}
.switch-label b { margin-left: 2px; color: inherit; font-size: 10px; }
.switch-track {
  position: relative;
  display: block;
  width: 56px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .3);
  transition: .25s ease;
}
.switch-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #55706f;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .35);
  transition: transform .3s var(--ease), background .25s ease, box-shadow .25s ease;
}
.switch-state {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  transition: color .2s ease;
}
.input-switch[aria-pressed="true"] .switch-track {
  border-color: rgba(200, 244, 81, .58);
  background: rgba(200, 244, 81, .1);
  box-shadow: 0 0 18px rgba(200, 244, 81, .1), inset 0 2px 5px rgba(0, 0, 0, .2);
}
.input-switch[aria-pressed="true"] .switch-knob {
  background: var(--lime);
  box-shadow: 0 0 14px rgba(200, 244, 81, .8);
  transform: translateX(26px);
}
.input-switch[aria-pressed="true"] .switch-label,
.input-switch[aria-pressed="true"] .switch-state { color: var(--lime); }
.input-switch.is-disabled {
  pointer-events: none;
  opacity: .28;
  filter: grayscale(1);
}
.wire-area {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 10px 0;
}
#circuitSvg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.wire-hint {
  position: absolute;
  right: 0;
  bottom: 6px;
  left: 0;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .1em;
  text-align: center;
  transition: opacity .2s ease;
}
.output-column {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-right: 10px;
}
.output-label {
  margin-top: 3px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .12em;
}
.output-label b { color: var(--muted); font-size: 10px; }
.output-value {
  margin-top: 2px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
  transition: color .2s ease, text-shadow .2s ease;
}
.output-value.is-on { color: var(--lime); text-shadow: 0 0 22px rgba(200, 244, 81, .65); }
.lamp {
  position: relative;
  display: grid;
  width: 84px;
  height: 96px;
  place-items: center;
}
.lamp-halo {
  position: absolute;
  inset: -26px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 244, 81, .35), transparent 65%);
  opacity: 0;
  transform: scale(.7);
  transition: opacity .3s ease, transform .5s var(--ease);
}
.bulb { position: relative; z-index: 1; width: 58px; height: auto; overflow: visible; }
.bulb-glass {
  fill: rgba(255, 255, 255, .025);
  stroke: #536c6d;
  stroke-width: 2.2;
  transition: fill .3s ease, stroke .3s ease, filter .3s ease;
}
.bulb-base {
  fill: none;
  stroke: #536c6d;
  stroke-width: 2.2;
  stroke-linecap: round;
  transition: stroke .3s ease;
}
.lamp.is-on .lamp-halo {
  opacity: 1;
  transform: scale(1);
  animation: lampPulse 2.4s ease-in-out infinite;
}
.lamp.is-on .bulb-glass {
  fill: rgba(200, 244, 81, .72);
  stroke: #e8ffad;
  filter: drop-shadow(0 0 16px rgba(200, 244, 81, .7));
}
.lamp.is-on .bulb-base { stroke: var(--lime); }

.circuit-wire {
  fill: none;
  stroke: #29454b;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .25s ease;
}
.circuit-wire.live {
  stroke: var(--lime);
  stroke-dasharray: 9 7;
  filter: drop-shadow(0 0 5px rgba(200, 244, 81, .55));
  animation: wireFlow 1.3s linear infinite;
}
.circuit-wire.output-wire.live { stroke-width: 3.6; }
.gate-body {
  fill: rgba(200, 244, 81, .035);
  stroke: #5b8581;
  stroke-width: 2.4;
  stroke-linejoin: round;
  transition: stroke .3s ease, fill .3s ease, filter .3s ease;
}
.gate-body.is-hot {
  stroke: var(--lime);
  fill: rgba(200, 244, 81, .075);
  filter: drop-shadow(0 0 12px rgba(200, 244, 81, .16));
}
.gate-bubble {
  fill: #0c2024;
  stroke: #5b8581;
  stroke-width: 2.4;
  transition: stroke .3s ease, fill .3s ease;
}
.gate-bubble.is-hot { stroke: var(--lime); fill: rgba(200, 244, 81, .13); }
.gate-extra { fill: none; stroke: #5b8581; stroke-width: 2.4; stroke-linecap: round; }
.gate-extra.is-hot { stroke: var(--lime); }
.gate-pin-line { fill: none; stroke: #29454b; stroke-width: 3; stroke-linecap: round; }
.gate-pin-line.live { stroke: var(--lime); }
.gate-svg-label {
  fill: var(--lime);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .16em;
  text-anchor: middle;
}
.gate-svg-sub {
  fill: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 8px;
  letter-spacing: .12em;
  text-anchor: middle;
}
.signal-dot { fill: var(--lime); filter: drop-shadow(0 0 5px rgba(200, 244, 81, .9)); }
.wire-terminal { fill: #0d2025; stroke: #4b6d6c; stroke-width: 1.6; }
.wire-terminal.live { stroke: var(--lime); }

.stage-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 5px 1px;
}
.caption-sentence {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .03em;
}
.caption-dot { width: 5px; height: 5px; }
.caption-count { color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; white-space: nowrap; }

.truth-panel { display: flex; flex-direction: column; padding: 25px; }
.panel-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .13em;
}
.truth-panel h3 {
  margin-top: 24px;
  font-size: 27px;
  letter-spacing: -.05em;
}
.truth-panel h3 em {
  margin-left: 5px;
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: .1em;
}
.gate-rule { margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.formula-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 16px;
  padding: 12px 13px;
  border: 1px solid rgba(200, 244, 81, .18);
  border-radius: 8px;
  background: rgba(200, 244, 81, .045);
}
.formula-box span { color: var(--muted-2); font-family: var(--font-mono); font-size: 6px; letter-spacing: .1em; }
.formula-box strong { color: var(--lime); font-family: var(--font-mono); font-size: 13px; font-weight: 500; letter-spacing: .02em; white-space: nowrap; }
.truth-table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.truth-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
  table-layout: fixed;
}
.truth-table th {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  background: rgba(255, 255, 255, .02);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .12em;
  text-align: center;
}
.truth-table td {
  padding: 10px 0;
  border-bottom: 1px solid rgba(186, 220, 221, .07);
  color: var(--muted);
  text-align: center;
  transition: color .2s ease, background .2s ease;
}
.truth-table tr:last-child td { border-bottom: 0; }
.truth-table tbody tr { cursor: pointer; transition: background .2s ease; }
.truth-table tbody tr:hover td { background: rgba(255, 255, 255, .035); color: var(--text); }
.truth-table tbody tr.is-active td { color: var(--bg); background: var(--lime); font-weight: 600; }
.truth-table tbody tr.is-active td:last-child { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.truth-tip { margin-top: 10px; color: var(--muted-2); font-family: var(--font-mono); font-size: 7px; letter-spacing: .05em; }
.gate-metaphor {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.gate-metaphor span { color: var(--muted-2); font-family: var(--font-mono); font-size: 7px; letter-spacing: .12em; }
.gate-metaphor p { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.8; }

.wave-panel { margin-top: 20px; padding: 23px 25px 17px; }
.wave-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.wave-head h3 { font-size: 19px; letter-spacing: -.04em; }
.wave-actions { display: flex; align-items: center; gap: 14px; }
.wave-current { color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: .03em; }
#waveSvg { display: block; width: 100%; height: auto; margin-top: 12px; }
.wave-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .04em;
}
.wave-legend span { display: inline-flex; align-items: center; gap: 6px; }
.wave-legend i { display: block; width: 15px; height: 2px; }
.legend-a { background: var(--cyan); }
.legend-b { background: var(--orange); }
.legend-y { background: var(--lime); }
.wave-note { margin-left: auto; }
.wave-grid-line { stroke: rgba(186, 220, 221, .1); stroke-width: 1; }
.wave-label {
  fill: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
}
.wave-label-a { fill: var(--cyan); }
.wave-label-b { fill: var(--orange); }
.wave-label-y { fill: var(--lime); }
.wave-segment { stroke-width: 2.4; stroke-linecap: round; }
.wave-slot-label {
  fill: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  text-anchor: middle;
}
.wave-slot-label.is-current { fill: var(--lime); }
.wave-segment,
.wave-label,
.wave-slot-label,
.wave-grid-line { pointer-events: none; }
.wave-slot-bg {
  fill: transparent;
  cursor: pointer;
  transition: fill .2s ease;
}
.wave-slot-bg:hover { fill: rgba(255, 255, 255, .035); }
.wave-slot-bg.is-current { fill: rgba(200, 244, 81, .055); }
.wave-slot-border {
  fill: none;
  stroke: transparent;
  transition: stroke .2s ease;
}
.wave-slot-border.is-current { stroke: rgba(200, 244, 81, .17); }

/* ===== Applications ===== */
.applications {
  border-top: 1px solid rgba(186, 220, 221, .08);
  background: radial-gradient(ellipse at 82% 55%, rgba(87, 104, 37, .11), transparent 48%);
}
.application-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 50px;
  margin-bottom: 48px;
}
.application-head h2 { font-size: clamp(2.2rem, 3.8vw, 3.5rem); letter-spacing: -.06em; }
.application-head > p { max-width: 410px; padding-bottom: 6px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.application-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.application-card {
  position: relative;
  min-height: 300px;
  padding: 27px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .03), transparent 55%),
    rgba(13, 29, 34, .6);
  transition: .35s var(--ease);
}
.application-card:hover { border-color: rgba(200, 244, 81, .24); transform: translateY(-4px); }
.application-card::after {
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(200, 244, 81, .08);
  border-radius: 50%;
  content: "";
}
.application-symbol {
  width: 62px;
  height: 44px;
  margin-bottom: 26px;
  color: var(--lime);
}
.application-symbol svg { display: block; width: 100%; height: 100%; }
.application-tag { color: var(--lime); font-family: var(--font-mono); font-size: 8px; letter-spacing: .13em; }
.application-card h3 { margin-top: 8px; font-size: 22px; letter-spacing: -.045em; }
.application-card p { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.application-formula {
  position: absolute;
  right: 27px;
  bottom: 25px;
  left: 27px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .03em;
}

/* ===== Quiz ===== */
.quiz-section {
  border-top: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 15% 60%, rgba(38, 88, 82, .15), transparent 45%),
    linear-gradient(180deg, rgba(10, 24, 28, .35), rgba(7, 17, 20, .6));
}
.quiz-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.quiz-aside { position: sticky; top: 100px; }
.quiz-aside-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(13, 29, 34, .66);
}
.aside-topline {
  display: flex;
  justify-content: space-between;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .12em;
}
.best-score {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-top: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.best-score strong {
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -.08em;
  line-height: 1;
}
.best-score span { color: var(--muted-2); font-size: 10px; }
.quiz-dots {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  margin-top: 20px;
}
.quiz-dot {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .09);
  transition: background .25s ease, box-shadow .25s ease;
}
.quiz-dot.is-correct { background: var(--green); }
.quiz-dot.is-wrong { background: var(--red); }
.quiz-dot.is-current { background: var(--lime); box-shadow: 0 0 8px rgba(200, 244, 81, .6); }
.aside-hint { margin-top: 14px; color: var(--muted-2); font-size: 10px; line-height: 1.7; }
.aside-divider { height: 1px; margin: 20px 0 14px; background: var(--line); }
.aside-legend { display: flex; flex-wrap: wrap; gap: 10px 13px; color: var(--muted-2); font-family: var(--font-mono); font-size: 7px; }
.aside-legend span { display: inline-flex; align-items: center; gap: 5px; }
.aside-legend i { display: block; width: 6px; height: 6px; border-radius: 50%; }
.dot-correct { background: var(--green); }
.dot-wrong { background: var(--red); }
.dot-current { background: var(--lime); }
.teacher-note {
  margin-top: 14px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(200, 244, 81, .025);
}
.teacher-note span { color: var(--lime); font-family: var(--font-mono); font-size: 7px; letter-spacing: .12em; }
.teacher-note p { margin-top: 7px; color: var(--muted-2); font-size: 10px; line-height: 1.8; }
.quiz-card {
  min-height: 540px;
  padding: clamp(24px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, .03), transparent 55%),
    rgba(12, 28, 33, .86);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .16);
}
.quiz-start { display: flex; min-height: 446px; flex-direction: column; align-items: flex-start; justify-content: center; }
.quiz-badge {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid rgba(200, 244, 81, .25);
  border-radius: 4px;
  color: var(--lime);
  background: rgba(200, 244, 81, .05);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .14em;
}
.quiz-start h3,
.quiz-result h3 {
  margin-top: 24px;
  font-size: clamp(2rem, 3.3vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -.06em;
}
.quiz-start p {
  max-width: 490px;
  margin-top: 17px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}
.start-stats {
  display: flex;
  gap: 30px;
  margin: 30px 0 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.start-stats span { color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; }
.start-stats b { margin-right: 4px; color: var(--text); font-size: 20px; font-weight: 500; }
.quiz-play { min-height: 446px; }
.quiz-progress-head {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .04em;
}
.quiz-progress-track { flex: 1; height: 3px; overflow: hidden; border-radius: 3px; background: rgba(255, 255, 255, .08); }
.quiz-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--lime); transition: width .45s var(--ease); }
.quiz-progress-head span:last-child { color: var(--muted); }
.question-block { margin-top: 36px; }
.question-tag {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .08em;
}
.question-block h3 {
  max-width: 750px;
  margin-top: 17px;
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  line-height: 1.45;
  letter-spacing: -.035em;
}
.question-visual:not(:empty) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(260px, 100%);
  height: 145px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: radial-gradient(circle at 50% 50%, rgba(200, 244, 81, .06), transparent 58%), rgba(5, 17, 20, .35);
}
.question-visual svg { width: 190px; height: auto; color: var(--lime); }
.question-visual.has-table {
  width: auto;
  height: auto;
  min-width: 170px;
  padding: 12px 20px;
}
.quiz-truth {
  width: 100%;
  min-width: 150px;
  border-collapse: collapse;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}
.quiz-truth th {
  padding: 5px 15px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: .12em;
}
.quiz-truth td {
  padding: 5px 15px;
  border-bottom: 1px solid rgba(186, 220, 221, .07);
  text-align: center;
}
.quiz-truth tr:last-child td { border-bottom: 0; }
.quiz-truth td:last-child { color: var(--lime); }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 26px; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, .015);
  font-size: 13px;
  text-align: left;
  transition: .2s ease;
}
.option:hover:not(:disabled) { border-color: rgba(200, 244, 81, .35); color: var(--text); background: rgba(200, 244, 81, .04); }
.option:disabled { cursor: default; }
.option-letter {
  display: inline-grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
}
.option.is-correct { border-color: rgba(131, 230, 167, .52); color: var(--text); background: rgba(131, 230, 167, .08); }
.option.is-correct .option-letter { border-color: rgba(131, 230, 167, .55); color: var(--green); background: rgba(131, 230, 167, .12); }
.option.is-wrong { border-color: rgba(255, 116, 116, .48); color: #ffd6d6; background: rgba(255, 116, 116, .07); }
.option.is-wrong .option-letter { border-color: rgba(255, 116, 116, .5); color: var(--red); background: rgba(255, 116, 116, .1); }
.feedback {
  display: none;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.8;
}
.feedback.is-visible { display: block; animation: feedbackIn .35s var(--ease); }
.feedback.is-correct { border-color: rgba(131, 230, 167, .25); background: rgba(131, 230, 167, .055); }
.feedback.is-wrong { border-color: rgba(255, 116, 116, .25); background: rgba(255, 116, 116, .045); }
.feedback strong { display: block; margin-bottom: 3px; color: var(--text); font-size: 11px; }
.feedback p { color: var(--muted); }
.feedback code { font-size: 11px; }
.quiz-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 26px; }
.streak-note { color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; letter-spacing: .04em; }
.button-next { min-height: 43px; padding: 0 18px; font-size: 12px; }
.button-next:disabled { cursor: not-allowed; opacity: .35; transform: none; box-shadow: none; }
.quiz-result { display: flex; min-height: 446px; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.quiz-result h3 { margin-top: 20px; }
.quiz-result > p { max-width: 500px; margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.9; }
.result-ring {
  position: relative;
  display: grid;
  width: 132px;
  height: 132px;
  margin-top: 24px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--lime) var(--pct, 0%), rgba(255, 255, 255, .08) 0);
  box-shadow: 0 0 40px rgba(200, 244, 81, .08);
}
.result-ring::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: #0c1c21;
  content: "";
  transform: translate(-50%, -50%);
}
.result-ring > div { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 3px; }
.result-ring strong { color: var(--lime); font-family: var(--font-mono); font-size: 34px; font-weight: 500; line-height: 1; }
.result-ring span { color: var(--muted-2); font-family: var(--font-mono); font-size: 10px; }
.result-review { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 420px; margin-top: 22px; }
.review-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
}
.review-pill i { width: 4px; height: 4px; border-radius: 50%; }
.review-pill.correct i { background: var(--green); }
.review-pill.wrong i { background: var(--red); }
.review-pill.wrong { color: #ffc9c9; border-color: rgba(255, 116, 116, .2); }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(5, 14, 17, .7);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  min-height: 108px;
}
.footer-brand { display: flex; align-items: center; gap: 11px; }
.footer-brand > div { display: flex; flex-direction: column; line-height: 1.4; }
.footer-brand strong { font-size: 11px; font-weight: 500; }
.footer-brand span { margin-top: 3px; color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; }
.footer-actions { display: flex; align-items: center; gap: 22px; }
.footer-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; }
.footer-status i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(131, 230, 167, .7); }
.footer-copy {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 8px;
  transition: .2s ease;
}
.footer-copy:hover { border-color: rgba(200, 244, 81, .35); color: var(--lime); }
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
  max-width: calc(100% - 48px);
  padding: 11px 16px;
  border: 1px solid rgba(200, 244, 81, .3);
  border-radius: 8px;
  color: var(--lime);
  background: rgba(10, 25, 28, .96);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: .25s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }

/* ===== Icon gates ===== */
.gate-icon { display: block; width: 100%; height: 100%; overflow: visible; }
.gate-icon .gi-body { fill: rgba(200, 244, 81, .035); stroke: currentColor; stroke-width: 2.1; stroke-linejoin: round; }
.gate-icon .gi-bubble { fill: #0d2024; stroke: currentColor; stroke-width: 2.1; }
.gate-icon .gi-line { fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; opacity: .8; }

/* ===== Animations ===== */
@keyframes wireFlow { to { stroke-dashoffset: -32; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes lampPulse { 0%, 100% { opacity: .72; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes rays { 0%, 100% { opacity: .35; transform: scale(.96); } 50% { opacity: .75; transform: scale(1.04); } }
@keyframes cue { 0% { transform: translateX(-100%); } 50%, 100% { transform: translateX(100%); } }
@keyframes feedbackIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Responsive ===== */
@media (max-width: 1180px) {
  .container { width: min(1240px, calc(100% - 56px)); }
  .main-nav { gap: 18px; }
  .lesson-pill { display: none; }
  .hero-grid { gap: 22px; }
  .floating-truth { right: -8px; bottom: -22px; }
  .section-head { gap: 38px; }
}

@media (max-width: 1000px) {
  .main-nav { display: none; }
  .mobile-nav-button { display: block; }
  .header-actions { margin-left: auto; }
  .header-inner { gap: 18px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); }
  .hero h1 { font-size: clamp(4rem, 8.8vw, 6.4rem); }
  .mobile-nav-button { margin-left: 0; }
  .hero-facts { gap: 24px; }
  .concept-card:nth-child(1),
  .concept-card:nth-child(2) { grid-column: span 6; }
  .concept-card:nth-child(3) { grid-column: span 5; }
  .concept-card:nth-child(4) { grid-column: span 7; }
  .lab-layout { grid-template-columns: minmax(0, 1.45fr) minmax(285px, .8fr); }
  .circuit-area { grid-template-columns: 94px minmax(0, 1fr) 86px; min-height: 320px; }
  .switch-column { height: 280px; padding-left: 12px; }
  .input-switch { width: 78px; }
  .quiz-layout { grid-template-columns: 245px minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .section { padding: 92px 0; }
  .hero { display: block; min-height: 0; }
  .hero-grid { grid-template-columns: 1fr; padding-top: 80px; padding-bottom: 74px; }
  .hero h1 { font-size: clamp(4.4rem, 15vw, 7.4rem); }
  .hero-lede { max-width: 620px; }
  .hero-visual { width: min(640px, 100%); margin: 14px auto 0; }
  .hero-strip { padding: 20px 0; flex-wrap: wrap; gap: 18px 28px; }
  .strip-steps { flex-basis: 100%; order: 3; flex-wrap: wrap; gap: 14px 28px; }
  .scroll-cue { margin-left: auto; }
  .section-head { grid-template-columns: 1fr; gap: 28px; margin-bottom: 42px; }
  .section-intro { max-width: 600px; }
  .concept-card:nth-child(n) { grid-column: span 12; min-height: 0; }
  .mini-gate-list { max-width: 620px; }
  .lab-layout { grid-template-columns: 1fr; }
  .lab-stage { order: 1; }
  .truth-panel { order: 2; }
  .gate-metaphor { padding-top: 17px; }
  .truth-panel { min-height: 0; }
  .application-head { align-items: flex-start; flex-direction: column; gap: 20px; }
  .application-grid { grid-template-columns: 1fr; }
  .application-card { min-height: 250px; }
  .quiz-layout { grid-template-columns: 1fr; }
  .quiz-aside { position: static; order: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .quiz-aside-card { height: 100%; }
  .teacher-note { margin-top: 0; }
}

@media (max-width: 680px) {
  .container { width: calc(100% - 36px); }
  .header-inner { height: 66px; }
  .brand-text strong { font-size: 13px; }
  .brand-text small { font-size: 8px; }
  .brand-mark { width: 34px; height: 34px; }
  .header-actions .button-small { display: none; }
  .icon-button span { display: none; }
  .icon-button { width: 36px; padding: 0; justify-content: center; border-color: var(--line); }
  .hero { padding-top: 66px; }
  .hero::before { top: 66px; }
  .hero-grid { padding-top: 54px; padding-bottom: 52px; gap: 44px; }
  .eyebrow { margin-bottom: 20px; font-size: 8px; letter-spacing: .12em; flex-wrap: wrap; gap: 7px; }
  .hero h1 { font-size: clamp(3.4rem, 17vw, 6rem); }
  .hero-lede { margin-top: 24px; font-size: 14px; line-height: 1.85; }
  .hero-actions { margin-top: 28px; }
  .hero-actions .button { flex: 1; min-width: 140px; }
  .hero-facts { margin-top: 34px; gap: 18px; justify-content: space-between; }
  .hero-facts li { gap: 5px; }
  .hero-facts strong { font-size: 20px; }
  .hero-facts span { font-size: 9px; }
  .floating-truth { right: -4px; bottom: -38px; transform: scale(.87) rotate(2deg); transform-origin: bottom right; }
  .floating-chip { left: -4px; top: 6px; transform: scale(.9) rotate(-3deg); transform-origin: top left; }
  .hero-visual { padding-bottom: 30px; }
  .monitor-top, .monitor-bottom { padding: 11px 13px; }
  .monitor-screen { padding: 12px 10px 0; }
  .monitor-reading { gap: 9px; font-size: 7px; padding-bottom: 11px; }
  .monitor-reading .reading-out { margin-left: 0; }
  .hero-strip { gap: 12px 20px; }
  .strip-label { display: none; }
  .strip-steps { order: 1; gap: 10px 20px; }
  .strip-steps span { font-size: 9px; }
  .scroll-cue { order: 2; margin-left: 0; font-size: 7px; }
  .scroll-cue span { display: none; }
  .section { padding: 76px 0; }
  .section-kicker { margin-bottom: 15px; font-size: 9px; }
  .section-head h2 { font-size: clamp(2.2rem, 9.5vw, 3.2rem); }
  .section-intro p { font-size: 13px; }
  .section-note { margin-top: 13px; font-size: 7px; }
  .concept-card { padding: 21px; border-radius: 19px; }
  .concept-level-card { min-height: 0; }
  .level-visual { margin-bottom: 30px; }
  .mini-gate-list { grid-template-columns: 1fr; }
  .mini-gate { padding: 10px 9px; }
  .universal-line { padding-top: 22px; }
  .xor-glyph { font-size: 4.2rem; }
  .lab-section { padding-bottom: 66px; }
  .lab-head-side p { font-size: 13px; }
  .shortcut-note { flex-wrap: wrap; }
  .gate-tabs { margin-inline: -6px; border-radius: 13px; }
  .gate-tab { min-width: 88px; flex-direction: column; gap: 3px; min-height: 65px; padding: 7px 8px; font-size: 10px; }
  .gate-tab .gate-tab-icon { width: 32px; height: 22px; }
  .gate-tab small { font-size: 7px; }
  .lab-stage { padding: 10px; border-radius: 20px; }
  .stage-bar { padding-bottom: 10px; }
  .stage-live { font-size: 8px; }
  .stage-button { min-height: 30px; padding: 0 8px; font-size: 8px; }
  .stage-button-icon { width: 30px; }
  .circuit-area {
    grid-template-columns: 78px minmax(0, 1fr) 70px;
    min-height: 260px;
    border-radius: 13px;
  }
  .switch-column { height: 235px; padding: 12px 0 14px 8px; }
  .input-switch { width: 68px; gap: 5px; padding: 4px 0; }
  .switch-label { font-size: 7px; }
  .switch-track { width: 47px; height: 24px; }
  .switch-knob { top: 3px; left: 3px; width: 16px; height: 16px; }
  .input-switch[aria-pressed="true"] .switch-knob { transform: translateX(22px); }
  .switch-state { font-size: 17px; }
  .wire-hint { display: none; }
  .output-column { padding-right: 2px; }
  .lamp { width: 58px; height: 70px; }
  .bulb { width: 42px; }
  .lamp-halo { inset: -12px; }
  .output-value { font-size: 26px; }
  .output-label { font-size: 7px; }
  .stage-caption { align-items: flex-start; flex-direction: column; gap: 7px; padding: 12px 3px 1px; }
  .caption-sentence { font-size: 9px; }
  .caption-count { font-size: 7px; }
  .truth-panel { padding: 20px; border-radius: 20px; }
  .truth-panel h3 { margin-top: 18px; font-size: 24px; }
  .truth-table td { padding: 8px 0; }
  .wave-panel { padding: 18px 14px 14px; border-radius: 20px; }
  .wave-head { flex-direction: column; gap: 12px; }
  .wave-head h3 { font-size: 16px; }
  .wave-actions { width: 100%; justify-content: space-between; }
  .wave-legend { flex-wrap: wrap; gap: 9px 16px; }
  .wave-note { width: 100%; margin-left: 0; }
  .application-card { padding: 22px; border-radius: 19px; }
  .application-formula { right: 22px; bottom: 20px; left: 22px; }
  .quiz-aside { grid-template-columns: 1fr; }
  .teacher-note { display: none; }
  .quiz-card { padding: 21px; border-radius: 20px; }
  .quiz-start, .quiz-play, .quiz-result { min-height: 420px; }
  .quiz-start h3, .quiz-result h3 { margin-top: 18px; font-size: clamp(1.8rem, 8vw, 2.5rem); }
  .options { grid-template-columns: 1fr; gap: 8px; margin-top: 20px; }
  .option { min-height: 50px; font-size: 12px; }
  .quiz-footer { align-items: flex-start; flex-direction: column; gap: 13px; }
  .button-next { width: 100%; }
  .result-ring { width: 116px; height: 116px; }
  .result-ring::before { width: 98px; height: 98px; }
  .footer-inner { min-height: 0; align-items: flex-start; flex-direction: column; gap: 18px; padding: 24px 0; }
  .footer-actions { width: 100%; justify-content: space-between; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 3.55rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .hero-facts { gap: 9px; }
  .hero-facts li { flex-direction: column; gap: 2px; }
  .circuit-area { grid-template-columns: 68px minmax(0, 1fr) 62px; min-height: 235px; }
  .switch-column { height: 215px; }
  .input-switch { width: 62px; }
  .switch-track { width: 42px; height: 22px; }
  .switch-knob { width: 14px; height: 14px; }
  .input-switch[aria-pressed="true"] .switch-knob { transform: translateX(20px); }
  .lamp { width: 50px; height: 60px; }
  .bulb { width: 36px; }
  .output-value { font-size: 22px; }
  .gate-tab { min-width: 82px; }
}

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