/* ==========================================================================
   CAS · Recurrent Neural Networks — sections.css
   Per-section visuals: hero, labs, simulator, math, charts, zoo, s2s,
   char-RNN, code lab, applications, history, summary, quiz.
   ========================================================================== */

/* ------------------------------------------------------------ hero */
.sec-hero { min-height: 92vh; display: flex; flex-direction: column; justify-content: center; }
.sec-hero .wrap { width: 100%; }
.hero-brand { margin: 0 0 1.4rem; }
.hero-title { font-size: clamp(2.6rem, 6.4vw, 4.9rem); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 1rem; }
.hero-title .grad {
  color: transparent; background: linear-gradient(100deg, var(--teal), var(--indigo) 60%, var(--violet));
  -webkit-background-clip: text; background-clip: text;
}
.hero-sub { color: var(--text-2); font-size: clamp(1.1rem, 2vw, 1.35rem); max-width: 62ch; line-height: 1.65; }
.hero-sub strong { color: var(--text); }

.def-banner {
  border: 1px solid rgba(94, 234, 212, 0.35); border-left: 3px solid var(--teal);
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.07), rgba(94, 234, 212, 0.02));
  border-radius: var(--radius); padding: 1.1rem 1.4rem; margin: 1.8rem 0;
  max-width: 860px;
}
.def-banner .mini { margin-bottom: 0.35rem; color: var(--teal); }
.def-banner p { margin: 0; font-size: 1.02rem; line-height: 1.7; }
.def-banner code { color: var(--teal); }

.cap-tags { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 2.2rem; }
.cap-tag {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.12em;
  border: 1px solid var(--line-2); border-radius: 999px; padding: 0.5rem 1rem 0.5rem 0.55rem;
  color: var(--text-2); background: rgba(8, 13, 24, 0.5);
}
.cap-idx {
  display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem;
  border-radius: 50%; background: rgba(94, 234, 212, 0.14); color: var(--teal);
  font-size: 0.72rem; letter-spacing: 0;
}

.hero-stage-grid {
  display: grid; grid-template-columns: minmax(300px, 0.9fr) minmax(340px, 1.1fr);
  gap: 1.3rem; align-items: stretch; max-width: 980px;
}
@media (max-width: 880px) { .hero-stage-grid { grid-template-columns: 1fr; } }
.hero-controls, .hero-canvas-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; display: flex; flex-direction: column;
}
.seq-btn-group { display: flex; flex-direction: column; gap: 0.55rem; }
.seq-btn {
  text-align: left; border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 0.7rem 0.9rem; background: rgba(8, 13, 24, 0.45); color: var(--text-2);
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.seq-btn:hover { border-color: var(--line-2); color: var(--text); }
.seq-btn.active { border-color: rgba(94, 234, 212, 0.55); background: rgba(94, 234, 212, 0.08); color: var(--text); }
.seq-btn-title { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.seq-btn:not(.active) .seq-btn-title { color: var(--text-3); }
.seq-btn.active .seq-btn-title { color: var(--teal); }
.seq-btn-desc { font-size: 0.88rem; font-style: italic; }

.timeline-track { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.9rem 0 0.4rem; flex: 1; }
.tl-row { display: flex; align-items: center; gap: 0.7rem; opacity: 0; transform: translateX(-8px); transition: opacity 0.35s, transform 0.35s; }
.tl-row.on { opacity: 1; transform: none; }
.tl-row .tl-word { font-family: var(--font-mono); font-size: 0.8rem; width: 7.2rem; color: var(--text-2); text-align: right; flex: none; }
.tl-cells { display: flex; gap: 2px; flex: 1; }
.tl-cell { height: 14px; flex: 1; border-radius: 3px; background: rgba(148, 163, 184, 0.12); transition: background 0.5s; }
.tl-arrow { color: var(--teal); font-size: 0.75rem; opacity: 0.5; flex: none; width: 1.2rem; text-align: center; }

.scroll-cue { position: absolute; bottom: 1.4rem; left: 50%; transform: translateX(-50%); }
.scroll-cue span { display: block; width: 1.6rem; height: 2.6rem; border: 2px solid var(--line-2); border-radius: 999px; position: relative; }
.scroll-cue span::after {
  content: ""; position: absolute; left: 50%; top: 0.45rem; width: 0.3rem; height: 0.55rem;
  background: var(--teal); border-radius: 2px; transform: translateX(-50%);
  animation: cueWheel 1.8s ease-in-out infinite;
}
@keyframes cueWheel { 0% { opacity: 0; transform: translate(-50%, 0); } 35% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 0.9rem); } }

/* ------------------------------------------------- 02 · order lab */
.order-lab { display: flex; flex-direction: column; gap: 1.2rem; }
.order-lab-top { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.ol-sentence { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.ol-word {
  font-family: var(--font-mono); font-size: 0.92rem; padding: 0.45rem 0.8rem;
  border: 1px solid var(--line-2); border-radius: 9px; background: rgba(8, 13, 24, 0.6);
  color: var(--text); transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s, background 0.2s;
}
.ol-word.moved { transform: translateY(-5px); border-color: var(--amber); color: var(--amber); }
.ol-word.idx0, .ol-word.idx1 { border-color: rgba(251, 191, 36, 0.5); }
.ol-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.order-lab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 1.2rem; }
.ol-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; background: var(--panel); display: flex; flex-direction: column; gap: 0.7rem; }
.ol-bow { border-top: 2px solid rgba(251, 113, 133, 0.5); }
.ol-rnn { border-top: 2px solid rgba(94, 234, 212, 0.5); }
.ol-viz { display: flex; flex-direction: column; gap: 0.35rem; min-height: 3.4rem; }
.ol-mini { display: flex; align-items: center; gap: 0.45rem; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-3); }
.ol-mini b { color: var(--text-2); font-weight: 500; width: 4.6rem; text-align: right; flex: none; }
.ol-bars { display: flex; gap: 3px; flex: 1; }
.ol-bar { height: 12px; flex: 1; border-radius: 3px; transition: background 0.45s; }
.ol-bow .ol-bar { background: rgba(251, 113, 133, 0.75); }
.ol-rnn .ol-bar { background: rgba(94, 234, 212, 0.8); }
.ol-verdict { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-top: 1px dashed var(--line); padding-top: 0.7rem; }
.ol-verdict-label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; color: var(--text-3); text-transform: uppercase; }
.ol-verdict-val { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.ol-note { margin: 0; font-size: 0.86rem; color: var(--text-2); font-style: italic; }
.ol-note.flash { animation: noteFlash 0.8s; }
@keyframes noteFlash { 0% { background: rgba(251, 191, 36, 0.18); } 100% { background: transparent; } }

/* ---------------------------------------------- 03 · unroll card */
.unroll-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.unroll-toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.unroll-mode { display: flex; gap: 0.4rem; }
.view-toggle-btn {
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.55rem 1rem; border: 1px solid var(--line); border-radius: 999px; color: var(--text-2);
  background: rgba(8, 13, 24, 0.5); transition: all 0.18s;
}
.view-toggle-btn:hover { border-color: var(--line-2); color: var(--text); }
.view-toggle-btn.active { border-color: var(--teal); background: var(--teal); color: #05231f; font-weight: 600; }
.unroll-t-ctl { display: flex; align-items: center; gap: 0.8rem; }
.unroll-t-ctl input[type="range"] { width: 11rem; }
.unroll-stage { background: rgba(5, 8, 14, 0.55); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.6rem; overflow-x: auto; }
.unroll-stage svg { width: 100%; min-width: 640px; height: auto; display: block; }

/* unroll svg vocabulary */
.u-node { fill: #0b1526; stroke: var(--line-2); stroke-width: 1.5; }
.u-x { fill: #0c2340; stroke: #38bdf8; stroke-width: 1.8; }
.u-h { fill: #064e3b; stroke: #5eead4; stroke-width: 1.8; }
.u-y { fill: #2e1065; stroke: #a78bfa; stroke-width: 1.8; }
.u-cellbox { fill: #101a2e; stroke: #818cf8; stroke-width: 1.6; }
.u-arrow { stroke: #5f7189; stroke-width: 1.6; fill: none; }
.u-arrow-h { stroke: #5eead4; stroke-width: 1.6; fill: none; }
.u-arrow-x { stroke: #38bdf8; stroke-width: 1.6; fill: none; }
.u-arrow-y { stroke: #a78bfa; stroke-width: 1.6; fill: none; }
.u-loop { stroke: #34d399; stroke-width: 1.8; fill: none; stroke-dasharray: 5 4; }
.u-txt { fill: #dbe7f5; font-family: var(--font-mono); font-size: 12px; }
.u-txt-sm { fill: #8ba3bf; font-family: var(--font-mono); font-size: 9.5px; }
.u-txt-c { fill: #5eead4; font-family: var(--font-mono); font-size: 11px; font-weight: 700; }
.u-txt-w { fill: #e9eef7; font-family: var(--font-mono); font-size: 10.5px; }
.u-pulse { opacity: 0; }
.u-pulse.run { animation: uPulse 1.4s ease-in-out; }
@keyframes uPulse { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }

.unroll-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.fact { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.9rem 1.05rem; background: rgba(8, 13, 24, 0.4); display: flex; flex-direction: column; gap: 0.3rem; }
.fact b { color: var(--teal); font-size: 0.92rem; }
.fact span { color: var(--text-2); font-size: 0.86rem; line-height: 1.55; }

/* ------------------------------------------- 04 · forward simulator */
.simulator { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgba(8, 13, 24, 0.6), rgba(8, 13, 24, 0.25)); overflow: hidden; }
.sim-header { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; justify-content: space-between; padding: 1rem 1.4rem; border-bottom: 1px solid var(--line); background: rgba(8, 13, 24, 0.5); }
.sim-left { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.sim-status-badge { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.12em; color: var(--teal); }
.sim-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 8px var(--teal); animation: dotPulse 1.6s infinite; }
@keyframes dotPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.sim-controls { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.sim-speed { display: inline-flex; gap: 2px; margin-left: 0.4rem; }
.sim-speed-btn { padding: 0.5rem 0.6rem !important; font-size: 0.68rem !important; }
.sim-speed-btn.on { border-color: var(--teal); background: rgba(94, 234, 212, 0.16); color: var(--teal); }
#simSelect { background: #09101d; color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; padding: 0.45rem 0.7rem; font-family: var(--font-mono); font-size: 0.8rem; }

.sim-tokenbar { padding: 0.9rem 1.4rem 0.5rem; background: rgba(8, 13, 24, 0.35); }
.token-stream { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.45rem; }
.tok {
  font-family: var(--font-mono); font-size: 0.85rem; padding: 0.38rem 0.65rem;
  border: 1px solid var(--line); border-radius: 8px; color: var(--text-2);
  background: rgba(8, 13, 24, 0.55); cursor: pointer; transition: all 0.2s;
}
.tok:hover { border-color: var(--line-2); color: var(--text); }
.tok.done { border-color: rgba(94, 234, 212, 0.35); color: var(--teal); }
.tok.cur { border-color: var(--teal); background: rgba(94, 234, 212, 0.16); color: var(--teal); transform: translateY(-2px); box-shadow: 0 4px 14px rgba(94, 234, 212, 0.18); }
.tok .tok-idx { font-size: 0.62rem; color: var(--text-3); display: block; letter-spacing: 0.1em; }

.sim-stage { display: grid; grid-template-columns: minmax(300px, 0.85fr) minmax(360px, 1.15fr); gap: 1.1rem; padding: 1.2rem 1.4rem; }
@media (max-width: 960px) { .sim-stage { grid-template-columns: 1fr; } }
.sim-inspector { display: flex; flex-direction: column; gap: 0.65rem; }
.vector-card { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.75rem 0.9rem; background: rgba(8, 13, 24, 0.45); transition: border-color 0.3s, box-shadow 0.3s; }
.vector-card.active { border-color: rgba(94, 234, 212, 0.5); box-shadow: 0 0 18px rgba(94, 234, 212, 0.08); }
.vector-card.vc-teal.active { border-color: rgba(94, 234, 212, 0.6); }
.vector-card.vc-violet.active { border-color: rgba(167, 139, 250, 0.6); }
.vector-title { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-2); margin-bottom: 0.5rem; }
.vector-title b { color: var(--text); font-weight: 600; }
.vc-teal .vector-title b { color: var(--teal); }
.vc-violet .vector-title b { color: var(--violet); }
.math-dim-tag { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-3); border: 1px solid var(--line); padding: 0.08rem 0.4rem; border-radius: 5px; flex: none; }
.vector-cells { display: flex; gap: 3px; flex-wrap: wrap; }
.vcell {
  width: 2.1rem; height: 1.7rem; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.62rem; border-radius: 4px;
  background: rgba(148, 163, 184, 0.12); color: var(--text-2);
  transition: background 0.4s, color 0.3s, transform 0.2s;
}
.vcell.hot { transform: translateY(-2px); }
.vcell.dimmed { opacity: 0.35; }
.vcell.hot-one {
  animation: onePulse 1.4s ease-in-out infinite;
}
@keyframes onePulse { 0%, 100% { box-shadow: 0 0 4px rgba(251, 191, 36, 0.5); } 50% { box-shadow: 0 0 12px rgba(251, 191, 36, 0.95); } }
html.static .vcell.hot-one { animation: none; }

/* vocabulary strip — word ↔ index mapping inside the one-hot card */
.vocab-strip { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 0.55rem; }
.vchip {
  display: inline-flex; align-items: baseline; gap: 0.3rem;
  font-family: var(--font-mono); font-size: 0.62rem; line-height: 1;
  padding: 0.28rem 0.45rem; border: 1px solid var(--line); border-radius: 5px;
  color: var(--text-3); background: rgba(8, 13, 24, 0.5); transition: all 0.25s;
}
.vchip i { font-style: normal; color: var(--text-3); opacity: 0.7; }
.vchip.on { border-color: rgba(251, 191, 36, 0.65); color: var(--amber); background: rgba(251, 191, 36, 0.1); }
.vchip.on i { color: var(--amber); }
#vecYt { display: flex; flex-direction: column; gap: 0.3rem; }
.yrow { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.74rem; }
.yrow .yword { width: 4.4rem; color: var(--text-2); flex: none; }
.yrow .ybar-wrap { flex: 1; height: 12px; background: rgba(148, 163, 184, 0.1); border-radius: 4px; overflow: hidden; }
.yrow .ybar { height: 100%; border-radius: 4px; background: rgba(167, 139, 250, 0.75); transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.yrow.lead .ybar { background: var(--violet); }
.yrow .ypct { width: 3.2rem; text-align: right; color: var(--text-3); flex: none; }
.yrow.lead .ypct { color: var(--violet); }

.sim-circuit { background: rgba(5, 8, 14, 0.5); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.circuit-svg { width: 100%; height: auto; display: block; }
.phase-tag { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--teal); text-transform: uppercase; }

/* circuit svg classes */
.sim-node { transition: opacity 0.3s; }
.sim-node.off { opacity: 0.25; }
.sim-node.hot .nd, .sim-node.hot .op { filter: drop-shadow(0 0 7px #fff3); }
.nd { stroke-width: 2; }
.nd-teal { fill: #064e3b; stroke: #5eead4; }
.nd-sky { fill: #0c2340; stroke: #38bdf8; }
.nd-violet { fill: #2e1065; stroke: #a78bfa; }
.nd-sum { fill: #132338; stroke: #fbbf24; }
.nd-big { stroke-width: 3; }
.nd-txt { fill: var(--text); font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.nd-sub { fill: #7286a0; font-family: var(--font-mono); font-size: 8.5px; }
.op { stroke-width: 1.8; }
.op-indigo { fill: #1e1b4b; stroke: #818cf8; }
.op-sky { fill: #082f49; stroke: #38bdf8; }
.op-violet { fill: #2e1065; stroke: #a78bfa; }
.op-txt { fill: var(--text); font-family: var(--font-mono); font-size: 11px; font-weight: 700; }
.bias-lbl { fill: #fbbf24; font-family: var(--font-mono); font-size: 10px; font-weight: 600; }
.wire { stroke: #5f7189; stroke-width: 1.8; fill: none; }
.wire-amber { stroke: #fbbf24; stroke-width: 1.5; }
.wire-violet { stroke: #a78bfa; stroke-width: 1.8; }
.loop-wire { stroke: #34d399; stroke-width: 1.8; fill: none; stroke-dasharray: 6 4; animation: loopDash 1.2s linear infinite; opacity: 0.85; }
@keyframes loopDash { to { stroke-dashoffset: -20; } }
.loop-lbl { fill: #34d399; font-family: var(--font-mono); font-size: 9px; opacity: 0.9; }
.tanh-curve { stroke: #ddd6fe; stroke-width: 1.6; opacity: 0.65; }
html.static .loop-wire { animation: none; }

.sim-narration { display: flex; gap: 0.9rem; align-items: flex-start; padding: 0.95rem 1.4rem 1.1rem; border-top: 1px solid var(--line); background: rgba(8, 13, 24, 0.5); }
.narration-badge { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.16em; color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.4); border-radius: 6px; padding: 0.2rem 0.5rem; flex: none; margin-top: 0.15rem; }
.narration-text { margin: 0; font-size: 0.98rem; line-height: 1.6; color: var(--text); }
.narration-text .eq { font-family: var(--font-mono); color: var(--teal); font-size: 0.88em; }

/* ------------------------------------------------ 05 · math card */
.math-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.2rem, 3vw, 2rem); }
.math-eq {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline;
  gap: 0.15rem; font-family: var(--font-mono); font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  padding: 1.4rem 0.5rem 1.6rem; line-height: 1.4;
}
.math-op { color: var(--text-3); padding: 0 0.25rem; }
.math-sep { color: var(--text-3); padding: 0 0.9rem; }
.math-token { padding: 0.18rem 0.45rem; border-radius: 8px; border: 1px solid transparent; cursor: pointer; transition: all 0.18s; }
.math-token:hover { border-color: currentColor; }
.math-token.selected { border-color: currentColor; background: rgba(148, 163, 184, 0.08); }
.tok-h { color: var(--teal); }
.tok-x { color: var(--sky); }
.tok-tanh { color: var(--violet); }
.tok-indigo { color: var(--indigo); }
.tok-sky { color: var(--sky); }
.tok-amber { color: var(--amber); }
.tok-y { color: #f0abfc; }
.tok-violet { color: var(--violet); }
.math-break { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(260px, 0.85fr); gap: 1.4rem; border-top: 1px solid var(--line); padding-top: 1.4rem; }
@media (max-width: 800px) { .math-break { grid-template-columns: 1fr; } }
.math-spec h3 { margin: 0.3rem 0 0.4rem; font-size: 1.3rem; }
.math-role { color: var(--text-2); font-size: 0.9rem; font-style: italic; margin: 0.4rem 0 0.9rem; }
.math-props { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.prop-chip { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; border: 1px solid var(--line-2); border-radius: 999px; padding: 0.3rem 0.7rem; color: var(--text-2); background: rgba(8, 13, 24, 0.45); }
.math-viz { border: 1px solid var(--line); border-radius: var(--radius-s); background: rgba(5, 8, 14, 0.55); padding: 1rem; display: grid; place-items: center; min-height: 210px; }
.math-viz svg { width: 100%; max-width: 360px; height: auto; }
.mv-cell { transition: opacity 0.2s; }

/* -------------------------------------------- 06 · activation labs */
.act-panel canvas { background: rgba(5, 8, 14, 0.55); border: 1px solid var(--line); border-radius: var(--radius-s); margin-top: 0.7rem; }
.act-ctl { margin-top: 0.8rem; display: flex; flex-direction: column; gap: 0.45rem; }
.act-read { display: flex; gap: 1.6rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-2); flex-wrap: wrap; }
.act-read b { color: var(--teal); }
.act-msg-ok { color: var(--green); }
.act-msg-warn { color: var(--amber); }
.act-msg-bad { color: var(--rose); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 4px; background: rgba(148, 163, 184, 0.25); outline-offset: 6px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--teal); border: 2px solid #04231f; box-shadow: 0 0 8px rgba(94, 234, 212, 0.5); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--teal); border: 2px solid #04231f; cursor: pointer; }

.ce-bars { display: flex; flex-direction: column; gap: 0.45rem; margin: 0.8rem 0 0.6rem; }
.ce-bar-row { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-mono); font-size: 0.8rem; }
.ce-bar-row .ce-word { width: 4.6rem; color: var(--text-2); flex: none; }
.ce-bar-row.target .ce-word { color: var(--sky); font-weight: 700; }
.ce-bar-track { flex: 1; height: 16px; background: rgba(148, 163, 184, 0.1); border-radius: 5px; overflow: hidden; }
.ce-bar-fill { height: 100%; border-radius: 5px; background: rgba(56, 189, 248, 0.45); transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s; }
.ce-bar-row.target .ce-bar-fill { background: var(--sky); }
.ce-bar-row .ce-p { width: 3.6rem; text-align: right; color: var(--text-3); flex: none; }
.ce-ctl { margin-top: 0.4rem; display: flex; flex-direction: column; gap: 0.45rem; }
.ce-ctl .act-read b { color: var(--sky); }

/* --------------------------------------------- 07 · shapes & params */
.shape-flow { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.8rem; }
.sf-row { display: flex; align-items: center; gap: 0.7rem; font-family: var(--font-mono); font-size: 0.8rem; flex-wrap: wrap; }
.sf-chip { border: 1px solid var(--line-2); border-radius: 8px; padding: 0.35rem 0.6rem; background: rgba(8, 13, 24, 0.55); }
.sf-chip b { font-weight: 700; }
.sf-arrow { color: var(--text-3); }
.sf-lbl { color: var(--text-3); font-size: 0.7rem; letter-spacing: 0.1em; min-width: 5.4rem; text-transform: uppercase; }
.sf-h b { color: var(--teal); } .sf-x b { color: var(--sky); } .sf-y b { color: var(--violet); }
.sf-w b { color: var(--indigo); } .sf-b b { color: var(--amber); }

.range-wrap { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 1.1rem; }
.range-header { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; color: var(--text-2); }
.range-val { color: var(--teal); font-weight: 700; }

.param-table { width: 100%; border-collapse: collapse; margin-top: 1.2rem; font-size: 0.88rem; }
.param-table th { text-align: left; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line-2); }
.param-table td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); color: var(--text-2); }
.param-table td.num { font-family: var(--font-mono); color: var(--text); font-size: 0.8rem; }
.param-table code { font-size: 0.78rem; color: var(--indigo); }
.param-total td { border-top: 2px solid var(--teal); border-bottom: 0; color: var(--text); }

/* ------------------------------------------- 08 · training / BPTT */
.train-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(430px, 100%), 1fr)); gap: 1.3rem; align-items: start; }
.bptt-steps { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 1rem; }
.bs-row { display: flex; gap: 0.8rem; align-items: baseline; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.65rem 0.9rem; background: rgba(8, 13, 24, 0.4); }
.bs-n { font-family: var(--font-mono); font-size: 0.7rem; color: var(--teal); border: 1px solid rgba(94, 234, 212, 0.4); border-radius: 6px; padding: 0.12rem 0.45rem; flex: none; }
.bs-row p { margin: 0; font-size: 0.88rem; color: var(--text-2); line-height: 1.55; }
.bs-row p b { color: var(--text); }
.bs-row p code { color: var(--amber); font-size: 0.82em; }

.chainviz { display: flex; align-items: center; gap: 0; margin-top: 1rem; overflow-x: auto; padding: 0.6rem 0.2rem; }
.cv-link { display: flex; align-items: center; flex: none; }
.cv-node { width: 2rem; height: 2rem; border-radius: 7px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.62rem; background: #132338; border: 1px solid rgba(94, 234, 212, 0.5); color: var(--teal); }
.cv-x { width: 1.9rem; height: 2px; background: linear-gradient(90deg, var(--teal), var(--amber)); position: relative; opacity: 0.85; }
.cv-x::after { content: "×0.4"; position: absolute; top: -1.05rem; left: 50%; transform: translateX(-50%); font-family: var(--font-mono); font-size: 0.58rem; color: var(--amber); }

/* ------------------------------------- 09 · vanishing gradient lab */
.bptt-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.bptt-controls-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 1.4rem; align-items: start; }
@media (max-width: 900px) { .bptt-controls-row { grid-template-columns: 1fr; } }
.bptt-fixes { display: flex; flex-direction: column; gap: 0.6rem; justify-content: center; }
.fix-toggle { display: flex; align-items: center; gap: 0.55rem; cursor: pointer; font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.06em; color: var(--text-2); }
.fix-toggle input { accent-color: var(--teal); width: 1.05rem; height: 1.05rem; }
.fix-toggle:hover { color: var(--text); }

.bptt-banner { margin-top: 1.2rem; border-radius: var(--radius-s); padding: 0.9rem 1.15rem; font-size: 0.94rem; border: 1px solid var(--line); background: rgba(8, 13, 24, 0.4); transition: all 0.3s; }
.bptt-banner b { font-weight: 700; }
.bptt-banner.vanish { border-color: rgba(251, 113, 133, 0.5); background: rgba(251, 113, 133, 0.07); color: #ffd7de; }
.bptt-banner.explode { border-color: rgba(251, 146, 60, 0.55); background: rgba(251, 146, 60, 0.08); color: #ffe4cf; }
.bptt-banner.healthy { border-color: rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.07); color: #c9f7e5; }
.bptt-banner.saved { border-color: rgba(56, 189, 248, 0.5); background: rgba(56, 189, 248, 0.07); color: #d3ecfd; }

.bptt-viz2 { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(340px, 1.3fr); gap: 1.3rem; margin-top: 1.2rem; align-items: start; }
@media (max-width: 960px) { .bptt-viz2 { grid-template-columns: 1fr; } }
.bptt-timeline { display: flex; flex-direction: row-reverse; gap: 3px; align-items: flex-end; height: 150px; margin-top: 0.7rem; padding: 0.5rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: rgba(5, 8, 14, 0.5); overflow: hidden; }
.bt-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; height: 100%; min-width: 6px; }
.bt-bar { width: 100%; border-radius: 3px 3px 0 0; min-height: 2px; transition: height 0.4s, background 0.4s; }
.bt-lbl { font-family: var(--font-mono); font-size: 0.52rem; color: var(--text-3); }
.bptt-chart-wrap canvas { background: rgba(5, 8, 14, 0.5); border: 1px solid var(--line); border-radius: var(--radius-s); margin-top: 0.7rem; }

.bptt-fixgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 1.3rem; }
.fix-card { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.9rem 1.05rem; background: rgba(8, 13, 24, 0.4); display: flex; flex-direction: column; gap: 0.35rem; }
.fix-card b { color: var(--sky); font-size: 0.92rem; }
.fix-card span { color: var(--text-2); font-size: 0.85rem; line-height: 1.55; }

/* --------------------------------------------------- 10 · zoo */
.zoo-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.zoo-nav { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.2rem; }
.zoo-tab {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.55rem 0.95rem; border: 1px solid var(--line); border-radius: 999px; color: var(--text-2);
  background: rgba(8, 13, 24, 0.45); transition: all 0.18s;
}
.zoo-tab:hover { border-color: var(--line-2); color: var(--text); }
.zoo-tab[aria-selected="true"] { border-color: var(--teal); background: var(--teal); color: #05231f; font-weight: 700; }
.zoo-content { display: grid; grid-template-columns: minmax(320px, 1.1fr) minmax(280px, 0.9fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .zoo-content { grid-template-columns: 1fr; } }
.zoo-diagram { background: rgba(5, 8, 14, 0.55); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.8rem; }
.zoo-diagram svg { width: 100%; height: auto; display: block; }
.zoo-details h3 { font-size: 1.45rem; margin: 0.4rem 0 0.6rem; }
.zoo-details .formula { font-size: 0.9rem; }

/* flow dots on zoo/variant svgs */
.z-dot { fill: var(--amber); }
.v-dot-f { fill: var(--teal); }
.v-dot-b { fill: var(--rose); }

/* ------------------------------------------ 11 · variants card */
.var-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.var-controls { display: flex; flex-wrap: wrap; gap: 1.1rem; align-items: center; margin-bottom: 1.1rem; }
.var-legend { display: flex; gap: 0.8rem; margin-left: auto; }
.lg { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; display: inline-flex; align-items: center; gap: 0.35rem; }
.lg::before { content: ""; width: 0.85rem; height: 3px; border-radius: 2px; display: inline-block; }
.lg-f { color: var(--teal); } .lg-f::before { background: var(--teal); }
.lg-b { color: var(--rose); } .lg-b::before { background: var(--rose); }
.lg.hidden { display: none; }
.var-stage { background: rgba(5, 8, 14, 0.55); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.6rem; overflow-x: auto; }
.var-stage svg { width: 100%; min-width: 620px; height: auto; display: block; }

/* ----------------------------------------------- 12 · seq2seq */
.s2s-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.s2s-controls { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; margin-bottom: 1.2rem; }
.s2s-stage { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: start; }
@media (max-width: 880px) { .s2s-stage { grid-template-columns: 1fr; } .s2s-mid { justify-self: center; } }
.s2s-col { display: flex; flex-direction: column; gap: 0.5rem; }
.s2s-lane { display: flex; flex-wrap: wrap; gap: 0.4rem; border: 1px dashed var(--line-2); border-radius: var(--radius-s); padding: 0.85rem; min-height: 4.6rem; background: rgba(5, 8, 14, 0.45); align-items: center; }
.s2s-token {
  font-family: var(--font-mono); font-size: 0.85rem; padding: 0.4rem 0.65rem;
  border: 1px solid var(--line); border-radius: 8px; color: var(--text-3);
  background: rgba(8, 13, 24, 0.55); transition: all 0.3s;
}
.s2s-token.enc-on { border-color: rgba(56, 189, 248, 0.6); color: var(--sky); background: rgba(56, 189, 248, 0.08); transform: translateY(-2px); }
.s2s-token.dec-on { border-color: rgba(167, 139, 250, 0.65); color: var(--violet); background: rgba(167, 139, 250, 0.1); transform: translateY(-2px); }
.s2s-token.err { border-color: rgba(251, 113, 133, 0.65); color: var(--rose); background: rgba(251, 113, 133, 0.1); }
.s2s-token.gold { opacity: 0.45; border-style: dashed; }
.s2s-mid { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding-top: 1.6rem; }
.ctx-arrow { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-3); letter-spacing: 0.1em; }
.ctx-node {
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; color: var(--teal);
  border: 2px solid rgba(94, 234, 212, 0.55); border-radius: 12px; padding: 0.6rem 0.9rem;
  background: rgba(6, 78, 59, 0.35); box-shadow: 0 0 18px rgba(94, 234, 212, 0.15);
  transition: transform 0.3s, box-shadow 0.3s;
}
.ctx-node.pulse { transform: scale(1.12); box-shadow: 0 0 26px rgba(94, 234, 212, 0.4); }

/* -------------------------------------------- 13 · char-RNN */
.ch-card { background: var(--panel); border: 1px solid rgba(94, 234, 212, 0.28); border-radius: var(--radius); padding: 1.4rem 1.5rem; box-shadow: 0 0 40px rgba(94, 234, 212, 0.05); }
.ch-toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 1.2rem; }
.ch-temp { display: flex; flex-direction: column; gap: 0.25rem; margin-left: auto; min-width: 10rem; }
.ch-temp input[type="range"] { width: 100%; }
.ch-grid { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(320px, 1.15fr); gap: 1.3rem; align-items: start; }
@media (max-width: 920px) { .ch-grid { grid-template-columns: 1fr; } }
.ch-metrics { display: flex; flex-direction: column; gap: 0.7rem; }
.ch-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
.ch-stat { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.6rem 0.4rem; text-align: center; background: rgba(8, 13, 24, 0.45); }
.ch-stat b { display: block; font-family: var(--font-mono); font-size: 1.05rem; color: var(--teal); }
.ch-stat span { font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.14em; color: var(--text-3); }
#chLossCanvas { background: rgba(5, 8, 14, 0.5); border: 1px solid var(--line); border-radius: var(--radius-s); }
.ch-out { display: flex; flex-direction: column; gap: 0.5rem; }
.ch-out-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.ch-text {
  margin: 0; flex: 1; min-height: 15rem; max-height: 24rem; overflow-y: auto;
  font-family: var(--font-mono); font-size: 0.88rem; line-height: 1.75; white-space: pre-wrap;
  background: rgba(5, 8, 14, 0.6); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 1rem 1.1rem; color: var(--text-2);
}
.ch-text .ch-new { color: var(--teal); }
.ch-code { margin-top: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: rgba(5, 8, 14, 0.5); }
.ch-code summary { cursor: pointer; padding: 0.85rem 1.1rem; font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.08em; color: var(--text-2); user-select: none; }
.ch-code summary:hover { color: var(--teal); }
.ch-code[open] summary { border-bottom: 1px solid var(--line); color: var(--teal); }

/* ------------------------------------------------ 14 · code lab */
.code-lab-card { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(5, 8, 14, 0.6); overflow: hidden; }
.code-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--line); background: rgba(8, 13, 24, 0.55); }
.code-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.code-tab-btn {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; padding: 0.5rem 0.9rem;
  border: 1px solid var(--line); border-radius: 999px; color: var(--text-2); background: rgba(8, 13, 24, 0.5); transition: all 0.18s;
}
.code-tab-btn:hover { color: var(--text); border-color: var(--line-2); }
.code-tab-btn.active { border-color: var(--teal); background: rgba(94, 234, 212, 0.14); color: var(--teal); }
.code-pre { margin: 0; padding: 1.2rem 1.3rem; overflow-x: auto; max-height: 34rem; overflow-y: auto; }
.code-pre code { font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.68; color: #c9d6e8; white-space: pre; }
.ck { color: var(--violet); }         /* keyword */
.ck-fn { color: var(--sky); }         /* function */
.ck-str { color: var(--green); }      /* string */
.ck-com { color: #5c6f88; font-style: italic; } /* comment */
.ck-num { color: var(--amber); }      /* number */
.ck-cls { color: var(--teal); }       /* class/important */
.code-terminal {
  font-family: var(--font-mono); font-size: 0.74rem; line-height: 1.7;
  padding: 0.9rem 1.3rem; border-top: 1px solid var(--line); background: #04070c;
  color: #7ee0c8; min-height: 3rem; white-space: pre-wrap;
}
.code-terminal .ct-dim { color: #56718c; }
.code-terminal .ct-warn { color: var(--amber); }

/* ---------------------------------------------- 15 · applications */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1.1rem; }
.app-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem; background: var(--panel); cursor: pointer; transition: border-color 0.2s, transform 0.2s; text-align: left; display: flex; flex-direction: column; gap: 0.5rem; }
.app-card:hover { border-color: rgba(94, 234, 212, 0.5); transform: translateY(-3px); }
.app-head { display: flex; align-items: center; gap: 0.7rem; }
.app-ico { font-size: 1.5rem; line-height: 1; }
.app-card h3 { margin: 0; font-size: 1.08rem; color: var(--text); }
.app-card p { margin: 0; color: var(--text-2); font-size: 0.9rem; line-height: 1.6; }
.app-topo { font-family: var(--font-mono); font-size: 0.72rem; color: var(--teal); border-top: 1px dashed var(--line); padding-top: 0.6rem; min-height: 2.6rem; }

/* ------------------------------------------------- 16 · history */
.hist-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 1rem; position: relative; }
.hist-item { border: 1px solid var(--line); border-radius: var(--radius-s); background: rgba(8, 13, 24, 0.45); padding: 1rem 1.05rem; cursor: pointer; transition: border-color 0.2s, background 0.2s; position: relative; }
.hist-item::before { content: ""; position: absolute; top: -1px; left: 1rem; right: 1rem; height: 2px; background: var(--line-2); border-radius: 2px; }
.hist-item:hover { border-color: var(--line-2); background: rgba(8, 13, 24, 0.7); }
.hist-item.open { border-color: rgba(94, 234, 212, 0.5); background: rgba(94, 234, 212, 0.05); }
.hist-item.open::before { background: var(--teal); }
.hist-yr { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 700; color: var(--teal); }
.hist-t { font-size: 0.95rem; font-weight: 600; margin: 0.25rem 0 0.35rem; }
.hist-d { font-size: 0.82rem; color: var(--text-3); line-height: 1.55; max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.hist-item.open .hist-d { max-height: 12rem; color: var(--text-2); padding-top: 0.2rem; }

/* ------------------------------------------------- 17 · summary */
.sum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 1rem; }
.sum-card { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); padding: 1.05rem 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; }
.sum-card b { color: var(--teal); font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; }
.sum-card p { margin: 0; color: var(--text-2); font-size: 0.92rem; line-height: 1.65; }
.sum-card code { color: var(--teal); font-size: 0.82em; }

/* ---------------------------------------------------- 18 · quiz */
.quiz-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 1.4rem 1.5rem; }
.quiz-score-banner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 1.1rem; margin-bottom: 1.3rem; }
.quiz-score-val { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: var(--teal); }
.quiz-q { border: 1px solid var(--line); border-radius: var(--radius-s); background: rgba(8, 13, 24, 0.4); padding: 1.05rem 1.2rem; }
.quiz-q.done { border-color: rgba(94, 234, 212, 0.3); }
.quiz-q-head { display: flex; gap: 0.75rem; align-items: baseline; margin-bottom: 0.8rem; }
.q-num { font-family: var(--font-mono); font-size: 0.72rem; color: var(--teal); border: 1px solid rgba(94, 234, 212, 0.4); border-radius: 6px; padding: 0.1rem 0.45rem; flex: none; }
.quiz-q-head h4 { margin: 0; font-size: 1.02rem; font-weight: 600; }
.quiz-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 0.5rem; }
.quiz-opt {
  text-align: left; font-size: 0.92rem; line-height: 1.5; color: var(--text-2);
  border: 1px solid var(--line); border-radius: 9px; padding: 0.6rem 0.85rem;
  background: rgba(8, 13, 24, 0.5); transition: all 0.16s; cursor: pointer;
}
.quiz-opt:hover { border-color: var(--line-2); color: var(--text); }
.quiz-opt .q-letter { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-3); margin-right: 0.45rem; }
.quiz-opt.correct { border-color: rgba(52, 211, 153, 0.65); background: rgba(52, 211, 153, 0.09); color: #c9f7e5; }
.quiz-opt.correct .q-letter { color: var(--green); }
.quiz-opt.wrong { border-color: rgba(251, 113, 133, 0.65); background: rgba(251, 113, 133, 0.08); color: #ffd7de; }
.quiz-opt.wrong .q-letter { color: var(--rose); }
.quiz-opt:disabled { cursor: default; opacity: 0.85; }
.quiz-expl { margin: 0.8rem 0 0; font-size: 0.88rem; line-height: 1.6; color: var(--text-2); border-left: 2px solid rgba(94, 234, 212, 0.5); padding-left: 0.85rem; }
.quiz-expl b { color: var(--teal); }

/* --------------------------------------------- responsive tweaks */
html.static { scroll-behavior: auto; }
@media (max-width: 640px) {
  .hero-title { font-size: clamp(2.1rem, 9vw, 3rem); }
  .sim-header, .sim-tokenbar, .sim-stage, .sim-narration { padding-inline: 0.9rem; }
  .bptt-card, .unroll-card, .zoo-card, .var-card, .s2s-card, .ch-card, .math-card { padding: 1.05rem 1rem; }
  .tl-row .tl-word { width: 5.2rem; font-size: 0.7rem; }
}
