/* EDU-ALGO · Algorithms Playground — a distinct member of the EDU-* collection.
   Same 1970s dark-steel console as the sibling labs: engraved labels, amber
   keycaps, deep phosphor-green screens for everything the machine "shows" —
   here the tree/heap/hash view and the graph diagram. */

:root {
  --chassis: #1c2128;
  --chassis-deep: #14181d;
  --panel: #222831;
  --panel-2: #2a313b;
  --panel-edge: #3a434e;
  --ink: #cdd9e5;
  --ink-soft: #8b98a5;
  --amber: #e3b341;
  --amber-dark: #b8862a;
  --screen: #07130c;
  --screen-2: #0a1a10;
  --screen-edge: #030805;
  --screen-grid: rgb(87 227 137 / 0.12);
  --phosphor: #57e389;
  --phosphor-dim: #3a9c63;
  --phosphor-soft: #9ff5c0;
  --pass: #57e389;
  --fail: #f0663f;
  --unknown: #c9a0dc;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% -10%, #262d36 0%, var(--chassis) 55%, var(--chassis-deep) 100%);
  display: flex;
  flex-direction: column;
}

button { font: inherit; cursor: pointer; }
a { color: var(--phosphor); }

/* ---------- header ---------- */

.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.7rem 1.2rem;
  border-bottom: 2px solid var(--panel-edge); flex-wrap: wrap;
  background: linear-gradient(#20262e, #1a1f26);
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-mark {
  font-family: var(--mono); font-weight: 700; font-size: 0.85rem;
  color: var(--screen); background: var(--phosphor); border-radius: 6px;
  padding: 0.45rem 0.5rem; letter-spacing: 0.02em;
  box-shadow: 0 0 10px rgb(87 227 137 / 0.4), inset 0 -2px 0 rgb(0 0 0 / 0.25);
}
.brand-text h1 { font-family: var(--mono); font-size: 1.15rem; letter-spacing: 0.06em; line-height: 1.1; color: var(--ink); }
.brand-sub { font-size: 0.62rem; letter-spacing: 0.3em; color: var(--ink-soft); font-weight: 600; vertical-align: 0.15em; }
.brand-tag { font-size: 0.72rem; color: var(--ink-soft); font-style: italic; }
.top-nav { display: flex; align-items: center; gap: 0.5rem; }
.lang-switch { display: flex; border: 1px solid var(--panel-edge); border-radius: 6px; overflow: hidden; margin-left: 0.4rem; }
.lang-switch button { border: 0; background: var(--panel); color: var(--ink-soft); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; padding: 0.35rem 0.55rem; }
.lang-switch button.active { background: var(--phosphor); color: var(--screen); }

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

.btn {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; color: var(--ink);
  background: linear-gradient(#2f3742, #262d36); border: 1px solid var(--panel-edge);
  border-radius: 7px; padding: 0.42rem 0.85rem;
  box-shadow: 0 2px 0 #12161b, 0 3px 4px rgb(0 0 0 / 0.25);
  transition: transform 60ms, box-shadow 60ms; display: inline-block;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 #12161b; }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn-primary { color: var(--screen); background: linear-gradient(#f0c65a, var(--amber)); border-color: var(--amber-dark); box-shadow: 0 2px 0 var(--amber-dark), 0 3px 6px rgb(227 179 65 / 0.25); }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:active { transform: none; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- cards & engraved labels ---------- */

.card {
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.03) inset, 0 6px 14px rgb(0 0 0 / 0.25);
  padding: 0.7rem 0.8rem 0.8rem;
}
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.55rem; }
.card-title, .lesson-eyebrow {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--ink-soft);
}
.chip { border-radius: 4px; padding: 0.08rem 0.45rem; white-space: nowrap; }
.chip-rule { font-family: var(--mono); font-size: 0.68rem; background: var(--panel-2); border: 1px solid var(--panel-edge); color: var(--ink); }
.sync-badge { font-family: var(--mono); font-size: 0.64rem; color: var(--fail); border: 1px dashed var(--fail); border-radius: 4px; padding: 0.05rem 0.4rem; }

/* ---------- lesson panel ---------- */

.lesson { display: flex; flex-direction: column; gap: 0.7rem; }
.lesson-eyebrow { display: flex; align-items: center; gap: 0.5rem; }
.lesson-title { font-size: 1.25rem; line-height: 1.2; color: var(--ink); }
.lesson-text { font-size: 0.86rem; line-height: 1.55; color: var(--ink); }
.lesson-text p + p { margin-top: 0.5rem; }
.lesson-text code, .goal code, .hint code, .help-body code {
  font-family: var(--mono); font-size: 0.85em; background: rgb(87 227 137 / 0.12);
  color: var(--phosphor-soft); border-radius: 4px; padding: 0.05em 0.3em;
}
.lesson-text pre, .help-body pre {
  font-family: var(--mono); font-size: 0.78rem; line-height: 1.5;
  background: var(--screen); color: var(--phosphor); border-radius: 7px;
  padding: 0.6rem 0.8rem; overflow-x: auto; margin: 0.4rem 0;
}
.goal { font-size: 0.86rem; line-height: 1.5; background: rgb(227 179 65 / 0.08); border-left: 3px solid var(--amber); border-radius: 0 7px 7px 0; padding: 0.5rem 0.7rem; }
.goal-label { display: block; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.26em; text-transform: uppercase; color: var(--amber); margin-bottom: 0.15rem; }
.rule-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.hints { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-start; }
.hint { font-size: 0.82rem; line-height: 1.5; background: rgb(201 160 220 / 0.1); border-left: 3px solid var(--unknown); border-radius: 0 7px 7px 0; padding: 0.45rem 0.65rem; }
.banner { border-radius: 8px; padding: 0.7rem 0.8rem; font-size: 0.86rem; font-weight: 600; display: flex; flex-direction: column; gap: 0.55rem; }
.banner-pass { background: rgb(87 227 137 / 0.12); border: 1px solid var(--pass); color: var(--phosphor-soft); }
.banner-fail { background: rgb(240 102 63 / 0.12); border: 1px solid var(--fail); color: #f6a48a; }
.done-mark { color: var(--pass); font-weight: 700; }
.btn-hint { font-size: 0.72rem; border: 1px dashed var(--panel-edge); }

/* ---------- modals ---------- */

.overlay { position: fixed; inset: 0; background: rgb(5 8 5 / 0.65); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 10; }
.modal { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px; box-shadow: 0 20px 60px rgb(0 0 0 / 0.5); max-width: 900px; width: 100%; max-height: 88vh; overflow-y: auto; padding: 1rem 1.2rem 1.2rem; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.8rem; }
.modal-head h2 { font-size: 1.1rem; letter-spacing: 0.02em; }
.level-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.6rem; }
.level-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; text-align: left; background: linear-gradient(#2b323c, #242a32); border: 1px solid var(--panel-edge); border-radius: 9px; padding: 0.7rem 0.8rem; box-shadow: 0 2px 0 #12161b; transition: transform 80ms; color: var(--ink); }
.level-card:hover { transform: translateY(-2px); }
.level-card.current { border-color: var(--amber); box-shadow: 0 2px 0 var(--amber-dark); }
.level-card .level-num { font-family: var(--mono); font-size: 0.7rem; font-weight: 700; color: var(--amber); letter-spacing: 0.1em; }
.level-card .level-name { font-weight: 600; font-size: 0.85rem; }
.level-card .level-desc { font-size: 0.72rem; color: var(--ink-soft); }
.level-card .done-mark { position: absolute; top: 0.55rem; right: 0.7rem; }
.level-card.done { border-color: var(--phosphor-dim); }
.sandbox-card { border-style: dashed; }
.help-body { font-size: 0.86rem; line-height: 1.55; }
.help-body p { margin-bottom: 0.5rem; }
.help-body h3 { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.26em; text-transform: uppercase; color: var(--amber); margin: 1.1rem 0 0.45rem; }
.help-body table { border-collapse: collapse; width: 100%; font-size: 0.8rem; margin: 0.3rem 0 0.6rem; }
.help-body th, .help-body td { text-align: left; padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--panel-edge); vertical-align: top; }
.help-body th { font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-soft); }
.intro-foot { display: flex; justify-content: flex-end; margin-top: 1rem; }

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

.workbench {
  flex: 1; display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(460px, 1fr) minmax(300px, 380px);
  gap: 0.9rem; padding: 0.9rem 1.2rem 1.2rem; align-items: start;
  max-width: 1800px; width: 100%; margin: 0 auto;
}
.col-main, .col-inspect { display: flex; flex-direction: column; gap: 0.9rem; }
.toolbar { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.speed { display: flex; align-items: center; gap: 0.4rem; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); margin-left: 0.3rem; }
.speed input { width: 84px; accent-color: var(--amber); }

/* ---------- screen inset (shared) ---------- */

.netscreen { position: relative; background: var(--screen); border: 2px solid var(--screen-edge); border-radius: 8px; box-shadow: inset 0 2px 14px rgb(0 0 0 / 0.7); overflow: hidden; }
.netscreen::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(rgb(0 0 0 / 0.12) 0 1px, transparent 1px 3px); pointer-events: none; border-radius: 6px; z-index: 5; }

/* ---------- network diagram ---------- */

.network-host { min-height: 300px; }
.net-svg { display: block; width: 100%; height: 300px; }
.net-node { fill: var(--screen-2); stroke: var(--phosphor-dim); stroke-width: 1.5; cursor: pointer; transition: fill 180ms, stroke 180ms; }
.net-node:hover { stroke: var(--phosphor-soft); }
.net-input { stroke: var(--ink-soft); cursor: default; }
.net-edge { stroke: var(--phosphor); stroke-width: 0.6; cursor: pointer; transition: stroke 180ms; }
.net-edge.neg { stroke: var(--amber); }
.net-label { fill: var(--phosphor-dim); font-family: var(--mono); font-size: 10px; }
.net-block { fill: var(--screen-2); stroke: var(--phosphor-dim); stroke-width: 1.5; cursor: pointer; transition: fill 180ms, stroke 180ms; }
.net-block:hover { stroke: var(--phosphor-soft); }
.net-block-label { fill: var(--phosphor); font-size: 12px; font-weight: 700; }
.net-arrow { stroke: var(--phosphor-dim); stroke-width: 1.5; marker-end: none; }
.net-residual { fill: none; stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.6; }

.net-col.pulse-fwd .net-node, .net-col.pulse-fwd .net-block { fill: rgb(87 227 137 / 0.35); stroke: var(--phosphor); }
.net-col.pulse-bwd .net-node, .net-col.pulse-bwd .net-block { fill: rgb(227 179 65 / 0.3); stroke: var(--amber); }
@media (prefers-reduced-motion: reduce) {
  .net-node, .net-block, .net-edge { transition: none; }
}

/* ---------- loss chart ---------- */

.loss-host { min-height: 130px; padding: 0; }
.loss-canvas { display: block; width: 100%; }
.loss-readout { font-family: var(--mono); font-size: 0.68rem; color: var(--phosphor-dim); padding: 0 0.5rem 0.3rem; }

/* ---------- editor ---------- */

.editor-wrap { display: flex; background: var(--screen); border: 2px solid var(--screen-edge); border-radius: 8px; box-shadow: inset 0 2px 14px rgb(0 0 0 / 0.7); overflow: hidden; height: 220px; }
.gutter { width: 2.2rem; overflow: hidden; background: var(--screen-2); border-right: 1px solid rgb(87 227 137 / 0.15); padding: 0.55rem 0; position: relative; flex: none; }
.gutter-inner { font-family: var(--mono); font-size: 0.82rem; line-height: 1.45; color: var(--phosphor-dim); text-align: right; padding-right: 0.4rem; }
.gutter-inner .g-err { color: var(--fail); font-weight: 700; }
.editor-area { position: relative; flex: 1; }
.hl-bar { position: absolute; left: 0; right: 0; pointer-events: none; z-index: 1; }
.hl-error { background: rgb(240 102 63 / 0.18); border-left: 2px solid var(--fail); }
textarea.code {
  position: relative; z-index: 2; width: 100%; height: 100%; resize: none;
  background: transparent; color: var(--phosphor); border: 0; outline: none;
  font-family: var(--mono); font-size: 0.82rem; line-height: 1.45;
  padding: 0.55rem 0.7rem; caret-color: var(--phosphor-soft); white-space: pre;
}
.editor-msg { font-family: var(--mono); font-size: 0.72rem; color: var(--fail); padding: 0.3rem 0.2rem 0; }
.status-line { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-soft); padding-top: 0.4rem; min-height: 1.4em; }
.status-line[data-kind="ok"] { color: var(--pass); }
.status-line[data-kind="err"] { color: var(--fail); }

/* ---------- builder (config panel) ---------- */

.cfg { display: flex; flex-direction: column; gap: 0.4rem; }
.cfg-invalid { opacity: 0.45; pointer-events: none; }
.cfg-field { display: flex; align-items: center; gap: 0.5rem; font-size: 0.76rem; }
.cfg-k { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-soft); width: 5.2rem; flex: none; text-align: right; }
.cfg input[type="number"] { width: 5.5rem; background: var(--screen); color: var(--phosphor); border: 1px solid var(--panel-edge); border-radius: 5px; font-family: var(--mono); font-size: 0.76rem; padding: 0.18rem 0.35rem; }
.cfg select { background: var(--panel-2); color: var(--ink); border: 1px solid var(--panel-edge); border-radius: 5px; font-size: 0.74rem; padding: 0.18rem 0.3rem; }
.cfg input[type="checkbox"] { accent-color: var(--amber); }
.cfg-layers { display: flex; flex-direction: column; gap: 0.25rem; }
.cfg-layer { display: flex; align-items: center; gap: 0.35rem; }
.cfg-layer-n { font-family: var(--mono); font-size: 0.66rem; color: var(--amber); width: 1.6rem; text-align: right; }
.cfg-layer input { width: 4rem; background: var(--screen); color: var(--phosphor); border: 1px solid var(--panel-edge); border-radius: 5px; font-family: var(--mono); font-size: 0.74rem; padding: 0.15rem 0.3rem; }
.cfg-del { padding: 0.05rem 0.3rem; font-size: 0.7rem; }
.cfg-sep { border-top: 1px dashed var(--panel-edge); margin: 0.25rem 0; }

/* ---------- result panel & token strip ---------- */

.stats { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.stat { display: flex; flex-direction: column; background: var(--panel-2); border: 1px solid var(--panel-edge); border-radius: 6px; padding: 0.3rem 0.55rem; }
.stat-k { font-size: 0.58rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.stat-v { font-family: var(--mono); font-size: 0.82rem; color: var(--ink); }
.stat.ok .stat-v { color: var(--pass); }
.stat.bad .stat-v { color: var(--fail); }
.token-strip { display: flex; flex-wrap: wrap; gap: 0.2rem; padding: 0.35rem; background: var(--screen); border-radius: 7px; border: 1px solid var(--screen-edge); margin-top: 0.3rem; }
.tok { font-family: var(--mono); font-size: 0.85rem; border-radius: 4px; padding: 0.12rem 0.32rem; }
.tok-prompt { color: var(--phosphor-dim); background: rgb(87 227 137 / 0.06); }
.tok-gen { color: var(--screen); background: var(--phosphor); font-weight: 700; box-shadow: 0 0 8px rgb(87 227 137 / 0.4); }
.tok-cursor { color: var(--phosphor); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tok-cursor { animation: none; } }

/* ---------- attention heatmap ---------- */

#attnHeatmap { padding: 0.4rem; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; min-height: 90px; }
.attn-tabs { display: flex; gap: 0.25rem; align-self: flex-start; }
.attn-tab { font-family: var(--mono); font-size: 0.66rem; background: var(--screen-2); color: var(--phosphor-dim); border: 1px solid var(--phosphor-dim); border-radius: 4px; padding: 0.1rem 0.4rem; }
.attn-tab.active { background: var(--phosphor); color: var(--screen); }
.attn-canvas { border-radius: 4px; }
.attn-note { font-family: var(--mono); font-size: 0.62rem; color: var(--phosphor-dim); text-align: center; }

/* ---------- inspector ---------- */

.insp { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.78rem; }
.insp-title { font-family: var(--mono); font-size: 0.74rem; font-weight: 700; color: var(--amber); }
.insp-line { font-family: var(--mono); font-size: 0.74rem; color: var(--ink); }
.insp-k { color: var(--ink-soft); display: inline-block; min-width: 3.4rem; }
.mini-matrix { border-collapse: collapse; font-family: var(--mono); font-size: 0.64rem; }
.mini-matrix td { border: 1px solid var(--panel-edge); padding: 0.08rem 0.25rem; color: var(--phosphor-soft); background: var(--screen); }

/* ---------- cases ---------- */

.cases { display: flex; flex-direction: column; gap: 0.3rem; }
.case-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; background: var(--panel-2); border: 1px solid var(--panel-edge); border-radius: 7px; padding: 0.4rem 0.6rem; color: var(--ink); font-size: 0.78rem; text-align: left; }
.case-row.sel { border-color: var(--amber); }
.case-row.ok { border-color: var(--pass); }
.case-row.bad { border-color: var(--fail); }
.case-row .case-mark { font-weight: 700; }
.case-row.ok .case-mark { color: var(--pass); }
.case-row.bad .case-mark { color: var(--fail); }
.cases-note { font-size: 0.7rem; color: var(--ink-soft); margin-top: 0.4rem; line-height: 1.45; }

/* ---------- event log ---------- */

.evt-tape { font-family: var(--mono); font-size: 0.72rem; line-height: 1.5; background: var(--screen); border: 2px solid var(--screen-edge); border-radius: 8px; box-shadow: inset 0 2px 10px rgb(0 0 0 / 0.6); height: 180px; overflow-y: auto; padding: 0.4rem 0.5rem; color: var(--phosphor-dim); }
.evt-row { display: flex; gap: 0.5rem; white-space: nowrap; }
.evt-time { color: rgb(87 227 137 / 0.4); min-width: 3.2em; text-align: right; flex: none; }
.evt-phase { color: var(--phosphor-soft); }
.evt-pass { color: var(--pass); }
.evt-drop { color: var(--fail); }
.evt-result { color: var(--phosphor); }
.tbl-empty { color: var(--ink-soft); font-size: 0.75rem; font-style: italic; padding: 0.4rem; }
.stat.warn .stat-v { color: var(--amber); }

/* ---------- bit grid (the signature view) ---------- */

.bitgrid-host { min-height: 220px; padding: 0.8rem; display: flex; }
.bg { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; align-items: flex-start; justify-content: center; font-family: var(--mono); }
.bg-inputs { display: flex; flex-direction: column; gap: 0.15rem; }
.bg-in-row { font-size: 0.8rem; color: var(--phosphor-dim); }
.bg-in-label { display: inline-block; min-width: 3.2rem; color: var(--ink-soft); }
.bg-in-val { color: var(--phosphor-soft); letter-spacing: 0.05em; }

.bg-strip { display: flex; flex-wrap: wrap; gap: 0.28rem; }
.bg-weights { }
.bg-weight { width: 1.9rem; text-align: center; font-size: 0.56rem; color: var(--ink-soft); }
.bg-carries { display: flex; flex-wrap: wrap; gap: 0.28rem; height: 0.9rem; }
.bg-carry { width: 1.9rem; text-align: center; font-size: 0.7rem; color: transparent; }
.bg-carry.show { color: var(--amber); animation: bg-drop 0.4s ease; }
@keyframes bg-drop { from { transform: translateY(6px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.bg-cell {
  width: 1.9rem; height: 2.1rem; display: inline-flex; align-items: center; justify-content: center;
  background: var(--screen-2); border: 1px solid rgb(87 227 137 / 0.18); border-radius: 5px;
  color: var(--phosphor-dim); font-size: 1rem; font-weight: 600; transition: color 120ms, border-color 120ms, background 120ms;
}
.bg-cell.one { color: var(--screen); background: var(--phosphor); border-color: var(--phosphor); box-shadow: 0 0 8px rgb(87 227 137 / 0.4); }
.bg-cell.cursor { border-color: var(--amber); box-shadow: 0 0 0 2px rgb(227 179 65 / 0.5); }
.bg-cell.pulse { animation: bg-pulse 0.32s ease; }
@keyframes bg-pulse { 0% { transform: translateY(-4px) scale(1.12); } 100% { transform: translateY(0) scale(1); } }
/* IEEE-754 / fixed-point field bands */
.bg-cell.f-sign { border-bottom: 3px solid var(--fail); }
.bg-cell.f-exp { border-bottom: 3px solid var(--amber); }
.bg-cell.f-mant { border-bottom: 3px solid var(--unknown); }
.bg-cell.f-int { border-bottom: 3px solid var(--amber); }
.bg-cell.f-frac { border-bottom: 3px solid var(--unknown); }

.bg-digits { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.bg-digit {
  min-width: 1.9rem; height: 2.1rem; padding: 0 0.4rem; display: inline-flex; align-items: center; justify-content: center;
  background: var(--screen-2); border: 1px solid rgb(87 227 137 / 0.25); border-radius: 5px;
  color: var(--phosphor); font-size: 1.05rem; font-weight: 700; text-transform: uppercase;
}
.bg-digit.pulse { animation: bg-pulse 0.32s ease; }
@media (prefers-reduced-motion: reduce) {
  .bg-cell, .bg-carry.show, .bg-digit.pulse { animation: none; transition: none; }
}

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

@media (max-width: 1100px) {
  .workbench { grid-template-columns: minmax(240px, 300px) 1fr; }
  .col-inspect { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
}
@media (max-width: 760px) {
  .workbench { grid-template-columns: 1fr; }
  .col-inspect { grid-template-columns: 1fr; }
  .net-svg { height: 240px; }
}

/* ---------- hub landing (EDU-ALGO) ---------- */
.hub { flex: 1; max-width: 920px; width: 100%; margin: 0 auto; padding: 1.6rem 1.2rem 2.4rem; }
.hero { text-align: center; margin: 1rem 0 2rem; }
.hero-title { font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1.15; margin-bottom: 0.7rem; color: var(--ink); }
.hero-title em { color: var(--phosphor); font-style: normal; }
.hero-text { max-width: 660px; margin: 0 auto; color: var(--ink-soft); font-size: 0.98rem; line-height: 1.6; }
.floors { display: flex; flex-direction: column; gap: 0.9rem; }
.floor { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 0.9rem 1rem; text-decoration: none; color: var(--ink); background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 1rem 1.2rem; box-shadow: 0 6px 14px rgb(0 0 0 / 0.25); transition: transform 0.12s, border-color 0.12s; }
.floor:hover { transform: translateY(-2px); border-color: var(--phosphor-dim); }
.floor-num { font-family: var(--mono); font-size: 0.8rem; color: var(--amber); font-weight: 700; }
.floor-icon { font-size: 1.5rem; color: var(--phosphor); width: 2rem; text-align: center; }
.floor-body { display: flex; flex-direction: column; gap: 0.2rem; }
.floor-title { font-size: 1.05rem; font-weight: 700; }
.floor-desc { font-size: 0.86rem; color: var(--ink-soft); line-height: 1.45; }
.floor-cta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; }
.floor-progress { font-size: 0.68rem; letter-spacing: 0.06em; color: var(--ink-soft); text-transform: uppercase; }
.floor-progress.complete { color: var(--pass); font-weight: 700; }
.hub-foot { text-align: center; color: var(--ink-soft); font-size: 0.8rem; margin-top: 2rem; font-style: italic; }
a.brand-mark { text-decoration: none; }
.stat.good .stat-v { color: var(--pass); }
@media (max-width: 640px) {
  .floor { grid-template-columns: auto 1fr; }
  .floor-num { display: none; }
  .floor-cta { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}
