/* ---------- Tokens: light-dark() keeps one list for both themes ---------- */
:root {
  color-scheme: light dark;
  --bg: light-dark(#f3f1ec, #101318); --paper: light-dark(#fbfaf7, #161a21); --ink: light-dark(#1c222b, #e7ecf2); --muted: light-dark(#5f6875, #9aa4b2);
  --line: light-dark(#e3dfd6, #252b35); --line-strong: light-dark(#cfc8ba, #353d49); --grid: light-dark(rgba(28, 34, 43, .055), rgba(231, 236, 242, .045));
  --accent: light-dark(#0e8f86, #2dd4bf); --accent-ink: light-dark(#ffffff, #06201d); --accent-soft: light-dark(rgba(14, 143, 134, .12), rgba(45, 212, 191, .12));
  --tile: light-dark(#fffdf8, #1c212a); --tile-side: light-dark(#e9e4d9, #12161c); --edge: light-dark(#cdc5b5, #3a4250); --route: light-dark(#0e8f86, #ffd166);
  --plate: light-dark(#ebe7dd, #171b22); --plate-l: light-dark(#ddd6c8, #0d1014); --plate-r: light-dark(#e4ded2, #111419); --pill: light-dark(#fffdf8, #1f252f);
  --shadow: 0 1px 0 rgba(28, 34, 43, .05), 0 10px 28px -14px light-dark(rgba(28, 34, 43, .2), rgba(0, 0, 0, .7));
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Geist", var(--sans);
  --pixel: "Pixelify Sans", var(--mono);
  --top: 60px;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
/* Links to a section glide there instead of jumping, and sections ease in as they arrive (only once site.js is running). */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .reveal-ready [data-reveal]:not(.milestones) { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
  .reveal-ready [data-reveal].in:not(.milestones) { opacity: 1; transform: none; }
}
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; line-height: 1.15; margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.muted { color: var(--muted); }
.ico { flex: none; vertical-align: -3px; }
.kicker { font: 600 12px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--paper); color: var(--ink); font: 600 14px/1.2 var(--sans); text-decoration: none; cursor: pointer; transition: border-color .15s, transform .15s; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 20px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 16px var(--display); letter-spacing: -.01em; }
.topnav { display: flex; gap: 4px; margin-left: auto; }
.topnav a { color: var(--muted); text-decoration: none; font: 600 13px var(--mono); padding: 6px 10px; border-radius: 8px; }
.topnav a:hover { color: var(--ink); background: var(--accent-soft); }
.theme-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); cursor: pointer; }
@media (max-width: 640px) { .topnav { display: none; } .brand span { font-size: 15px; } .theme-btn { margin-left: auto; } }

/* ---------- Scenes (shared) ---------- */
.scene { margin: 0; position: relative; border-radius: 14px; background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 26px 26px; }
.scene svg, .thumb svg { display: block; width: 100%; height: auto; }
/* Keep the whole stage (head, scene, timeline) on one screen, however wide the window is. */
.lesson .scene svg { max-height: max(300px, calc(100vh - 430px)); }
/* On a desktop-sized window the stage is exactly one screen tall and the scene takes the space left over. */
@media (min-width: 981px) and (min-height: 640px) {
  .stage { display: flex; flex-direction: column; height: calc(100vh - var(--top) - 36px); min-height: 600px; }
  .lesson .scene { flex: 1 1 0; min-height: 260px; }
  .lesson .scene svg { width: 100%; height: 100%; max-height: none; }
}
.scene [data-s], .scene [data-from], .thumb [data-s], .thumb [data-from] { opacity: 0; transition: opacity .35s; }
.scene [data-s].on, .scene [data-from].on, .thumb [data-s].on, .thumb [data-from].on { opacity: 1; }
.lit { fill: none; stroke: var(--route); stroke-width: 3; stroke-linejoin: round; stroke-dasharray: 8 8; animation: flow .9s linear infinite; }
.packet { fill: var(--route); stroke: var(--paper); stroke-width: 2.5; }
@keyframes flow { to { stroke-dashoffset: -16; } }

/* Isometric */
.iso .plate-top { fill: var(--plate); stroke: var(--line-strong); stroke-width: 1; }
.iso .plate-l { fill: var(--plate-l); }
.iso .plate-r { fill: var(--plate-r); }
.iso .edges path { fill: none; stroke: var(--edge); stroke-width: 2; stroke-linejoin: round; }
.iso .lit { stroke-width: 3.2; }
.iso .tile .top { fill: color-mix(in srgb, var(--tone) 16%, var(--tile)); stroke: var(--tone); stroke-width: 1.4; }
.iso .tile .side-l { fill: color-mix(in srgb, var(--tone) 42%, var(--tile-side)); stroke: var(--tone); stroke-opacity: .45; }
.iso .tile .side-r { fill: color-mix(in srgb, var(--tone) 26%, var(--tile-side)); stroke: var(--tone); stroke-opacity: .45; }
.iso .glyph { fill: none; stroke: var(--tone); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.iso .tile { transition: opacity .3s; }
.iso.stepping .tile:not(.cur) { opacity: .5; }
.iso .glow { fill: none; stroke: var(--route); stroke-width: 2; stroke-dasharray: 3 4; }
.iso .name rect { fill: var(--pill); stroke: var(--line-strong); }
.iso .name text { font: 600 12px var(--mono); fill: var(--ink); }
.iso .pill rect { fill: var(--ink); }
.iso .pill circle { fill: var(--route); }
.iso .pill text { font: 600 12px var(--mono); fill: var(--bg); }

/* Flat scenes */
.flat text { font-family: var(--mono); font-size: 13px; fill: var(--ink); }
.flat .lbl { font-weight: 600; font-size: 14px; }
.flat .lbl.sm, .flat .sm { font-size: 12.5px; }
.flat .lbl.big { font: 700 20px var(--display); }
.flat .tiny { font-size: 11px; }
.flat .strong { font-weight: 700; }
.flat .dim { fill: var(--muted); }
.flat .sub { font-size: 11px; fill: var(--muted); }
.flat .huge { font: 700 54px var(--display); }
.flat .ok { fill: var(--accent); }
.flat .alertc { fill: light-dark(#c62828, #ff8a80); }
.flat .code { font-size: 12.5px; }
.flat .bn { font-family: "Noto Sans Bengali", "Nirmala UI", "Vrinda", var(--sans); font-size: 15px; }
.flat .card { fill: var(--tile); stroke: var(--line-strong); }
.flat .toned { fill: color-mix(in srgb, var(--tone) 14%, var(--tile)); stroke: var(--tone); stroke-width: 1.3; }
.flat .panel { fill: var(--tile); stroke: var(--line-strong); }
.flat .console { fill: #1b2130; stroke: light-dark(transparent, #2e3646); } /* always dark, so its light text reads in both themes */
.flat .cons text, .flat .logline text { fill: #e7ecf2; }
.flat .cons .dim { fill: #9aa4b2; }
.flat .screen { fill: color-mix(in srgb, var(--ink) 6%, var(--tile)); stroke: var(--line-strong); stroke-width: 1.5; }
.flat .bubble { fill: var(--accent-soft); stroke: var(--accent); }
.flat .note { fill: var(--plate); stroke: var(--line-strong); }
.flat .alert { fill: color-mix(in srgb, #ef6461 18%, var(--tile)); stroke: #ef6461; }
.flat .wire path { fill: none; stroke: var(--edge); stroke-width: 1.6; }
.flat .wire polygon { fill: var(--edge); }
.flat .wire.thin path { stroke-width: 1.2; stroke-dasharray: 3 3; }
.flat .pill rect { fill: var(--ink); }
.flat .pill text { fill: var(--bg); font-size: 12px; font-weight: 600; }
.flat .pill.ok rect { fill: var(--accent); }
.flat .pill.ok text { fill: var(--accent-ink); }
.flat .pill.hot rect { fill: #e8590c; }
.flat .pill.hot text { fill: #fff; }
.flat .pill.big rect { fill: var(--accent); }
.flat .pill.big text { fill: var(--accent-ink); font-size: 13px; }
.flat .check circle { fill: var(--accent-soft); stroke: var(--accent); }
.flat .check .mark { fill: var(--accent); font-size: 11px; font-weight: 700; }
.flat .check.no circle { fill: rgba(239, 100, 97, .15); stroke: #ef6461; }
.flat .check.no .mark { fill: light-dark(#c62828, #ff8a80); }
.flat .txt { fill: var(--line-strong); }
.flat .txt.sel { fill: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); }
.flat .grid { stroke: var(--line); stroke-width: 1; }
.flat.stepping [data-a]:not(.cur) { opacity: .55; transition: opacity .3s; }
.flat.stepping [data-a].cur { opacity: 1; }
.flat .msg:not(.cur) .lit { display: none; }
/* An element that is dimmed (not current) but also not yet reached stays hidden: the step order wins. */
.flat.stepping [data-from]:not(.on), .flat.stepping [data-s]:not(.on) { opacity: 0; }
/* bKash checkout */
.checkout .co-notch { fill: var(--line-strong); }
.checkout .co-btn { fill: var(--accent); }
.checkout .co-btn-t { fill: var(--accent-ink); }
.checkout .co-bk { fill: #e2136e; stroke: #e2136e; }
.checkout .co-bk-t { fill: #fff; font-weight: 700; }
.checkout .co-btn.co-bk + .co-btn-t { fill: #fff; }
.checkout .co-dot { fill: var(--accent); }
.checkout .co-pin { fill: #e2136e; animation: pop .25s ease both; transform-box: fill-box; transform-origin: center; }
.checkout .co-pin:nth-of-type(2) { animation-delay: .15s; } .checkout .co-pin:nth-of-type(3) { animation-delay: .3s; }
.checkout .co-spin { fill: none; stroke: #e2136e; stroke-width: 5; stroke-dasharray: 100 40; stroke-linecap: round; animation: co-spin 1s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes co-spin { to { transform: rotate(360deg); } }
.checkout .co-ok { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.checkout .co-okmark { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .15s ease forwards; }
.checkout .co-pending { fill: color-mix(in srgb, #d9ad19 22%, var(--tile)); stroke: #d9ad19; }
.checkout .co-track { fill: var(--line); }
.checkout .co-played { fill: #f08a3c; }
.checkout .co-fill { fill: #34b27b; transform-box: fill-box; transform-origin: left; animation: co-grow 1.1s ease both; }
@keyframes co-grow { from { transform: scaleX(0); } }
.checkout .co-paper { fill: light-dark(#fffdf6, #1d222c); stroke: var(--line-strong); }
.checkout .co-tear { stroke: var(--line-strong); stroke-dasharray: 3 4; }
.checkout .co-stamp rect { fill: none; stroke: #34b27b; stroke-width: 2.5; }
.checkout .co-stamp text { fill: #34b27b; letter-spacing: .12em; font-weight: 700; }
/* sequence */
.seq .life { stroke: var(--line-strong); stroke-dasharray: 4 5; }
.seq .mlbl { font-size: 11.5px; fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
/* pipeline */
.pipe .tick circle { fill: var(--accent); }
.pipe .tick path { fill: none; stroke: var(--accent-ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pipe .log { font-size: 12.5px; fill: #e7ecf2; }
.pipe .logline.cur .log { fill: #ffd166; }
.pipe .console + text { fill: #9aa4b2; }
.pipe .bar { fill: var(--accent); opacity: .8; }
.pipe .bar.warn { fill: #f08a3c; }
.pipe .on .bar { animation: rise .5s both; }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.pipe .bar { transform-box: fill-box; transform-origin: bottom; }
/* scan */
.scan .q text { fill: #e7ecf2; }
.scan .sweep { fill: #ef6461; opacity: 0; }
.scan .on .sweep { animation: sweep 1.9s ease-out both infinite; }
@keyframes sweep { 0% { opacity: 0; } 6% { opacity: .45; } 18%, 100% { opacity: 0; } }
.scan .doc.hit.cur rect { stroke-width: 2.6; }
/* chart */
.chart .series { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-dasharray: 1400; stroke-dashoffset: 1400; }
.chart .series.on { animation: draw 2.4s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .poll { fill: var(--accent); animation: blink 1.4s infinite; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.chart .bracket { stroke: var(--muted); stroke-width: 1.2; }
.chart .baseline { fill: var(--paper); stroke: var(--ink); stroke-width: 2.5; }
.chart .thr line { stroke-dasharray: 5 5; stroke-width: 1.6; }
.chart .thr.minor line { stroke: #d9ad19; }
.chart .thr.moderate line { stroke: #f08a3c; }
.chart .thr.major line { stroke: #ef6461; }
.chart .hit, .ladder .hit { fill: #f08a3c; stroke: var(--paper); stroke-width: 3; }
/* vectors */
.vec .beam { fill: var(--accent); opacity: .35; }
.vec .on .beam { animation: beam 2.2s ease-in-out infinite; }
@keyframes beam { 0% { transform: translateY(0); } 50% { transform: translateY(250px); } 100% { transform: translateY(0); } }
.vec .brk { fill: none; stroke-width: 3; }
.vec .on .dot { animation: pop .4s both; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.vec .dot { transform-box: fill-box; transform-origin: center; opacity: .8; }
.vec .reach { fill: var(--accent-soft); stroke: var(--accent); stroke-dasharray: 4 4; }
.vec .nn { stroke: var(--accent); stroke-width: 1.4; }
.vec .star { fill: #ffd166; stroke: var(--ink); stroke-width: 1; }
.vec .meter { fill: var(--accent); }
/* chain */
.chain .link { stroke: var(--accent); stroke-width: 3; }
.chain .on.blk { animation: pop .35s both; transform-box: fill-box; transform-origin: center; }
/* devices */
.devices .pingring { fill: none; stroke: var(--accent); stroke-width: 2; animation: ping 1.6s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }
/* bitmap */
.bitmap .cell { fill: var(--line); }
.bitmap .cell.a { fill: var(--accent); }
.bitmap .cell.b { fill: #a77cf3; }
.bitmap .cell.c { fill: #34b27b; }
.bitmap .on .cell.a, .bitmap .on .cell.b, .bitmap .on .cell.c { animation: pop .3s both; transform-box: fill-box; transform-origin: center; }
.bitmap .track { fill: var(--line-strong); }
.bitmap .played { fill: #f08a3c; }
.bitmap .mark90 { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 3; }
/* exam */
.exam .bar { fill: color-mix(in srgb, var(--ink) 8%, var(--tile)); }
.exam .tab.cur rect { fill: var(--accent); stroke: var(--accent); }
.exam .tab.cur text { fill: var(--accent-ink); }
.exam .wave { fill: var(--line-strong); }
.exam .wave.buf { fill: color-mix(in srgb, var(--accent) 40%, var(--line-strong)); }
.exam .wave.play { fill: var(--accent); }
.exam .playhead { stroke: #e8590c; stroke-width: 2.5; }
.exam .on .playhead { animation: blink 1s infinite; }
.exam .strike text { text-decoration: line-through; }
/* ladder */
.ladder .ladder { fill: none; stroke: var(--accent); stroke-width: 2.6; }
.ladder .guide { stroke: #f08a3c; stroke-dasharray: 4 4; stroke-width: 1.5; }
@media (prefers-reduced-motion: reduce) { .lit, .scene *, .thumb * { animation: none !important; } .chart .series { stroke-dashoffset: 0; } * { transition: none !important; } }

/* ---------- Home: hero ---------- */
.home .topbar { position: fixed; left: 0; right: 0; z-index: 30; background: transparent; border-bottom: 0; backdrop-filter: none; }
.home .topbar .brand, .home .topbar .topnav a { color: #fff; }
/* Over the hero, the links sit in a navy pill; once the hero has folded away they're plain again. */
.home .topnav { background: rgba(14, 22, 96, .88); border: 1px solid rgba(255, 255, 255, .2); border-radius: 8px; padding: 3px; transition: background .25s, border-color .25s; }
.home .topnav a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.folded .home .topnav { background: transparent; border-color: transparent; }
.folded .home .topnav a:hover { background: var(--accent-soft); color: var(--ink); }
.home .topbar .theme-btn { background: rgba(14, 24, 110, .35); border-color: rgba(255, 255, 255, .3); color: #fff; }
.hero { position: relative; min-height: max(640px, 100svh); display: grid; place-items: center; overflow: hidden; background: #2c45dc; color: #fff; isolation: isolate; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; z-index: -1; }
/* The scene fades into the page below (smooth, so it follows the light/dark theme). */
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22%; z-index: -1; background: linear-gradient(to bottom, transparent, var(--bg) 92%); pointer-events: none; }
.hero-inner { width: min(780px, calc(100% - 32px)); text-align: center; padding: 76px 0 96px; }
.hero-kicker { display: inline-block; font: 600 14px var(--pixel); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: rgba(14, 22, 96, .88); border: 1px solid rgba(255, 255, 255, .2); border-radius: 4px; padding: 6px 12px; }
.wordmark { font: 700 clamp(2.6rem, 6.4vw, 5.4rem)/.98 var(--display); letter-spacing: -.045em; margin: 12px 0 14px; text-shadow: 0 3px 0 rgba(17, 28, 120, .35); }
.hero-lead { display: inline-block; font: 500 clamp(.9rem, 1.5vw, 1rem)/1.6 var(--mono); color: #fff; max-width: 38em; margin: 0 auto 22px; padding: 12px 18px; background: rgba(14, 22, 96, .88); border: 1px solid rgba(255, 255, 255, .2); border-radius: 4px; }
.hero-badge { display: none; }
.cvterm { text-align: left; background: rgba(14, 22, 96, .9); border: 1px solid rgba(255, 255, 255, .22); border-radius: 4px; box-shadow: 0 0 0 4px rgba(14, 22, 96, .25), 0 24px 60px -20px rgba(8, 12, 60, .7); font: 13.5px/1.55 var(--mono); color: #e8ebff; }
.cv-tabs { display: flex; align-items: stretch; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.cv-tabs button { font: 600 13px var(--mono); color: #b8c2f2; background: none; border: 0; padding: 10px 14px; cursor: pointer; }
.cv-tabs button[aria-selected="true"] { color: #0e1660; background: #eef2ff; }
.cv-tour { margin-left: auto; align-self: center; padding: 0 14px; color: #8ff0e1; text-decoration: none; font-weight: 600; }
.cv-tour:hover { text-decoration: underline; }
.cv-panel { padding: 14px 16px 16px; }
.js .cv-panel:not(.active) { display: none; }
.cv-cmd { color: #fff; margin-bottom: 8px; }
.c-dollar { color: #8ff0e1; margin-right: 6px; }
.cv-out { display: grid; gap: 4px; }
.cv-out li { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; }
.cv-out .c-yr { color: #9aa6e0; }
.cv-out .c-role b { color: #fff; font-weight: 600; }
.cv-out .c-role.wide { grid-column: 2 / -1; }
.cv-out .c-stat { color: #ffd166; text-align: right; white-space: nowrap; }
.cv-out a { color: #8ff0e1; }
.cvterm .copy { font: 600 11px var(--mono); color: #0e1660; background: #8ff0e1; border: 0; border-radius: 3px; padding: 1px 7px; margin-left: 6px; cursor: pointer; }
.typed .cv-out li { animation: typein .35s steps(12) both; animation-delay: calc(var(--i, 0) * 70ms); }
.cv-tabs button { display: inline-flex; align-items: center; gap: 7px; }
.cv-tabs .m { font: 600 10px var(--mono); padding: 2px 5px; border-radius: 3px; letter-spacing: .04em; }
.cv-tabs .m-get { background: rgba(143, 240, 225, .18); color: #8ff0e1; }
.cv-tabs .m-post { background: rgba(255, 209, 102, .18); color: #ffd166; }
.cv-tabs button[aria-selected="true"] .m-get { background: #0e7f75; color: #fff; }
.cv-tabs button[aria-selected="true"] .m-post { background: #b7791f; color: #fff; }
.cv-status { color: #9aa6e0; margin-bottom: 8px; }
.cv-status .ok { color: #7ee2a8; font-weight: 600; }
.c-dim { color: #8d97cc; }
.cv-out.json { gap: 1px; }
.cv-out.json li { display: block; white-space: pre-wrap; padding-left: 2ch; text-indent: -2ch; }
.j-key { color: #c3b1ff; }
.j-str { color: #ffd98a; }
.j-num { color: #8ff0e1; }
.cv-out.json a { text-decoration: none; }
.cv-out.json a:hover .j-str { text-decoration: underline; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { font: 500 12.5px var(--mono); color: #e8ebff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; padding: 5px 11px; cursor: pointer; }
.chip:hover { border-color: #8ff0e1; }
.chip[aria-pressed="true"] { background: #eef2ff; color: #0e1660; border-color: #eef2ff; }
.ask-out { min-height: 4.8em; color: #fff; font: 14px/1.6 var(--mono); }
.ask-out.streaming::after { content: "▍"; color: #8ff0e1; animation: blink 1s steps(2) infinite; }
.qa { display: grid; gap: 4px 0; }
.qa dt { color: #ffd98a; margin-top: 6px; }
.qa dd { margin: 0; color: #e8ebff; }
.js .qa, html:not(.js) .ask-live, html:not(.js) .cv-copy { display: none; }
.cv-copy { position: absolute; right: 10px; bottom: 10px; }
/* Where the hero is too tall to fold (it scrolls away instead), the top bar shows the name only once the hero is gone. */
.home .topbar .brand span { transition: opacity .25s; }
.js:not(.fold):not(.folded) .home .topbar .brand span { opacity: 0; }
.cvterm { position: relative; }
@keyframes typein { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.scene-switch { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 2px; padding: 3px; background: rgba(14, 22, 96, .85); border: 1px solid rgba(255, 255, 255, .2); border-radius: 6px; }
.scene-switch button { white-space: nowrap; font: 600 13px var(--pixel); color: #c9d2fb; background: none; border: 0; border-radius: 4px; padding: 6px 10px; cursor: pointer; }
.scene-switch button[aria-pressed="true"] { background: #eef2ff; color: #0e1660; }
.scroll-cue { position: absolute; left: 50%; bottom: 18px; translate: -50% 0; color: var(--ink); rotate: 90deg; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateX(6px); } }

/* The fold (script only): the hero stays fixed and shrinks into the name badge in the top bar while the page scrolls in
   underneath. The top bar's background sits below the hero and its links above it, so the badge is never covered. */
.fold .home .hero { position: fixed; inset: 0; min-height: 0; height: 100svh; z-index: 20; }
.fold .home .hero-spacer { height: calc(80svh + 40px); } /* the fold ends as the tour reaches the top bar */
.fold .home .topbar .brand { visibility: hidden; }
.fold .home .hero-badge { display: flex; position: absolute; left: 20px; top: 0; height: var(--top); opacity: var(--fold, 0); }
.fold .home .hero-badge span { color: #fff; }
.fold .home .hero-inner, .fold .home .scene-switch, .fold .home .scroll-cue { opacity: calc(1 - var(--fold, 0) * 2.2); }
.fold.folding .home .hero-inner, .fold.folding .home .scene-switch { pointer-events: none; }
.home::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: var(--top); z-index: 10; background: color-mix(in srgb, var(--bg) 90%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); opacity: 0; transition: opacity .25s; }
.folded .home::before { opacity: 1; }
.folded .home .topbar .topnav a, .folded .home .topbar .brand { color: var(--ink); }
.folded .home .topbar .theme-btn { background: var(--paper); border-color: var(--line-strong); color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .typed .cv-out li, .scroll-cue { animation: none; } }

/* ---------- Home: sections ---------- */
.section { padding-top: 72px; padding-bottom: 8px; }
.section-head { max-width: 720px; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); margin: 8px 0 10px; }
.section-head p:not(.kicker) { color: var(--muted); font-size: 1.05rem; }
.products { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.products a { font: 600 12px var(--mono); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-strong); text-decoration: none; color: var(--ink); background: var(--paper); }
.products a:hover { border-color: var(--accent); color: var(--accent); }
.tour-chapter { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; padding: 28px 0; border-top: 1px solid var(--line); }
.tour-head { position: sticky; top: calc(var(--top) + 16px); align-self: start; display: grid; gap: 6px; }
.tour-head h3 { font-size: 1.4rem; }
.tour-head .muted { font-size: 14px; }
.tour-body { display: grid; gap: 16px; min-width: 0; }
.work-diagram { margin: 0; }
.work-diagram img { display: block; width: 100%; height: auto; border-radius: 16px; }
/* The diagram follows the theme: the light copy by default, the dark one when the page is dark (OS setting or toggle). */
.work-diagram .wd-dark { display: none; }
:root[data-theme="dark"] .work-diagram .wd-light { display: none; }
:root[data-theme="dark"] .work-diagram .wd-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .work-diagram .wd-light { display: none; }
  :root:not([data-theme="light"]) .work-diagram .wd-dark { display: block; }
}
.lesson-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.lesson-card { display: grid; grid-template-rows: auto 1fr; height: 100%; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--paper); color: var(--ink); text-decoration: none; transition: transform .2s, border-color .2s, box-shadow .2s; }
.lesson-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.thumb { display: block; aspect-ratio: 16 / 10; padding: 8px; border-bottom: 1px solid var(--line); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 20px 20px; }
.thumb svg { height: 100%; }
.thumb .lit, .thumb * { animation: none !important; }
.thumb .packets { display: none; }
.lc-meta { display: grid; gap: 4px; padding: 12px 14px 14px; align-content: start; }
.lc-meta strong { font: 700 1.05rem var(--display); }
.lc-lede { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
/* More projects: each card leads with its own looping mini scene. */
.more { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.more-card { display: grid; grid-template-rows: auto 1fr; height: 100%; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--paper); color: var(--ink); text-decoration: none; transition: transform .2s, border-color .2s, box-shadow .2s; }
.more-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.mini-wrap { display: block; padding: 10px 10px 4px; border-bottom: 1px solid var(--line); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 20px 20px; }
.mini-wrap svg { display: block; width: 100%; height: auto; }
.more-meta { display: grid; gap: 4px; padding: 12px 14px 14px; align-content: start; }
.more-meta strong { font: 700 1.05rem var(--display); }
.more-text { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.mini .slot { transition: fill .3s; }
.mini .taken { fill: color-mix(in srgb, var(--muted) 22%, var(--tile)); }
.mini .book rect { animation: book 3.2s infinite; }
.mini .book .tick { fill: none; stroke: var(--accent-ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; animation: tick 3.2s infinite; }
@keyframes book { 0%, 35% { fill: var(--tile); stroke: var(--line-strong); } 45%, 100% { fill: var(--accent); stroke: var(--accent); } }
@keyframes tick { 0%, 45% { stroke-dashoffset: 20; } 60%, 100% { stroke-dashoffset: 0; } }
.mini .rx { animation: rx 3.2s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes rx { 0%, 60% { opacity: .35; } 75%, 100% { opacity: 1; } }
.mini .scanbg { fill: #1d2433; stroke: none; }
.mini .organ { fill: #4b5568; }
.mini .organ2 { fill: #5d687d; }
.mini .stone { fill: #e9edf5; }
.mini .bbox rect { fill: none; stroke: #ffd166; stroke-width: 2; }
.mini .bbox text { fill: #ffd166; font-weight: 700; }
.mini .bbox { transform-box: fill-box; animation: seek 4s infinite; }
@keyframes seek { 0% { transform: translate(-58px, 18px) scale(2.2); } 30% { transform: translate(-20px, -14px) scale(1.6); } 55%, 100% { transform: none; } }
.mini .bbox text { animation: label 4s infinite; }
@keyframes label { 0%, 55% { opacity: 0; } 65%, 100% { opacity: 1; } }
.mini .track { fill: none; stroke: var(--line); stroke-width: 6; }
.mini .ring { fill: none; stroke: var(--accent); stroke-width: 6; transform: rotate(-90deg); transform-origin: 46px 62px; animation: ring 6s linear infinite; }
@keyframes ring { to { stroke-dashoffset: 0; } }
.mini .ans { fill: var(--tile); stroke: var(--line-strong); animation: ans 6s infinite; }
@keyframes ans { 0% { fill: var(--tile); } 8%, 100% { fill: var(--accent); stroke: var(--accent); } }
.mini .band { opacity: 0; animation: band 6s infinite; }
@keyframes band { 0%, 62% { opacity: 0; } 70%, 100% { opacity: 1; } }
.mini .tl { animation: typein-loop 4.8s steps(16) infinite; }
@keyframes typein-loop { 0% { clip-path: inset(0 100% 0 0); } 18%, 100% { clip-path: inset(0 0 0 0); } }

/* Volunteering: a pixel meetup room with clickable objects, and the card for the one picked. */
.room { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.room-stage { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #2c45dc; }
.room-art { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; image-rendering: pixelated; }
.spot { position: absolute; padding: 0; background: transparent; border: 2px dashed transparent; border-radius: 8px; cursor: pointer; transition: border-color .2s, background .2s; }
.spot:hover, .spot:focus-visible { border-color: rgba(255, 255, 255, .75); background: rgba(255, 255, 255, .06); outline: none; }
.spot[aria-pressed="true"] { border: 2px solid #ffd166; background: rgba(255, 209, 102, .08); }
.spot-dot { position: absolute; top: 4px; left: 4px; width: 12px; height: 12px; border-radius: 50%; background: #ffd166; box-shadow: 0 0 0 3px rgba(255, 209, 102, .35); animation: spotpulse 1.6s infinite; }
.spot[aria-pressed="true"] .spot-dot { animation: none; }
@keyframes spotpulse { 50% { box-shadow: 0 0 0 8px rgba(255, 209, 102, 0); } }
html:not(.js) .spot { display: none; }
.room-info { display: grid; gap: 12px; }
.spot-card { border: 1px solid var(--line); border-radius: 16px; background: var(--paper); padding: 18px 20px; display: grid; gap: 8px; }
.spot-card h3 { font-size: 1.2rem; }
.spot-card p:not(.kicker) { color: var(--muted); }
.spot-card .kicker { color: var(--accent); }
.spot-card a { font: 600 13.5px var(--mono); }
.room-ready .spot-card:not(.active) { display: none; }
.room-ready .spot-card.active { animation: cardin .35s ease both; }
@keyframes cardin { from { opacity: 0; transform: translateY(6px); } }
.room-links { font: 600 13px var(--mono); color: var(--muted); }
@media (max-width: 980px) { .room { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .spot-dot, .room-ready .spot-card.active { animation: none; } }

/* Milestones: a line that draws itself, with dots that pop in order. */
.milestones { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; padding-top: 36px; }
.milestones::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 2px; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform 1.2s ease; }
.milestones.in::before, html:not(.js) .milestones::before { transform: scaleX(1); }
.milestones li { position: relative; display: grid; gap: 6px; align-content: start; opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s; transition-delay: calc(var(--i) * .18s + .2s); }
.milestones.in li, html:not(.js) .milestones li { opacity: 1; transform: none; }
.milestones .dot { position: absolute; top: -34px; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 3px solid var(--accent); }
.milestones .when { font: 600 12px var(--mono); color: var(--accent); letter-spacing: .04em; }
.milestones h3 { font-size: 1rem; line-height: 1.3; }
.milestones h3 a { color: var(--ink); }
.milestones p { font-size: 13.5px; color: var(--muted); line-height: 1.45; }

/* Closing band: the Dhaka pixel scene again, as a bookend to the hero. */
.closing { position: relative; margin-top: 88px; min-height: 340px; display: grid; align-items: center; overflow: hidden; isolation: isolate; background: #2c45dc; color: #fff; }
.closing-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; image-rendering: pixelated; z-index: -1; }
.closing::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 30%; z-index: -1; background: linear-gradient(to top, transparent, var(--bg)); }
.closing-inner { padding-top: 64px; padding-bottom: 64px; }
.closing-card { max-width: 560px; padding: 28px; border-radius: 6px; background: rgba(14, 22, 96, .88); border: 1px solid rgba(255, 255, 255, .2); box-shadow: 0 0 0 4px rgba(14, 22, 96, .25), 0 24px 60px -20px rgba(8, 12, 60, .7); }
.closing h2 { font: 700 clamp(1.8rem, 4vw, 2.8rem)/1.1 var(--display); letter-spacing: -.03em; text-shadow: 0 2px 0 rgba(17, 28, 120, .35); }
.closing p { margin-top: 8px; color: #eef2ff; }
.btn.ghost-light { background: rgba(14, 22, 96, .55); color: #fff; border-color: rgba(255, 255, 255, .35); }
.home .footer { margin-top: 0; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
@media (max-width: 980px) {
  .milestones { grid-template-columns: minmax(0, 1fr); padding: 0 0 0 30px; gap: 22px; }
  .milestones::before { left: 6px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; transform-origin: top; transform: scaleY(0); }
  .milestones.in::before, html:not(.js) .milestones::before { transform: scaleY(1); }
  .milestones .dot { top: 2px; left: -30px; }
}
@media (prefers-reduced-motion: reduce) { .mini *, .milestones::before, .milestones li { animation: none !important; transition: none !important; } .milestones li { opacity: 1; transform: none; } .milestones::before { transform: none; } }

.chapter-t { display: flex; align-items: center; gap: 10px; font: 700 .98rem var(--display); margin-bottom: 8px; }
.chapter-t .num { font: 600 11px var(--mono); color: var(--muted); border: 1px solid var(--line-strong); border-radius: 6px; padding: 1px 5px; }
.chapter ol { display: grid; gap: 2px; }
.chapter li a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 14px; text-decoration: none; color: var(--ink); }
.chapter li a:hover { background: var(--accent-soft); }
.chapter li a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.footer { max-width: 1180px; margin: 72px auto 0; padding: 24px 20px 40px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 14px; }
.lesson-page .footer { max-width: none; margin-top: 0; }

/* ---------- Lesson ---------- */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
.course { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow: auto; padding: 20px 14px; border-right: 1px solid var(--line); display: grid; gap: 18px; align-content: start; }
.course-h { font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.lesson { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; padding: 18px; align-items: start; }
.stage { border: 1px solid var(--line); border-radius: 18px; background: var(--paper); padding: 18px; display: grid; gap: 14px; min-width: 0; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; font: 12px var(--mono); color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.stage-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: end; }
.stage-head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 6px 0 6px; }
.lede { color: var(--muted); max-width: 44em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font: 600 12px var(--mono); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg); }
.chips li:first-child { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.metrics div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--bg); transition: border-color .3s, background .3s; }
.metrics dt { font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.metrics dd { margin: 2px 0 0; font: 700 1rem var(--display); }
.metrics .pending { display: none; color: var(--muted); }
.js .metrics div:not(.on) .val { display: none; }
.js .metrics div:not(.on) .pending { display: inline; }
.metrics div.on { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.lesson .scene { border: 1px solid var(--line); padding: 6px; }
.timeline { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.timeline li { flex: 1 0 auto; }
.timeline a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 10px; text-decoration: none; color: var(--muted); font: 600 11px var(--mono); }
.timeline .n { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--paper); font-size: 12px; color: var(--ink); }
.timeline a:hover { background: var(--accent-soft); }
.timeline a.done .n { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.timeline a.active { color: var(--ink); }
.timeline a.active .n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.panel { position: sticky; top: calc(var(--top) + 18px); display: grid; gap: 12px; }
.panel-card { border: 1px solid var(--line); border-radius: 16px; background: var(--paper); padding: 16px; }
.progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-bottom: 14px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .35s; }
.steps { display: grid; gap: 18px; }
.js .steps li:not(.active) { display: none; }
.step-meta { display: flex; justify-content: space-between; align-items: center; font: 600 12px var(--mono); color: var(--muted); }
.tag { font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.steps h2 { font-size: 1.3rem; margin: 8px 0 8px; }
.steps p:not(.step-meta) { color: var(--muted); }
.controls { display: flex; gap: 8px; margin-top: 18px; }
.controls .primary { flex: 1; justify-content: center; }
html:not(.js) .controls, html:not(.js) .hint, html:not(.js) .progress { display: none; }
@media (hover: none) { .hint { display: none; } }
.hint { margin-top: 10px; font: 12px var(--mono); color: var(--muted); }
.h-sm { font-size: .95rem; margin-bottom: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font: 12px var(--mono); padding: 3px 9px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); }
/* Shorter laptop screens (e.g. 1366×768): a tighter hero, so it still fits on one screen and keeps the fold. */
@media (min-width: 641px) and (max-height: 860px) {
  .hero-inner { padding: 64px 0 52px; }
  .wordmark { font-size: clamp(2.4rem, 5vw, 4.4rem); margin: 10px 0 12px; }
  .hero-lead { margin-bottom: 16px; padding: 10px 16px; }
  .cv-panel { padding: 10px 14px 12px; }
  .cv-out.json { line-height: 1.42; }
}
/* Lesson contact card, in the hero's navy. */
.panel-card.hire { background: #0e1660; border-color: #0e1660; color: #fff; }
.hire-kicker { font: 600 12px var(--mono); letter-spacing: .04em; color: #8ff0e1; }
.hire h2 { font-size: 1.25rem; margin: 6px 0 2px; }
.btn.small.ghost-light { background: transparent; }
/* Page changes cross-fade where the browser supports it. */
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }
.ext { margin-top: 12px; font: 600 13px var(--mono); }
.ext a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
.pager a { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; line-height: 1.3; }
.pager a:hover { background: var(--accent-soft); }
.pager .next { text-align: right; grid-column: 2; }
.hire .cta { margin-top: 12px; }

.notfound main { padding: 120px 20px; text-align: center; display: grid; gap: 16px; justify-items: center; }

/* ---------- Click feedback: small, quick, everywhere (and off with reduced motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, .cv-tabs button, .scene-switch button, .timeline a, .theme-btn, .topnav a, .spot, .lesson-card, .more-card, .chapter li a, .pager a {
    transition: transform .15s ease, background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
  }
  .btn:active, .chip:active, .cv-tabs button:active, .scene-switch button:active, .theme-btn:active, .topnav a:active, .pager a:active { transform: scale(.96); }
  .timeline a:active .n { transform: scale(.88); }
  .timeline .n { transition: transform .15s ease, background-color .25s ease, color .25s ease; }
  .lesson-card:active, .more-card:active { transform: translateY(-1px) scale(.99); }
  .spot:active { transform: scale(.98); }
  .js .cv-panel.active { animation: panelin .28s ease both; }
  .js .steps li.active { animation: panelin .32s ease both; }
  .metrics div.on { animation: metricin .4s ease both; }
  .theme-btn svg { transition: transform .45s ease; }
  .theme-btn:active svg { transform: rotate(180deg); }
}
@keyframes panelin { from { opacity: 0; transform: translateY(6px); } }
@keyframes metricin { from { transform: scale(.97); } }

/* ---------- Responsive ---------- */
/* Tall screens show only the Dhaka scene (see hero.js), so there is nothing to switch. */
@media (max-aspect-ratio: 4/5) { .scene-switch { display: none; } }
.tag.edge { background: rgba(232, 89, 12, .12); color: #c2410c; }
@media (max-width: 1180px) {
  .lesson { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .panel-card:first-child { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .course { display: none; }
  .tour-chapter { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .tour-head { position: static; }
}
@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lesson { padding: 10px; }
  .stage { padding: 12px; }
  .timeline .t { display: none; }
  /* Phones: no fold (hero.js), the hero scrolls away like any section, so the whole JSON response shows. */
  .hero { min-height: 100svh; }
  .hero-inner { padding: 76px 0 72px; }
  .hero-kicker { font-size: 12px; padding: 5px 10px; }
  .wordmark { font-size: clamp(2rem, 10.2vw, 2.6rem); margin: 10px 0 12px; }
  .hero-lead { font-size: 12.5px; line-height: 1.55; padding: 9px 12px; margin-bottom: 14px; }
  .cvterm { font-size: 12px; line-height: 1.5; }
  .cv-tabs button { flex: 1; justify-content: center; gap: 5px; padding: 9px 6px; font-size: 12px; }
  .cv-tabs .m { font-size: 9px; padding: 2px 4px; }
  .cv-panel { padding: 10px 12px 34px; }
  .ask-out { min-height: 3.2em; font-size: 12.5px; }
  .chip { font-size: 11.5px; padding: 4px 9px; }
  .cv-out li { grid-template-columns: 58px minmax(0, 1fr); gap: 2px 10px; font-size: 12.5px; }
  .cv-out .c-stat { grid-column: 2; text-align: left; white-space: normal; }
  .cv-tour { display: none; }
  .scroll-cue { display: none; }
  /* Lesson on phones: scene, then the current step, then the rest. */
  .lesson { display: flex; flex-direction: column; gap: 12px; }
  .lesson .stage, .lesson .panel { display: contents; }
  .crumbs { order: 1; } .stage-head { order: 2; } .lesson .scene { order: 3; } .timeline { order: 4; }
  .panel-card { order: 7; } .panel-card:first-child { order: 5; } .metrics { order: 6; }
  .lesson .scene { overflow-x: auto; max-width: 100%; }
  .lesson .scene svg { min-width: 600px; }
}
