/* ==========================================================================
   Techbase Academy — design system + shared components
   Edit the tokens in :root (and the dark-mode block) to re-theme the site.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Type */
  --font-display: "Bricolage Grotesque", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: .78rem;
  --fs-sm: .9rem;
  --fs-md: 1rem;
  --fs-lg: clamp(1.08rem, 1rem + .35vw, 1.22rem);
  --fs-xl: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  --fs-2xl: clamp(1.85rem, 1.3rem + 2.2vw, 2.9rem);
  --fs-3xl: clamp(2.3rem, 1.4rem + 3.8vw, 4.1rem);
  --fs-hero: clamp(2.7rem, 1.2rem + 6.6vw, 5.9rem);

  /* Spacing (4px base) */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4.5rem; --s-9: 7rem;

  /* Shape */
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 26px; --r-pill: 999px;
  --w-page: 1180px; --w-read: 46rem;

  /* Motion */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur-1: 140ms; --dur-2: 240ms; --dur-3: 520ms;

  /* Layers */
  --z-nav: 50; --z-modal: 100; --z-toast: 120;

  /* Brand */
  --brand: #2457e6;          /* Techbase blue (from the logo gear) */
  --brand-strong: #1a43c0;
  --brand-ink: #1d4ed8;      /* brand colour used for text on light surfaces */
  --accent: #f5a524;         /* spark amber */

  /* Light theme neutrals */
  --bg: #fafaf8;
  --bg-soft: #f2f3f0;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --ink: #0e1525;
  --ink-2: #384358;
  --muted: #5a6578;
  --line: #e4e7ec;
  --line-strong: #cfd5df;
  --glow: rgba(36, 87, 230, .16);
  --shadow-sm: 0 1px 2px rgba(14, 21, 37, .06);
  --shadow-md: 0 10px 30px -12px rgba(14, 21, 37, .18), 0 2px 6px rgba(14, 21, 37, .05);
  --shadow-lg: 0 30px 60px -24px rgba(14, 21, 37, .28);

  /* Semantic */
  --success: #0f8a5f; --warning: #b45309; --error: #c62828; --info: #1d4ed8;

  /* Code */
  --code-bg: #0c1322; --code-bar: #121b2e; --code-ink: #dbe4f3; --code-line: #1f2b45;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --brand: #5b86ff; --brand-strong: #7f9fff; --brand-ink: #8fadff;
  --bg: #0a0e17; --bg-soft: #0e1420; --surface: #111826; --surface-2: #151e2f;
  --ink: #eef1f6; --ink-2: #c5cddb; --muted: #97a3b8;
  --line: #202a3b; --line-strong: #2c384d;
  --glow: rgba(91, 134, 255, .22);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 14px 34px -14px rgba(0, 0, 0, .65), 0 2px 6px rgba(0, 0, 0, .35);
  --shadow-lg: 0 34px 70px -26px rgba(0, 0, 0, .75);
  --success: #3ddc97; --warning: #fbbf24; --error: #ff8a80; --info: #8fadff;
  --code-bg: #080d18; --code-bar: #0e1627;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #5b86ff; --brand-strong: #7f9fff; --brand-ink: #8fadff;
    --bg: #0a0e17; --bg-soft: #0e1420; --surface: #111826; --surface-2: #151e2f;
    --ink: #eef1f6; --ink-2: #c5cddb; --muted: #97a3b8;
    --line: #202a3b; --line-strong: #2c384d;
    --glow: rgba(91, 134, 255, .22);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-md: 0 14px 34px -14px rgba(0, 0, 0, .65), 0 2px 6px rgba(0, 0, 0, .35);
    --shadow-lg: 0 34px 70px -26px rgba(0, 0, 0, .75);
    --success: #3ddc97; --warning: #fbbf24; --error: #ff8a80; --info: #8fadff;
    --code-bg: #080d18; --code-bar: #0e1627;
    color-scheme: dark;
  }
}

/* Course identities: --c is the fill/graphic colour, --c-ink is the text-safe colour. */
.c-html      { --c: #e34f26; --c-ink: #b93a17; }
.c-css       { --c: #0284c7; --c-ink: #0369a1; }
.c-js        { --c: #d97706; --c-ink: #9a5604; }
.c-python    { --c: #059669; --c-ink: #047857; }
.c-scratch   { --c: #ea580c; --c-ink: #bf4309; }
.c-microbit  { --c: #7c3aed; --c-ink: #6d28d9; }
.c-practical { --c: #e11d48; --c-ink: #be123c; }
.c-android   { --c: #3ddc84; --c-ink: #1b7f46; }
:root[data-theme="dark"] .c-html      { --c-ink: #ff8f6b; }
:root[data-theme="dark"] .c-css       { --c-ink: #4cc2ff; }
:root[data-theme="dark"] .c-js        { --c-ink: #fbbf24; }
:root[data-theme="dark"] .c-python    { --c-ink: #3ddc97; }
:root[data-theme="dark"] .c-scratch   { --c-ink: #ff9a57; }
:root[data-theme="dark"] .c-microbit  { --c-ink: #b79bff; }
:root[data-theme="dark"] .c-practical { --c-ink: #ff7d98; }
:root[data-theme="dark"] .c-android   { --c-ink: #6ee7a0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .c-html      { --c-ink: #ff8f6b; }
  :root:not([data-theme="light"]) .c-css       { --c-ink: #4cc2ff; }
  :root:not([data-theme="light"]) .c-js        { --c-ink: #fbbf24; }
  :root:not([data-theme="light"]) .c-python    { --c-ink: #3ddc97; }
  :root:not([data-theme="light"]) .c-scratch   { --c-ink: #ff9a57; }
  :root:not([data-theme="light"]) .c-microbit  { --c-ink: #b79bff; }
  :root:not([data-theme="light"]) .c-practical { --c-ink: #ff7d98; }
  :root:not([data-theme="light"]) .c-android   { --c-ink: #6ee7a0; }
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 400 var(--fs-md)/1.65 var(--font-body); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video, canvas { max-width: 100%; display: block; }
a { color: var(--brand-ink); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; letter-spacing: -.025em; margin: 0; font-weight: 700; text-wrap: balance; }
p { margin: 0; }
code, kbd, pre { font-family: var(--font-mono); }
::selection { background: color-mix(in srgb, var(--brand) 30%, transparent); color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-6) 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: var(--s-4); top: -4rem; z-index: 200; background: var(--ink); color: var(--bg); padding: .7rem 1rem; border-radius: var(--r-md); transition: top var(--dur-2) var(--ease); }
.skip-link:focus { top: var(--s-4); }
.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Styled scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

.wrap { width: min(100% - 2.5rem, var(--w-page)); margin-inline: auto; }
.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.eyebrow { display: inline-flex; align-items: center; gap: .55rem; font: 600 var(--fs-xs)/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink); }
.eyebrow::before { content: ""; width: 1.4rem; height: 2px; background: currentColor; border-radius: 2px; }
.lede { font-size: var(--fs-lg); color: var(--ink-2); max-width: 38rem; }
.h-section { font-size: var(--fs-2xl); margin-top: var(--s-3); }
.muted { color: var(--muted); }

/* ---------- 3. Buttons ---------- */
.btn {
  --_bg: var(--brand); --_ink: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 46px; padding: .7rem 1.25rem; border-radius: var(--r-pill);
  border: 1px solid transparent; background: var(--_bg); color: var(--_ink);
  font: 600 var(--fs-sm)/1 var(--font-body); text-decoration: none; cursor: pointer;
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--_bg) 70%, transparent), inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), background var(--dur-1), border-color var(--dur-1);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -10px color-mix(in srgb, var(--_bg) 80%, transparent), inset 0 1px 0 rgba(255,255,255,.2); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn .icon { transition: transform var(--dur-2) var(--ease); }
.btn:hover .icon-arrow { transform: translateX(3px); }
.btn--ghost { --_bg: transparent; --_ink: var(--ink); border-color: var(--line-strong); box-shadow: none; }
.btn--ghost:hover { background: var(--surface); border-color: var(--ink-2); box-shadow: var(--shadow-sm); }
.btn--course { --_bg: var(--c); }
.btn--lg { min-height: 54px; padding-inline: 1.6rem; font-size: var(--fs-md); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
:root[data-theme="dark"] .btn--course { --_ink: #0a0e17; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  transition: background var(--dur-1), border-color var(--dur-1), transform var(--dur-2) var(--ease);
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }

/* ---------- 4. Top navigation ---------- */
.topbar { position: sticky; top: 0; z-index: var(--z-nav); transition: background var(--dur-2), border-color var(--dur-2), backdrop-filter var(--dur-2); border-bottom: 1px solid transparent; }
.topbar.is-scrolled { background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom-color: var(--line); }
.topbar-in { display: flex; align-items: center; gap: var(--s-4); height: 72px; transition: height var(--dur-2) var(--ease); }
.topbar.is-scrolled .topbar-in { height: 60px; }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); font: 700 1.2rem/1 var(--font-display); letter-spacing: -.03em; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand b { color: var(--brand-ink); font-weight: 700; }
.brand small { font: 500 .7rem/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-left: .15rem; }
.nav-links { display: flex; align-items: center; gap: .25rem; margin: 0 0 0 auto; padding: 0; list-style: none; }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .9rem; border-radius: var(--r-pill); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; position: relative; transition: color var(--dur-1), background var(--dur-1); }
.nav-links a:hover { color: var(--ink); background: var(--bg-soft); }
.nav-links a[aria-current] { color: var(--ink); }
.nav-links a[aria-current]::after { content: ""; position: absolute; left: .9rem; right: .9rem; bottom: 6px; height: 2px; border-radius: 2px; background: var(--brand); }
.nav-tools { display: flex; align-items: center; gap: .5rem; }
.search-btn { display: inline-flex; align-items: center; gap: .6rem; height: 44px; padding: 0 .9rem 0 1rem; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--muted); font: 500 var(--fs-sm)/1 var(--font-body); cursor: pointer; transition: border-color var(--dur-1), box-shadow var(--dur-1); }
.search-btn:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); color: var(--ink-2); }
.kbd { font: 500 .7rem/1 var(--font-mono); padding: .25rem .4rem; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; color: var(--muted); background: var(--surface-2); }
.theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: block; }
}
.menu-btn { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: inline-grid; }
  .search-btn span, .search-btn .kbd { display: none; }
  .search-btn { width: 44px; padding: 0; justify-content: center; }
  .nav-links { position: absolute; inset: 100% 0 auto 0; flex-direction: column; align-items: stretch; margin: 0; padding: .75rem 1.25rem 1.25rem; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md); display: none; }
  .nav-links.is-open { display: flex; }
  .nav-links a { min-height: 48px; font-size: var(--fs-md); }
  .nav-links a[aria-current]::after { display: none; }
  .nav-tools { margin-left: auto; }
  .brand small { display: none; }
}
@media (min-width: 861px) { .nav-tools { margin-left: .5rem; } }

/* ---------- 5. Hero (hub + course) ---------- */
.hero { position: relative; isolation: isolate; padding-block: clamp(3rem, 8vw, 6.5rem) clamp(3rem, 6vw, 5rem); overflow: clip; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto -10%; height: 90%; z-index: -2;
  background: radial-gradient(60% 60% at 18% 20%, var(--glow), transparent 70%), radial-gradient(40% 50% at 85% 10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px; -webkit-mask-image: radial-gradient(70% 70% at 50% 0%, #000, transparent 75%); mask-image: radial-gradient(70% 70% at 50% 0%, #000, transparent 75%); }
.hero-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; }
.hero h1 { font-size: var(--fs-hero); letter-spacing: -.045em; line-height: .98; margin-top: var(--s-4); }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, var(--brand) 10%, color-mix(in srgb, var(--brand) 40%, var(--accent)) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: var(--fs-lg); color: var(--ink-2); max-width: 36rem; margin-top: var(--s-5); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: var(--s-6); }
.stats { display: flex; flex-wrap: wrap; gap: var(--s-5) var(--s-7); margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.stat b { display: block; font: 700 var(--fs-2xl)/1 var(--font-display); letter-spacing: -.04em; }
.stat span { font-size: var(--fs-sm); color: var(--muted); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

/* Curriculum card (hub hero) */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.panel-bar { display: flex; align-items: center; gap: .45rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--surface-2); font: 500 var(--fs-xs)/1 var(--font-mono); color: var(--muted); }
.panel-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.panel-bar span { margin-left: .6rem; }
.curriculum { list-style: none; margin: 0; padding: .5rem; }
.curriculum a { display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: center; gap: .85rem; padding: .7rem .75rem; border-radius: var(--r-md); text-decoration: none; color: var(--ink); transition: background var(--dur-1), transform var(--dur-2) var(--ease); }
.curriculum a:hover { background: var(--bg-soft); transform: translateX(3px); text-decoration: none; }
.tile { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 12px; color: var(--c-ink); background: color-mix(in srgb, var(--c) 14%, transparent); }
.tile .icon { width: 1.2rem; height: 1.2rem; }
.curriculum b { display: block; font: 600 var(--fs-sm)/1.2 var(--font-body); }
.curriculum small { color: var(--muted); font-size: var(--fs-xs); }
.curriculum em { font: 500 var(--fs-xs)/1 var(--font-mono); font-style: normal; color: var(--c-ink); }

/* ---------- 6. Marquee ---------- */
.marquee { border-block: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.marquee-track { display: flex; width: max-content; gap: 2.75rem; padding-block: 1.05rem; animation: marquee 48s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { white-space: nowrap; font: 500 var(--fs-sm)/1 var(--font-mono); color: var(--muted); }
.marquee-track em { font-style: normal; color: var(--ink); font-weight: 600; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- 7. Course cards (hub bento) ---------- */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; margin-top: var(--s-7); }
.card { position: relative; display: flex; flex-direction: column; gap: var(--s-4); padding: clamp(1.25rem, 2.4vw, 1.75rem); border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; overflow: hidden; isolation: isolate;
  transition: transform var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease), border-color var(--dur-2); }
.card::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity var(--dur-3) var(--ease);
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--c) 18%, transparent), transparent 60%); }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md), 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); text-decoration: none; }
.card:hover::before { opacity: 1; }
.card h3 { font-size: var(--fs-xl); letter-spacing: -.03em; }
.card p { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.6; }
.card .tile { width: 3rem; height: 3rem; border-radius: 14px; }
.card .tile .icon { width: 1.5rem; height: 1.5rem; }
.card-meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: var(--s-3); font-size: var(--fs-xs); font-weight: 600; color: var(--c-ink); }
.card-meta .go { display: inline-flex; align-items: center; gap: .35rem; }
.card:hover .icon-arrow { transform: translateX(4px); }
.card .icon-arrow { transition: transform var(--dur-2) var(--ease); }
.bar { height: 6px; border-radius: 6px; background: var(--bg-soft); overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; width: 0; background: var(--c, var(--brand)); border-radius: 6px; transition: width var(--dur-3) var(--ease); }
.card .bar, .progress-line { opacity: 0; transition: opacity var(--dur-2); }
.has-progress .bar, .has-progress.progress-line { opacity: 1; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
@media (max-width: 900px) { .span-2, .span-3, .span-4 { grid-column: span 3; } }
@media (max-width: 620px) { .bento { grid-template-columns: 1fr; } .span-2, .span-3, .span-4 { grid-column: auto; } }

/* ---------- 8. Generic sections ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.prose p { color: var(--ink-2); margin-top: var(--s-4); max-width: 40rem; }
.prose strong { color: var(--ink); }
.checks { list-style: none; margin: var(--s-5) 0 0; padding: 0; display: grid; gap: .7rem; }
.checks li { position: relative; padding-left: 1.9rem; color: var(--ink-2); font-size: var(--fs-sm); }
.checks li::before { content: ""; position: absolute; left: 0; top: .2rem; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: color-mix(in srgb, var(--c, var(--brand)) 16%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232457e6' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center/70% no-repeat; }
.paths { display: grid; gap: .75rem; }
.path { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.05rem 1.25rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.path b { display: block; font-weight: 600; }
.path small { color: var(--muted); font-size: var(--fs-sm); }
.path a { white-space: nowrap; font-size: var(--fs-sm); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; }
.band { background: var(--bg-soft); border-block: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: var(--s-7); counter-reset: s; }
.step { padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.step .n { font: 700 var(--fs-xl)/1 var(--font-display); letter-spacing: -.04em; color: var(--c-ink, var(--brand-ink)); }
.step h3 { font-size: var(--fs-lg); margin-top: var(--s-4); }
.step p { color: var(--ink-2); font-size: var(--fs-sm); margin-top: var(--s-2); }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.kit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-top: var(--s-4); }
.kit div { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.kit b { display: block; font-size: var(--fs-sm); } .kit span { font-size: var(--fs-xs); color: var(--muted); }
@media (max-width: 480px) { .kit { grid-template-columns: 1fr; } }

/* ---------- 9. Course page: lesson list ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: var(--fs-sm); color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs .sep { opacity: .5; }
.course-hero .tile-lg { width: 4rem; height: 4rem; border-radius: 18px; margin-bottom: var(--s-5); }
.course-hero .tile-lg .icon { width: 2rem; height: 2rem; }
.course-hero h1 { font-size: var(--fs-3xl); letter-spacing: -.045em; margin-top: var(--s-3); }
.course-hero .eyebrow { color: var(--c-ink); }
.course-hero::before { background: radial-gradient(60% 60% at 15% 20%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%), radial-gradient(40% 50% at 90% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }
.progress-card { padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-md); }
.progress-card h2 { font-size: var(--fs-md); font-family: var(--font-body); letter-spacing: 0; font-weight: 600; }
.progress-card .bar { margin-top: var(--s-4); height: 8px; }
.progress-card p { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s-3); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: var(--s-6); }
.field { position: relative; flex: 1 1 18rem; }
.field .icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.field input { width: 100%; height: 50px; padding: 0 1rem 0 2.8rem; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font: 500 var(--fs-md) var(--font-body); transition: border-color var(--dur-1), box-shadow var(--dur-1); }
.field input::placeholder { color: var(--muted); }
.field input:focus { outline: none; border-color: var(--c, var(--brand)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, var(--brand)) 20%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { min-height: 44px; padding: 0 1rem; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font: 600 var(--fs-sm)/1 var(--font-body); cursor: pointer; transition: all var(--dur-1); }
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.phase-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: var(--s-8) 0 var(--s-4); padding-bottom: var(--s-3); border-bottom: 1px solid var(--line); }
.phase-head h3 { font-size: var(--fs-xl); }
.phase-head span { font: 500 var(--fs-xs)/1 var(--font-mono); color: var(--muted); white-space: nowrap; }
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19.5rem), 1fr)); gap: .75rem; list-style: none; margin: 0; padding: 0; }
.lesson { position: relative; display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) auto; align-items: start; gap: .85rem; height: 100%; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); text-decoration: none; color: var(--ink);
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2), box-shadow var(--dur-2); }
.lesson:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 50%, var(--line)); box-shadow: var(--shadow-md); text-decoration: none; }
.lesson .num { display: grid; place-items: center; height: 2.4rem; border-radius: 10px; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c-ink); font: 700 var(--fs-sm)/1 var(--font-mono); }
.lesson b { display: block; font: 600 var(--fs-sm)/1.4 var(--font-body); }
.lesson small { display: block; margin-top: .3rem; color: var(--muted); font-size: var(--fs-xs); line-height: 1.5; }
.lesson .state { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; margin-top: .4rem; }
.lesson.is-done .state { background: var(--success); border-color: var(--success); color: #fff; }
.lesson.is-done .state::after { content: ""; width: .65rem; height: .35rem; border: 2px solid currentColor; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.lesson.is-started .state { border-color: var(--c); background: conic-gradient(var(--c) 0 50%, transparent 50%); }
.pill { display: inline-block; margin-bottom: .35rem; padding: .18rem .55rem; border-radius: var(--r-pill); font: 700 .68rem/1.3 var(--font-body); letter-spacing: .04em; text-transform: uppercase; }
.pill-beg { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.pill-int { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.pill-adv { background: color-mix(in srgb, var(--error) 14%, transparent); color: var(--error); }
.empty { display: none; padding: var(--s-7) var(--s-5); text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--r-xl); color: var(--muted); margin-top: var(--s-6); }
.empty.is-visible { display: block; }
[hidden] { display: none !important; }

.pathnav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.pathnav a { display: flex; flex-direction: column; gap: .35rem; padding: 1.25rem 1.4rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); text-decoration: none; color: var(--ink); transition: transform var(--dur-2) var(--ease), border-color var(--dur-2); }
.pathnav a:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 50%, var(--line)); }
.pathnav small { color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.pathnav b { font: 700 var(--fs-lg)/1.2 var(--font-display); color: var(--c-ink); }
.pathnav a:last-child:not(:first-child) { text-align: right; }
@media (max-width: 560px) { .pathnav { grid-template-columns: 1fr; } .pathnav a:last-child { text-align: left; } }

/* ---------- 10. Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding-block: var(--s-8) var(--s-6); }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: var(--s-7); }
.footer p { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s-4); max-width: 22rem; }
.footer h2 { font: 600 var(--fs-xs)/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-4); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.footer li a { display: inline-flex; align-items: center; min-height: 36px; color: var(--ink-2); font-size: var(--fs-sm); text-decoration: none; }
.footer li a:hover { color: var(--brand-ink); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-xs); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- 11. Command palette + toast ---------- */
dialog.palette { width: min(92vw, 40rem); max-height: min(80vh, 36rem); margin: 10vh auto auto; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-xl); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); overflow: hidden; }
dialog.palette[open] { display: flex; flex-direction: column; animation: pop var(--dur-2) var(--ease); }
dialog.palette::backdrop { background: rgba(8, 12, 22, .55); backdrop-filter: blur(4px); }
.palette-input { display: flex; align-items: center; gap: .8rem; padding: 0 1.2rem; border-bottom: 1px solid var(--line); }
.palette-input input { flex: 1; height: 62px; border: 0; background: transparent; color: var(--ink); font: 500 var(--fs-lg) var(--font-body); }
.palette-input input:focus { outline: none; }
.palette-list { list-style: none; margin: 0; padding: .5rem; overflow-y: auto; }
.palette-list a { display: grid; grid-template-columns: 2.2rem 1fr auto; gap: .8rem; align-items: center; padding: .65rem .75rem; border-radius: var(--r-md); text-decoration: none; color: var(--ink); }
.palette-list a[aria-selected="true"], .palette-list a:hover { background: var(--bg-soft); text-decoration: none; }
.palette-list b { display: block; font: 600 var(--fs-sm)/1.3 var(--font-body); }
.palette-list small { color: var(--muted); font-size: var(--fs-xs); }
.palette-hint { padding: .7rem 1.2rem; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); display: flex; gap: 1rem; flex-wrap: wrap; }
.palette-empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toast { position: fixed; left: 50%; bottom: 1.5rem; z-index: var(--z-toast); transform: translate(-50%, 200%); opacity: 0; visibility: hidden; display: flex; align-items: center; gap: .6rem; max-width: calc(100vw - 2rem); padding: .85rem 1.2rem; border-radius: var(--r-pill); background: var(--ink); color: var(--bg); font: 600 var(--fs-sm)/1.3 var(--font-body); box-shadow: var(--shadow-lg); transition: transform var(--dur-3) var(--ease), opacity var(--dur-2), visibility var(--dur-3); pointer-events: none; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.to-top { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity var(--dur-2), transform var(--dur-2) var(--ease); box-shadow: var(--shadow-md); }
.to-top.is-on { opacity: 1; pointer-events: auto; transform: none; }

/* ---------- 12. Scroll reveal (only when JS is on) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- 13. 404 ---------- */
.notfound { min-height: 70vh; display: grid; place-items: center; text-align: center; padding-block: var(--s-8); }
.notfound h1 { font-size: clamp(5rem, 22vw, 11rem); letter-spacing: -.07em; line-height: .9; background: linear-gradient(120deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.notfound p { color: var(--ink-2); margin: var(--s-4) auto var(--s-6); max-width: 28rem; }

noscript .noscript-note { padding: .75rem 1.25rem; background: var(--bg-soft); border-bottom: 1px solid var(--line); text-align: center; font-size: var(--fs-sm); }

/* ---------- 14. Reduced motion + print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
  .marquee-track [aria-hidden] { display: none; }
  .js .reveal { opacity: 1; transform: none; }
}
@media print {
  .topbar, .footer, .marquee, .toast, .to-top, .search-btn, .hero::before, .hero::after { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: inherit; }
}
