/* AI Engineer Roadmap: design layer (loaded after theme.css on every page).
   Look: mernstackdev.com. Crisp white cards on a cool off-white in light mode, deep navy in dark mode, brand rose as the one accent,
   Bricolage Grotesque headings. Structure and behaviour stay in theme.css and the scripts; this file changes how things look. */

@property --v { syntax: "<number>"; inherits: false; initial-value: 0; }

/* ================================================================== tokens */
:root {
  --bg: #f5f6fa; --surface: #ffffff; --surface-2: #f1f3f8; --surface-3: #e6e9f2;
  --line: #e3e6ee; --line-strong: #cdd3e1; --text: #0d1124; --text-2: #2b3250; --muted: #5a6381;
  --accent: #c2364b; --accent-hover: #a82c40; --accent-ink: #ffffff; --accent-soft: #fdedf0; --accent-line: #f2bcc5; --focus: #c2364b;
  --good: #11692f; --good-soft: #e3f5ea; --stage-bg: #ffffff;
  --card-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 6px -2px rgba(16, 24, 40, .06);
  --card-shadow-hi: 0 2px 4px rgba(16, 24, 40, .04), 0 16px 32px -12px rgba(16, 24, 40, .16);
  --top-bg: rgba(255, 255, 255, .82); --side-bg: #ffffff; --glow-1: rgba(124, 92, 255, .10); --glow-2: rgba(194, 54, 75, .08);
  --grid-line: rgba(13, 17, 36, .045); --hero-bg: linear-gradient(180deg, #ffffff, #fbfbfe);
  --r-card: 18px; --r-ctl: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --bg: #0a0d19; --surface: #11162a; --surface-2: #171d35; --surface-3: #202848; --line: #232b47; --line-strong: #343f66;
    --text: #eef1fa; --text-2: #cfd5e8; --muted: #a2abc8; --accent: #ff6f86; --accent-hover: #ff93a6; --accent-ink: #1a0b10;
    --accent-soft: rgba(255, 111, 134, .13); --accent-line: rgba(255, 111, 134, .42); --focus: #ff93a6; --good: #4fd39a; --good-soft: rgba(79, 211, 154, .12); --stage-bg: #0a0e1c;
    --card-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px -14px rgba(0, 0, 0, .7); --card-shadow-hi: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 24px 48px -18px rgba(0, 0, 0, .8);
    --top-bg: rgba(10, 13, 25, .78); --side-bg: #0d1122; --glow-1: rgba(124, 92, 255, .20); --glow-2: rgba(255, 111, 134, .14);
    --grid-line: rgba(255, 255, 255, .04); --hero-bg: linear-gradient(180deg, #131932, #0f1428);
  }
}
:root[data-theme="dark"] {
  --bg: #0a0d19; --surface: #11162a; --surface-2: #171d35; --surface-3: #202848; --line: #232b47; --line-strong: #343f66;
  --text: #eef1fa; --text-2: #cfd5e8; --muted: #a2abc8; --accent: #ff6f86; --accent-hover: #ff93a6; --accent-ink: #1a0b10;
  --accent-soft: rgba(255, 111, 134, .13); --accent-line: rgba(255, 111, 134, .42); --focus: #ff93a6; --good: #4fd39a; --good-soft: rgba(79, 211, 154, .12); --stage-bg: #0a0e1c;
  --card-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px -14px rgba(0, 0, 0, .7); --card-shadow-hi: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 24px 48px -18px rgba(0, 0, 0, .8);
  --top-bg: rgba(10, 13, 25, .78); --side-bg: #0d1122; --glow-1: rgba(124, 92, 255, .20); --glow-2: rgba(255, 111, 134, .14);
  --grid-line: rgba(255, 255, 255, .04); --hero-bg: linear-gradient(180deg, #131932, #0f1428);
}

/* ================================================================== base */
html { scroll-padding-top: 80px; }
body { background: var(--bg); font-size: 15.5px; }
body::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 520px; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 70% at 70% 0%, var(--glow-1), transparent 70%), radial-gradient(40% 60% at 20% 0%, var(--glow-2), transparent 70%); }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); }
h1 { font-weight: 800; letter-spacing: -.035em; } h2 { font-weight: 750; letter-spacing: -.025em; } h3 { font-weight: 700; letter-spacing: -.015em; }
::selection { background: var(--accent-soft); }
a { text-underline-offset: 3px; }

/* ================================================================== controls */
.btn { border-radius: var(--r-ctl); min-height: 42px; padding: 0 18px; font-weight: 650; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--card-shadow);
  transition: transform .18s var(--ease), box-shadow .18s, background .18s, border-color .18s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--text-2); box-shadow: var(--card-shadow-hi); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 8px 20px -10px var(--accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.small { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; }
.chip { border-radius: 999px; font-weight: 650; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.chip.accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.chip.good { background: var(--good-soft); color: var(--good); }
kbd { border-radius: 6px; font-family: var(--mono); font-size: 11px; background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; color: var(--muted); }
input[type="search"], .browse-bar input, .pal-in input, select { border-radius: var(--r-ctl) !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ================================================================== top bar */
.topbar { min-height: 60px; padding: 0 20px; gap: 14px; background: var(--top-bg); -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%); border-bottom: 1px solid var(--line); }
.brand { font: 750 1.02rem/1 var(--font-display); letter-spacing: -.02em; gap: 10px; }
.brand .logo { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(140deg, #ff6f86, #c2364b 55%, #7c5cff); color: #fff; font: 800 12px/1 var(--font-display); box-shadow: 0 6px 14px -6px rgba(194, 54, 75, .7); }
.topnav { gap: 2px; padding: 3px; margin-left: 8px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.topnav a { min-height: 32px; padding: 0 12px; border-radius: 9px; font-size: 13.5px; font-weight: 650; color: var(--muted); }
.topnav a:hover { color: var(--text); background: transparent; }
.topnav a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 0 0 1px var(--line); }
.parent-link, .parent-pill { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted) !important; font-size: 12.5px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.parent-link:hover, .parent-pill:hover { color: var(--accent) !important; border-color: var(--accent-line); }
.searchbox input { min-height: 36px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; }
.searchbox input:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); outline: none; }
#palette-btn kbd { display: none; }
.icon-btn { min-width: 36px; min-height: 36px; border-radius: 10px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ================================================================== sidebar */
.layout { grid-template-columns: 304px minmax(0, 1fr); }
.sidebar { top: 60px; height: calc(100vh - 60px); padding: 14px 12px 32px; background: var(--side-bg); border-right: 1px solid var(--line); scrollbar-width: thin; }
.nav-filters { gap: 6px; margin-bottom: 10px; }
.nav-filters select, .nav-filters .chip { min-height: 32px; font-size: 12.5px; }
.nav-phase { margin-bottom: 2px; }
.nav-phase > button { min-height: 40px; padding: 0 10px; border-radius: 10px; gap: 10px; }
.nav-phase > button .t { font: 650 13px/1.25 var(--font-display); letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-phase > button .n { font-size: 11.5px; font-variant-numeric: tabular-nums; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); }
.nav-phase > button[aria-expanded="true"] { background: var(--surface-2); }
.phase-dot { width: 9px; height: 9px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc, var(--muted)) 22%, transparent); }
.nav-list { margin: 4px 0 10px 14px; padding-left: 10px; border-left: 1.5px solid var(--line); }
.nav-list a { min-height: 32px; padding: 5px 10px; border-radius: 8px; font-size: 13.5px; color: var(--text-2); }
.nav-list a:hover { background: var(--surface-2); color: var(--text); }
.nav-list a[aria-current="page"] { background: color-mix(in srgb, var(--pc, var(--accent)) 12%, var(--surface)); color: var(--text); font-weight: 650; box-shadow: inset 2px 0 0 var(--pc, var(--accent)); }
.nav-list a .m { font-size: 11.5px; }
.nav-list .tick { color: var(--good); } .nav-list .star { color: #e3a008; }
.nav-list a .has-lab { color: var(--muted); }

/* ================================================================== cards */
.card, .hero-art, .dash, .rcard, .bcard, .stage-card, .step-panel, .toc, .related, .answer-first, .pal-card, .browse-bar {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--card-shadow); -webkit-backdrop-filter: none; backdrop-filter: none; }
a.card, .lab-card, .phase-card, .bcard { transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s; }
a.card:hover, .lab-card:hover, .phase-card:hover, .bcard:hover { transform: translateY(-3px); box-shadow: var(--card-shadow-hi); border-color: color-mix(in srgb, var(--pc, var(--accent)) 45%, var(--line)); }
.section-head { margin-top: 48px; align-items: flex-end; }
.section-head h2 { font-size: clamp(1.3rem, .8vw + 1.1rem, 1.7rem); }
.section-head p { color: var(--muted); }
main, .wrap { max-width: 1200px; }

/* ================================================================== home: hero */
.hero { position: relative; padding: clamp(28px, 4vw, 52px); margin-top: 8px; border-radius: 24px; border: 1px solid var(--line); background: var(--hero-bg); box-shadow: var(--card-shadow); overflow: hidden; isolation: isolate; gap: 36px; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 1;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(70% 90% at 30% 0%, #000, transparent 75%); mask-image: radial-gradient(70% 90% at 30% 0%, #000, transparent 75%); }
.hero::after { content: ""; position: absolute; right: -10%; top: -40%; width: 60%; height: 140%; z-index: -1; background: radial-gradient(closest-side, var(--glow-1), transparent); }
.hero h1 { font-size: clamp(2.4rem, 3.4vw + 1rem, 4.1rem); line-height: 1; letter-spacing: -.045em; margin: 14px 0 16px; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent); background: none; -webkit-text-fill-color: currentColor; position: relative; white-space: nowrap; }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: .02em; height: .12em; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #7c5cff); opacity: .35; }
.hero p.lead { color: var(--muted); font-size: 1.12rem; line-height: 1.6; max-width: 38em; }
.hero .cta { gap: 10px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); box-shadow: var(--card-shadow); font-size: 12px; letter-spacing: .02em; text-transform: none; }
.eyebrow .ic { color: var(--accent); }
.hero .note { color: var(--muted); }
.hero-art { padding: 22px; border-radius: 20px; box-shadow: var(--card-shadow-hi); }
.hero-art .mini-title { color: var(--text); }

/* ================================================================== home: progress dashboard */
.dash { margin-top: 18px; padding: 24px; }
.dash-top h2 { font-size: 1.35rem; }
.dash-stats { gap: 12px; }
.dash-stats div { position: relative; padding: 16px 16px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.dash-stats div::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tone, var(--accent)); }
.dash-stats div:nth-child(1) { --tone: #c2364b; } .dash-stats div:nth-child(2) { --tone: #7c5cff; } .dash-stats div:nth-child(3) { --tone: #0e9aa7; } .dash-stats div:nth-child(4) { --tone: #d97706; } .dash-stats div:nth-child(5) { --tone: #15803d; }
.dash-stats b { font: 800 1.6rem/1.1 var(--font-display); letter-spacing: -.03em; color: var(--text); }
.dash-stats span { color: var(--muted); font-weight: 600; }
.ring.big { --pc: var(--accent); }
.dash-lists h3 { font-size: 1rem; }

/* ================================================================== home: labs and phases */
.grid-labs { gap: 14px; }
.lab-card { padding: 20px; }
.lab-card .art { border-radius: 14px; background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, #7c5cff 10%, var(--surface))); color: var(--accent); border: 1px solid var(--line); }
.lab-card p { color: var(--muted); }
.grid-phases { gap: 14px; }
.phase-card { padding: 22px 22px 18px; overflow: hidden; }
.phase-card::before { width: 100%; height: 3px; inset: 0 0 auto 0; background: linear-gradient(90deg, var(--pc), transparent); }
.phase-card .ph { color: var(--muted); }
.phase-card h3 { font-size: 1.2rem; }
.levelbar { height: 5px; }

/* ================================================================== syllabus map */
.smap-block .section-head { margin-top: 48px; }
.smap { padding: 18px 20px; }
.smap-row { grid-template-columns: 230px minmax(0, 1fr); padding: 10px 6px; }
.smap-label { font-size: 13.5px; }
.scell { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid color-mix(in srgb, var(--pc) 50%, var(--line)); background: color-mix(in srgb, var(--pc) 7%, var(--surface)); }
.scell:hover, .scell:focus-visible { background: color-mix(in srgb, var(--pc) 30%, var(--surface)); }
.scell.is-done { background: var(--pc); border-color: var(--pc); }

/* ================================================================== roadmap page */
.road-intro { position: relative; padding: clamp(28px, 4vw, 48px); border-radius: 24px; border: 1px solid var(--line); background: var(--hero-bg); box-shadow: var(--card-shadow); overflow: hidden; isolation: isolate; }
.road-intro::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 32px 32px; -webkit-mask-image: radial-gradient(80% 100% at 20% 0%, #000, transparent 75%); mask-image: radial-gradient(80% 100% at 20% 0%, #000, transparent 75%); }
.road-intro h1 { font-size: clamp(2.1rem, 2.8vw + 1rem, 3.4rem); line-height: 1.04; letter-spacing: -.04em; max-width: 18ch; text-wrap: balance; }
.road-intro .lead { color: var(--muted); font-size: 1.08rem; max-width: 46em; }
.road-stats { gap: 12px; }
.road-stats div { padding: 14px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-shadow); min-width: 120px; }
.road-stats b { font: 800 1.7rem/1.1 var(--font-display); letter-spacing: -.03em; color: var(--accent); }
.road-steps { gap: 12px; }
.road-steps li { padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-shadow); }
.road-steps .num { background: var(--accent); color: var(--accent-ink); border: 0; box-shadow: 0 6px 14px -6px var(--accent); font-family: var(--font-display); }
.road-steps p { color: var(--muted); }
.timeline::before { width: 2px; background: linear-gradient(180deg, var(--accent), #7c5cff 40%, #0e9aa7 75%, transparent); opacity: .55; }
.tl .node { width: 40px; height: 40px; border-radius: 12px; background: var(--surface); border: 2px solid var(--pc, var(--accent)); color: var(--text); font: 800 15px/1 var(--font-display); box-shadow: 0 0 0 5px var(--bg), 0 8px 18px -8px var(--pc, var(--accent)); }
.rcard { padding: 24px; position: relative; overflow: hidden; }
.rcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--pc, var(--accent)), transparent 80%); }
.rcard .ph { color: var(--pc, var(--accent)); font-weight: 800; letter-spacing: .08em; }
.rcard h3 { font-size: 1.45rem; letter-spacing: -.025em; }
.rcard .tagline { color: var(--text-2); font-weight: 600; }
.rcard .why, .rcard .meta, .rcard .needs { color: var(--muted); }
.rcard h4 { font: 800 11px/1 var(--font); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.ticks li::before { color: var(--good); }
.rcard a.chip { background: var(--surface-2); }
.rcard a.chip:hover { border-color: var(--pc, var(--accent)); color: var(--text); }

/* ================================================================== topics (browse) page */
.browse-head h1 { font-size: clamp(2rem, 2vw + 1rem, 2.8rem); letter-spacing: -.035em; }
.browse-bar { padding: 16px; }
.browse-bar input[type="search"] { min-height: 46px; font-size: 15px; background: var(--surface-2); border: 1px solid var(--line); }
.seg.wrap { gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.seg.wrap button { border-radius: 9px; font-weight: 650; font-size: 13px; }
.seg.wrap button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .1), 0 0 0 1px var(--line); }
.chip.tg[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.bsec h2 { font-size: 1.25rem; }
.bgrid { gap: 12px; }
.bcard { padding: 16px 18px; position: relative; overflow: hidden; }
.bcard::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--pc, var(--accent)); }
.bcard .bt { font: 700 1rem/1.3 var(--font-display); }
.bcard .bs { color: var(--muted); }
.bcard.is-done { background: color-mix(in srgb, var(--good) 5%, var(--surface)); }

/* ================================================================== interactive lesson */
.crumbs { color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--accent); }
.lesson-head h1 { font-size: clamp(2rem, 2.4vw + 1rem, 3rem); line-height: 1.05; letter-spacing: -.04em; }
.lesson-head .sub { color: var(--muted); font-size: 1.1rem; }
.oneliner { border-radius: 14px; border: 1px solid var(--accent-line); background: var(--accent-soft); }
.stage-card { padding: 14px; }
.stage { border-radius: 14px; background: var(--stage-bg); border: 1px solid var(--line); }
.step-panel { padding: 22px; }
.step-panel .k { color: var(--accent); font-weight: 800; letter-spacing: .08em; }
.steps button { border-radius: 12px; }
.steps button .n { font-family: var(--font-display); }
.steps button[aria-current="step"] { background: var(--accent-soft); color: var(--text); }
.steps button[aria-current="step"] .n { background: var(--accent); color: var(--accent-ink); }
.steps button.done .n { background: var(--good); color: #fff; }
.transport .play { box-shadow: 0 8px 18px -8px var(--accent); }
.lesson-nav a { border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-shadow); transition: transform .2s var(--ease), box-shadow .2s; }
.lesson-nav a:hover { transform: translateY(-2px); box-shadow: var(--card-shadow-hi); }
.lab { border-radius: var(--r-card); }

/* ================================================================== static pages: articles, phase pages, glossary */
.page-col { min-width: 0; }
.page-col > main.article { max-width: 780px; margin-inline: auto; padding: clamp(24px, 3vw, 44px) clamp(18px, 3vw, 40px) 48px; }
.article h1 { font-size: clamp(2.1rem, 2.6vw + 1rem, 3.2rem); line-height: 1.04; letter-spacing: -.04em; margin: 8px 0 10px; text-wrap: balance; }
.article h2 { font-size: clamp(1.4rem, .8vw + 1.15rem, 1.8rem); margin-top: 2.2em; }
.article h3 { font-size: 1.2rem; }
.article p, .article li { font-size: 17px; line-height: 1.75; color: var(--text-2); }
.article strong { color: var(--text); }
.article li::marker { color: var(--accent); }
.article a { color: var(--accent); }
.article blockquote.meta { display: none; }                      /* the same level, time and phase are shown under the title */
.article blockquote { border-left-color: var(--accent); background: var(--surface-2); border-radius: 0 12px 12px 0; }
.article pre { border-radius: 14px; border: 1px solid var(--line); background: #0d1124; color: #e8ecf8; }
.article code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; }
.article pre code { background: none; border: 0; }
.article figure { border-radius: 16px; border: 1px solid var(--line); background: var(--stage-bg); box-shadow: var(--card-shadow); }
.meta-line { color: var(--muted); font-size: 14px; }
.answer-first { padding: 16px 20px; margin: 18px 0; border-color: var(--accent-line); background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); }
.answer-first p { margin: 0; color: var(--text); }
.cta { gap: 10px; margin: 20px 0; }
.cta a { border-radius: var(--r-ctl); min-height: 44px; padding: 0 18px; font-weight: 650; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--card-shadow); text-decoration: none; transition: transform .18s var(--ease), box-shadow .18s; }
.cta a:hover { transform: translateY(-1px); box-shadow: var(--card-shadow-hi); }
.cta a.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -10px var(--accent); }
.toc { padding: 14px 18px; }
.related { padding: 18px 20px; margin-top: 40px; }
.pager a { border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-shadow); transition: transform .2s var(--ease), border-color .2s; }
.pager a:hover { transform: translateY(-2px); border-color: var(--accent); }
.glossary dt, .glossary h3 { font-family: var(--font-display); }
.lesson-list li { border-radius: 12px; }
.article-foot { max-width: 780px; margin-inline: auto; padding: 24px clamp(18px, 3vw, 40px) 56px; color: var(--muted); border-top: 1px solid var(--line); }
.art-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.art-actions .btn[aria-pressed="true"][data-chrome="done"] { background: var(--good-soft); border-color: var(--good); color: var(--good); box-shadow: none; }
.art-actions .btn[aria-pressed="true"][data-chrome="mark"] { border-color: #e3a008; }
.read-progress, .readbar { position: fixed; top: 60px; left: 0; right: 0; height: 2px; z-index: 31; pointer-events: none; }
.read-progress span { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), #7c5cff); }

/* ================================================================== quiz */
.quiz-head h1 { font-size: clamp(2rem, 2vw + 1rem, 2.8rem); letter-spacing: -.035em; }
.tabs { padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.tabs button, .tabs a { border-radius: 10px; font-weight: 650; }
.tabs [aria-selected="true"], .tabs [aria-current="page"], .tabs [aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .1), 0 0 0 1px var(--line); }
.filters .fchip { border-radius: 999px; }
.filters .fchip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ================================================================== palette, toasts */
.palette .pal-card { border-radius: 20px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); }
.palette li[aria-selected="true"] { background: var(--accent-soft); }
.toast { border-radius: 999px; }

/* ================================================================== syllabus map tooltip */
.stip { position: fixed; z-index: 90; max-width: 290px; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); box-shadow: var(--card-shadow-hi); font-size: 13px; line-height: 1.4; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.stip.on { opacity: 1; transform: none; } .stip b { display: block; font: 700 .95rem/1.25 var(--font-display); margin-bottom: 3px; } .stip span { color: var(--muted); }
.smap { display: grid; gap: 2px; } .smap-row { display: grid; gap: 16px; align-items: start; border-radius: 12px; }
.smap-row + .smap-row { border-top: 1px dashed var(--line); } .smap-row:hover { background: color-mix(in srgb, var(--pc) 5%, transparent); }
.smap-label { display: flex; align-items: center; gap: 10px; min-height: 28px; font-family: var(--font-display); font-weight: 650; line-height: 1.25; }
.smap-label .t { flex: 1; min-width: 0; } .smap-label .n { font: 700 11.5px/1 var(--font); color: var(--muted); font-variant-numeric: tabular-nums; }
.smap-cells { display: flex; flex-wrap: wrap; gap: 6px; }
.scell { position: relative; display: block; transition: transform .18s var(--ease), background .18s, box-shadow .18s; }
.js .smap .scell { animation: cellIn .5s var(--ease) both; animation-delay: calc(var(--i) * 6ms); }
.scell:hover, .scell:focus-visible { transform: translateY(-3px) scale(1.12); box-shadow: 0 6px 14px -6px var(--pc); z-index: 2; }
.scell.is-done::after { content: ""; position: absolute; inset: 0; background: center / 14px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.scell.is-marked::before { content: ""; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: #e3a008; border: 2px solid var(--surface); }
.smap-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 14px; margin: 0; padding: 0; font-size: 12px; font-weight: 650; color: var(--muted); }
.smap-legend li { display: inline-flex; align-items: center; gap: 7px; }
.smap-legend .scell { --pc: var(--accent); display: inline-block; width: 15px; height: 15px; border-radius: 5px; animation: none !important; pointer-events: none; }
.smap-legend .scell.is-done::after { background-size: 9px; }
@keyframes cellIn { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }

/* ================================================================== motion */
.js .wrap > *, .js main.article > * { animation: rise .5s var(--ease) both; }
.js .wrap > *:nth-child(2), .js main.article > *:nth-child(2) { animation-delay: 50ms; }
.js .wrap > *:nth-child(3), .js main.article > *:nth-child(3) { animation-delay: 100ms; }
.js .wrap > *:nth-child(n+4), .js main.article > *:nth-child(n+4) { animation-delay: 150ms; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
.pop { animation: pop .4s var(--ease); }

/* ================================================================== small screens */
@media (max-width: 1100px) { .topnav a { padding: 0 9px; } .searchbox { width: min(240px, 26vw); } }
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { top: 0; height: 100%; background: var(--surface); box-shadow: var(--card-shadow-hi); }
  body.nav-open .scrim { background: rgba(5, 8, 20, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  .smap-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hero { padding: 24px; }
  .read-progress, .readbar { top: 56px; }
}
@media (max-width: 560px) { .topbar a.icon-btn[href*="github.com"], .parent-pill, .parent-link { display: none; } .scell { width: 28px; height: 28px; } .dash { padding: 16px; } }
@media (hover: none) { .scell:hover { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .js .smap .scell, .js .wrap > *, .js main.article > * { animation: none !important; }
  .btn:hover:not(:disabled), a.card:hover, .lab-card:hover, .phase-card:hover, .bcard:hover, .pager a:hover, .cta a:hover, .scell:hover, .lesson-nav a:hover { transform: none; }
}
@media print { body::before, .read-progress, .art-actions { display: none !important; } }
