/* ==========================================================================
   AI with Mayank: Learning Center styles
   Tokens live in tokens.css (loaded first). Sections:
   1 Fonts · 2 Base · 3 Type · 4 Controls · 5 Header/footer · 6 Home
   7 Track · 8 Lesson · 9 Library · 10 Progress · 11 Resources
   12 Search/toast · 13 Motion · 14 Responsive · 15 Print
   ========================================================================== */

/* 1. Fonts (self-hosted, same files as the main site) ------------------- */
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 300 800; font-display: swap;
    src: url('/assets/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 300 800; font-display: swap;
    src: url('/assets/fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 700 800; font-display: swap;
    src: url('/assets/fonts/playfair-display-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }

/* 2. Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
    margin: 0; background: var(--paper); color: var(--ink-2);
    font: 400 var(--fs-base)/1.6 var(--font);
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset, blockquote { margin: 0; }
ul, ol { padding: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: var(--gold-mid); color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section-tight { padding-block: clamp(32px, 5vw, 56px); }
.section-tint { background: var(--surface-2); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: var(--r-sm); background: var(--ink); color: var(--paper); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
.no-js .js-only { display: none !important; }
.muted { color: var(--faint); }
.stretched::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }

code { font-family: var(--mono); font-size: 0.88em; font-variant-ligatures: none; padding: 0.12em 0.38em; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); overflow-wrap: anywhere; }

/* 3. Type ---------------------------------------------------------------- */
.h-display { font-family: var(--display); font-weight: 800; font-size: var(--fs-4xl); line-height: 1.02; letter-spacing: -0.022em; color: var(--ink); text-wrap: balance; }
.h-display-md { font-size: var(--fs-3xl); line-height: 1.06; }
.h-section { font-family: var(--display); font-weight: 700; font-size: var(--fs-2xl); line-height: 1.1; letter-spacing: -0.015em; color: var(--ink); text-wrap: balance; }
.h-card { display: flex; align-items: center; gap: 10px; font-size: var(--fs-md); font-weight: 700; color: var(--ink); line-height: 1.3; }
.h-card-lg { font-size: var(--fs-xl); margin-bottom: var(--s-5); font-family: var(--display); }
.h-sub { display: flex; align-items: center; gap: 10px; font-size: var(--fs-lg); font-weight: 700; color: var(--ink); }
.hl { position: relative; white-space: nowrap; background: linear-gradient(transparent 60%, var(--gold-mid) 60%, var(--gold-mid) 92%, transparent 92%); padding-inline: 0.06em; }
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-ink); }
.eyebrow-num { font-family: var(--mono); letter-spacing: 0; color: var(--faint); font-weight: 600; }
.eyebrow-num::after { content: ''; display: inline-block; width: 22px; height: 1px; margin-left: 10px; vertical-align: middle; background: currentColor; }
.eyebrow-pill { display: inline-flex; padding: 6px 12px; border-radius: var(--r-pill); background: var(--gold-soft); letter-spacing: 0.08em; }
.section-head { display: grid; gap: var(--s-4); max-width: 680px; margin-bottom: clamp(32px, 4vw, 48px); }
.section-head.is-center { margin-inline: auto; text-align: center; justify-items: center; }
.section-lede, .hero-lede { font-size: var(--fs-md); line-height: 1.65; color: var(--slate); max-width: 62ch; }
.section-lede a { color: var(--ink); font-weight: 600; }
.section-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-4) var(--s-8); margin-bottom: clamp(28px, 4vw, 44px); }
.section-head-row .section-head { margin-bottom: 0; }

/* 4. Controls ------------------------------------------------------------ */
.btn {
    --btn-bg: transparent; --btn-ink: var(--ink); --btn-line: var(--line-strong);
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    min-height: 44px; padding: 10px 20px; border: 1px solid var(--btn-line); border-radius: var(--r-pill);
    background: var(--btn-bg); color: var(--btn-ink); font-size: var(--fs-sm); font-weight: 700; line-height: 1.2;
    text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: transform 0.18s var(--ease), background-color 0.18s, border-color 0.18s, box-shadow 0.18s, color 0.18s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--ink); }
.btn:active { transform: translateY(0); }
.btn-lg { min-height: 52px; padding: 13px 26px; font-size: 0.97rem; }
.btn-sm { min-height: 38px; padding: 7px 15px; font-size: 0.84rem; }
.btn-block { width: 100%; }
.btn-primary { --btn-bg: var(--ink); --btn-ink: var(--paper); --btn-line: var(--ink); }
.btn-primary:hover { box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.45); }
.btn-gold { --btn-bg: var(--gold); --btn-ink: #121212; --btn-line: var(--gold); }
.btn-gold:hover { border-color: #f5c93a; background: #f5c93a; box-shadow: 0 10px 26px -10px rgba(234, 179, 8, 0.7); }
.btn-ghost { --btn-bg: var(--surface); }
.btn-ghost-inv { --btn-bg: transparent; --btn-ink: var(--inv-ink); --btn-line: var(--inv-line); }
.btn-ghost-inv:hover { border-color: var(--inv-ink); }
.btn-danger { --btn-bg: transparent; --btn-ink: var(--red); --btn-line: color-mix(in srgb, var(--red) 40%, transparent); }
.btn-danger:hover { border-color: var(--red); background: var(--red-soft); }
.btn.is-done { --btn-bg: var(--green-soft); --btn-ink: var(--green); --btn-line: color-mix(in srgb, var(--green) 45%, transparent); box-shadow: none; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 4px; border: 0; background: none; color: inherit; font-size: var(--fs-sm); font-weight: 600; opacity: 0.8; }
.link-btn:hover { opacity: 1; text-decoration: underline; }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 700; font-size: var(--fs-sm); text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.text-link .ic { transition: transform 0.2s var(--ease); }
.text-link:hover .ic { transform: translateX(3px); }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); transition: border-color 0.18s, background 0.18s; }
.icon-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.kbd { display: inline-flex; align-items: center; min-width: 22px; height: 22px; padding: 0 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); color: var(--slate); font: 600 0.72rem/1 var(--font); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em; text-transform: none; line-height: 1.3; white-space: nowrap; }
.pill-tech { background: var(--tech-soft); color: var(--tech-ink); }
.pill-nontech { background: var(--nontech-soft); color: var(--nontech-ink); }
.pill-level { background: var(--surface-2); color: var(--slate); }
.check-list { list-style: none; display: grid; gap: 10px; }
.check-list li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; font-size: var(--fs-sm); line-height: 1.5; }
.check-list .ic { margin-top: 2px; color: var(--green); }
.check-list-lg li { font-size: var(--fs-base); }
.dot-list { list-style: none; display: grid; gap: 8px; }
.dot-list li { position: relative; padding-left: 18px; font-size: var(--fs-sm); }
.dot-list li::before { content: ''; position: absolute; left: 2px; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.notice { display: flex; gap: 12px; align-items: flex-start; max-width: 760px; margin-top: var(--s-6); padding: 14px 18px; border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: var(--r-md); background: var(--surface); font-size: var(--fs-sm); color: var(--ink-2); }
.notice .ic { flex: none; margin-top: 1px; color: var(--gold-ink); }
.notice a { font-weight: 700; color: var(--ink); }
.notice-warn { border-left-color: var(--red); }

/* Progress ring */
.ring { position: relative; display: inline-grid; place-items: center; width: var(--size); height: var(--size); flex: none; --p: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.4; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--route, var(--gold)); stroke-linecap: round; stroke-dasharray: var(--p) 100; transition: stroke-dasharray 0.9s var(--ease); }
.ring:not(.has-progress) .ring-fg { opacity: 0; }
.ring-num { position: absolute; display: grid; justify-items: center; line-height: 1.1; font-weight: 800; font-size: calc(var(--size) * 0.24); color: var(--ink); }
.ring-num small { font-size: 0.42em; font-weight: 600; color: var(--slate); letter-spacing: 0.02em; }
.ring-lg circle { stroke-width: 3; }

/* Formats */
.formats { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); }
.fmt { display: inline-flex; align-items: center; gap: 5px; }
.fmt-interactive { color: var(--gold-ink); }
.fmt-label { font-size: var(--fs-xs); font-weight: 600; }

/* 5. Header / footer ----------------------------------------------------- */
.sitebar { background: var(--inv-bg); color: var(--inv-muted); font-size: 0.8rem; }
.sitebar-inner { display: flex; align-items: center; gap: var(--s-6); min-height: 38px; }
.sitebar a { color: var(--inv-muted); text-decoration: none; transition: color 0.15s; }
.sitebar a:hover { color: #fff; }
.sitebar-back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #fff !important; }
.sitebar-nav { display: flex; gap: var(--s-5); margin-left: auto; }
.sitebar-social { display: flex; gap: 12px; padding-left: var(--s-5); border-left: 1px solid var(--inv-line); }
.lc-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.lc-header-inner { display: flex; align-items: center; gap: var(--s-6); min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -0.01em; flex: none; }
.brand img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--gold); }
.brand-divider { width: 1px; height: 18px; background: var(--line-strong); }
.brand-sub { font-family: var(--display); font-weight: 700; font-size: 1.05rem; }
.lc-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.lc-nav a { position: relative; padding: 8px 12px; border-radius: var(--r-pill); color: var(--slate); font-size: 0.89rem; font-weight: 600; text-decoration: none; transition: color 0.15s, background 0.15s; }
.lc-nav a:hover { color: var(--ink); background: var(--surface-2); }
.lc-nav a[aria-current="page"] { color: var(--ink); }
.lc-nav a[aria-current="page"]::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 1px; height: 2px; border-radius: 2px; background: var(--gold); }
.lc-nav-back { display: none !important; }
.lc-actions { display: flex; align-items: center; gap: 8px; }
.search-trigger { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 8px 0 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--slate); font-size: var(--fs-sm); text-decoration: none; transition: border-color 0.15s; }
.search-trigger:hover { border-color: var(--line-strong); color: var(--ink); }
.theme-ic-light { display: none; }
[data-theme="dark"] .theme-ic-light { display: block; }
[data-theme="dark"] .theme-ic-dark { display: none; }

.lc-footer { margin-top: auto; padding-block: var(--s-16) var(--s-8); background: var(--inv-bg); color: var(--inv-muted); }
.footer-top { display: grid; grid-template-columns: 1.2fr 1.4fr auto; gap: var(--s-10); align-items: start; }
.footer-brand { display: flex; gap: 14px; align-items: center; }
.footer-brand img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.footer-name { color: #fff; font-family: var(--display); font-size: 1.3rem; font-weight: 700; }
.footer-tag { font-size: var(--fs-sm); }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-8); }
.footer-cols a { display: block; padding: 4px 0; color: var(--inv-muted); font-size: var(--fs-sm); text-decoration: none; }
.footer-cols a:hover { color: #fff; }
.footer-h { margin-bottom: 8px; color: #fff; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--inv-line); border-radius: 50%; color: var(--inv-muted); transition: color 0.15s, border-color 0.15s; }
.footer-social a:hover { color: #fff; border-color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-12); padding-top: var(--s-6); border-top: 1px solid var(--inv-line); font-size: 0.82rem; }
.footer-bottom a { color: #fff; }
.lc-footer :focus-visible { outline-color: var(--gold); }

/* Breadcrumbs */
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; list-style: none; margin-bottom: var(--s-6); font-size: 0.84rem; color: var(--faint); }
.crumbs li { display: inline-flex; align-items: center; gap: 4px; }
.crumbs a { color: var(--slate); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink-2); font-weight: 600; }

/* 6. Home ----------------------------------------------------------------- */
.hero { position: relative; padding-block: clamp(48px, 7vw, 96px) clamp(40px, 5vw, 64px); overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: -20% -10% auto auto; width: 720px; height: 720px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--gold) 16%, transparent), transparent); pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero-copy { display: grid; gap: var(--s-6); justify-items: start; }
.hero-lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-trust { display: flex; align-items: center; gap: 12px; max-width: 54ch; color: var(--slate); font-size: var(--fs-sm); line-height: 1.5; }
.trust-icons { display: flex; flex: none; }
.trust-icons > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--paper); }
.trust-yt { background: #ff0033; color: #fff; }
.trust-ud { margin-left: -9px; background: #a435f0; color: #fff; }
.hero-visual { position: relative; justify-self: center; width: min(100%, 420px); aspect-ratio: 1 / 1.05; }
.float-card { position: absolute; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--lift-lg); }
.float-lesson { left: -6%; bottom: 2%; width: 240px; padding: 16px; display: grid; gap: 8px; animation: floaty 7s ease-in-out infinite; }
.float-kicker { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700; color: var(--tech-ink); letter-spacing: 0.04em; text-transform: uppercase; }
.float-title { font-weight: 800; color: var(--ink); line-height: 1.3; font-size: 0.95rem; }
.float-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.float-steps span { height: 5px; border-radius: 3px; background: var(--line); }
.float-steps .is-done { background: var(--tech); }
.float-steps .is-on { background: linear-gradient(90deg, var(--tech) 55%, var(--line) 55%); }
.float-meta { font-size: 0.76rem; color: var(--slate); }
.float-stat { right: -2%; top: 10%; display: flex; align-items: center; gap: 10px; padding: 12px 16px 12px 12px; animation: floaty 8s ease-in-out -3s infinite; }
.float-stat-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); }
.float-stat strong { display: block; color: var(--ink); font-size: 0.95rem; }
.float-stat small { color: var(--slate); font-size: 0.75rem; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(40px, 6vw, 72px); border-block: 1px solid var(--line); }
.hero-stats > div { display: flex; flex-direction: column-reverse; gap: 2px; padding: 22px 24px; }
.hero-stats > div + div { border-left: 1px solid var(--line); }
.hero-stats dt { color: var(--slate); font-size: var(--fs-sm); }
.hero-stats dd { font-family: var(--display); font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800; color: var(--ink); line-height: 1.1; }

/* Continue card */
.continue-wrap { margin-top: -8px; margin-bottom: var(--s-8); }
.continue-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-6); padding: 22px 26px; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--lift); }
.continue-main { display: grid; gap: 6px; min-width: 0; flex: 1 1 360px; }
.continue-title { font-size: var(--fs-lg); font-weight: 800; color: var(--ink); line-height: 1.3; }
.continue-title a { text-decoration: none; }
.continue-title a:hover { text-decoration: underline; }
.continue-meta { color: var(--slate); font-size: var(--fs-sm); }
.continue-side { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.continue-bar { width: 140px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.continue-bar span { display: block; height: 100%; width: 0; background: var(--gold); border-radius: inherit; transition: width 0.8s var(--ease); }
.continue-pct { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); min-width: 4ch; }

/* Entry cards */
.entry-grid { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.entry-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s; }
.entry-card:hover { transform: translateY(-4px); box-shadow: var(--lift-lg); border-color: var(--route-mid); }
.entry-card:focus-within { border-color: var(--route); }
.entry-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--route-soft); color: var(--route-text); }
.entry-title { font-size: 1.08rem; font-weight: 800; color: var(--ink); line-height: 1.3; }
.entry-text { color: var(--slate); font-size: var(--fs-sm); line-height: 1.55; flex: 1; }
.entry-first { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 0.82rem; font-weight: 600; color: var(--ink-2); line-height: 1.35; }
.entry-first span { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.entry-link { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--route-text); text-decoration: none; }
.entry-link:focus-visible { outline: none; }
.entry-link:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }
.entry-card:hover .entry-link .ic { transform: translateX(3px); }
.entry-link .ic { transition: transform 0.2s var(--ease); }

/* Ink section + path picker */
.section-ink { position: relative; background: var(--inv-bg); color: var(--inv-muted); overflow: hidden; }
.section-ink::before { content: ''; position: absolute; left: -200px; bottom: -300px; width: 700px; height: 700px; border-radius: 50%; background: radial-gradient(closest-side, rgba(234,179,8,0.14), transparent); pointer-events: none; }
.section-ink .h-section { color: var(--inv-ink); }
.section-ink .section-lede { color: var(--inv-muted); }
.section-ink .eyebrow { color: var(--gold); }
.section-ink .eyebrow-num { color: var(--inv-muted); }
.section-ink :focus-visible { outline-color: var(--gold); }
.picker-grid { position: relative; display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.picker-steps { list-style: none; display: grid; gap: 4px; margin-top: var(--s-2); }
.picker-steps li { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-weight: 600; color: var(--inv-muted); opacity: 0.6; transition: opacity 0.2s; }
.picker-steps li span { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--inv-line); border-radius: 50%; font-size: 0.82rem; }
.picker-steps li.is-on, .picker-steps li.is-done { opacity: 1; color: var(--inv-ink); }
.picker-steps li.is-on span { border-color: var(--gold); background: var(--gold); color: #111; }
.picker-steps li.is-done span { border-color: var(--gold); color: var(--gold); }
.picker-panel { padding: clamp(20px, 3vw, 32px); border: 1px solid var(--inv-line); border-radius: var(--r-xl); background: var(--inv-surface); }
.picker-q { display: flex; align-items: baseline; gap: 12px; margin-bottom: var(--s-5); color: var(--inv-ink); font-size: var(--fs-lg); font-weight: 700; line-height: 1.35; }
.picker-q-num { font: 600 0.8rem var(--mono); color: var(--gold); }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px; border: 1px solid var(--inv-line); border-radius: var(--r-md); cursor: pointer; transition: border-color 0.18s, background 0.18s, transform 0.18s var(--ease); }
.choice:hover { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.03); transform: translateY(-1px); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.choice:has(input:checked) { border-color: var(--gold); background: rgba(234,179,8,0.08); }
.choice-body { display: grid; gap: 2px; flex: 1; }
.choice-label { color: var(--inv-ink); font-weight: 700; }
.choice-hint { font-size: 0.84rem; color: var(--inv-muted); }
.choice-arrow { color: var(--inv-muted); flex: none; transition: transform 0.2s var(--ease), color 0.2s; }
.choice:hover .choice-arrow { color: var(--gold); transform: translateX(3px); }
.picker-step { animation: stepIn 0.35s var(--ease); }
.picker-step .link-btn { margin-top: var(--s-4); color: var(--inv-muted); }
@keyframes stepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.picker-result:focus { outline: none; }
.picker-result .eyebrow { color: var(--gold); }
.picker-result-title { margin-top: 6px; color: var(--inv-ink); font-family: var(--display); font-size: var(--fs-xl); line-height: 1.2; }
.picker-result-meta { margin-top: 6px; font-size: var(--fs-sm); }
.path-list { list-style: none; counter-reset: path; display: grid; gap: 8px; margin-block: var(--s-5); }
.path-list li { counter-increment: path; }
.path-list a { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--inv-line); border-radius: var(--r-md); color: var(--inv-ink); text-decoration: none; transition: border-color 0.15s, background 0.15s; }
.path-list a:hover { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.03); }
.path-list a::before { content: counter(path); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--inv-line); font-size: 0.8rem; font-weight: 700; color: var(--inv-muted); }
.path-list .is-done a::before { content: '✓'; border-color: var(--green); background: var(--green); color: #fff; }
.path-list strong { display: block; font-weight: 700; line-height: 1.35; }
.path-list small { display: block; color: var(--inv-muted); font-size: 0.78rem; }
.path-list .path-len { font-size: 0.8rem; color: var(--inv-muted); font-variant-numeric: tabular-nums; }
.path-list-light a { border-color: var(--line); color: var(--ink); }
.path-list-light a:hover { border-color: var(--line-strong); background: var(--surface-2); }
.path-list-light a::before { border-color: var(--line-strong); color: var(--slate); }
.path-list-light small, .path-list-light .path-len { color: var(--slate); }
.picker-result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.picker-result-actions .link-btn { color: var(--inv-muted); }
.picker-fallback ul { list-style: none; display: grid; gap: 10px; }
.picker-fallback a { color: var(--inv-ink); font-weight: 700; }
.picker-fallback span { font-size: var(--fs-sm); }

/* Track cards */
.track-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6); }
.track-card { position: relative; display: flex; flex-direction: column; gap: var(--s-5); padding: clamp(24px, 3vw, 36px); border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); overflow: hidden; transition: box-shadow 0.3s var(--ease), border-color 0.3s; }
.track-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--route); }
.track-card:hover { box-shadow: var(--lift-lg); border-color: var(--route-mid); }
.track-card-top { display: flex; justify-content: space-between; align-items: center; }
.track-card .eyebrow { color: var(--route-text); }
.track-card-title { font-family: var(--display); font-size: var(--fs-2xl); line-height: 1.05; color: var(--ink); }
.track-card-title a { text-decoration: none; }
.track-card-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.track-card-sub { display: block; margin-top: 6px; font-family: var(--font); font-size: var(--fs-base); font-weight: 600; color: var(--slate); letter-spacing: 0; }
.track-card-text { color: var(--slate); }
.track-stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r-md); }
.track-stats > div { display: flex; flex-direction: column-reverse; padding: 12px 14px; }
.track-stats > div + div { border-left: 1px solid var(--line); }
.track-stats dt { font-size: 0.74rem; color: var(--slate); }
.track-stats dd { font-weight: 800; color: var(--ink); font-size: 1.05rem; white-space: nowrap; }
.track-card-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: -8px; }
.track-card-phases { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.track-card-phases li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-radius: var(--r-pill); background: var(--route-soft); color: var(--route-text); font-size: 0.78rem; font-weight: 600; }
.track-card-phases span { display: grid; place-items: center; min-width: 22px; height: 22px; border-radius: 50%; background: var(--surface); font: 700 0.68rem var(--mono); }
.track-card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }

/* Content map */
.map-grid { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.map-tile { position: relative; display: grid; gap: 6px; padding: 26px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.map-tile:hover { transform: translateY(-3px); box-shadow: var(--lift-lg); }
.map-tile:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.map-tile a:focus-visible { outline: none; }
.map-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 8px; border-radius: 12px; background: var(--gold-soft); color: var(--gold-ink); }
.map-num { font-family: var(--display); font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--ink); }
.map-label { font-size: 1.02rem; font-weight: 800; color: var(--ink); }
.map-label a { text-decoration: none; }
.map-text { color: var(--slate); font-size: var(--fs-sm); }
.map-arrow { position: absolute; top: 24px; right: 24px; color: var(--faint); transition: transform 0.2s var(--ease), color 0.2s; }
.map-tile:hover .map-arrow { color: var(--ink); transform: translate(2px, -2px); }

/* How a lesson works */
.how-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.how-steps { list-style: none; display: grid; gap: 0; border-top: 1px solid var(--line); }
.how-step { display: grid; grid-template-columns: 70px 1fr; gap: var(--s-4); padding: 24px 0; border-bottom: 1px solid var(--line); }
.how-num { font-family: var(--display); font-size: 2.2rem; font-weight: 800; color: var(--gold-ink); line-height: 1; }
.how-step h3 { font-size: var(--fs-lg); color: var(--ink); margin-bottom: 4px; }
.how-step p { color: var(--slate); }

/* YouTube */
.yt-grid { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-5); }
.yt-card { display: grid; gap: 10px; align-content: start; }
.yt-thumb { position: relative; display: block; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface-3); }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.yt-card:hover .yt-thumb img { transform: scale(1.04); }
.yt-title { font-size: 0.96rem; font-weight: 700; line-height: 1.4; color: var(--ink); }
.yt-title a { text-decoration: none; }
.yt-title a:hover { text-decoration: underline; }
.yt-meta { font-size: 0.8rem; color: var(--slate); }

/* Go deeper */
.deeper-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6); }
.deeper-panel { display: flex; flex-direction: column; gap: var(--s-4); padding: clamp(24px, 3vw, 36px); border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); }
.deeper-panel-ink { background: var(--inv-bg); border-color: var(--inv-bg); color: var(--inv-muted); }
.deeper-panel-ink .deeper-title { color: var(--inv-ink); }
.deeper-panel-ink .check-list .ic { color: var(--gold); }
.deeper-panel-ink :focus-visible { outline-color: var(--gold); }
.deeper-title { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: var(--fs-xl); color: var(--ink); }
.deeper-text { color: inherit; opacity: 0.92; }
.deeper-panel:not(.deeper-panel-ink) .deeper-text { color: var(--slate); }
.deeper-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: var(--s-2); }
.course-list { display: grid; gap: 10px; }
.course-card { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-decoration: none; transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s var(--ease); }
.course-card:hover { border-color: var(--line-strong); box-shadow: var(--lift); transform: translateY(-2px); }
.course-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: var(--surface-3); }
.course-card-body { display: grid; gap: 4px; }
.course-card-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #8b2fd6; }
[data-theme="dark"] .course-card-kicker { color: #c58cff; }
.course-card-title { font-weight: 700; color: var(--ink); line-height: 1.35; font-size: 0.93rem; }
.course-card-cta { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; font-weight: 700; color: var(--slate); }
.course-card.is-compact { grid-template-columns: 112px 1fr; }
.course-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); margin-top: var(--s-6); }

/* FAQ + CTA band */
.faq-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.faq-list { display: grid; gap: 10px; }
.faq { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); transition: border-color 0.18s; }
.faq[open] { border-color: var(--line-strong); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; font-weight: 700; color: var(--ink); cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { flex: none; transition: transform 0.25s var(--ease); color: var(--slate); }
.faq[open] summary .ic { transform: rotate(180deg); }
.faq p { padding: 0 20px 20px; color: var(--slate); }
.cta-band { padding-block: clamp(64px, 9vw, 112px); background: var(--inv-bg); color: var(--inv-muted); text-align: center; position: relative; overflow: hidden; }
.cta-band::before { content: ''; position: absolute; left: 50%; top: -260px; width: 800px; height: 520px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(234,179,8,0.16), transparent); }
.cta-inner { position: relative; display: grid; justify-items: center; gap: var(--s-5); }
.cta-band .h-section { color: var(--inv-ink); max-width: 18ch; }
.cta-band .hl { background: none; color: var(--gold); }
.cta-band :focus-visible { outline-color: var(--gold); }

/* 7. Track page ------------------------------------------------------------ */
.track-hero { padding-block: clamp(32px, 5vw, 56px) clamp(40px, 6vw, 72px); background: linear-gradient(180deg, var(--route-soft), var(--paper) 85%); }
.track-hero .eyebrow { color: var(--route-text); }
.track-hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.track-hero-grid > div:first-child { display: grid; gap: var(--s-5); justify-items: start; }
.track-hero-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.track-hero-stats > div { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.track-hero-stats .ic { grid-row: span 2; color: var(--route-text); }
.track-hero-stats dt { font-size: 0.72rem; color: var(--slate); }
.track-hero-stats dd { font-weight: 800; color: var(--ink); font-size: 0.95rem; }
.track-progress-card { display: flex; align-items: center; gap: var(--s-5); padding: 24px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--lift); }
.tpc-title { font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.tpc-text { color: var(--slate); font-size: var(--fs-sm); margin-bottom: 10px; }
.about-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: var(--s-5); }
.about-card { display: grid; gap: var(--s-3); align-content: start; padding: 28px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.about-card .h-card + p { color: var(--slate); margin-bottom: var(--s-3); }
.about-card .h-card .ic { color: var(--route-text); }
.about-outcomes { background: var(--route-soft); border-color: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: var(--s-5); font-size: 0.82rem; color: var(--slate); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.phases { display: grid; gap: 12px; }
.phase { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); transition: border-color 0.2s, box-shadow 0.2s; }
.phase[open] { border-color: var(--line-strong); box-shadow: var(--lift); }
.phase-head { display: grid; grid-template-columns: 96px minmax(0, 1fr) 210px 24px; gap: var(--s-5); align-items: center; padding: 20px 24px; cursor: pointer; list-style: none; }
.phase-head::-webkit-details-marker { display: none; }
.phase-num { font: 700 0.78rem var(--mono); letter-spacing: 0.04em; color: var(--route-text); text-transform: uppercase; }
.phase-main { display: grid; gap: 4px; }
.phase-title { font-size: 1.12rem; font-weight: 800; color: var(--ink); line-height: 1.3; }
.phase-summary { color: var(--slate); font-size: var(--fs-sm); }
.phase-side { display: grid; gap: 6px; }
.phase-meta { font-size: 0.8rem; color: var(--slate); }
.phase-bar { display: block; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.phase-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--route); transition: width 0.8s var(--ease); }
.phase-count { font-size: 0.78rem; font-weight: 700; color: var(--ink-2); }
.phase.is-complete .phase-count { color: var(--green); }
.phase-chevron { color: var(--slate); transition: transform 0.25s var(--ease); }
.phase[open] .phase-chevron { transform: rotate(180deg); }
.phase-body { padding: 0 24px 22px; }
.lesson-rows { list-style: none; border-top: 1px solid var(--line); }
.lesson-row { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 8px; border-bottom: 1px solid var(--line); border-radius: 8px; transition: background 0.15s; }
.lesson-row:hover { background: var(--surface-2); }
.lesson-status { position: relative; display: grid; place-items: center; width: 28px; height: 28px; border: 1.5px solid var(--line-strong); border-radius: 50%; font-size: 0.76rem; font-weight: 700; color: var(--slate); }
.lesson-status .ic { display: none; }
.lesson-row.is-done .lesson-status { border-color: var(--green); background: var(--green); color: #fff; }
.lesson-row.is-done .lesson-status .ic { display: block; }
.lesson-row.is-done .lesson-status-num { display: none; }
.lesson-row.is-next .lesson-status { border-color: var(--route); color: var(--route-text); box-shadow: 0 0 0 4px var(--route-soft); }
.lesson-row-title { font-weight: 600; color: var(--ink); text-decoration: none; line-height: 1.4; }
.lesson-row-title::after { content: ''; position: absolute; inset: 0; }
.lesson-row-title:focus-visible { outline: none; }
.lesson-row:has(.lesson-row-title:focus-visible) { outline: 3px solid var(--focus); outline-offset: 1px; }
.lesson-row.is-next .lesson-row-title::before { content: 'Up next'; display: inline-block; margin-right: 8px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--route); color: var(--on-route, #fff); font-size: 0.68rem; font-weight: 700; vertical-align: 2px; }
.track-tech .lesson-row.is-next .lesson-row-title::before { color: #fff; }
[data-theme="dark"] .lesson-row.is-next .lesson-row-title::before { color: #0b0b0c; }
.lesson-row-meta { display: flex; align-items: center; gap: 14px; }
.lesson-row-time { min-width: 56px; text-align: right; font-size: 0.82rem; color: var(--slate); font-variant-numeric: tabular-nums; }
.phase-deeper { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: var(--s-4); padding: 14px; border-radius: var(--r-md); background: var(--surface-2); }
.phase-deeper p { font-weight: 700; color: var(--ink); font-size: var(--fs-sm); padding-left: 6px; }
.phase-deeper .course-card { flex: 1 1 340px; max-width: 460px; }
.other-track { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 32px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--route-soft); color: var(--ink); text-decoration: none; transition: transform 0.2s var(--ease), box-shadow 0.2s; }
.other-track:hover { transform: translateY(-2px); box-shadow: var(--lift-lg); }
.other-track > span { display: grid; gap: 6px; }
.other-track .eyebrow { color: var(--route-text); }
.other-track-title { font-family: var(--display); font-size: var(--fs-xl); font-weight: 700; }
.other-track-text { color: var(--slate); }

/* 8. Lesson page ------------------------------------------------------------ */
.lesson-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr) 230px; gap: clamp(24px, 3vw, 48px); max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); align-items: start; }
.lesson-sidebar { position: sticky; top: 66px; max-height: calc(100vh - 66px); overflow-y: auto; padding-block: 28px 40px; overscroll-behavior: contain; scrollbar-width: thin; }
.side-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.side-track { display: grid; gap: 6px; justify-items: start; color: var(--ink); font-weight: 800; text-decoration: none; line-height: 1.3; }
.side-track:hover span:last-child { text-decoration: underline; }
.side-progress { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin: 14px 0 18px; }
.side-progress-bar { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.side-progress-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--route); transition: width 0.6s var(--ease); }
.side-progress-text { font-size: 0.76rem; font-weight: 700; color: var(--slate); }
.side-phases { display: grid; gap: 2px; }
.side-phase summary { display: grid; grid-template-columns: 26px 1fr 16px; gap: 8px; align-items: center; padding: 10px 8px; border-radius: var(--r-sm); cursor: pointer; list-style: none; font-size: 0.86rem; font-weight: 700; color: var(--ink); }
.side-phase summary::-webkit-details-marker { display: none; }
.side-phase summary:hover { background: var(--surface-2); }
.side-phase summary .ic { color: var(--faint); transition: transform 0.2s; }
.side-phase[open] summary .ic { transform: rotate(180deg); }
.side-phase-num { font: 700 0.72rem var(--mono); color: var(--route-text); }
.side-phase ol { list-style: none; display: grid; gap: 1px; margin: 2px 0 10px 12px; padding-left: 12px; border-left: 1px solid var(--line); }
.side-phase a { display: grid; grid-template-columns: 18px 1fr auto; gap: 9px; align-items: start; padding: 7px 8px; border-radius: var(--r-sm); color: var(--slate); font-size: 0.84rem; line-height: 1.4; text-decoration: none; transition: background 0.15s, color 0.15s; }
.side-phase a:hover { background: var(--surface-2); color: var(--ink); }
.side-phase a[aria-current="page"] { background: var(--route-soft); color: var(--ink); font-weight: 700; }
.side-status { display: grid; place-items: center; width: 16px; height: 16px; margin-top: 2px; border: 1.5px solid var(--line-strong); border-radius: 50%; color: transparent; }
.side-phase li.is-done .side-status { border-color: var(--green); background: var(--green); color: #fff; }
.side-phase a[aria-current="page"] .side-status { border-color: var(--route); }
.side-len { font-size: 0.72rem; color: var(--faint); font-variant-numeric: tabular-nums; margin-top: 2px; }
.drawer-scrim { display: none; }

.lesson-main { min-width: 0; padding-block: 28px 80px; max-width: 760px; width: 100%; justify-self: center; }
.lesson-header { padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.lesson-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 12px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.lesson-kicker a { color: var(--route-text); text-decoration: none; }
.lesson-kicker a:hover { text-decoration: underline; }
.lesson-kicker span { color: var(--faint); }
.h-lesson { font-family: var(--display); font-weight: 800; font-size: var(--fs-3xl); line-height: 1.08; letter-spacing: -0.018em; color: var(--ink); text-wrap: balance; }
.lesson-summary { margin-top: 14px; font-size: var(--fs-md); line-height: 1.6; color: var(--slate); }
.lesson-meta { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 18px; font-size: 0.86rem; color: var(--slate); }
.lesson-meta li { display: inline-flex; align-items: center; gap: 6px; }
.lesson-done-flag { color: var(--green); font-weight: 700; }
.lesson-head-actions { display: none; margin-top: 16px; }
.step-nav { margin-top: 22px; }
.step-nav ol { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.step-nav a { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-size: 0.84rem; font-weight: 700; text-decoration: none; transition: border-color 0.15s, background 0.15s; line-height: 1.25; position: relative; overflow: hidden; }
.step-nav a span { font: 700 0.7rem var(--mono); color: var(--faint); }
.step-nav a:hover { border-color: var(--line-strong); }
.step-nav a.is-active { border-color: var(--route); background: var(--route-soft); }
.step-nav a.is-active span { color: var(--route-text); }
.step-nav a.is-seen::after { content: ''; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--route); }

.lesson-section { padding-top: 48px; }
.step-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.step-num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--route); color: #fff; font: 700 0.85rem var(--mono); flex: none; }
.track-tech .step-num { color: #fff; }
[data-theme="dark"] .step-num { color: #0b0b0c; }
.h-step { font-family: var(--display); font-weight: 700; font-size: var(--fs-xl); color: var(--ink); line-height: 1.2; }

/* Video facade */
.video { position: relative; margin-bottom: 32px; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: #000; box-shadow: var(--lift-lg); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-facade { position: absolute; inset: 0; display: block; color: #fff; text-decoration: none; }
.video-facade img { width: 100%; height: 100%; object-fit: cover; opacity: 0.88; transition: opacity 0.3s, transform 0.6s var(--ease); }
.video-facade::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.55)); }
.video-facade:hover img { opacity: 1; transform: scale(1.02); }
.video-play { position: absolute; left: 50%; top: 50%; z-index: 1; display: grid; place-items: center; width: 76px; height: 76px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--gold); color: #111; box-shadow: 0 10px 30px rgba(0,0,0,0.35); transition: transform 0.25s var(--ease); }
.video-play .ic { margin-left: 4px; }
.video-facade:hover .video-play { transform: translate(-50%, -50%) scale(1.08); }
.video-play.sm { width: 42px; height: 42px; }
.video-play.sm .ic { margin-left: 2px; }
.video-cta { position: absolute; left: 18px; bottom: 16px; z-index: 1; font-weight: 700; font-size: 0.9rem; }
.video-len { position: absolute; right: 12px; bottom: 12px; z-index: 1; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,0.75); color: #fff; font-size: 0.76rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.yt-thumb .video-play { opacity: 0; transition: opacity 0.2s, transform 0.25s var(--ease); }
.yt-card:hover .yt-thumb .video-play { opacity: 1; }

/* Prose */
.prose { font-size: 1.07rem; line-height: 1.78; color: var(--ink-2); }
.prose > * + * { margin-top: 1.15em; }
.prose-lead { font-size: 1.16rem; line-height: 1.72; }
.prose-lead > p:first-child::first-letter { float: left; margin: 0.08em 0.12em 0 0; font-family: var(--display); font-size: 3.4em; font-weight: 800; line-height: 0.82; color: var(--route-text); }
.prose h2 { position: relative; margin-top: 2.2em; font-size: 1.6rem; font-weight: 800; line-height: 1.25; color: var(--ink); letter-spacing: -0.01em; }
.prose h3 { position: relative; margin-top: 1.8em; font-size: 1.25rem; font-weight: 800; color: var(--ink); }
.prose h4 { margin-top: 1.5em; font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }
.prose .anchor { margin-left: 8px; color: var(--faint); text-decoration: none; opacity: 0; transition: opacity 0.15s; font-weight: 500; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus-visible { opacity: 1; }
.prose a { color: var(--route-text); font-weight: 600; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--route); font-weight: 700; }
.prose ul ul, .prose ol ol, .prose ul ol, .prose ol ul { margin-top: 0.45em; }
.prose hr { margin-block: 2.4em; border: 0; height: 1px; background: var(--line); }
.prose img { border-radius: var(--r-md); border: 1px solid var(--line); }
.prose blockquote { padding-left: 18px; border-left: 3px solid var(--line-strong); color: var(--slate); font-style: italic; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.prose table, .score-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; line-height: 1.5; }
.prose th, .prose td, .score-table th, .score-table td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th, .score-table th { background: var(--surface-2); color: var(--ink); font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.prose tr:last-child td, .score-table tr:last-child td { border-bottom: 0; }

/* Code */
.code-block { margin-block: 1.6em; border-radius: var(--r-md); overflow: hidden; background: var(--code-bg); border: 1px solid #000; box-shadow: var(--lift); }
.code-block figcaption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.03); }
.code-lang { font: 600 0.74rem var(--mono); color: #9aa1ad; letter-spacing: 0.04em; }
.code-block[data-lang="python"] .code-lang::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--gold); }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 10px; border: 1px solid rgba(255,255,255,0.14); border-radius: 7px; background: transparent; color: #c9ced8; font-size: 0.76rem; font-weight: 600; transition: background 0.15s, color 0.15s; }
.copy-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.copy-btn.is-copied { color: #7ee2b8; border-color: rgba(126,226,184,0.4); }
.copy-btn:focus-visible { outline-color: var(--gold); }
.code-block pre { margin: 0; padding: 16px 18px; overflow-x: auto; font: 0.88rem/1.7 var(--mono); color: var(--code-ink); tab-size: 4; }
.code-block pre:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: 0; }
.code-block code { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; overflow-wrap: normal; }
.t-kw { color: #ff8fa3; } .t-str { color: #a8e6a1; } .t-com { color: #7f8796; font-style: italic; } .t-num { color: #ffc27a; }
.t-fn { color: #82b6ff; } .t-call { color: #82b6ff; } .t-bi { color: #e8c96a; } .t-dec { color: #d5a6ff; } .t-var { color: #ffc27a; }

/* Callouts */
.callout { position: relative; padding: 16px 18px 16px 20px; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--r-md); background: var(--surface); font-size: 1rem; line-height: 1.65; }
.callout > * + * { margin-top: 0.6em; }
.callout-title { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.callout-analogy { border-left-color: var(--gold); background: color-mix(in srgb, var(--gold-soft) 55%, var(--surface)); }
.callout-analogy .callout-title { color: var(--gold-ink); }
.callout-tip { border-left-color: var(--green); background: color-mix(in srgb, var(--green-soft) 60%, var(--surface)); }
.callout-tip .callout-title { color: var(--green); }
.callout-mistake { border-left-color: var(--red); background: color-mix(in srgb, var(--red-soft) 60%, var(--surface)); }
.callout-mistake .callout-title { color: var(--red); }
.callout-example { border-left-color: var(--tech); background: color-mix(in srgb, var(--tech-soft) 55%, var(--surface)); }
.callout-example .callout-title { color: var(--tech-ink); }
.callout-note, .callout-remember { border-left-color: #8b5cf6; }
.callout-note .callout-title, .callout-remember .callout-title { color: #7c3aed; }
[data-theme="dark"] .callout-note .callout-title, [data-theme="dark"] .callout-remember .callout-title { color: #b79cff; }
.visual-host { margin-block: 2em; }

/* Task, takeaways */
.task-card { display: grid; gap: 12px; padding: 26px 28px; border: 1px dashed var(--route-mid); border-radius: var(--r-lg); background: var(--route-soft); }
.task-kicker { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--route-text); }
.task-text { font-size: 1.12rem; line-height: 1.65; color: var(--ink); font-weight: 500; }
.takeaways { padding: 26px 28px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.takeaways ol { list-style: none; counter-reset: tk; display: grid; gap: 12px; margin-top: 16px; }
.takeaways li { counter-increment: tk; display: grid; grid-template-columns: 30px 1fr; gap: 12px; line-height: 1.6; }
.takeaways li::before { content: counter(tk); display: grid; place-items: center; width: 26px; height: 26px; margin-top: 1px; border-radius: 8px; background: var(--route-soft); color: var(--route-text); font: 700 0.78rem var(--mono); }

/* Quiz */
.quiz-wrap { margin-top: 24px; padding: 26px 28px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.quiz-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 18px; }
.quiz-head p { font-size: 0.84rem; color: var(--slate); }
.quiz { display: grid; gap: 22px; }
.quiz-q legend { display: flex; gap: 12px; margin-bottom: 12px; font-weight: 700; color: var(--ink); line-height: 1.5; font-size: 1.02rem; }
.quiz-n { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 0.78rem; }
.quiz-opts { display: grid; gap: 8px; }
.quiz-opt { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: center; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-md); cursor: pointer; transition: border-color 0.15s, background 0.15s; line-height: 1.45; }
.quiz-opt:hover { border-color: var(--line-strong); background: var(--surface-2); }
.quiz-opt input { position: absolute; opacity: 0; pointer-events: none; }
.quiz-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.quiz-letter { display: grid; place-items: center; width: 28px; height: 28px; border: 1.5px solid var(--line-strong); border-radius: 8px; font-size: 0.8rem; font-weight: 700; color: var(--slate); }
.quiz-q.is-answered .quiz-opt { cursor: default; }
.quiz-q.is-answered .quiz-opt:hover { background: transparent; }
.quiz-opt.is-correct { border-color: var(--green); background: var(--green-soft); }
.quiz-opt.is-correct .quiz-letter { border-color: var(--green); background: var(--green); color: #fff; }
.quiz-opt.is-wrong { border-color: var(--red); background: var(--red-soft); }
.quiz-opt.is-wrong .quiz-letter { border-color: var(--red); background: var(--red); color: #fff; }
.quiz-q.is-answered .quiz-opt:not(.is-correct):not(.is-wrong) { opacity: 0.6; }
.quiz-feedback { margin-top: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); font-size: 0.94rem; animation: stepIn 0.3s var(--ease); }
.quiz-verdict { font-weight: 800; }
.quiz-verdict.is-right { color: var(--green); }
.quiz-verdict.is-wrong { color: var(--red); }
.quiz-explain { color: var(--ink-2); margin-top: 2px; }
.quiz-result { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-radius: var(--r-md); background: var(--gold-soft); }
.quiz-score { font-weight: 800; color: var(--ink); }
.quiz-answers { margin-top: 12px; }
.quiz-answers summary { cursor: pointer; font-weight: 700; }
.quiz-answers ol { margin-top: 10px; padding-left: 1.3em; display: grid; gap: 6px; }

/* Resources + deeper (lesson) */
.resource-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.resource-tile { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color 0.15s, transform 0.18s var(--ease), box-shadow 0.18s; }
.resource-tile:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--lift); }
.resource-tile strong { display: block; font-size: 0.95rem; }
.resource-tile small { color: var(--slate); font-size: 0.8rem; }
.resource-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--gold-soft); color: var(--gold-ink); }
.resource-ic-yt { background: rgba(255,0,51,0.1); color: #e00030; }
.go-deeper { display: grid; gap: 12px; margin-top: 32px; }
.deeper-box { padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.deeper-box-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 800; color: var(--ink); font-size: 0.95rem; }
.more-list { list-style: none; display: grid; gap: 8px; }
.more-list a { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; padding: 6px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.9rem; line-height: 1.35; }
.more-list a:hover { background: var(--surface); }
.more-list img { border-radius: 6px; aspect-ratio: 16/9; object-fit: cover; }
.more-list small { display: block; color: var(--slate); font-weight: 500; font-size: 0.78rem; margin-top: 2px; }
.complete-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: 32px; padding: 24px 26px; border-radius: var(--r-lg); background: var(--inv-bg); color: var(--inv-muted); }
.complete-title { color: var(--inv-ink); font-weight: 800; font-size: 1.1rem; }
.complete-text { font-size: 0.92rem; }
.complete-card .btn-primary { --btn-bg: var(--gold); --btn-ink: #111; --btn-line: var(--gold); }
.complete-card .btn.is-done { --btn-bg: transparent; --btn-ink: #7ee2b8; --btn-line: rgba(126,226,184,0.45); }
.complete-card :focus-visible { outline-color: var(--gold); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.pager-link { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-decoration: none; transition: border-color 0.15s, transform 0.18s var(--ease); }
.pager-link:hover { border-color: var(--route); transform: translateY(-2px); }
.pager-link.is-next { text-align: right; justify-items: end; }
.pager-dir { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700; color: var(--slate); text-transform: uppercase; letter-spacing: 0.06em; }
.pager-title { font-weight: 700; color: var(--ink); line-height: 1.35; }

/* TOC */
.lesson-toc { position: sticky; top: 66px; padding-block: 36px; max-height: calc(100vh - 66px); overflow-y: auto; scrollbar-width: thin; }
.toc-title { margin-bottom: 10px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.toc-list, .toc-list ol { list-style: none; }
.toc-list { display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc-list a { display: flex; gap: 8px; margin-left: -1px; padding: 5px 0 5px 14px; border-left: 2px solid transparent; color: var(--slate); font-size: 0.84rem; line-height: 1.4; text-decoration: none; transition: color 0.15s, border-color 0.15s; }
.toc-list a span { font: 700 0.7rem/1.9 var(--mono); color: var(--faint); }
.toc-list a:hover { color: var(--ink); }
.toc-list a.is-active { color: var(--ink); font-weight: 700; border-left-color: var(--route); }
.toc-list ol a { padding-left: 32px; font-size: 0.8rem; }
.toc-card { display: grid; gap: 8px; margin-top: 24px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }

/* 9. Library ---------------------------------------------------------------- */
.page-hero { padding-block: clamp(32px, 5vw, 56px) clamp(24px, 3vw, 36px); }
.page-hero .h-display { margin-bottom: 14px; }
.library-search { position: relative; max-width: 560px; margin-top: 24px; }
.library-search .ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--slate); pointer-events: none; }
.library-search input { width: 100%; min-height: 54px; padding: 0 20px 0 50px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); font-size: 1rem; box-shadow: var(--lift); }
.library-search input:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.library-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(24px, 3vw, 40px); align-items: start; }
.no-js .library-grid { grid-template-columns: 1fr; }
.library-aside { position: sticky; top: 86px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; }
.filters-toggle > summary { display: none; }
.filters { display: grid; gap: 22px; }
.filter-group legend { margin-bottom: 8px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.filter-opt { position: relative; display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; margin-inline: -8px; border-radius: var(--r-sm); cursor: pointer; font-size: 0.9rem; color: var(--ink-2); }
.filter-opt:hover { background: var(--surface-2); }
.filter-opt input { position: absolute; opacity: 0; pointer-events: none; }
.filter-box { display: grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid var(--line-strong); border-radius: 5px; color: transparent; background: var(--surface); }
.filter-opt input:checked + .filter-box { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.filter-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 0; }
.filter-label { display: inline-flex; align-items: center; gap: 7px; }
.filter-label .ic { color: var(--faint); }
.filter-count { font-size: 0.76rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.results-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; min-height: 36px; }
.results-count { font-weight: 700; color: var(--ink); }
.active-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); font-size: 0.8rem; font-weight: 600; color: var(--ink); }
.chip:hover { border-color: var(--ink); }
.card-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-5); }
.lesson-card { position: relative; display: flex; flex-direction: column; height: 100%; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s; }
.lesson-card:hover { transform: translateY(-3px); box-shadow: var(--lift-lg); border-color: var(--line-strong); }
.lesson-card:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.lesson-card-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--surface-3); overflow: hidden; }
.lesson-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.lesson-card:hover .lesson-card-thumb img { transform: scale(1.04); }
.lesson-card-done { position: absolute; top: 10px; left: 10px; display: none; align-items: center; gap: 4px; padding: 4px 10px 4px 8px; border-radius: var(--r-pill); background: var(--green); color: #fff; font-size: 0.74rem; font-weight: 700; }
.lesson-card.is-done .lesson-card-done { display: inline-flex; }
.lesson-card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.lesson-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.76rem; color: var(--slate); font-weight: 600; }
.lesson-card-title { font-size: 1.02rem; font-weight: 800; line-height: 1.35; color: var(--ink); }
.lesson-card-title a { text-decoration: none; }
.lesson-card-title a::after { content: ''; position: absolute; inset: 0; }
.lesson-card-title a:focus-visible { outline: none; }
.lesson-card-text { color: var(--slate); font-size: 0.88rem; line-height: 1.5; flex: 1; }
.lesson-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 0.78rem; color: var(--slate); }
.lesson-card-time { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font-variant-numeric: tabular-nums; }
.empty-state { display: grid; justify-items: center; gap: 10px; padding: 64px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); text-align: center; color: var(--slate); }
.empty-title { font-weight: 800; color: var(--ink); font-size: 1.1rem; }

/* 10. Progress -------------------------------------------------------------- */
.dash-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; margin-bottom: var(--s-6); padding: 24px 28px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.dash-empty > div { flex: 1 1 280px; display: grid; gap: 4px; }
.dash-empty p { color: var(--slate); }
.dash-empty-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--green-soft); color: var(--green); }
.dash-top { display: grid; gap: var(--s-5); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.stat { display: flex; flex-direction: column; gap: 6px; padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.stat dt { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; font-weight: 600; color: var(--slate); }
.stat dd { display: flex; align-items: baseline; gap: 6px; font-family: var(--display); font-size: 2.4rem; font-weight: 800; line-height: 1.05; color: var(--ink); }
.stat dd small { font-family: var(--font); font-size: 0.9rem; font-weight: 600; color: var(--slate); }
.stat-foot { font-size: 0.8rem; color: var(--slate); }
.stat-gold { background: var(--gold-soft); border-color: transparent; }
.stat-gold dt .ic { color: var(--gold-ink); }
.dash-panel { padding: 24px 26px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.dash-panel > .h-card { margin-bottom: 16px; }
.dash-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 18px; }
.dash-week { display: flex; gap: 6px; }
.dash-week span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); font-size: 0.72rem; font-weight: 700; color: var(--slate); }
.dash-week span.is-on { background: var(--gold); border-color: var(--gold); color: #111; }
.dash-week span.is-today { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 16px); grid-auto-columns: 16px; justify-content: start; gap: 5px; overflow-x: auto; padding-bottom: 4px; }
.heatmap i { width: 16px; height: 16px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); }
.heatmap i.l1 { background: color-mix(in srgb, var(--gold) 35%, var(--surface)); border-color: transparent; }
.heatmap i.l2 { background: color-mix(in srgb, var(--gold) 65%, var(--surface)); border-color: transparent; }
.heatmap i.l3 { background: var(--gold); border-color: transparent; }
.heatmap i.is-future { visibility: hidden; }
.heatmap-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 10px; font-size: 0.74rem; color: var(--slate); }
.heatmap-legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); }
.heatmap-legend i.l1 { background: color-mix(in srgb, var(--gold) 35%, var(--surface)); }
.heatmap-legend i.l2 { background: color-mix(in srgb, var(--gold) 65%, var(--surface)); }
.heatmap-legend i.l3 { background: var(--gold); }
.heatmap-legend span:first-child { margin-right: 4px; } .heatmap-legend span:last-child { margin-left: 4px; }
.dash-tracks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); }
.dash-track { padding: 26px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.dash-track-head { display: flex; gap: 20px; align-items: center; margin-bottom: 20px; }
.dash-track-head > div { display: grid; gap: 4px; justify-items: start; }
.dash-track .eyebrow { color: var(--route-text); }
.dash-track-title { font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.dash-track-title a { text-decoration: none; }
.dash-track-title a:hover { text-decoration: underline; }
.dash-track-text { font-size: 0.86rem; color: var(--slate); margin-bottom: 6px; }
.dash-phases { list-style: none; display: grid; gap: 10px; }
.dash-phases li { display: grid; grid-template-columns: minmax(0, 1fr) 110px 44px; gap: 12px; align-items: center; font-size: 0.86rem; }
.dash-phase-name { display: flex; gap: 8px; color: var(--ink-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-phase-name span { font: 700 0.72rem/1.7 var(--mono); color: var(--faint); }
.dash-phase-count { text-align: right; font-size: 0.78rem; font-weight: 700; color: var(--slate); font-variant-numeric: tabular-nums; }
.dash-two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); align-items: start; }
.history { list-style: none; display: grid; gap: 2px; max-height: 420px; overflow-y: auto; }
.history li a { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 10px 8px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 0.9rem; }
.history li a:hover { background: var(--surface-2); }
.history small { color: var(--slate); font-weight: 500; font-size: 0.78rem; white-space: nowrap; }
.score-table td:not(:first-child), .score-table th:not(:first-child) { text-align: right; white-space: nowrap; }
.score-table a { color: var(--ink); font-weight: 600; text-decoration: none; }
.score-table a:hover { text-decoration: underline; }
.score-good { color: var(--green); font-weight: 800; }
.data-panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; }
.data-panel > div:first-child { flex: 1 1 380px; display: grid; gap: 8px; }
.data-panel p { color: var(--slate); }
.data-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.file-btn { cursor: pointer; }
.file-btn:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

/* 11. Resources ------------------------------------------------------------- */
.sheet-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: var(--s-4); }
.sheet-card { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 22px; border: 1px solid var(--line); border-top: 4px solid var(--route); border-radius: var(--r-lg); background: var(--surface); }
.sheet-kicker { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--route-text); }
.sheet-title { font-size: 1.05rem; font-weight: 800; color: var(--ink); line-height: 1.35; }
.sheet-text { font-size: 0.88rem; color: var(--slate); flex: 1; }
.sheet-lessons { width: 100%; margin-top: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.sheet-lessons summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; font-size: 0.84rem; font-weight: 700; color: var(--slate); }
.sheet-lessons summary::-webkit-details-marker { display: none; }
.sheet-lessons[open] summary .ic { transform: rotate(180deg); }
.sheet-lessons ul { list-style: none; display: grid; gap: 2px; margin-top: 8px; }
.sheet-lessons a { display: flex; gap: 8px; align-items: flex-start; padding: 6px; border-radius: 6px; font-size: 0.84rem; color: var(--ink-2); text-decoration: none; line-height: 1.4; }
.sheet-lessons a:hover { background: var(--surface-2); color: var(--ink); }
.sheet-lessons a .ic { flex: none; margin-top: 2px; color: var(--faint); }
.link-grid { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
.link-card { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color 0.15s, transform 0.18s var(--ease); }
.link-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.link-card > .ic:first-child { justify-self: center; color: var(--gold-ink); }
.link-card small { display: block; color: var(--slate); font-size: 0.84rem; }

/* 12. Search dialog + toast ------------------------------------------------- */
.search-dialog { width: min(640px, calc(100vw - 24px)); max-height: min(620px, calc(100vh - 80px)); margin: 10vh auto auto; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--ink-2); box-shadow: 0 30px 80px rgba(0,0,0,0.35); overflow: hidden; }
.search-dialog::backdrop { background: rgba(10, 10, 12, 0.5); backdrop-filter: blur(4px); }
.search-dialog[open] { animation: stepIn 0.2s var(--ease); }
.search-box { display: flex; flex-direction: column; max-height: inherit; }
.search-field { display: flex; align-items: center; gap: 12px; padding: 0 14px 0 18px; border-bottom: 1px solid var(--line); color: var(--slate); }
.search-field input { flex: 1; min-width: 0; height: 60px; border: 0; background: none; font-size: 1.05rem; color: var(--ink); }
.search-field input:focus { outline: none; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-esc { border: 0; background: none; padding: 4px; }
.search-results { list-style: none; overflow-y: auto; padding: 8px; flex: 1; }
.search-results li a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 11px 12px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
.search-results li a small { grid-column: 1; color: var(--slate); font-size: 0.8rem; }
.search-results li a .sr-tag { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.search-results li a mark { background: var(--gold-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-results li[aria-selected="true"] a { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--gold); }
.search-results .sr-empty, .search-results .sr-hint { padding: 22px 12px; color: var(--slate); font-size: 0.92rem; text-align: center; }
.search-results .sr-group { padding: 10px 12px 4px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.search-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 0.78rem; color: var(--slate); }
.search-foot span { display: inline-flex; align-items: center; gap: 4px; }
.search-foot a { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-weight: 700; text-decoration: none; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translateX(-50%); padding: 12px 18px; border-radius: var(--r-pill); background: var(--ink); color: var(--paper); font-size: 0.9rem; font-weight: 600; box-shadow: var(--lift-lg); animation: toastIn 0.3s var(--ease); max-width: calc(100vw - 32px); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 13. Motion ------------------------------------------------------------------ */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    .js .reveal { opacity: 1; transform: none; }
}

/* Dark-mode fixes for the reused interactive visuals (visuals.css was drawn for light) */
[data-theme="dark"] .lcv-tk.c0 { background: rgba(234,179,8,0.25); }
[data-theme="dark"] .lcv-tk.c1 { background: rgba(111,143,255,0.25); }
[data-theme="dark"] .lcv-tk.c2 { background: rgba(60,207,145,0.22); }
[data-theme="dark"] .lcv-tk.c3 { background: rgba(236,130,210,0.22); }
[data-theme="dark"] .lcv-bar.is-right .lcv-bar-fill { background: rgba(111,143,255,0.45); }
[data-theme="dark"] .lcv-result.is-bad { color: #ffb4b4; }
[data-theme="dark"] .lcv-result.is-good { color: #9ff0c9; }

/* 14. Responsive ------------------------------------------------------------- */
@media (max-width: 1240px) {
    .lesson-layout { grid-template-columns: 270px minmax(0, 1fr); }
    .lesson-toc { display: none; }
    .lc-nav a { padding: 8px 9px; font-size: 0.85rem; }
    .search-trigger-text { display: none; }
    .search-trigger { padding: 0 8px 0 12px; }
}
@media (max-width: 1080px) {
    .sitebar-nav { display: none; }
    .sitebar-social { margin-left: auto; }
    .js .lc-nav { position: fixed; inset: 104px 0 auto 0; z-index: 39; display: none; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px var(--gutter) 20px; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--lift-lg); max-height: calc(100vh - 104px); overflow-y: auto; }
    .js .lc-nav.is-open { display: flex; }
    .js .lc-nav a { padding: 13px 12px; font-size: 1rem; }
    .js .lc-nav a[aria-current="page"]::after { left: 0; right: auto; top: 12px; bottom: 12px; width: 3px; height: auto; }
    .js .lc-nav .lc-nav-back { display: flex !important; align-items: center; gap: 8px; margin-top: 8px; border-top: 1px solid var(--line); border-radius: 0; padding-top: 18px; }
    .js .menu-btn { display: inline-grid !important; }
    .no-js .lc-header-inner { flex-wrap: wrap; padding-block: 10px; }
    .no-js .lc-nav { order: 3; width: 100%; overflow-x: auto; margin: 0; }
    .lc-actions { margin-left: auto; }
    .hero-grid, .picker-grid, .how-grid, .faq-grid, .track-hero-grid { grid-template-columns: 1fr; }
    .hero-visual { width: min(100%, 360px); }
    .entry-grid { grid-template-columns: repeat(2, 1fr); }
    .yt-grid { grid-template-columns: repeat(2, 1fr); }
    .track-grid, .deeper-grid, .dash-tracks, .dash-two { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-top { grid-template-columns: 1fr; }

    .lesson-layout { grid-template-columns: minmax(0, 1fr); }
    .lesson-head-actions { display: flex; }
    .js .lesson-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(340px, 88vw); max-height: none; padding: 20px; background: var(--paper); border-right: 1px solid var(--line); box-shadow: var(--lift-lg); transform: translateX(-105%); transition: transform 0.3s var(--ease); visibility: hidden; }
    .js .lesson-sidebar.is-open { transform: none; visibility: visible; }
    .js .side-close { display: inline-grid !important; }
    .js .drawer-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(10,10,12,0.45); }
    .no-js .lesson-sidebar { position: static; max-height: none; order: 3; }
    .lesson-main { justify-self: stretch; max-width: 780px; }
    .library-grid { grid-template-columns: 1fr; }
    .library-aside { position: static; max-height: none; }
    .filters-toggle { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
    .filters-toggle > summary { display: flex; align-items: center; gap: 8px; padding: 14px 16px; font-weight: 700; color: var(--ink); cursor: pointer; list-style: none; }
    .filters-toggle > summary::-webkit-details-marker { display: none; }
    .filters-toggle .filters { padding: 4px 16px 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .filters-active { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); background: var(--ink); color: var(--paper); font-size: 0.74rem; }
}
@media (max-width: 760px) {
    .sitebar-back span { font-size: 0.78rem; }
    .brand-name, .brand-divider { display: none; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .hero-stats > div:nth-child(3) { border-left: 0; }
    .hero-stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
    .hero-stats > div { padding: 16px 14px; }
    .float-lesson { left: -2%; width: 210px; }
    .map-grid { grid-template-columns: 1fr 1fr; }
    .choice-grid { grid-template-columns: 1fr; }
    .about-grid, .resource-row, .link-grid, .course-row { grid-template-columns: 1fr; }
    .track-stats { grid-template-columns: repeat(2, 1fr); }
    .track-stats > div:nth-child(3) { border-left: 0; }
    .track-stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
    .phase-head { grid-template-columns: 1fr 22px; gap: 8px 12px; padding: 18px; }
    .phase-num { grid-column: 1; }
    .phase-main { grid-column: 1; }
    .phase-side { grid-column: 1; }
    .phase-chevron { grid-column: 2; grid-row: 1; }
    .phase-body { padding: 0 12px 16px; }
    .lesson-row { grid-template-columns: 30px minmax(0, 1fr); padding: 12px 6px; }
    .lesson-row-meta { grid-column: 2; gap: 10px; }
    .lesson-row-time { text-align: left; min-width: 0; }
    .step-nav ol { grid-template-columns: repeat(2, 1fr); }
    .pager { grid-template-columns: 1fr; }
    .pager-link.is-next { text-align: left; justify-items: start; }
    .other-track { padding: 22px; }
    .course-card { grid-template-columns: 110px 1fr; }
    .dash-track-head { flex-direction: column; align-items: flex-start; }
    .dash-phases li { grid-template-columns: minmax(0, 1fr) 70px 40px; }
    .quiz-wrap, .takeaways, .task-card { padding: 20px; }
    .prose { font-size: 1.03rem; }
    .prose-lead { font-size: 1.08rem; }
}
@media (max-width: 520px) {
    .entry-grid, .yt-grid, .stat-grid { grid-template-columns: 1fr; }
    .map-grid { grid-template-columns: 1fr; }
    .hero-actions .btn { flex: 1 1 100%; }
    .sitebar-social { display: none; }
    .float-stat { display: none; }
    .search-foot span { display: none; }
    .btn-lg { min-height: 50px; }
    .footer-cols { grid-template-columns: 1fr 1fr; gap: var(--s-5); }
}

/* 15. Print (lesson pages print as clean notes) ------------------------------ */
@media print {
    .sitebar, .lc-header, .lc-footer, .lesson-sidebar, .lesson-toc, .step-nav, .video, .complete-card, .pager, .go-deeper, .resource-row, .search-dialog, .toast, .lesson-head-actions, .copy-btn, .quiz-wrap { display: none !important; }
    body { background: #fff; color: #000; }
    .lesson-layout { display: block; }
    .code-block { box-shadow: none; }
    a { text-decoration: none; }
}

/* Header fit: never wrap nav labels; collapse progressively */
.lc-nav a, .search-trigger, .kbd, .brand { white-space: nowrap; }
.menu-btn { display: none; }
@media (max-width: 1360px) { .search-trigger-text { display: none; } .search-trigger { padding: 0 8px 0 12px; } }
@media (max-width: 1240px) and (min-width: 1081px) { .brand-name, .brand-divider { display: none; } }
body { overflow-x: clip; }
@media (max-width: 420px) { .search-trigger .kbd { display: none; } .search-trigger { padding: 0; width: 42px; justify-content: center; } }

/* ==========================================================================
   Review fixes (student review, Nov 2026)
   ========================================================================== */

/* #2 Returning visitors: Resume card at the top of the hero */
.hero-resume { display: flex; align-items: center; gap: 16px 20px; width: 100%; max-width: 560px; padding: 14px 14px 14px 18px; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--lift); }
.hero-resume-main { display: grid; gap: 4px; min-width: 0; flex: 1; }
.hero-resume-kicker { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-ink); }
.hero-resume-title { font-weight: 800; color: var(--ink); line-height: 1.3; }
.hero-resume-title a { text-decoration: none; }
.hero-resume-title a:hover { text-decoration: underline; }
.hero-resume-meta { font-size: 0.8rem; color: var(--slate); }
.hero-resume .continue-bar { width: 100%; max-width: 260px; height: 5px; margin-top: 4px; }
.hero-resume .btn { flex: none; }

/* #7 Phone: compact "Start where you are" chips under the hero buttons */
.hero-doors { display: none; }
@media (max-width: 767px) {
    .hero-doors { display: grid; gap: 8px; width: 100%; }
    .hero-doors-label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
    .hero-doors ul { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .hero-doors a { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-size: 0.9rem; font-weight: 700; text-decoration: none; }
    .hero-doors a .ic { flex: none; color: var(--gold-ink); }
    .hero-doors a:active { background: var(--surface-2); }
    .hero-trust { font-size: 0.82rem; }
}

/* #9 Featured lesson card is a real link now */
a.float-lesson { display: grid; gap: 6px; color: inherit; text-decoration: none; transition: transform 0.2s var(--ease), box-shadow 0.2s; }
a.float-lesson:hover { transform: translateY(-3px); animation-play-state: paused; }
.float-go { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; font-weight: 800; color: var(--ink); }

/* #6 Deep-dive labels */
.pill-deep { background: var(--gold-soft); color: var(--gold-ink); }
.lesson-row-meta .pill-deep { padding: 2px 8px; font-size: 0.7rem; }
.path-len .pill-deep { margin-right: 8px; padding: 2px 8px; font-size: 0.68rem; background: rgba(234,179,8,0.16); color: var(--gold); }
.deep-note { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; padding: 12px 14px; border-radius: var(--r-md); background: var(--gold-soft); color: var(--ink-2); font-size: 0.92rem; line-height: 1.55; }
.deep-note .ic { flex: none; margin-top: 2px; color: var(--gold-ink); }
.deep-note strong { color: var(--ink); }

/* #1 Saved path on lesson pages */
.path-label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 10px; font-size: 0.84rem; font-weight: 600; color: var(--slate); }
.path-label a { color: var(--ink); font-weight: 700; }
.path-label-ic { color: var(--gold); font-size: 0.7rem; margin-right: 2px; }
.path-next { margin-top: 16px; }
.path-next-link { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; padding: 18px 20px; border: 1.5px solid var(--gold); border-radius: var(--r-md); background: var(--gold-soft); color: var(--ink); text-decoration: none; transition: transform 0.18s var(--ease), box-shadow 0.18s; }
.path-next-link:hover { transform: translateY(-2px); box-shadow: var(--lift); }
.path-next-kicker { font-size: 0.76rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-ink); }
.path-next-title { grid-column: 1; font-weight: 800; font-size: 1.05rem; line-height: 1.35; }
.path-next-go { grid-column: 2; grid-row: 1 / span 2; font-size: 1.4rem; font-weight: 800; }

/* #5 Phone: sticky "Mark complete / Next" bar on lessons */
.mobile-bar { display: none; }
@media (max-width: 767px) {
    .mobile-bar-on .mobile-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
    .mobile-bar .btn { min-height: 48px; padding-inline: 12px; }
    .mobile-bar-on { padding-bottom: 76px; }
    .mobile-bar-on .toast { bottom: 88px; }
    .mobile-bar-on .lc-footer { padding-bottom: calc(var(--s-8) + 8px); }
}

/* #10 Phone library: compact rows instead of big cards */
@media (max-width: 767px) {
    .library .card-grid { grid-template-columns: 1fr; gap: 10px; }
    .library .lesson-card { flex-direction: row; align-items: stretch; }
    .library .lesson-card-thumb { flex: none; width: 112px; aspect-ratio: auto; min-height: 100%; }
    .library .lesson-card-thumb img { position: absolute; inset: 0; }
    .library .lesson-card-done { top: 6px; left: 6px; padding: 2px 6px; font-size: 0.66rem; }
    .library .lesson-card-body { padding: 10px 12px; gap: 4px; }
    .library .lesson-card-text { display: none; }
    .library .lesson-card-title { font-size: 0.95rem; }
    .library .lesson-card-meta { font-size: 0.7rem; }
    .library .lesson-card-meta .pill { padding: 2px 8px; font-size: 0.68rem; }
    .library .lesson-card-foot { padding-top: 6px; border-top: 0; gap: 6px 10px; }
    .library .lesson-card-foot .formats .fmt:not(.fmt-video):not(.fmt-interactive) { display: none; }
    .library .lesson-card-level { display: none; }
}

/* #11 Keyboard hint only where there is a keyboard; a search button on touch screens */
.hint-touch { display: none; }
@media (max-width: 767px), (hover: none) {
    .hint-desktop { display: none; }
    .hint-touch { display: inline-flex; margin-top: 16px; }
    .library-search { margin-top: 12px; }
}

/* #14 Bigger tap areas on phones (visual size unchanged; padding grows the hit area) */
@media (max-width: 767px) {
    .sitebar-inner { min-height: 44px; }
    .sitebar-back { min-height: 44px; padding-right: 12px; }
    .crumbs a, .lesson-kicker a, .path-label a { display: inline-block; padding-block: 12px; margin-block: -12px; }
    .footer-cols a { padding: 11px 0; }
    .text-link { padding-block: 12px; margin-block: -12px; }
    .yt-title a { display: block; padding-block: 4px; }
}

/* #15 Wide tables: edge shadows + hint while there is more to scroll */
.table-wrap {
    background:
        linear-gradient(to right, var(--surface) 30%, transparent) left / 32px 100% no-repeat local,
        linear-gradient(to left, var(--surface) 30%, transparent) right / 32px 100% no-repeat local,
        radial-gradient(farthest-side at 0 50%, rgba(0,0,0,0.14), transparent) left / 12px 100% no-repeat scroll,
        radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,0.14), transparent) right / 12px 100% no-repeat scroll,
        var(--surface);
}
.table-wrap.is-wide::after { content: 'Swipe sideways to see the whole table →'; position: sticky; left: 0; display: block; padding: 6px 12px; border-top: 1px solid var(--line); font-size: 0.76rem; font-weight: 600; color: var(--slate); background: var(--surface-2); }
.table-wrap.is-wide.is-scrolled-end::after { content: '← Swipe back'; }
@media (hover: hover) and (min-width: 768px) { .table-wrap.is-wide::after { content: 'Scroll sideways to see the whole table →'; } }

/* #16 Comfortable reading measure (~70 characters); videos, code and tables keep the full width */
.prose > p, .prose > ul, .prose > ol, .prose > blockquote, .prose > h2, .prose > h3, .prose > h4, .lesson-summary, .task-text { max-width: 37em; } /* ≈70 characters in Plus Jakarta Sans (its "ch" unit is unusually wide) */

/* Group 3: glossary page + finish estimate */
.az { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.az a { display: grid; place-items: center; min-width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-weight: 700; text-decoration: none; }
.az a:hover { border-color: var(--ink); }
.glossary { display: grid; gap: 28px; max-width: 860px; }
.gl-group { display: grid; grid-template-columns: 64px 1fr; gap: 16px; scroll-margin-top: 90px; }
.gl-letter { font-family: var(--display); font-size: 2.4rem; font-weight: 800; color: var(--gold-ink); line-height: 1; }
.gl-group dl { display: grid; gap: 12px; }
.gl-item { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); scroll-margin-top: 90px; }
.gl-item:target { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.gl-item dt { font-weight: 800; color: var(--ink); font-size: 1.05rem; }
.gl-item dd { margin: 6px 0 0; display: grid; gap: 8px; justify-items: start; }
.gl-item dd p { color: var(--ink-2); line-height: 1.6; }
@media (max-width: 520px) { .gl-group { grid-template-columns: 1fr; gap: 6px; } .gl-letter { font-size: 1.8rem; } }
.finish-est { margin-bottom: 10px; font-size: var(--fs-sm); color: var(--slate); }
.finish-est select { min-height: 36px; margin: 0 2px; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-weight: 700; }
.finish-est strong { color: var(--ink); }

/* Hero visual: chat-style "where do I start?" card */
.hero-visual { position: relative; justify-self: center; width: 100%; max-width: 600px; height: auto; aspect-ratio: auto; }
.hero-visual::before { /* stacked-paper backdrop */
    content: ""; position: absolute; inset: 18px -14px -14px 18px; z-index: -1; border-radius: 26px;
    background: linear-gradient(135deg, var(--gold-soft), color-mix(in srgb, var(--tech) 14%, transparent)); transform: rotate(2.5deg);
}
.hero-chat { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 30px 70px -30px rgba(18, 16, 10, 0.35); overflow: hidden; }

.hc-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.hc-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--gold); }
.hc-head p { display: grid; gap: 1px; margin: 0; }
.hc-head strong { font-size: 0.95rem; color: var(--ink); }
.hc-head span { font-size: 0.76rem; color: var(--slate); }

.hc-body { display: grid; gap: 14px; padding: 18px; }
.hc-q {
    justify-self: end; max-width: 80%; margin: 0; padding: 10px 16px; border-radius: 18px 18px 4px 18px;
    background: var(--ink); color: var(--surface); font-size: 0.92rem; font-weight: 600;
}
.hc-a { justify-self: start; max-width: 94%; padding: 14px; border: 1px solid var(--line); border-radius: 18px 18px 18px 4px; background: var(--surface-2); }
.hc-a > p { margin: 0 0 12px; font-size: 0.9rem; line-height: 1.5; color: var(--ink); }
.hc-lessons { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hc-lessons a {
    display: grid; grid-template-columns: 24px 92px minmax(0, 1fr); align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--line);
    border-radius: 12px; background: var(--surface); color: inherit; text-decoration: none; transition: border-color 0.2s, transform 0.2s var(--ease);
}
.hc-lessons a:hover { border-color: var(--tech); transform: translateX(3px); }
.hc-step { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #111; font-size: 0.74rem; font-weight: 800; }
.hc-thumb { display: block; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.hc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hc-lesson { display: grid; gap: 2px; min-width: 0; }
.hc-title { font-size: 0.88rem; font-weight: 800; line-height: 1.3; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-meta { display: flex; align-items: center; gap: 5px; font-size: 0.74rem; color: var(--faint); }
.hc-meta .ic { color: var(--tech-ink); }

.hc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.hc-foot > span { width: 100%; font-size: 0.74rem; font-weight: 700; color: var(--faint); }
.hc-foot a {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px;
    color: var(--ink); font-size: 0.82rem; font-weight: 700; text-decoration: none; transition: border-color 0.2s, background 0.2s;
}
.hc-foot a:hover { border-color: var(--tech); background: var(--surface-2); }
.hc-foot .ic { color: var(--tech-ink); }

@media (min-width: 1081px) {
    .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 4vw, 72px); align-items: center; }
}
@media (max-width: 1080px) { .hero-visual { justify-self: stretch; margin-inline: auto; } }
@media (max-width: 760px) {
    .hero-visual::before { inset: 10px -6px -8px 10px; }
    .hc-foot { display: none; } /* the same choices sit just above in "Start where you are" */
    .hc-body { padding: 14px; }
    .hc-lessons a { grid-template-columns: 22px 72px minmax(0, 1fr); gap: 8px; }
    .hc-title { white-space: normal; font-size: 0.82rem; }
}
/* Keep long text comfortable inside the wider container */
.section-head { max-width: 760px; }
.footer-top { max-width: 100%; }

/* Search: "not covered yet" notice */
.search-results .sr-request { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 4px 8px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--gold-soft); color: var(--ink-2); font-size: 0.86rem; }
.search-results .sr-request a { color: var(--ink); font-weight: 800; }

/* Phone tap targets: inline links get a 44px-tall hit area (vertical padding on inline
   elements does not move the text). Heading "#" links are hover-only, so they're removed on touch. */
@media (max-width: 767px), (hover: none) {
    .prose a, .callout a, .takeaways a, .quiz-explain a, .lesson-summary a, .notice a, .section-lede a, .tpc-text a, .hero-resume-title a, .continue-title a, .team-line a, .footer-bottom a, .lesson-byline a { padding-block: 13px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
    .prose .anchor { display: none; }
}

/* About your instructor (home) */
.instructor { display: grid; grid-template-columns: 160px 1fr; gap: clamp(20px, 3vw, 40px); align-items: center; max-width: 1100px; padding: clamp(20px, 3vw, 32px); border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); }
.instructor-photo { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--gold); }
.instructor-body { display: grid; gap: 10px; justify-items: start; }
.instructor-body .h-card-lg { margin: 0; flex-wrap: wrap; gap: 6px 12px; }
.instructor-role { font-family: var(--font); font-size: 0.95rem; font-weight: 600; color: var(--slate); }
.instructor-bio { color: var(--ink-2); line-height: 1.65; max-width: 70ch; }
.instructor-facts { list-style: none; display: grid; gap: 6px; font-size: 0.9rem; color: var(--slate); }
.instructor-facts li { display: flex; gap: 8px; align-items: flex-start; }
.instructor-facts .ic { flex: none; margin-top: 3px; color: var(--gold-ink); }
.instructor-facts strong { color: var(--ink); }
.instructor-links { display: flex; flex-wrap: wrap; gap: 8px; }
.instructor-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--ink); font-size: 0.86rem; font-weight: 700; text-decoration: none; }
.instructor-links a:hover { border-color: var(--ink); }
@media (max-width: 640px) { .instructor { grid-template-columns: 1fr; justify-items: start; } .instructor-photo { width: 96px; height: 96px; } }

/* Lesson byline + updated date */
.lesson-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 12px; font-size: 0.88rem; color: var(--slate); }
.lesson-byline img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.lesson-byline a { color: var(--ink); font-weight: 700; }
.byline-sep { color: var(--faint); }
@media (max-width: 767px) { .lesson-byline a { padding-block: 12px; } }

/* Video chapters */
.chapters { margin: -16px 0 28px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.chapters summary { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 14px; cursor: pointer; list-style: none; font-weight: 700; color: var(--ink); }
.chapters summary::-webkit-details-marker { display: none; }
.chapters summary > .ic:last-child { margin-left: auto; color: var(--slate); transition: transform 0.2s; }
.chapters[open] summary > .ic:last-child { transform: rotate(180deg); }
.chapters-count { font-size: 0.8rem; font-weight: 600; color: var(--slate); }
.chapters ol { list-style: none; max-height: 340px; overflow-y: auto; margin: 0; padding: 0 6px 6px; border-top: 1px solid var(--line); }
.chapters li a { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: baseline; min-height: 44px; padding: 10px 8px; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font-size: 0.92rem; line-height: 1.4; }
.chapters li a:hover { background: var(--surface-2); color: var(--ink); }
.ch-time { font: 600 0.8rem var(--mono); color: var(--route-text); font-variant-numeric: tabular-nums; }
.chapters-src { padding: 8px 14px 12px; font-size: 0.76rem; color: var(--faint); }

/* Team training line, shortcut hint, progress wording, practitioner option */
.team-line { display: flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 0.9rem; color: var(--slate); }
.team-line .ic { flex: none; color: var(--gold-ink); }
.team-line a { color: var(--ink); font-weight: 700; }
@media (max-width: 767px) { .team-line a { padding-block: 12px; } }
.kbd-hint { margin-top: 4px; font-size: 0.74rem; color: var(--faint); text-align: center; }
.kbd-hint .kbd { min-width: 18px; height: 18px; font-size: 0.66rem; }
.pct-secondary { color: var(--faint); font-weight: 500; }
.hero-doors .door-wide { grid-column: 1 / -1; }
.choice-grid > label:last-child:nth-child(odd) { grid-column: 1 / -1; }
.search-foot .sf-lesson { display: none; }
[data-page="lesson"] .search-foot .sf-lesson { display: inline-flex; }
@media (max-width: 760px) { [data-page="lesson"] .search-foot .sf-lesson { display: none; } }

/* Phone tap targets: every control at least 44px tall */
@media (max-width: 767px), (hover: none) {
    .icon-btn { width: 44px; height: 44px; }
    .search-trigger { min-height: 44px; }
    .brand { min-height: 44px; }
    .btn-sm { min-height: 44px; }
    .copy-btn { min-height: 44px; padding-inline: 12px; }
    .lcv button, .lcv-seg button { min-height: 44px; }
    .filter-opt { min-height: 44px; }
    .az a { min-width: 44px; height: 44px; }
    .finish-est select { min-height: 44px; }
    .track-card-title a, .dash-track-title a, .lesson-card-title a, .yt-title a, .sheet-lessons a, .history li a, .score-table a, .side-track, .phase-deeper a, .course-card-title { padding-block: 10px; }
    .sheet-lessons summary, .side-phase summary, .faq summary { min-height: 44px; }
}
@media (max-width: 767px), (hover: none) {
    .footer-social a { width: 44px; height: 44px; }
    .link-btn { min-height: 44px; }
}
@media (max-width: 767px), (hover: none) {
    .team-line a, .footer-bottom a, .notice a, .lesson-byline a { padding-block: 15px; }
    .yt-title a, .dash-track-title a, .track-card-title a { padding-block: 12px; }
}

/* Lesson notice (e.g. archived framework) */
.lesson-notice { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--red) 35%, transparent); border-left: 4px solid var(--red); border-radius: var(--r-md); background: var(--red-soft); color: var(--ink-2); font-size: 0.92rem; line-height: 1.55; }
.lesson-notice > .ic { flex: none; margin-top: 2px; color: var(--red); }
.lesson-notice > div { display: grid; gap: 6px; }
.lesson-notice-title { font-weight: 800; color: var(--ink); }
.lesson-notice-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.lesson-notice-links a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--ink); font-weight: 700; }
.lesson-notice-meta { font-size: 0.78rem; color: var(--slate); }
.lesson-notice-links { display: grid; gap: 0; }
.lesson-notice-links a { display: inline; min-height: 0; padding-block: 13px; line-height: 1.5; }
.lesson-notice-links a .ic { display: inline-block; vertical-align: -2px; margin-left: 4px; }

/* ==========================================================================
   Lesson page polish (wide screens, header, steps, reading progress)
   ========================================================================== */
/* 1. Align with the full-width header; give the reading column more room (text stays ~70 chars) */
.lesson-layout { max-width: var(--wrap); grid-template-columns: 280px minmax(0, 1fr) 250px; column-gap: clamp(24px, 3.5vw, 64px); }
.lesson-main { max-width: 860px; }
@media (max-width: 1240px) { .lesson-layout { grid-template-columns: 270px minmax(0, 1fr); } }
@media (max-width: 1080px) { .lesson-layout { grid-template-columns: minmax(0, 1fr); } }

/* 2. Title: two lines on wide screens, still bold and editorial */
.h-lesson { font-size: clamp(2rem, 2.9vw, 3rem); line-height: 1.1; max-width: 22ch; }

/* 3. Lead paragraph without the drop cap (it misaligned with Plus Jakarta Sans) */
.prose-lead > p:first-child::first-letter { float: none; margin: 0; font: inherit; color: inherit; }
.prose-lead { font-size: 1.18rem; color: var(--ink); }

/* 4. Steps: one slim row with a progress line under each step */
.step-nav ol { gap: 8px; }
.step-nav a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px 10px; }
.step-nav a span { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); color: var(--slate); font-size: 0.72rem; }
.step-nav a.is-active span, .step-nav a.is-seen span { background: var(--route); color: #fff; }
[data-theme="dark"] .step-nav a.is-active span, [data-theme="dark"] .step-nav a.is-seen span { color: #0b0b0c; }
.step-nav a::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 5px; height: 3px; border-radius: 2px; background: var(--surface-2); }
.step-nav a.is-seen::after, .step-nav a.is-active::after { background: var(--route); left: 12px; right: 12px; bottom: 5px; height: 3px; inset: auto 12px 5px 12px; }
.step-nav a.is-active::after { background: linear-gradient(90deg, var(--route) var(--step-p, 30%), var(--surface-2) var(--step-p, 30%)); }

/* 5. Reading progress: a thin bar on the sticky header (lesson pages) */
.read-progress { position: absolute; left: 0; bottom: -1px; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--read, 0)); background: var(--route, var(--gold)); transition: transform 0.1s linear; pointer-events: none; }
.lc-header { position: sticky; }

/* 6. Tidier side card */
.toc-card .kbd-hint { display: flex; justify-content: center; align-items: center; gap: 4px; margin-top: 2px; font-size: 0.72rem; }
.toc-card .kbd-hint .kbd { min-width: 20px; height: 20px; padding: 0 5px; }
.lesson-toc { padding-top: 28px; }

/* ==========================================================================
   Lesson "course layout" (proportions taken from the reference course page):
   full-height sidebar flush left, one centred 880px reading column,
   17px text with roomy spacing, "On this page" in the right margin only when it fits.
   ========================================================================== */

/* Sidebar: numbered timeline, durations under titles, per-phase counts (all sizes) */
.side-phase summary { grid-template-columns: 16px 1fr auto; gap: 10px; padding: 12px 8px; font-size: 0.9rem; }
.side-phase summary > .ic:first-child { color: var(--slate); transform: rotate(-90deg); transition: transform 0.2s; }
.side-phase[open] summary > .ic:first-child { transform: none; }
.side-phase-count { padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); font: 600 0.7rem var(--mono); color: var(--slate); }
.side-phase.is-complete .side-phase-count { border-color: var(--green); color: var(--green); }
.side-phase ol { position: relative; margin: 0 0 10px; padding: 0; border-left: 0; gap: 2px; }
.side-phase ol::before { content: ''; position: absolute; left: 21px; top: 14px; bottom: 14px; width: 1px; background: var(--line-strong); }
.side-phase a { position: relative; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; align-items: start; padding: 9px 10px 9px 8px; border-radius: var(--r-md); }
.side-status { position: relative; z-index: 1; grid-row: 1 / span 2; width: 28px; height: 28px; margin: 0; border: 1px solid var(--line-strong); background: var(--paper); color: var(--slate); }
.side-status .ic { display: none; }
.side-num { font: 600 0.68rem var(--mono); }
.side-title { grid-column: 2; font-size: 0.9rem; color: var(--ink-2); }
.side-len { grid-column: 2; margin: 0; font: 0.72rem var(--mono); color: var(--faint); }
.side-phase li.is-done .side-status { border-color: var(--green); background: var(--green); color: #fff; }
.side-phase li.is-done .side-status .ic { display: block; }
.side-phase li.is-done .side-num { display: none; }
.side-phase a[aria-current="page"] { background: var(--route-soft); }
.side-phase a[aria-current="page"] .side-status { border-color: var(--route); background: var(--route); color: #fff; }
[data-theme="dark"] .side-phase a[aria-current="page"] .side-status { color: #0b0b0c; }
.side-phase a[aria-current="page"] .side-title { color: var(--ink); font-weight: 700; }
.side-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 8px; padding: 0 8px; color: var(--slate); font-size: 0.86rem; font-weight: 600; text-decoration: none; }
.side-back:hover { color: var(--ink); }

@media (min-width: 1081px) {
    .lesson-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); column-gap: 0; max-width: none; margin: 0; padding: 0; }
    .lesson-sidebar { position: sticky; top: 66px; height: calc(100vh - 66px); max-height: none; padding: 22px 14px 40px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 55%, var(--paper)); }
    .lesson-main { width: 100%; max-width: 880px; margin: 0 auto; padding: 40px clamp(24px, 3vw, 40px) 96px; justify-self: center; box-sizing: content-box; }
    /* "On this page": hidden unless the right margin can hold it without shifting the centred column */
    .lesson-toc { display: none; }

    /* Reading: full 880px column, 17px text, generous rhythm */
    .prose { font-size: 1.06rem; line-height: 1.78; }
    .prose > * + * { margin-top: 1.2em; }
    .prose > p, .prose > ul, .prose > ol, .prose > blockquote, .prose > h2, .prose > h3, .prose > h4, .lesson-summary, .task-text { max-width: none; }
    .prose-lead { font-size: 1.1rem; font-weight: 600; line-height: 1.72; }
    .prose h2 { font-size: 1.4rem; margin-top: 2.1em; }
    .prose h3 { font-size: 1.18rem; }
    .h-lesson { font-size: clamp(2rem, 2.1vw, 2.5rem); max-width: none; line-height: 1.12; }
    .lesson-summary { font-size: 1.1rem; }
    .lesson-section { padding-top: 44px; }
    .h-step { font-size: 1.6rem; }
    .step-num { width: 36px; height: 36px; border-radius: 10px; }
}
/* Wide screens: put "On this page" in the right margin (needs ~260px beside the centred 880px column) */
@media (min-width: 1800px) {
    .lesson-toc { display: block; position: fixed; top: 124px; right: max(24px, calc((100vw - 300px - 880px - 80px) / 2 - 250px)); width: 230px; max-height: calc(100vh - 120px); padding: 0; }
}

/* Compact hero: smaller headline, tighter spacing */
.hero { padding-block: clamp(28px, 3.5vw, 52px) clamp(20px, 2.5vw, 36px); }
.hero .h-display { font-size: clamp(2.4rem, 4.1vw, 3.9rem); }
.hero-copy { gap: var(--s-5); }
.hero-stats { margin-top: clamp(24px, 3vw, 40px); }
.hero-stats > div { padding: 16px 22px; }




/* Chat card: compact so the hero stays short */
.hc-head { padding: 10px 16px; }
.hc-avatar { width: 34px; height: 34px; }
.hc-body { gap: 10px; padding: 14px 16px; }
.hc-q { padding: 8px 14px; font-size: 0.88rem; }
.hc-a { padding: 12px; }
.hc-a > p { margin-bottom: 10px; font-size: 0.86rem; }
.hc-lessons { gap: 6px; }
.hc-lessons a { grid-template-columns: 24px 76px minmax(0, 1fr); padding: 4px 6px; }
.hc-foot { flex-wrap: nowrap; padding: 10px 16px 12px; }
.hc-foot > span { width: auto; flex: none; margin-right: 2px; }
.hc-foot a { min-height: 34px; padding: 4px 10px; font-size: 0.8rem; white-space: nowrap; }
@media (max-width: 1280px) { .hc-foot > span { display: none; } }

/* ---------- Polish pass (v1.13) ---------- */
/* Sections: a little less empty space between them */
:root { --section-y: clamp(56px, 7vw, 92px); }

/* Home "What's inside": icon beside the text, no repeated big numbers */
.map-tile { grid-template-columns: 44px minmax(0, 1fr); column-gap: 16px; row-gap: 4px; align-items: start; padding: 22px 48px 22px 22px; }
.map-icon { grid-row: span 2; margin-bottom: 0; }
.map-label { align-self: end; }
.map-arrow { top: 22px; right: 20px; }

/* Home instructor card uses the full width */
.instructor { max-width: none; grid-template-columns: 180px minmax(0, 1fr); }
.instructor-photo { width: 180px; height: 180px; }
.instructor-bio { max-width: 72ch; }

/* Home corporate card: training photos fill the space above the buttons */
.deeper-photos { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 0; padding: 0; }
.deeper-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: rgba(255, 255, 255, 0.06); }

/* Library: tighter filter list so more of it fits without scrolling */
.filters { gap: 18px; }
.filter-opt { padding: 4px 8px; }
.lesson-card-meta .pill-deep { margin-left: auto; }

/* Resources: an odd last link card spans the row instead of sitting alone */
.link-grid > li:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Glossary: use the page width; two columns of terms on wide screens */
.glossary { max-width: none; }
@media (min-width: 1100px) {
    .gl-group dl { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
}
@media (max-width: 640px) {
    .instructor { grid-template-columns: 1fr; }
    .instructor-photo { width: 96px; height: 96px; }
    .deeper-photos { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}
.library-aside { overflow-x: hidden; padding-inline: 8px; margin-inline: -8px; }
.map-label { align-self: start; padding-top: 2px; }
.map-tile { align-content: start; }

/* ---------- Lesson diagrams (```diagram …``` blocks, learn-src/lib/diagram.mjs) ---------- */
.dg { margin: 28px 0; padding: clamp(16px, 2.4vw, 24px); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.dg-title { margin: 0 0 16px; font-size: 0.95rem; font-weight: 800; color: var(--ink); }
.dg-caption { margin-top: 14px; font-size: 0.86rem; line-height: 1.5; color: var(--slate); }
.dg ol, .dg ul { margin: 0; padding: 0; list-style: none; }
.dg li::marker { content: none; }
/* undo lesson list spacing inside diagrams, with the lowest possible specificity */
.prose .dg ul, .prose .dg ol { padding-left: 0; }
.prose .dg li + li, .prose .dg ul ul, .prose .dg ol ol, .prose .dg ul ol, .prose .dg ol ul { margin-top: 0; }
.dg-node { display: inline-grid; gap: 2px; min-width: 0; padding: 10px 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--surface-2); text-align: left; }
.dg-label { font-size: 0.92rem; font-weight: 700; line-height: 1.3; color: var(--ink); }
.dg-detail { font-size: 0.78rem; line-height: 1.4; color: var(--slate); }
.dg code { font-size: 0.85em; }

/* flow / loop / branch steps: left to right with arrows, wrapping as needed */
.dg-steps { display: flex; flex-wrap: wrap; align-items: center; row-gap: 10px; }
.dg-steps > li { display: flex; align-items: center; }
.dg-steps > li + li::before { content: "→"; padding: 0 10px; font-size: 1.15rem; font-weight: 700; line-height: 1; color: var(--route-text, var(--gold-ink)); }
.dg-flow .dg-steps > li:first-child .dg-node { border-color: var(--route, var(--gold)); background: var(--route-soft, var(--gold-soft)); }

/* loop: a dashed return line under the steps */
.dg-loop-back { position: relative; height: 22px; margin: 6px 14px 0; border: 2px dashed var(--route, var(--gold)); border-top: 0; border-radius: 0 0 14px 14px; }
.dg-loop-back span { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); padding: 0 8px; background: var(--surface); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--route-text, var(--gold-ink)); }
.dg-loop-back::before { content: ""; position: absolute; left: -7px; top: -8px; border: 6px solid transparent; border-bottom: 8px solid var(--route, var(--gold)); border-top: 0; }
.dg-exit { display: inline-block; margin: 18px 0 0; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 0.82rem; font-weight: 700; color: var(--ink); }

/* branch: a start chain, then one row per outcome joined by a rail */
.dg-branches { display: grid; gap: 10px; margin: 12px 0 0 22px; padding: 4px 0 0 22px; border-left: 2px solid var(--line-strong); }
.dg-branches > li { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dg-branches > li::after { content: ""; position: absolute; left: -22px; top: 50%; width: 16px; border-top: 2px solid var(--line-strong); }
.dg-branch-label { padding: 4px 10px; border-radius: 999px; background: var(--route-soft, var(--gold-soft)); font-size: 0.78rem; font-weight: 800; color: var(--route-text, var(--gold-ink)); }

/* tree: root above, children in a row under a rail */
.dg-tree { text-align: center; }
.dg-root { border-color: var(--route, var(--gold)); background: var(--route-soft, var(--gold-soft)); }
.dg-children { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 2px solid var(--line-strong); }
.dg-children::before { content: ""; position: absolute; left: 50%; top: -20px; height: 18px; border-left: 2px solid var(--line-strong); }
.dg-children > li { display: grid; gap: 8px; align-content: start; }
.dg-children .dg-node { width: 100%; }
.dg-grandchildren { display: grid; gap: 6px; padding-left: 14px; border-left: 2px dotted var(--line-strong); }
.dg-grandchildren .dg-node { background: var(--surface); }

/* nested: rings from the outside in */
.dg-rings, .dg-rings ol { display: block; }
.dg-ring > ol { margin-top: 2px; }
.dg-ring { display: grid; gap: 10px; padding: 12px 14px 14px; border: 1.5px solid var(--line-strong); border-radius: 16px; background: var(--surface); }
.dg-ring > .dg-node { padding: 0; border: 0; background: none; }
.dg-ring > ol { display: block; }
.dg-ring-2 { background: color-mix(in srgb, var(--route, var(--gold)) 6%, var(--surface)); }
.dg-ring-3 { background: color-mix(in srgb, var(--route, var(--gold)) 12%, var(--surface)); }
.dg-ring-4, .dg-ring-5 { background: color-mix(in srgb, var(--route, var(--gold)) 20%, var(--surface)); border-color: var(--route, var(--gold)); }

/* layers: a stack, top to bottom */
.dg-stack { display: grid; gap: 6px; }
.dg-stack .dg-node { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; width: 100%; }
.dg-stack > li:first-child .dg-node { border-color: var(--route, var(--gold)); background: var(--route-soft, var(--gold-soft)); }

/* compare: side-by-side columns */
.dg-cols { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 12px; }
.dg-col { padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--surface-2); }
.dg-col:first-child { border-color: var(--route, var(--gold)); }
.dg-col-title { margin: 0 0 8px; font-size: 0.95rem; font-weight: 800; color: var(--ink); }
.dg-col ul { display: grid; gap: 6px; }
.dg-col li { position: relative; padding-left: 16px; font-size: 0.88rem; line-height: 1.45; color: var(--ink-2); }
.dg-col li::before { content: ""; position: absolute; left: 2px; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--route, var(--gold)); }

@media (max-width: 640px) {
    .dg-steps { flex-direction: column; align-items: stretch; }
    .dg-steps > li { flex-direction: column; align-items: stretch; }
    .dg-steps > li + li::before { content: "↓"; padding: 4px 0; text-align: center; }
    .dg-steps .dg-node { width: 100%; }
    .dg-branches > li { flex-direction: column; align-items: stretch; }
    .dg-cols { grid-template-columns: 1fr; }
    .dg-loop-back { margin-inline: 30%; }
}
.dg-children { margin-top: 26px; }
.dg-children::before { top: -28px; height: 26px; }
.dg-children > li { position: relative; }
.dg-children > li::before { content: ""; position: absolute; left: 50%; top: -18px; height: 18px; border-left: 2px solid var(--line-strong); }
/* diagram containers that need their own spacing (beat the list resets above) */
.prose .dg .dg-children, .dg .dg-children { margin-top: 26px; padding-top: 18px; }
.prose .dg .dg-branches, .dg .dg-branches { margin: 12px 0 0 22px; padding: 4px 0 0 22px; }
.prose .dg .dg-grandchildren, .dg .dg-grandchildren { padding-left: 14px; }
.prose .dg .dg-col-title, .dg .dg-col-title { margin: 0 0 8px; }
.prose .dg .dg-title, .prose .dg .dg-caption, .prose .dg .dg-exit { max-width: none; }
