/* ============================================================
   The Blockchain Course — light, formal, visualization-first.
   Takshashila house style: Llama maroon #620d3c · Marigold
   #f1a222 on white / pale-yellow surfaces. Lora headings,
   Inter for body & UI, JetBrains Mono for data.
   Fonts load via <link> in index.html (not @import).
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-2: #fffbe2;
  --surface: #ffffff;
  --surface-2: #fffbe2;
  --surface-3: #faf3d3;
  --line: #e6e0d8;
  --line-2: #d3cabb;
  --plum-line: rgba(98,13,60,.14);
  --nav-bg: rgba(255,255,255,.85);

  --plum: #620d3c; --plum-2: #8a2057; --plum-soft: #f6e7ee; --plum-tint: #fbf1f6;
  --gold: #f1a222; --gold-2: #c67c05; --gold-soft: #fdedcf; --gold-tint: #fff4dd;
  /* brand colours as *foreground text* need darker pairs to clear WCAG AA */
  --gold-text: #8a5a00; --plum-text: #620d3c;
  --ink: #2a2a2a; --ink-2: #4d4d4d; --ink-3: #6b6b6b; --ink-4: #9a938a;
  --green: #1e7350; --green-soft: #e2f6ec; --red: #c72842; --red-soft: #fbe6ea; --blue: #2f6df6;

  --disp: "Lora", Georgia, serif;
  --sans: "Inter", "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  --sh-sm: 0 1px 2px rgba(98,13,60,.02), 0 2px 4px rgba(98,13,60,.03), 0 4px 8px rgba(98,13,60,.04);
  --sh: 0 2px 4px rgba(98,13,60,.02), 0 8px 16px rgba(98,13,60,.04), 0 24px 48px rgba(98,13,60,.08);
  --sh-plum: 0 8px 22px rgba(98,13,60,.22);
  --sh-gold: 0 8px 22px rgba(241,162,34,.3);
  /* faint inner top highlight so cards read as lit from above */
  --card-hl: inset 0 1px 0 rgba(255,255,255,.5);
  --aura-gold: rgba(241,162,34,.13); --aura-plum: rgba(98,13,60,.06);
  --r: 16px; --r-lg: 22px; --r-xl: 30px;
  --maxw: 1140px; --readw: 760px;
  --ease: cubic-bezier(.2,.8,.2,1);
  /* semantic z-index scale */
  --z-bg: 0; --z-content: 1; --z-bar: 40; --z-overlay: 45; --z-nav: 50; --z-overlay-ui: 70;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
h1,h2,h3,h4 { margin: 0; line-height: 1.1; letter-spacing: -.02em; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--sans); cursor: pointer; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--disp); }
::selection { background: var(--gold-soft); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: rgba(98,13,60,.18); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(98,13,60,.3); background-clip: content-box; }
:focus-visible { outline: 2px solid var(--plum-2); outline-offset: 2px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none !important; }

/* celebration burst: own layer at full opacity, above everything, inert */
#fxLayer { position: fixed; top: 0; left: 0; z-index: var(--z-overlay-ui); pointer-events: none; }
.bg-aura { position: fixed; inset: 0; z-index: var(--z-bg); pointer-events: none;
  background:
    radial-gradient(1000px 680px at 84% -12%, var(--aura-gold), transparent 60%),
    radial-gradient(820px 760px at -2% 110%, var(--aura-plum), transparent 55%); }
#root { position: relative; z-index: var(--z-content); min-height: 100vh; }
#root.viewin { animation: viewfade .32s var(--ease); }
@keyframes viewfade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ nav ============ */
.nav { position: sticky; top: 0; z-index: var(--z-nav); display: flex; align-items: center; gap: 18px; padding: 0 26px; height: 92px; background: var(--nav-bg); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.nav .brand { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.logo-light { height: 65px; display: block; }
.logo-dark { height: 65px; display: none; }
[data-theme="dark"] .logo-light { display: none !important; }
[data-theme="dark"] .logo-dark { display: block !important; }
.nav .links { display: flex; gap: 4px; margin-left: 14px; }
.nav .links a { padding: 8px 14px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: all .15s; cursor: pointer; }
.nav .links a:hover { color: var(--plum); background: var(--plum-soft); }
.nav .links a.on { color: var(--plum); background: var(--plum-soft); }
.nav .right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

/* Theme Toggle */
.theme-toggle { background: var(--surface-3); border: 1px solid var(--line-2); color: var(--ink-2); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; transition: all .2s var(--ease); flex-shrink: 0; box-shadow: var(--sh-sm); }
.theme-toggle:hover { background: var(--plum); color: #fff; border-color: var(--plum); transform: scale(1.05); }

.progmini { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.progmini .bar { width: 120px; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; border: 1px solid var(--line); }
.progmini .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--plum), var(--gold)); border-radius: 99px; transition: width .6s var(--ease); }
@media (max-width: 560px) { .nav { height: 56px; padding: 0 16px; } .logo-light, .logo-dark { height: 38px; } .progmini span { display: none; } .progmini .bar { width: 74px; } }

/* Mobile Navigation */
/* 44x44 touch target; the 28x18 glyph sits centred inside */
.hamburger { display: none; background: none; border: none; cursor: pointer; width: 44px; height: 44px; padding: 13px 8px; position: relative; z-index: var(--z-overlay-ui); }
.hamburger span { display: block; width: 28px; height: 2px; background-color: var(--ink); position: absolute; left: 8px; transition: all 0.3s ease; border-radius: 2px; }
.hamburger span:nth-child(1) { top: 13px; }
.hamburger span:nth-child(2) { top: 21px; }
.hamburger span:nth-child(3) { top: 29px; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg); top: 21px; }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg); top: 21px; }

.mobile-nav { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background-color: var(--bg); display: flex; flex-direction: column; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; z-index: var(--z-overlay); }
.mobile-nav.active { opacity: 1; pointer-events: auto; }
.mobile-nav a { color: var(--ink); text-decoration: none; font-size: 2rem; font-family: var(--disp); font-weight: 600; margin: 1.5rem 0; opacity: 0; transform: translateY(20px); transition: all 0.4s ease; }
.mobile-nav a.on { color: var(--plum); }
.mobile-nav.active a { opacity: 1; transform: translateY(0); }
.mobile-nav a:nth-child(1) { transition-delay: 0.1s; }
.mobile-nav a:nth-child(2) { transition-delay: 0.15s; }

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .hamburger { display: block; }

}

/* ============ buttons ============ */
.btn { font-size: 14px; font-weight: 600; border-radius: 12px; padding: 12px 20px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; gap: 9px; justify-content: center; transition: transform .08s, background .16s, box-shadow .2s, border-color .16s; }
.btn:hover { background: var(--surface-2); border-color: var(--ink-4); transform: scale(1.02); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--plum); border-color: transparent; color: #fff; box-shadow: var(--sh-plum); }
.btn.primary:hover { background: var(--plum-2); }
.btn.gold { background: var(--gold); border-color: transparent; color: #4a2c00; box-shadow: var(--sh-gold); }
.btn.gold:hover { background: #e29310; color: #3d2400; }
.btn.danger { background: var(--red); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; }
.btn.lg { font-size: 16px; padding: 16px 30px; border-radius: 14px; }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ============ HOME ============ */
.hero { position: relative; min-height: 88vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 56px 24px; overflow: hidden; }
.hero canvas { position: absolute; inset: 0; }
.hero-in { position: relative; z-index: 2; max-width: 880px; }
.hero h1 { font-family: var(--disp); font-weight: 400; font-size: clamp(46px, 8vw, 96px); letter-spacing: -.035em; line-height: .97; color: var(--plum); }
.hero h1 em { font-style: italic; color: var(--gold-text); }
.hero .sub { font-size: clamp(17px, 2vw, 21px); color: var(--ink-2); max-width: 620px; margin: 28px auto 0; line-height: 1.55; font-weight: 450; }
.hero .cta { margin-top: 40px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* home is a single no-scroll landing: hero fills what the nav leaves over */
.home-wrap { display: flex; flex-direction: column; min-height: calc(100vh - 92px); overflow: hidden; }
@media (max-width: 560px) { .home-wrap { min-height: calc(100vh - 56px); } }
.home-hero { flex: 1; min-height: 0; padding: 32px 26px; }

/* one dot per chapter, coloured from the chapter palette */
.journey-rail { margin-top: 52px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; }
.journey-rail .jd { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 4px var(--bg); position: relative; cursor: pointer; transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s var(--ease); text-decoration: none; }
.journey-rail .jd:hover { transform: scale(1.3); box-shadow: 0 0 0 2px var(--bg); z-index: 10; }
.journey-rail .jd-link { width: 26px; height: 2px; background: var(--line); display: block; }
.journey-rail .jd-cap { font-size: 11px; color: var(--ink-4); margin-left: 8px; }

/* Tooltip on hover */
.journey-rail .jd .jd-tt { position: absolute; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%) translateY(10px) scale(0.95); opacity: 0; pointer-events: none; background: color-mix(in oklch, var(--wca) 35%, color-mix(in oklch, var(--bg) 90%, transparent)); backdrop-filter: blur(12px); color: var(--ink); padding: 10px 14px; border-radius: 10px; box-shadow: 0 12px 24px rgba(0,0,0,0.12), 0 0 0 1px color-mix(in oklch, var(--wca) 40%, transparent); transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column; gap: 4px; text-align: center; z-index: 100; width: max-content; }
.journey-rail .jd .jd-tt::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border-width: 6px; border-style: solid; border-color: color-mix(in oklch, var(--wca) 35%, var(--bg)) transparent transparent transparent; }
.journey-rail .jd:hover .jd-tt { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.journey-rail .jd-tt-n { font-size: 11px; font-weight: 500; font-family: var(--mono); letter-spacing: 0.04em; color: color-mix(in oklch, var(--ink) 60%, var(--wca)); }
.journey-rail .jd-tt-t { font-size: 14px; font-weight: 600; font-family: var(--disp); }


/* ============ MAP ============ */
.map-wrap { max-width: 980px; margin: 0 auto; padding: 46px 26px 90px; }
.map-head { text-align: center; margin-bottom: 48px; }
.map-head h1 { font-family: var(--disp); font-weight: 600; font-size: clamp(34px, 5vw, 56px); color: var(--plum); }
.map-head p { color: var(--ink-2); margin-top: 12px; font-size: 17px; }
.world-block { margin-bottom: 34px; }
/* chapter header band: accent bar + mono code + Lora title + "read intro" */
.chapter-band { display: flex; align-items: center; gap: 16px; padding: 15px 18px; border-radius: 15px; margin-bottom: 18px;
  background: color-mix(in oklch, var(--wca) 6%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--wca) 22%, var(--line));
  transition: transform .2s var(--ease), box-shadow .2s; }
.chapter-band:hover { transform: translateY(-2px); box-shadow: var(--sh-sm); }
.chapter-band .cb-bar { width: 5px; align-self: stretch; border-radius: 99px; background: var(--wca); flex: 0 0 auto; }
.chapter-band .cb-main { flex: 1; min-width: 0; }
.chapter-band .cb-code { font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--wcl); }
.chapter-band .cb-title { font-family: var(--disp); font-weight: 600; font-size: 22px; color: var(--wcl); letter-spacing: -.01em; margin-top: 2px; line-height: 1.15; }
.chapter-band .cb-sub { font-size: 13.5px; color: var(--ink-3); margin-top: 3px; }
.chapter-band .cb-right { display: flex; align-items: center; gap: 16px; flex: 0 0 auto; }
.chapter-band .cb-prog { font-family: var(--mono); font-size: 12px; color: var(--ink-4); }
.chapter-band .cb-read { font-size: 12.5px; font-weight: 600; color: var(--wcl); white-space: nowrap; }
.nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; padding-left: 4px; }
.lnode { display: block; position: relative; width: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; cursor: pointer; transition: transform .22s var(--ease), border-color .2s, box-shadow .22s; box-shadow: var(--sh-sm), var(--card-hl); }
.lnode:hover { transform: translateY(-5px); border-color: var(--wca, var(--line-2)); box-shadow: 0 12px 26px color-mix(in oklch, var(--wca, var(--plum)) 26%, transparent), var(--card-hl); }
.lnode .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 12px; font-family: var(--mono); font-weight: 700; font-size: 18px; }
.lnode .lt { font-weight: 600; font-size: 15px; line-height: 1.25; color: var(--ink); }
.lnode .lo { font-size: 12px; color: var(--ink-3); margin-top: 4px; line-height: 1.4; }
.lnode .lx { margin-top: 11px; font-size: 11px; font-weight: 600; }
.lnode.done { border-color: rgba(36,133,90,.5); }
.lnode.done .check { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.lnode.cur { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--sh); }

/* ============ LESSON — vertical explorable ============ */
.lesson-bar { position: sticky; top: 0; z-index: var(--z-bar); display: flex; align-items: center; gap: 14px; padding: 12px 24px; background: var(--nav-bg); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.lesson-bar .back { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); font-weight: 500; padding: 7px 12px; border-radius: 9px; cursor: pointer; }
.lesson-bar .back:hover { background: var(--plum-soft); color: var(--plum); }
.lesson-bar .wchip { font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: 99px; }
.lesson-bar .lttl { font-family: var(--disp); font-weight: 600; font-size: 18px; color: var(--plum); }
.lesson-bar .nums { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.lesson-bar .barnav { display: flex; gap: 7px; }
.lesson-bar .lprog { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.lesson-bar .lprog i { display: block; height: 100%; width: 0; transition: width .15s linear; }
@media (max-width: 640px) { .lesson-bar .lttl { display: none; } }
.lbtn { font-size: 13px; font-weight: 600; border-radius: 9px; padding: 8px 13px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); transition: transform .2s, background .2s, border-color .2s; }
.lbtn:hover:not(:disabled) { background: var(--surface-2); transform: scale(1.03); } .lbtn:disabled { opacity: .35; cursor: not-allowed; }
.lbtn.next { background: var(--plum); color: #fff; border-color: transparent; }

.explorable { max-width: var(--readw); margin: 0 auto; padding: 8px 26px 120px; }
.lesson-hero { text-align: center; padding: 46px 0 30px; }
.lesson-hero .icbig { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 18px; font-family: var(--mono); font-weight: 700; font-size: 28px; }
.lesson-hero h1 { font-family: var(--disp); font-weight: 600; font-size: clamp(34px, 5vw, 50px); color: var(--plum); }
.lesson-hero p { color: var(--ink-2); font-size: 18px; margin-top: 12px; line-height: 1.55; }

.beat { margin: 40px 0; }
.beat-cap { margin-bottom: 18px; }
.beat-cap .bn { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--gold-text); letter-spacing: .04em; }
.beat-cap h2, .beat-cap h3 { font-family: var(--disp); font-weight: 600; font-size: 25px; color: var(--plum); margin: 6px 0 8px; }
.beat-cap p { font-size: 16px; line-height: 1.62; color: var(--ink-2); }
.beat-cap p b { color: var(--ink); font-weight: 600; } .beat-cap p .k { color: var(--plum); font-weight: 600; }
.beat-cap code, .ic-code { font-family: var(--mono); font-size: .85em; background: var(--surface-3); padding: 1.5px 6px; border-radius: 5px; color: var(--plum); }

.deeper { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.deeper summary { padding: 13px 18px; font-size: 13.5px; font-weight: 600; color: var(--plum); cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.deeper summary::-webkit-details-marker { display: none; }
.deeper summary::before { content: "+"; font-family: var(--mono); color: var(--gold-text); font-weight: 700; }
.deeper[open] summary::before { content: "−"; }
.deeper .dbody { padding: 0 18px 16px; font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.deeper .dbody p { margin-bottom: .8em; } .deeper .dbody b { color: var(--ink); }
.deeper .dbody p:last-child { margin-bottom: 0; }
.deeper .dbody code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; color: var(--plum-2); }

.lesson-end { text-align: center; margin-top: 60px; padding-top: 36px; border-top: 1px solid var(--line); }
.kbd-hint { margin-top: 18px; font-size: 12px; color: var(--ink-3); }
.kbd-hint kbd { font-family: var(--mono); font-size: 11px; background: var(--surface); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--ink-3); }

/* ============ COURSE COMPLETION ============ */
.completion { min-height: calc(100dvh - 92px); padding: clamp(48px, 7vw, 88px) 24px 48px; display: grid; place-items: center; align-content: center; }
.completion-card { position: relative; width: min(760px, 100%); text-align: center; padding: clamp(36px, 6vw, 68px); border: 1px solid var(--plum-line); border-radius: var(--r-xl); background:
  radial-gradient(circle at 50% 0%, var(--gold-soft), transparent 42%),
  var(--surface); box-shadow: var(--sh), var(--card-hl); overflow: hidden; }
.completion-card::before, .completion-card::after { content: ""; position: absolute; width: 180px; height: 180px; border: 1px solid var(--plum-line); border-radius: 50%; pointer-events: none; }
.completion-card::before { left: -112px; top: 34%; }
.completion-card::after { right: -132px; bottom: -32px; width: 240px; height: 240px; border-color: color-mix(in oklch, var(--gold) 24%, transparent); }
.completion-mark { width: 112px; height: 112px; position: relative; display: grid; place-items: center; margin: 0 auto 26px; color: var(--plum); font-family: var(--mono); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.completion-mark svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.completion-mark circle { fill: none; stroke-width: 7; }
.cm-track { stroke: var(--surface-3); }
.cm-progress { stroke: var(--gold); stroke-linecap: round; animation: completion-draw 1s var(--ease) both; }
@keyframes completion-draw { from { stroke-dasharray: 0 100; } }
.completion-kicker { color: var(--gold-text); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.completion-card h1 { margin-top: 14px; color: var(--plum); font-family: var(--disp); font-size: clamp(40px, 7vw, 68px); font-weight: 500; line-height: 1.02; letter-spacing: -.04em; }
.completion-message { max-width: 610px; margin: 22px auto 0; color: var(--ink-2); font-size: clamp(16px, 2vw, 18px); line-height: 1.65; }
.completion-stats { display: grid; grid-template-columns: repeat(2, 1fr); max-width: 510px; margin: 38px auto 0; border-block: 1px solid var(--line); }
.completion-stat { padding: 24px 18px 22px; }
.completion-stat + .completion-stat { border-left: 1px solid var(--line); }
.completion-stat strong { display: block; color: var(--plum); font-family: var(--mono); font-size: clamp(30px, 5vw, 42px); font-variant-numeric: tabular-nums; letter-spacing: -.05em; }
.completion-stat strong span { color: var(--ink-4); font-size: .48em; letter-spacing: 0; }
.completion-stat p { margin-top: 7px; color: var(--ink-3); font-size: 13px; }
.completion-actions { margin-top: 36px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.completion-signoff { margin-top: 24px; color: var(--ink-3); font-family: var(--disp); font-size: 14px; font-style: italic; }
.completion-card.complete-all { border-color: color-mix(in oklch, var(--gold) 44%, var(--line)); }
.completion-card.complete-all .completion-mark { font-family: var(--sans); font-size: 40px; color: var(--green); }
.completion-card.complete-all .cm-progress { stroke: var(--green); }
@media (max-width: 560px) {
  .completion { min-height: calc(100dvh - 56px); padding: 26px 14px 32px; }
  .completion-card { padding: 34px 20px 30px; border-radius: 22px; }
  .completion-mark { width: 92px; height: 92px; margin-bottom: 22px; }
  .completion-stats { margin-top: 28px; }
  .completion-stat { padding: 20px 8px 18px; }
  .completion-actions { align-items: stretch; flex-direction: column; }
}

/* ====== interactive primitives (light) ====== */
.fcard { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--sh-sm), var(--card-hl); position: relative; }
.fcard + .fcard { margin-top: 16px; }
.flabel { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.flabel .pin { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
input.in, textarea.in { width: 100%; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 11px 13px; font-family: var(--sans); font-size: 14.5px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input.in:focus, textarea.in:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
input.in.mono, textarea.in.mono { font-family: var(--mono); } textarea.in { resize: none; line-height: 1.5; }
.big-in { font-size: 18px; padding: 14px 16px; }
.srow { display: flex; align-items: center; gap: 12px; } .srow .nm { font-size: 12.5px; color: var(--ink-2); width: 110px; flex: 0 0 auto; } .srow .v { font-family: var(--mono); font-weight: 700; font-size: 16px; color: var(--plum); width: 56px; text-align: right; flex: 0 0 auto; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 7px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--plum); border: 3px solid var(--surface); box-shadow: var(--sh-sm); cursor: pointer; }
.kvs { font-size: 13px; } .kvs .kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); } .kvs .kv:last-child { border: none; } .kvs .k { color: var(--ink-3); } .kvs .v { font-family: var(--mono); color: var(--ink); word-break: break-all; text-align: right; } .kvs .v.gr { color: var(--green); } .kvs .v.vi { color: var(--plum); }
.note { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; } .note.ok { color: var(--green); } .note.bad { color: var(--red); }
.metric { font-family: var(--mono); } .metric .n { font-size: 30px; font-weight: 700; color: var(--plum); } .metric .u { font-size: 13px; color: var(--ink-3); }

.hashout { font-family: var(--mono); font-size: 13px; word-break: break-all; line-height: 1.6; color: var(--plum); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.hashout .go { color: var(--gold-text); font-weight: 700; }
.avalanche { display: grid; grid-template-columns: repeat(32, 1fr); gap: 3px; margin-top: 14px; }
.avalanche .b { aspect-ratio: 1; border-radius: 2px; background: var(--surface-3); transition: background .12s; }
.avalanche .b.on { background: var(--gold); box-shadow: 0 0 6px rgba(241,162,34,.5); }

.bfields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.bfield { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; }
.bfield.full { grid-column: 1 / -1; }
.bfield .k { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.bfield .v { font-family: var(--mono); font-size: 13px; color: var(--ink-2); word-break: break-all; margin-top: 4px; }
.bfield .v.hash { color: var(--green); } .bfield .v.vi { color: var(--plum); } .bfield .v.go { color: var(--gold-text); }
.bfield.hl { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }

.nonce-display { font-family: var(--mono); font-size: 52px; font-weight: 700; color: var(--gold-text); text-align: center; letter-spacing: -.02em; line-height: 1; }
.nonce-display .lab { display: block; font-size: 11px; letter-spacing: .16em; color: var(--ink-3); font-weight: 600; margin-bottom: 8px; }
.target-line { font-family: var(--mono); font-size: 14px; color: var(--ink-2); text-align: center; } .target-line .t { color: var(--gold-text); font-weight: 700; }
.verdict { font-family: var(--mono); font-weight: 600; font-size: 14px; padding: 12px 14px; border-radius: 11px; text-align: center; }
.verdict.no { color: var(--red); background: var(--red-soft); } .verdict.yes { color: var(--green); background: var(--green-soft); }
.statline { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; } .statline .s { text-align: center; } .statline .s .n { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--gold-text); display: block; } .statline .s .l { font-size: 11px; color: var(--ink-3); }

.mchain { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 8px 0 16px; }
.mblk { flex: 0 0 196px; background: var(--surface-2); border: 1.5px solid var(--green); border-radius: 16px; padding: 15px; transition: border-color .25s, box-shadow .25s; }
.mblk .top { display: flex; justify-content: space-between; align-items: center; font-family: var(--disp); font-weight: 600; color: var(--plum); }

.mtree2 { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.mrow { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.mnode { font-family: var(--mono); font-size: 11px; padding: 9px 11px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink-3); min-width: 64px; text-align: center; cursor: pointer; transition: all .18s; }
.mnode.leaf { border-color: rgba(98,13,60,.3); color: var(--plum); } .mnode.root { border-color: var(--gold); color: var(--gold-text); }
.mnode.path { background: var(--plum-soft); border-color: var(--plum); color: var(--plum); } .mnode.proof { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-text); }

.sig-state { font-family: var(--mono); font-size: 13px; padding: 11px 14px; border-radius: 11px; border: 1px solid var(--line); color: var(--ink-2); background: var(--surface-2); }
.sig-state.ok { color: var(--green); background: var(--green-soft); border-color: rgba(36,133,90,.4); } .sig-state.bad { color: var(--red); background: var(--red-soft); border-color: rgba(199,40,66,.4); }

.pos-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; padding: 14px; text-align: center; transition: all .25s; }
.pos-card.chosen { border-color: var(--plum); box-shadow: 0 0 0 2px var(--plum-soft); } .pos-card.slashed { border-color: var(--red); opacity: .6; }
.pos-card .stk { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--plum); } .pos-card.slashed .stk { color: var(--red); text-decoration: line-through; }
.sc-screen { font-family: var(--mono); font-size: 12.5px; background: #2a1020; color: #f6e7ee; border: 1px solid var(--line); border-radius: 12px; padding: 16px; overflow-x: auto; }
.log { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 12px; max-height: 150px; overflow-y: auto; }
.log div { padding: 2px 0; color: var(--ink-2); } .log .ok { color: var(--green); } .log .bad { color: var(--red); } .log .warn { color: var(--gold-text); } .log .info { color: var(--plum); }

/* ====== rich block & chain visuals ====== */
.xchain { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 26px 6px 18px; }
.xblock { flex: 0 0 236px; border-radius: 18px; background: var(--surface); border: 1.6px solid var(--green); box-shadow: 0 10px 28px rgba(98,13,60,.09); position: relative; overflow: hidden; transition: border-color .3s, box-shadow .3s, transform .25s; }
.xblock.bad { border-color: var(--red); box-shadow: 0 0 28px rgba(199,40,66,.18); }
.xblock.mining { border-color: var(--gold); box-shadow: 0 0 28px rgba(241,162,34,.28); }
.xblock.fresh { animation: xin .6s cubic-bezier(.2,.85,.25,1); }
@keyframes xin { 0% { opacity: 0; transform: translateX(46px) scale(.9); } 100% { opacity: 1; transform: none; } }
.xblock .xtop { height: 7px; background: var(--green); }
.xblock.bad .xtop { background: var(--red); } .xblock.mining .xtop { background: var(--gold); }
.xblock .xpad { padding: 13px 15px 15px; }
.xblock .xh { display: flex; justify-content: space-between; align-items: baseline; }
.xblock .xh .xn { font-family: var(--disp); font-weight: 600; font-size: 25px; color: var(--plum); }
.xblock .xh .xs { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--green-soft); color: var(--green); }
.xblock.bad .xh .xs { background: var(--red-soft); color: var(--red); } .xblock.mining .xh .xs { background: var(--gold-soft); color: var(--gold-text); }
.xblock .xseg { margin-top: 10px; }
.xblock .xlbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; margin-bottom: 3px; }
.xblock .xv { font-family: var(--mono); font-size: 11px; color: var(--ink-2); word-break: break-all; }
.xblock .xprev .xv { color: var(--ink-3); }
.xblock textarea.xdata { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-family: var(--mono); font-size: 11px; padding: 7px 9px; resize: none; }
.xblock .xtxs { display: flex; flex-direction: column; gap: 5px; }
.xblock .xtx { font-family: var(--mono); font-size: 10.5px; background: var(--surface-3); border-radius: 7px; padding: 5px 9px; color: var(--ink-2); animation: txin .3s; }
@keyframes txin { from { opacity: 0; transform: scale(.9); } to { opacity: 1; } }
.xblock .xnonce { display: flex; align-items: center; justify-content: space-between; }
.xblock .xnonce .v { font-family: var(--mono); font-weight: 700; color: var(--gold-text); }
.xblock .xseal { margin-top: 11px; padding: 9px 11px; border-radius: 11px; background: var(--green-soft); display: flex; align-items: center; gap: 9px; }
.xblock.bad .xseal { background: var(--red-soft); } .xblock.mining .xseal { background: var(--gold-soft); }
.xblock .xseal .lk { font-size: 14px; }
.xblock .xseal .sv { font-family: var(--mono); font-size: 11px; color: var(--green); font-weight: 600; word-break: break-all; }
.xblock.bad .xseal .sv { color: var(--red); } .xblock.mining .xseal .sv { color: var(--gold-text); }
.xconn { flex: 0 0 46px; align-self: center; position: relative; height: 60px; display: flex; align-items: center; }
.xconn .ln { width: 100%; height: 3px; border-radius: 99px; background: var(--green); position: relative; }
.xconn.bad .ln { background: var(--red); }
.xconn .ln::after { content: "▸"; position: absolute; right: -3px; top: 50%; transform: translateY(-50%); color: inherit; font-size: 13px; line-height: 0; }
.xconn .ln { color: var(--green); } .xconn.bad .ln { color: var(--red); }
.xconn .hashtag { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 10px; color: var(--ink-4); white-space: nowrap; }
.xconn.bad .hashtag { color: var(--red); }
.xconn.flow .ln { background-image: linear-gradient(90deg, var(--green) 40%, transparent 40%); background-size: 12px 3px; animation: flow 1s linear infinite; }
@keyframes flow { to { background-position: 12px 0; } }

/* primer: copies across the network */
.copies { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.cnode { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; transition: all .25s; }
.cnode.bad { border-color: var(--red); background: var(--red-soft); }
.cnode .nlabel { font-size: 11px; color: var(--ink-3); margin-bottom: 8px; font-weight: 600; }
.cnode .minichain { display: flex; gap: 3px; justify-content: center; }
.cnode .mb { width: 13px; height: 16px; border-radius: 3px; background: var(--green); }
.cnode.bad .mb.tampered { background: var(--red); }

/* big single block (primer) */
.bigblock { max-width: 360px; margin: 0 auto; border-radius: 22px; background: var(--surface); border: 2px solid var(--plum); box-shadow: var(--sh); overflow: hidden; }
.bigblock .bt { height: 9px; background: var(--plum); }
.bigblock .bp { padding: 22px 24px; }
.bigblock .bn { font-family: var(--disp); font-weight: 600; font-size: 30px; color: var(--plum); }
.bigblock .brow { margin-top: 14px; } .bigblock .brow .k { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; } .bigblock .brow .v { font-family: var(--mono); font-size: 13px; color: var(--ink-2); word-break: break-all; margin-top: 3px; }

/* drag-to-build block playground */
.lab-grid { display: grid; grid-template-columns: 1fr 268px; gap: 22px; align-items: start; }
@media (max-width: 720px) { .lab-grid { grid-template-columns: 1fr; } }
.txpool { display: flex; flex-direction: column; gap: 9px; }
.txchip { font-family: var(--mono); font-size: 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; cursor: grab; display: flex; align-items: center; gap: 9px; transition: border-color .15s, box-shadow .15s, opacity .15s; user-select: none; }
.txchip:hover { border-color: var(--plum); box-shadow: var(--sh-sm); }
.txchip:active { cursor: grabbing; }
.txchip.dragging { opacity: .4; }
.txchip.used { opacity: .4; border-style: dashed; cursor: default; }
.txchip .grip { color: var(--ink-4); font-size: 14px; }
.dropzone { min-height: 86px; border: 2px dashed var(--line-2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 6px; transition: all .2s; background: var(--surface-2); }
.dropzone.over { border-color: var(--plum); background: var(--plum-tint); transform: scale(1.01); }
.dropzone.empty { align-items: center; justify-content: center; color: var(--ink-3); font-size: 12.5px; text-align: center; }
.dropzone .xtx { animation: txin .35s; }
@keyframes sealpulse { 0% { box-shadow: 0 0 0 0 rgba(36,133,90,.5); } 100% { box-shadow: 0 0 0 20px rgba(36,133,90,0); } }
.xblock.justsealed { animation: sealpulse .75s; }
.xblock.mining .sv { animation: flick .12s infinite; }
@keyframes flick { 50% { opacity: .55; } }
.minebar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 4px; }
.minebar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #d98908); width: 0; transition: width .1s; }

/* ===== merkle computation tree ===== */
.mvz { position: relative; padding: 6px 0; overflow-x: auto; }
.mvz-rows { display: flex; flex-direction: column; gap: 30px; align-items: center; position: relative; z-index: 1; min-width: max-content; margin: 0 auto; }
.mvz-row { display: flex; gap: 14px; justify-content: center; }
.mvz-node { background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 11px; padding: 7px 9px; font-family: var(--mono); font-size: 11px; text-align: center; min-width: 76px; transition: opacity .3s, border-color .25s, box-shadow .25s, transform .25s; box-shadow: var(--sh-sm); }
.mvz-node .lbl { font-size: 10.5px; color: var(--ink-3); margin-bottom: 3px; font-family: var(--sans); font-weight: 600; }
.mvz-node.leaf { border-color: rgba(98,13,60,.28); }
.mvz-node.ghost { opacity: .3; border-style: dashed; }
.mvz-node.active { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); transform: scale(1.06); }
.mvz-node.root { border-color: var(--gold); background: var(--gold-tint); color: var(--gold-text); font-weight: 700; }
.mvz svg { position: absolute; inset: 0; z-index: 0; pointer-events: none; width: 100%; height: 100%; }
.mvz-formula { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; text-align: center; color: var(--ink-2); margin-top: 16px; line-height: 1.5; }
.mvz-formula b { color: var(--gold-text); } .mvz-formula .hl { color: var(--plum); }
.mvz.compact .mvz-rows { gap: 18px; } .mvz.compact .mvz-node { min-width: 56px; padding: 5px 7px; font-size: 10px; } .mvz.compact .mvz-node .lbl { font-size: 10px; }

/* ===== nonce: static fields vs the one dial ===== */
.nfields { display: flex; flex-direction: column; gap: 8px; }
.nfield { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 11px 14px; }
.nfield .ico { font-size: 15px; flex: 0 0 auto; opacity: .6; }
.nfield .nf-k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; width: 96px; flex: 0 0 auto; }
.nfield .nf-v { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); word-break: break-all; flex: 1; }
.nfield .tag { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--surface-3); color: var(--ink-3); flex: 0 0 auto; }
.nfield.locked { opacity: .82; }
.nfield.dial { background: var(--gold-tint); border: 2px solid var(--gold); }
.nfield.dial .nf-k, .nfield.dial .ico { color: var(--gold-text); opacity: 1; }
.nfield.dial .nf-v { color: var(--gold-text); font-weight: 700; font-size: 20px; }
.nfield.dial .tag { background: var(--gold); color: #4a2c00; }
.nfield.spin .nf-v { animation: flick .1s infinite; }
.nfield.hashout-row { background: #2a1020; border-color: #4a2436; }
.nfield.hashout-row .nf-k { color: #c89bb0; } .nfield.hashout-row .nf-v { color: #79e0c0; font-weight: 600; } .nfield.hashout-row .ico { opacity: 1; }
.nfield.hashout-row .nf-v .go { color: #ffd479; font-weight: 700; }
.arrowdown { text-align: center; color: var(--ink-3); font-family: var(--mono); font-size: 12px; margin: 4px 0; }

/* ===== chain link tracing ===== */
.xblock .xprev.lit .xv, .xblock .xseal.lit .sv { color: var(--gold-text) !important; background: var(--gold-soft); border-radius: 5px; padding: 1px 4px; }
.xblock.traced { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.linkmsg { text-align: center; font-size: 13.5px; color: var(--ink-2); margin-top: 12px; min-height: 20px; }
.linkmsg b { color: var(--gold-text); }

/* ===== checkpoint quiz ===== */
.quiz { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--sh-sm), var(--card-hl); }
.quiz-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.quiz-tag { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--plum); font-weight: 700; background: var(--plum-soft); padding: 4px 11px; border-radius: 99px; }
.quiz-n { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.quiz-q { font-size: 16.5px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.quiz-opts { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.quiz-opt { display: flex; align-items: center; gap: 11px; text-align: left; font-size: 14.5px; font-weight: 500; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 13px 16px; transition: border-color .15s, background .15s, transform .08s; }
.quiz-opt:hover:not(:disabled) { border-color: var(--plum); background: var(--plum-tint); color: var(--ink); }
.quiz-opt:active:not(:disabled) { transform: translateY(1px); }
.quiz-opt:disabled { cursor: default; opacity: .75; }
.quiz-opt.right { border-color: var(--green); background: var(--green-soft); color: var(--green); font-weight: 600; opacity: 1; }
.quiz-opt.wrong { border-color: var(--red); background: var(--red-soft); color: var(--red); opacity: 1; }
.quiz-why { display: none; margin-top: 14px; font-size: 14px; line-height: 1.6; border-radius: 11px; padding: 12px 15px; }
.quiz-why.show { display: block; animation: fadein .3s ease; }
.quiz-why.ok { background: var(--green-soft); color: var(--ink-2); } .quiz-why.ok b { color: var(--green); }
.quiz-why.bad { background: var(--red-soft); color: var(--ink-2); } .quiz-why.bad b { color: var(--red); }
.quiz-foot { margin-top: 14px; display: flex; justify-content: flex-end; }
.quiz-mark { box-shadow: 0 0 0 2px var(--green-soft); }
.qo-mk { flex: 0 0 auto; width: 19px; height: 19px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; transition: border-color .2s, background .2s; }
.quiz-opt.right .qo-mk { border-color: var(--green); background: var(--green); }
.quiz-opt.right .qo-mk::after { content: "✓"; }
.quiz-opt.wrong .qo-mk { border-color: var(--red); background: var(--red); }
.quiz-opt.wrong .qo-mk::after { content: "✕"; }
.qo-t { flex: 1; }
.quiz-dots { display: flex; gap: 6px; align-items: center; }
.qd { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); transition: background .25s var(--ease), transform .25s var(--ease); }
.qd.cur { background: var(--plum); transform: scale(1.3); }
.qd.right { background: var(--green); }
.qd.wrong { background: var(--red); }
.quiz-skip { background: none; border: none; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 4px 6px; border-radius: 7px; transition: color .15s; }
.quiz-skip:hover { color: var(--plum); }
.quiz-skipmsg { font-size: 14.5px; color: var(--ink-2); line-height: 1.5; margin: 2px 0 4px; }
.quiz.skipped .quiz-foot { justify-content: flex-start; }
.quiz-result { text-align: center; padding: 6px 0; }
.qr-score { margin-bottom: 12px; font-family: var(--mono); font-weight: 700; line-height: 1; }
.qr-n { font-size: 48px; color: var(--plum); }
.qr-d { font-size: 22px; color: var(--ink-4); margin-left: 4px; }
.quiz-result .quiz-dots { justify-content: center; margin-bottom: 16px; }
.quiz-result h3, .quiz-result h4 { font-family: var(--disp); font-weight: 600; font-size: 23px; color: var(--ink); }
.quiz-result p { font-size: 14px; color: var(--ink-2); margin: 6px auto 0; max-width: 46ch; line-height: 1.55; }
.quiz-result .quiz-foot { justify-content: center; margin-top: 18px; }

/* ===== incentives: fee market ===== */
.feegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 9px; }
.feechip { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; color: var(--ink-2); transition: border-color .15s, background .15s; text-align: left; }
.feechip:hover:not(:disabled) { border-color: var(--plum); }
.feechip.on { border-color: var(--gold); background: var(--gold-tint); color: var(--ink); }
.feechip .fee { font-weight: 700; color: var(--gold-text); flex: 0 0 auto; }
.feechip:disabled { cursor: default; opacity: .8; }
.paysheet { margin-top: 16px; border-top: 1px dashed var(--line-2); }
.payrow { display: flex; justify-content: space-between; gap: 12px; padding: 9px 2px; font-size: 13.5px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.payrow b { font-family: var(--mono); color: var(--ink); }
.payrow.total { border-bottom: none; font-weight: 600; color: var(--ink); }
.payrow.total b { color: var(--gold-text); font-size: 16px; }
.halvestats { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; margin: 18px 0 12px; }
.halvestats .hs { text-align: center; }
.halvestats .hs .n { font-family: var(--mono); font-size: 24px; font-weight: 700; color: var(--plum); display: block; }
.halvestats .hs .l { font-size: 11px; color: var(--ink-3); }
.supplybar { height: 14px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line); overflow: hidden; }
.supplybar i { display: block; height: 100%; background: linear-gradient(90deg, var(--plum), var(--gold)); border-radius: 99px; transition: width .25s var(--ease); }

/* ===== gossip network ===== */
.netbox { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.netbox svg { display: block; width: 100%; height: auto; }
.netedge { stroke: var(--line-2); stroke-width: 1.5; transition: stroke .3s; }
.netedge.lit { stroke: var(--gold); stroke-width: 2.5; }
.netnode { fill: var(--surface); stroke: var(--line-2); stroke-width: 2; cursor: pointer; transition: fill .3s, stroke .3s; }
.netnode:focus { outline: none; }
.netnode:hover, .netnode:focus-visible { stroke: var(--plum); }
.netnode.src { stroke-width: 4; }
.netnode.heard { fill: var(--gold); stroke: var(--gold-2); }
.netnode.heard-a { fill: #8a2057; stroke: #620d3c; }
.netnode.heard-b { fill: #f1a222; stroke: #c67c05; }
.race-legend { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.race-legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.race-legend .sw.a { background: #8a2057; } .race-legend .sw.b { background: #f1a222; }

/* ===== safety drill ===== */
.scam-card { font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; font-style: italic; }
.flipRow { display: block; width: 100%; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 0; margin-bottom: 8px; overflow: hidden; transition: border-color .2s; }
.flipRow:hover { border-color: var(--line-2); }
.flipRow .side { display: block; padding: 13px 16px; font-size: 14px; line-height: 1.5; }
.flipRow .side.good { color: var(--green); font-weight: 500; }
.flipRow .side.dark { display: none; color: var(--red); font-weight: 500; background: var(--red-soft); }
.flipRow.flipped .side.good { display: none; }
.flipRow.flipped .side.dark { display: block; animation: fadein .25s ease; }

/* ===== why: resilient network grid ===== */
.netgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 10px; }
.ncell { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 6px; text-align: center; transition: opacity .3s, border-color .3s, transform .2s; }
.ncell .nc-ic { font-size: 20px; }
.ncell .nc-bal { font-family: var(--mono); font-weight: 700; color: var(--green); font-size: 15px; margin-top: 3px; }
.ncell.off { opacity: .3; border-style: dashed; }
.ncell.off .nc-bal { color: var(--ink-4); }
.ncell.shield { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); transform: translateY(-2px); }

/* ===== tour: animated payment pipeline ===== */
.pipe { margin: 6px 0 4px; }
.pipe-track { position: relative; height: 30px; }
.pcoin { position: absolute; top: 0; left: 0; transform: translateX(-50%); font-size: 22px; color: var(--gold-text); transition: left .8s cubic-bezier(.5,0,.2,1); filter: drop-shadow(0 3px 6px rgba(241,162,34,.5)); }
.pcoin.thump { animation: pthump .4s var(--ease); }
@keyframes pthump { 40% { transform: translateX(-50%) scale(1.5); } 100% { transform: translateX(-50%) scale(1); } }
.pipe-stations { display: flex; gap: 6px; position: relative; }
.pipe-stations::before { content: ""; position: absolute; top: 32px; left: 8%; right: 8%; height: 2px; background: var(--line); z-index: 0; }
.pstat { flex: 1; text-align: center; padding: 8px 2px; border-radius: 12px; position: relative; z-index: 1; transition: background .3s; }
.pstat .ps-ic { font-size: 24px; filter: grayscale(1) opacity(.4); transition: filter .3s, transform .3s; }
.pstat .ps-t { font-size: 11px; font-weight: 700; color: var(--ink-4); margin-top: 3px; transition: color .3s; letter-spacing: .02em; }
.pstat.on .ps-ic { filter: none; } .pstat.on .ps-t { color: var(--plum); }
.pstat.live { background: var(--gold-tint); } .pstat.live .ps-ic { transform: scale(1.18); } .pstat.live .ps-t { color: var(--gold-text); }
.pipe-cap { font-size: 15px; line-height: 1.6; color: var(--ink-2); margin-top: 18px; min-height: 48px; }
.pipe-cap b { color: var(--ink); }
.pipe-detail { display: inline-block; margin-left: 6px; font-size: 12.5px; color: var(--ink-3); background: var(--surface-3); border-radius: 6px; padding: 2px 8px; }

/* ===== tokens: flying coins ===== */
.tokcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; position: relative; }
.tokcol { text-align: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px 6px; }
.tokcol .tk-ic { font-size: 28px; }
.tokcol .tk-name { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 4px; }
.tokcol .tk-bal { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--plum); margin-top: 6px; transition: transform .2s, color .2s; }
.tokcol .tk-bal.up { color: var(--green); transform: scale(1.28); }
.tokcol .tk-bal.dn { color: var(--red); transform: scale(.82); }
.tokcol .tk-u { font-size: 10px; color: var(--ink-4); letter-spacing: .1em; }
.flycoin { position: absolute; z-index: 5; font-size: 16px; color: var(--gold-text); pointer-events: none; transition: transform .45s cubic-bezier(.4,0,.2,1), opacity .45s; transform: translate(0,0); }

/* Chapter Gate */
.ch-gate { max-width: 680px; margin: 0 auto; padding: 60px 24px 120px; }
.ch-gate-head { text-align: center; margin-bottom: 60px; }
.cg-n { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--plum); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 16px; }
.cg-title { font-size: 48px; font-weight: 600; font-family: var(--disp); color: var(--plum); margin-bottom: 24px; letter-spacing: -0.02em; line-height: 1.1; }
.cg-intro { font-size: 19px; color: var(--ink-2); line-height: 1.6; max-width: 600px; margin: 0 auto; }

.cg-modules { display: flex; flex-direction: column; gap: 12px; margin-bottom: 48px; }
.cg-mod { display: flex; align-items: center; padding: 20px 24px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; text-decoration: none; transition: all .2s var(--ease); cursor: pointer; }
.cg-mod:hover { transform: translateY(-2px); border-color: var(--plum); box-shadow: var(--sh-sm); background: var(--surface-2); }
.cgm-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-right: 20px; color: var(--ink-3); flex-shrink: 0; }
.cgm-info { flex: 1; }
.cgm-title { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.cgm-sub { font-size: 15px; color: var(--ink-3); line-height: 1.4; }
.cgm-arrow { font-size: 22px; color: var(--line-2); transition: color .2s, transform .2s; font-family: var(--mono); }
.cg-mod:hover .cgm-arrow { color: var(--plum); transform: translateX(4px); }

.cg-start { text-align: center; }
.cg-start .btn { box-shadow: var(--sh-plum); transition: transform .15s, box-shadow .15s, background .15s; }
.cg-start .btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,0.15); filter: brightness(1.1); }
.cg-start .btn:active { transform: translateY(1px); }



/* ===== layer2: rollup funnel ===== */
.roll-stage { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.roll-swarm { position: relative; width: 100%; height: 120px; border: 1px dashed var(--line-2); border-radius: 14px; background: var(--surface-2); overflow: hidden; transition: transform .3s; }
.roll-swarm .swd { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--plum); opacity: .8; animation: swfloat 3s ease-in-out infinite; }
@keyframes swfloat { 0%,100% { transform: translate(0,0); } 50% { transform: translate(4px,-6px); } }
.roll-swarm.suck .swd { transition: all .7s cubic-bezier(.6,0,.3,1); left: 50% !important; top: 100% !important; opacity: 0; transform: scale(.3); }
.roll-funnel { font-size: 22px; color: var(--gold-text); line-height: .6; }
.roll-l1 { display: flex; flex-direction: column; align-items: center; background: linear-gradient(180deg, var(--plum), var(--plum-2)); color: #fff; border-radius: 12px; padding: 10px 26px; box-shadow: var(--sh-plum); }
.roll-l1 .l1-lab { font-size: 10px; letter-spacing: .12em; opacity: .85; text-transform: uppercase; }
.roll-l1 .l1-n { font-family: var(--mono); font-size: 24px; font-weight: 700; }
.roll-l1 .l1-u { font-size: 10px; opacity: .8; }
.roll-l1.pop { animation: l1pop .5s var(--ease); }
@keyframes l1pop { 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
.roll-meter { font-size: 13px; color: var(--ink-3); margin-top: 10px; text-align: center; }
.roll-meter .mono { color: var(--plum); font-weight: 700; font-size: 16px; }

/* ===== wallets: derivation cascade ===== */
.casc-seed { background: #2a1020; border: 1px solid #4a2436; border-radius: 12px; padding: 13px 16px; }
.casc-seed .cs-k { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #ff9db4; font-weight: 700; }
.casc-seed .cs-v { font-family: var(--mono); font-size: 15px; color: #ffd479; margin-top: 5px; letter-spacing: .04em; }
.casc-tree { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-left: 14px; }
.casc-row { display: flex; align-items: stretch; gap: 10px; }
.casc-row.casc-in { animation: cascin .5s var(--ease) both; }
@keyframes cascin { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; } }
.casc-arm { width: 16px; border-left: 2px solid var(--line-2); border-bottom: 2px solid var(--line-2); border-bottom-left-radius: 8px; margin: 0 0 12px 2px; flex: 0 0 auto; }
.casc-acct { flex: 1; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 10px 13px; }
.casc-acct .ca-h { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; margin-bottom: 5px; }
.casc-acct .ca-r { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 2px 0; }
.casc-acct .ca-r span { color: var(--ink-4); }

/* ===== pos: animated energy meter ===== */
.enrow { display: grid; grid-template-columns: 150px 1fr 64px; align-items: center; gap: 14px; margin: 14px 0; }
.en-lab b { display: block; font-size: 14px; color: var(--ink); }
.en-lab span { font-size: 11.5px; color: var(--ink-3); }
.en-bar { position: relative; height: 26px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line); overflow: hidden; }
.en-fill { display: block; height: 100%; width: 0; border-radius: 99px; transition: width 1.4s cubic-bezier(.2,.8,.2,1); }
.en-fill.pow { background: linear-gradient(90deg, var(--gold), #d98908); }
.en-fill.pos { background: var(--green); }
.en-bolts { position: absolute; inset: 0; display: flex; align-items: center; gap: 4px; padding-left: 12px; font-size: 12px; opacity: .55; pointer-events: none; letter-spacing: 3px; }
.en-pct { font-weight: 700; text-align: right; color: var(--ink-2); }
.enrow:first-of-type .en-pct { color: var(--gold-text); } .enrow:nth-of-type(2) .en-pct { color: var(--green); }
@media (max-width: 560px) { .enrow { grid-template-columns: 1fr; gap: 4px; } .en-pct { text-align: left; } }

/* ===== transaction: anatomy + mempool ===== */
.txp { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.txrow { padding: 11px 15px; border-bottom: 1px solid var(--line); }
.txrow:last-child { border-bottom: none; }
.txrow-top { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.txk { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; flex: 0 0 auto; }
.txv { font-family: var(--mono); font-size: 13.5px; color: var(--ink); text-align: right; word-break: break-all; }
.txn { display: block; font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.45; }
.txsig { margin-top: 10px; }
.txsig-in { padding: 12px 15px; border-radius: 12px; border: 1px solid var(--line); transition: background .3s var(--ease), border-color .3s var(--ease); }
.txsig-in.ok { border-color: rgba(36,133,90,.45); background: var(--green-soft); }
.txsig-in.ok .txn, .txsig-in.ok .txk { color: var(--green); }
.txsig-in.bad { border-color: rgba(199,40,66,.45); background: var(--red-soft); }
.txsig-in.bad .txn, .txsig-in.bad .txk { color: var(--red); }

.mpool { border: 1px dashed var(--line-2); border-radius: 14px; background: var(--surface-2); padding: 13px 14px; }
.mpool-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.mpool-h .mono { text-transform: none; letter-spacing: 0; color: var(--plum-2); }
.mpgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 8px; margin-top: 10px; }
.mptx { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; transition: opacity .4s var(--ease), transform .4s var(--ease), border-color .2s, background .2s; }
.mptx .who { font-weight: 500; color: var(--ink); }
.mptx .fee { font-family: var(--mono); font-weight: 700; color: var(--gold-text); font-size: 11.5px; flex: 0 0 auto; }
.mptx.mine { border-color: var(--gold); background: var(--gold-tint); }
.mptx.picked { border-color: var(--green); background: var(--green-soft); transform: translateY(-3px); box-shadow: 0 6px 16px rgba(36,133,90,.14); }
.mpempty { grid-column: 1 / -1; text-align: center; font-size: 12.5px; color: var(--ink-3); padding: 12px; }
.mpblk { margin-top: 14px; }
.mpblk-h { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin-bottom: 8px; }
.mpblk-h .lk { color: var(--gold-text); }
.mpslots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mpslot { min-height: 48px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--ink-3); padding: 6px; text-align: center; transition: border-color .3s var(--ease), background .3s var(--ease); }
.mpslot.full { border-style: solid; border-color: var(--green); background: var(--green-soft); color: var(--ink); animation: mppop .4s var(--ease); }
.mpslot.full.mine { border-color: var(--gold); background: var(--gold-tint); }
.mpslot .who { font-weight: 600; font-size: 11.5px; }
.mpslot .fee { font-family: var(--mono); color: var(--gold-text); font-weight: 700; }
@keyframes mppop { 0% { opacity: 0; transform: scale(.7); } 60% { transform: scale(1.06); } 100% { opacity: 1; transform: scale(1); } }
@media (max-width: 520px) { .mpslots { grid-template-columns: repeat(2, 1fr); } }

/* ===== ledger: balances that move (but nothing physical does) ===== */
.ledgrid { display: flex; flex-direction: column; gap: 8px; }
.ledrow { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.led-ic { font-size: 24px; flex: 0 0 auto; }
.led-name { font-weight: 600; color: var(--ink); font-size: 15px; }
.led-bal { margin-left: auto; font-family: var(--mono); font-size: 24px; font-weight: 700; color: var(--plum); transition: transform .22s var(--ease), color .22s; }
.led-bal.up { color: var(--green); transform: scale(1.22); }
.led-bal.dn { color: var(--red); transform: scale(.85); }
.led-u { font-size: 11px; color: var(--ink-4); letter-spacing: .08em; flex: 0 0 auto; }

/* ===== double-spend: cloning coin + ordering resolution ===== */
.dsp { display: flex; align-items: center; justify-content: center; gap: 40px; padding: 16px 0; flex-wrap: wrap; }
.dsp-src { text-align: center; }
.dsp-coin { width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffd479, var(--gold)); display: grid; place-items: center; font-size: 26px; color: #7a4a00; box-shadow: var(--sh-gold); margin: 0 auto; transition: transform .3s var(--ease); }
.dsp-coin.split { animation: dspsplit .5s var(--ease); }
@keyframes dspsplit { 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
.dsp-targets { display: flex; flex-direction: column; gap: 12px; }
.dsp-t { display: flex; align-items: center; gap: 10px; min-width: 200px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px; transition: border-color .3s, background .3s; }
.dsp-t.has { border-color: var(--green); background: var(--green-soft); }
.dsp-ic { font-size: 22px; }
.dsp-nm { font-weight: 600; color: var(--ink); }
.dsp-got { margin-left: auto; font-size: 12.5px; color: var(--ink-3); font-family: var(--mono); }

.dord { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dord-tx { display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 14px 16px; transition: border-color .4s var(--ease), background .4s var(--ease), opacity .4s, transform .4s var(--ease); }
.dord-h { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; }
.dord-b { font-size: 14px; color: var(--ink); }
.dord-s { font-size: 12.5px; font-weight: 600; color: var(--green); }
.dord-tx.settling { animation: dordpulse .7s var(--ease) infinite; }
@keyframes dordpulse { 0%, 100% { border-color: var(--line-2); } 50% { border-color: var(--plum-2); } }
.dord-tx.win { border-color: var(--green); background: var(--green-soft); }
.dord-tx.win .dord-s { color: var(--green); }
.dord-tx.lose { border-color: var(--red); background: var(--red-soft); opacity: .72; transform: scale(.97); }
.dord-tx.lose .dord-s { color: var(--red); }
@media (max-width: 480px) { .dord { grid-template-columns: 1fr; } }

/* ===== whatis: records dropping in ===== */
.wr-rec { padding: 3px 0; }
.wr-in { animation: wrin .4s var(--ease); }
@keyframes wrin { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

/* ===== forks: the chain splits, one branch wins ===== */
.frk { display: flex; justify-content: center; padding: 16px 0; overflow-x: auto; }
.frk-line { display: flex; align-items: center; }
.frk-b { flex: 0 0 auto; min-width: 54px; height: 46px; display: flex; align-items: center; justify-content: center; font-family: var(--disp); font-weight: 600; font-size: 15px; border-radius: 11px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink-3); transition: border-color .45s var(--ease), background .45s var(--ease), opacity .45s, transform .45s var(--ease); }
.frk-b.ok { border-color: var(--green); background: var(--green-soft); color: var(--ink); }
.frk-b.cand { border-color: var(--gold); background: var(--gold-tint); color: var(--ink); }
.frk-b.orphan { border-color: var(--line-2); background: var(--surface-2); color: var(--ink-4); opacity: .45; filter: grayscale(.5); transform: scale(.9); }
.frk-b.pulse { animation: frkpulse 1.5s var(--ease) infinite; }
.frk-b.pop { animation: mppop .45s var(--ease); }
@keyframes frkpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(241,162,34,0); } 50% { box-shadow: 0 0 0 6px rgba(241,162,34,.12); } }
.frk-arm { width: 24px; height: 2.5px; background: var(--line-2); flex: 0 0 auto; }
.frk-split { display: flex; flex-direction: column; gap: 14px; }

/* ===== connective tissue: chapter opener + bridge ===== */
.co-head { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.co-num, .co-title { font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 0; }
.co-title { color: var(--ink-2); }
.co-sep { color: var(--ink-4); font-size: 16px; line-height: 1; }
.co-i { position: relative; z-index: 1; font-family: var(--sans); font-size: 16.5px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.chapter-open + .lesson-hero { padding-top: 10px; margin-top: 0; }

.bridge { max-width: var(--readw); margin: 32px auto 0; background: linear-gradient(180deg, var(--plum-tint), var(--surface)); border: 1px solid var(--plum-line); border-radius: var(--r-lg); padding: 22px 26px; }
.bridge-lab { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 9px; }
.bridge-txt { font-size: 16.5px; line-height: 1.62; color: var(--ink); text-wrap: pretty; }
.bridge-txt i { color: var(--ink-2); font-style: italic; }
.bridge-next { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--plum-line); font-size: 13px; color: var(--ink-3); }
.bridge-next b { color: var(--plum-2); font-weight: 600; }

/* ===== capstone: the whole machine ===== */
.mstages { display: flex; align-items: stretch; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.mstage { flex: 1 0 106px; min-width: 106px; text-align: center; padding: 12px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); transition: border-color .3s var(--ease), background .3s var(--ease), transform .3s var(--ease), box-shadow .3s; }
.mstage.on { border-color: var(--plum); background: var(--plum-tint); box-shadow: var(--sh-sm); transform: translateY(-3px); }
.ms-ic { font-size: 24px; line-height: 1; }
.ms-t { font-family: var(--disp); font-size: 15px; font-weight: 600; color: var(--ink); margin-top: 5px; }
.mstage.on .ms-t { color: var(--plum); }
.ms-d { font-size: 11px; color: var(--ink-3); margin-top: 2px; line-height: 1.3; }
.ms-tag { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); font-weight: 700; margin-top: 7px; }
.ms-arrow { flex: 0 0 auto; align-self: center; color: var(--line-2); font-size: 15px; padding: 0 3px; transition: color .3s; }
.ms-arrow.lit { color: var(--gold); }
.mrow { display: flex; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.mchain-wrap { flex: 1 1 58%; min-width: 240px; }
.mchain-lab, .mnodes-lab { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin-bottom: 8px; }
.mchain-lab b { color: var(--plum); }
.mchain { display: flex; align-items: center; overflow-x: auto; padding-bottom: 6px; min-height: 54px; }
.mblk2 { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 11px; border-radius: 10px; border: 1.5px solid var(--green); background: var(--green-soft); transition: transform .3s var(--ease); }
.mblk2.fresh { animation: mppop .5s var(--ease); border-color: var(--gold); background: var(--gold-tint); }
.mb-n { font-family: var(--disp); font-weight: 600; font-size: 13px; color: var(--ink); }
.mb-h { font-size: 10px; color: var(--ink-3); }
.mlink2 { flex: 0 0 auto; width: 16px; height: 2.5px; background: var(--green); }
.mnodes-wrap { flex: 1 1 28%; min-width: 150px; }
.mnodes { position: relative; height: 96px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); overflow: hidden; transition: background .4s; }
.mnodes.lit { background: var(--green-soft); }
.mnode2 { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); transition: background .4s, transform .4s; }
.mnodes.lit .mnode2 { background: var(--green); transform: scale(1.3); }
.mnodes-lab { margin-top: 6px; text-align: center; margin-bottom: 0; }
@media (max-width: 560px) { .mrow { flex-direction: column; } }

@media (prefers-reduced-motion: reduce) {
  .pcoin { transition: none; } .flycoin { transition: none; } .roll-swarm .swd { animation: none; } .en-fill { transition: none; }
  .frk-b.pulse, .dord-tx.settling, .dsp-coin.split { animation: none; }
}

footer { text-align: center; padding: 56px 24px; color: var(--ink-3); font-size: 13px; position: relative; z-index: 1; }
.fadein { animation: fadein .5s ease; } @keyframes fadein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; } }
.muted { color: var(--ink-3); }
.reveal { transition: opacity .6s ease, transform .6s ease; }
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(20px); }
  .reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

[data-theme="dark"] {
  --bg: #100710;
  --bg-2: #170b15;
  --surface: #1e1019;
  --surface-2: #261320;
  --surface-3: #32192b;
  --line: #3b2033;
  --line-2: #553049;
  --plum-line: rgba(255,255,255,.1);
  --nav-bg: rgba(16,7,16,.78);

  --plum: #e264a6; --plum-2: #c74a88; --plum-soft: #32192b; --plum-tint: #462039;
  --gold: #f7c064; --gold-2: #f8c977; --gold-soft: #3f2c12; --gold-tint: #3b280b;
  --gold-text: #f9cd80; --plum-text: #e87bb4;
  --ink: #f6eff3; --ink-2: #ddccd7; --ink-3: #ac93a4; --ink-4: #7e6477;
  --green: #5cd39d; --green-soft: #123626;
  --red: #f2748e; --red-soft: #3a1622;
  --blue: #6f9bff;
  --sh-sm: 0 1px 2px rgba(0,0,0,.4), 0 6px 16px rgba(0,0,0,.42);
  --sh: 0 12px 30px rgba(0,0,0,.5), 0 30px 70px rgba(0,0,0,.55);
  --sh-plum: 0 8px 22px rgba(226,100,166,.3);
  --sh-gold: 0 8px 22px rgba(247,192,100,.3);
  --card-hl: inset 0 1px 0 rgba(255,255,255,.055);
  --aura-gold: rgba(247,192,100,.11); --aura-plum: rgba(226,100,166,.13);
}

/* mono/data text set in brand colour needs the lighter text pair in dark mode */
[data-theme="dark"] .log .info, [data-theme="dark"] .kvs .v.vi, [data-theme="dark"] .bfield .v.vi,
[data-theme="dark"] .metric .n, [data-theme="dark"] .led-bal, [data-theme="dark"] .tokcol .tk-bal,
[data-theme="dark"] .pos-card .stk, [data-theme="dark"] .hashout, [data-theme="dark"] .qr-n,
[data-theme="dark"] .mpool-h .mono, [data-theme="dark"] .roll-meter .mono,
[data-theme="dark"] .srow .v { color: var(--plum-text); }

/* smooth theme switch: app.js adds .theming to <html> around the toggle */
html.theming, html.theming *, html.theming *::before, html.theming *::after {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, fill .25s ease, stroke .25s ease !important;
}

/* ============ accessibility & polish pass ============ */

/* per-chapter colour, readable as text: elements carry
   style="--wca:{accent};--wcl:{light-text};--wcd:{dark-text}" */
.wchip, .lnode .lx, .bridge-lab, .lesson-hero .icbig, .lnode .ic, .beat-cap .bn.wc { color: var(--wcl, inherit); }
[data-theme="dark"] .wchip, [data-theme="dark"] .lnode .lx, [data-theme="dark"] .bridge-lab,
[data-theme="dark"] .lesson-hero .icbig, [data-theme="dark"] .lnode .ic,
[data-theme="dark"] .chapter-band .cb-code, [data-theme="dark"] .chapter-band .cb-title,
[data-theme="dark"] .chapter-band .cb-read { color: var(--wcd, inherit); }

/* range sliders: ring the thumb, not the track */
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--plum-2); }
input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--plum-2); }

/* horizontal chains: edge fade signals off-screen blocks; gentle snap */
.xchain, .mchain { scroll-snap-type: x proximity; }
.xchain > *, .mchain > * { scroll-snap-align: start; }
.xchain, .mchain, .mstages {
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 34px), transparent);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 34px), transparent);
}

/* tx chips are real <button>s now */
button.txchip { font-family: var(--mono); text-align: left; width: 100%; color: var(--ink); }
.xblock[tabindex] { cursor: pointer; }

/* touch targets on coarse pointers */
@media (pointer: coarse) {
  .theme-toggle { width: 44px; height: 44px; }
  .lbtn { padding: 12px 15px; }
  .quiz-skip { padding: 10px 12px; }
  .nav .links a { padding: 11px 14px; }
}

/* map: resume block on top of the page */
.map-resume { max-width: 560px; margin: 18px auto 0; display: flex; align-items: center; gap: 14px; justify-content: center; flex-wrap: wrap; }
.map-resume .bar { flex: 1 1 180px; max-width: 260px; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; border: 1px solid var(--line); }
.map-resume .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--plum), var(--gold)); border-radius: 99px; }
.map-resume .mr-n { font-family: var(--mono); font-size: 13px; color: var(--ink-3); }

/* map footer: two-step restart, no native confirm() */
.restart-confirm { display: inline-flex; gap: 10px; align-items: center; }
.restart-confirm b { color: var(--red); font-weight: 600; }
.restart-confirm a { cursor: pointer; border-bottom: 1px solid var(--line-2); }

/* "start here" node: slow marigold ring so the entry point is findable */
@media (prefers-reduced-motion: no-preference) {
  .lnode.cur { animation: frkpulse 2.4s var(--ease) infinite; }
}

/* completion: one pulse on the nav progress bar */
.progmini .bar.pulse i { animation: progpulse .6s var(--ease); }
@keyframes progpulse { 40% { transform: scaleY(1.9); } 100% { transform: scaleY(1); } }

/* ============ the two paths: core, and optional ============ */

/* the banner an optional lesson or chapter opens with */
.opt-banner { display: flex; align-items: center; gap: 15px; max-width: var(--readw); margin: 0 auto 34px;
  padding: 15px 18px; border-radius: 15px;
  background: color-mix(in oklch, var(--wca, var(--gold)) 7%, var(--surface));
  border: 1px dashed color-mix(in oklch, var(--wca, var(--gold)) 40%, var(--line-2)); }
.opt-banner .ob-mark { font-size: 21px; line-height: 1; color: var(--wcl, var(--gold-text)); flex: 0 0 auto; }
[data-theme="dark"] .opt-banner .ob-mark { color: var(--wcd, var(--gold-text)); }
.opt-banner .ob-main { flex: 1; min-width: 0; }
.opt-banner .ob-t { font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--wcl, var(--gold-text)); }
[data-theme="dark"] .opt-banner .ob-t { color: var(--wcd, var(--gold-text)); }
.opt-banner .ob-d { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.5; }
.opt-banner .ob-skip { flex: 0 0 auto; font-size: 12.5px; padding: 9px 15px; white-space: nowrap; }
@media (max-width: 620px) {
  .opt-banner { flex-wrap: wrap; }
  .opt-banner .ob-skip { width: 100%; }
}

/* map: core / everything switch */
.path-switch { display: inline-flex; gap: 4px; margin: 22px auto 0; padding: 4px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.path-switch .ps-b { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--ink-3); background: transparent; border: 0; padding: 8px 15px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: background .18s, color .18s; }
.path-switch .ps-b:hover { color: var(--ink); }
.path-switch .ps-b.on { background: var(--surface); color: var(--plum); font-weight: 600; box-shadow: var(--sh-sm), var(--card-hl); }
.path-switch .ps-n { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.path-note { font-size: 13px; color: var(--ink-3); margin-top: 12px; }

/* an optional chapter reads as a side road: dashed band, softer weight */
.chapter-band.optional { border-style: dashed; }
.chapter-band .cb-opt { font-size: 10.5px; letter-spacing: .08em; opacity: .8; margin-left: 6px; }
.world-block.optional .nodes { opacity: .94; }

/* ============ curriculum: deep dives ============ */
.cg-meta { margin-top: 14px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); letter-spacing: .04em; }
.deep-chip { display: inline-block; font-size: 10.5px; font-weight: 600; font-family: var(--sans); color: var(--gold-text); background: var(--gold-tint); border: 1px solid var(--gold); border-radius: 99px; padding: 2px 9px; margin-left: 8px; vertical-align: 2px; }
.lnode.deep { border-style: dashed; }
.lnode.deep .lx { font-style: italic; }

/* ============ capstone: build your own coin ============ */
.fcard.locked .cxgrid .in, .fcard.locked input[type=range] { opacity: .55; }

.cxgrid { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.cxf { display: flex; align-items: center; gap: 9px; }
.cxf > span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.cxf .in { width: 150px; } .cxf .in.mono { width: 84px; }

.cxsupply { margin: 14px 0 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 8px 10px 4px; }
.cxsupply svg { width: 100%; height: 92px; display: block; }

/* wallet cards, shared by the payment and attack beats */
.cxw, .cxwallet { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.cxwallet { margin: 14px 0 0; }
.cxwc { display: grid; grid-template-columns: auto 1fr; grid-auto-rows: min-content; gap: 2px 10px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; transition: border-color .3s, box-shadow .3s; }
.cxwc.me { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-soft); }
.cxwc.watch { border-color: var(--plum); box-shadow: 0 0 0 1px color-mix(in oklch, var(--plum) 18%, transparent); }
.cxwi { grid-row: 1 / 3; font-family: var(--mono); font-size: 17px; color: var(--plum); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-3); }
.cxwn { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.cxwa { grid-column: 2; font-size: 10.5px; color: var(--ink-4); word-break: break-all; }
.cxwb { grid-column: 2; font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--green); }
.cxwb i { font-style: normal; font-size: 10px; color: var(--ink-4); }

.cxpay { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: center; }
.cxpay .in { padding: 9px 12px; }
.cxpay .note { font-size: 12px; }

.cxpool { margin-top: 14px; }
.cxpl { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin-bottom: 6px; }

/* one transaction row, in the mempool and inside an opened block */
.cxt { display: grid; grid-template-columns: auto 1fr auto auto; gap: 3px 12px; align-items: baseline; background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: 9px; padding: 8px 12px; margin-bottom: 6px; }
.cxt.cb { border-left-color: var(--green); background: var(--green-soft); }
.cxt.bad { border-left-color: var(--red); background: var(--red-soft); }
.cxt-k { font-family: var(--mono); font-size: 10.5px; color: var(--ink-4); }
.cxt-b { font-size: 13px; font-weight: 600; color: var(--ink); }
.cxt-a { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--ink); text-align: right; }
.cxt.cb .cxt-a { color: var(--green); }
.cxt-f { font-family: var(--mono); font-size: 10.5px; color: var(--ink-4); }
.cxt-s { grid-column: 1 / -1; font-size: 10.5px; color: var(--ink-3); }
.cxt.bad .cxt-s { color: var(--red); }
.cxin { width: 62px; background: var(--surface); border: 1px solid var(--gold); border-radius: 7px; color: var(--ink); font-size: 13px; font-weight: 700; padding: 3px 7px; text-align: right; }

/* the opened-block drawer */
.xblock .cxopen { margin-top: 9px; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); font-weight: 700; text-align: center; }
.xblock.sel { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft), 0 10px 28px rgba(241,162,34,.2); }
.xblock.sel .xtop { background: var(--gold); }
.xblock.sel .cxopen { color: var(--gold-text); }

.cxdrawer { display: none; }
.cxdrawer.on { display: block; margin-top: 16px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface-2); padding: 16px 18px 18px; animation: xin .4s cubic-bezier(.2,.85,.25,1); }
.cxdh { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.cxdn { font-family: var(--disp); font-size: 22px; font-weight: 600; color: var(--plum); }
.cxds { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.cxds.ok { background: var(--green-soft); color: var(--green); }
.cxds.bad { background: var(--red-soft); color: var(--red); }
.cxdl { font-size: 11.5px; color: var(--ink-3); margin: 14px 0 8px; line-height: 1.5; }
.cxdrawer .bfield .v { font-size: 11.5px; }
.cxdrawer .bfield .v .go { color: var(--gold-text); font-weight: 700; background: var(--gold-soft); border-radius: 4px; }

/* the race, two lanes of real blocks */
.cxrace { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.cxlane { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 9px 12px; }
.cxln { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; margin-bottom: 4px; }
.cxln.ok { color: var(--green); } .cxln.bad { color: var(--red); }
.cxlane .mchain { min-height: 44px; gap: 5px; }
.cxlane .mblk2.bad { border-color: var(--red); background: var(--red-soft); }
.cxodds { font-size: 13px; line-height: 1.55; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 10px 13px; margin: 12px 0; }

[data-theme="dark"] .cxin { background: var(--surface-3); }
[data-theme="dark"] .cxsupply { background: var(--surface-3); }

@media (max-width: 560px) {
  .cxt { grid-template-columns: 1fr auto; }
  .cxt-k, .cxt-f { grid-column: 1 / -1; }
  .cxpay { justify-content: flex-start; }
}

/* the capstone's slider labels are sentences, not words */
.fcard.cxc .srow { margin: 7px 0; }
.fcard.cxc .srow .nm { width: 200px; }
.fcard.cxc .srow .v { width: 84px; white-space: nowrap; }
@media (max-width: 560px) {
  .fcard.cxc .srow { flex-wrap: wrap; }
  .fcard.cxc .srow .nm { width: 100%; }
  .fcard.cxc .srow input[type=range] { flex: 1; }
}
/* a forged block can leave a wallet owing money. say so */
.cxwb.neg { color: var(--red); }
