/* ═══════════════════════════════════════════════════════════════════
   LearnWithPython 2026 refresh
   Loaded after style.css and wins by source order. It re-tokens the whole
   site and restyles the shared components, so every page changes without
   touching the markup the scripts depend on. Removing the <link> to this
   file in base.html restores the previous design exactly.

   Direction: quiet and confident. One brand blue, hairline borders, soft
   depth, real typographic hierarchy, motion only where it explains state.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --brand-1: #2453d4;
  --brand-1-hover: #1c43b3;
  --brand-2: #0d8a7b;
  --brand-grad: linear-gradient(var(--brand-1), var(--brand-1));
  --brand-soft: #eef3ff;
  --success: #0f8a5f;
  --warn: #c56a06;
  --danger: #d4263f;

  --bg: #fbfbfd;
  --bg-soft: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --border: #e5e8ee;
  --border-strong: #d2d8e1;
  --text: #0b1220;
  --text-dim: #586274;
  --text-faint: #8a93a3;
  --ink: #0a1222;
  --ink-2: #16213a;
  --cream: #f6f8fc;
  --tint-1: rgba(36, 83, 212, .06);
  --tint-2: rgba(13, 138, 123, .06);
  --nav-bg: rgba(251, 251, 253, .82);
  --nav-line: var(--border);
  --nav-panel: #ffffff;
  --code-inline-bg: #f1f3f8;
  --code-inline-fg: #1f3fa8;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .04);
  --shadow-lg: 0 2px 6px rgba(16, 24, 40, .04), 0 16px 40px -12px rgba(16, 24, 40, .16);
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand-1) 22%, transparent);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --content-wide: 1200px;
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

[data-theme="dark"] {
  --brand-1: #7aa2ff;
  --brand-1-hover: #9ab8ff;
  --brand-2: #3ccfb9;
  --brand-soft: rgba(122, 162, 255, .12);
  --success: #34c38f;
  --warn: #f0a33a;
  --danger: #f2667b;

  --bg: #090d16;
  --bg-soft: #0d121d;
  --surface: #111724;
  --surface-2: #161e2e;
  --border: #212a3b;
  --border-strong: #2d3850;
  --text: #edf1f7;
  --text-dim: #9ca6b8;
  --text-faint: #6c768a;
  --ink: #060a12;
  --ink-2: #111a2c;
  --tint-1: rgba(122, 162, 255, .08);
  --tint-2: rgba(60, 207, 185, .06);
  --nav-bg: rgba(9, 13, 22, .8);
  --nav-panel: #111724;
  --code-inline-bg: #182033;
  --code-inline-fg: #a9c2ff;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .22);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 22px 50px -14px rgba(0, 0, 0, .6);
}

/* ── base ─────────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: -.003em;
  font-feature-settings: 'ss01', 'cv11';
}
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 650;
  letter-spacing: -.028em;
  line-height: 1.12;
  color: var(--text);
}
h3 { letter-spacing: -.018em; }
a { color: var(--brand-1); }
a:hover { color: var(--brand-1-hover); }
::selection { background: color-mix(in srgb, var(--brand-1) 22%, transparent); }
code {
  border: 0; border-radius: 6px; padding: .12em .4em;
  font-size: .88em; font-weight: 500;
}
.grad {
  background: none; animation: none;
  -webkit-text-fill-color: currentColor; color: var(--brand-1);
}
.eyebrow {
  display: inline-block; color: var(--brand-1);
  font-size: .75rem; font-weight: 600; letter-spacing: .02em; text-transform: none;
}
.muted { color: var(--text-dim); }

/* Motion: keep transitions that explain state, drop the decorative loops. */
.hero-demo { animation: none; }
.hero-demo::before { display: none; }
.nav-streak .ui-icon { animation: none; }
.course-card::before, .project-card::before, .challenge-card::before,
.feature::before, .dash-course::before, .use-case-card::before,
.achieve-tile::before, .learn-card::before, .how-card::before { display: none; }
.btn-ripple { display: none; }
@media (prefers-reduced-motion: no-preference) {
  main { animation: pageIn .4s var(--ease) both; }
}
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } }
.js .reveal { transform: translateY(12px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.js .reveal-left { transform: translateX(-16px); }
.js .reveal-right { transform: translateX(16px); }
.stagger { animation-duration: .55s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── focus ────────────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--brand-1); outline-offset: 2px; }

/* ── announcement bar ─────────────────────────────────────────────── */
.announce {
  background: var(--ink); color: #c9d3e6;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.announce-inner { min-height: 36px; font-size: .78rem; gap: 1rem; letter-spacing: 0; }
.announce strong {
  background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600;
  font-size: .68rem; letter-spacing: .02em; text-transform: none;
  padding: .12rem .5rem; border-radius: 99px;
}
.announce a { color: #fff; font-weight: 600; }
.announce a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ── navigation ───────────────────────────────────────────────────── */
.nav {
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav.scrolled, [data-theme="dark"] .nav.scrolled { box-shadow: none; border-bottom-color: var(--border); }
.nav-inner { max-width: var(--content-wide); min-height: 64px; gap: 1.75rem; }
.brand { font-weight: 700; font-size: 1.08rem; letter-spacing: -.03em; }
.brand-name { letter-spacing: -.03em; }
.brand-name em {
  background: none; -webkit-text-fill-color: currentColor; color: var(--brand-1);
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--brand-1); color: #fff; border: 0; box-shadow: none;
}
[data-theme="dark"] .brand-mark { color: #0b1220; }
.brand-glyph { width: 19px; height: 19px; }
.brand:hover .brand-mark { transform: none; }
.nav-links > a, .nav-menu-trigger {
  font-weight: 500; font-size: .9rem; color: var(--text-dim);
  border-radius: 8px; padding: .4rem .7rem; min-height: 36px;
}
.nav-links > a:hover, .nav-menu-trigger:hover,
.nav-links > a.active, .nav-menu-trigger.active,
.nav-menu-trigger[aria-expanded="true"] {
  color: var(--text); background: var(--surface-2);
}
.nav-links .nav-lead .ui-icon { display: none; }
.nav-start { color: var(--text-dim); }
.cmdk-btn {
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-dim); font-weight: 500; box-shadow: var(--shadow-xs);
}
.cmdk-btn:hover { border-color: var(--border-strong); color: var(--text); }
.cmdk-hint {
  font-family: var(--font); font-weight: 500; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-faint);
}
.theme-toggle {
  border-radius: 8px; background: transparent; border: 1px solid var(--border);
  width: 36px; height: 36px;
}
.theme-toggle:hover { transform: none; background: var(--surface-2); color: var(--text); }
.nav-stats { font-weight: 600; }
.account-btn { border-radius: 99px; }

/* mega menus */
.mega-menu {
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--nav-panel); box-shadow: var(--shadow-lg);
}
.mega-intro {
  background: var(--surface-2); border-radius: 10px; color: var(--text);
  border: 1px solid var(--border);
}
.mega-intro h2 { color: var(--text); font-size: 1.15rem; font-weight: 650; }
.mega-intro p { color: var(--text-dim); }
.mega-kicker { color: var(--brand-1); font-weight: 600; text-transform: none; letter-spacing: 0; }
.mega-primary { color: var(--brand-1); font-weight: 600; }
.mega-progress { display: none; }
.mega-links a { border-radius: 10px; }
.mega-links a:hover { background: var(--surface-2); }
.mega-links strong { font-weight: 600; }
.menu-icon {
  background: var(--brand-soft); color: var(--brand-1); border: 0; border-radius: 8px;
}
.menu-featured { background: var(--brand-soft); }
.mega-foot { border-top: 1px solid var(--border); }
.mega-foot-label { text-transform: none; letter-spacing: 0; font-weight: 600; }

/* ── buttons ──────────────────────────────────────────────────────── */
.btn {
  font-weight: 600; font-size: .92rem; letter-spacing: -.01em;
  border-radius: 9px; min-height: 40px; padding: .55rem 1rem; gap: .45rem;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { transform: none; }
.btn:active { transform: translateY(.5px); }
.btn .ui-icon { width: 1.05em; height: 1.05em; }
.btn-primary, [data-theme="dark"] .btn-primary {
  background: var(--brand-1); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 2px rgba(16, 24, 40, .12);
}
[data-theme="dark"] .btn-primary { color: #0a1020; }
.btn-primary::after { display: none; }
.btn-primary:hover, [data-theme="dark"] .btn-primary:hover {
  background: var(--brand-1-hover); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 2px 6px rgba(16, 24, 40, .14);
  transform: none;
}
[data-theme="dark"] .btn-primary:hover { color: #0a1020; }
.btn-ghost {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-xs);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); transform: none; }
.btn-dark-ghost {
  color: #fff; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .18);
}
.btn-dark-ghost:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.btn-run, .btn-run:hover {
  background: var(--success); color: #fff; transform: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
}
[data-theme="dark"] .btn-run { color: #052417; }
.btn-run:hover { filter: brightness(1.06); }
.btn-sm { min-height: 34px; padding: .4rem .8rem; font-size: .85rem; border-radius: 8px; }
.btn-lg { min-height: 46px; padding: .7rem 1.25rem; font-size: .96rem; border-radius: 10px; }

/* ── surfaces ─────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-xs);
}
a.card, a.card:hover { text-decoration: none; color: inherit; }
.course-card, .project-card, .challenge-card, .dash-course, .use-case-card,
.course-row, .lesson-row, .learn-card, .usecase-card, .practice-card, .how-card {
  border-top-width: 1px;
  transition: border-color .18s, box-shadow .18s, transform .18s var(--ease);
}
a.course-card:hover, a.project-card:hover, a.challenge-card:hover, a.dash-course:hover,
a.course-row:hover, a.lesson-row:hover, a.usecase-card:hover, a.practice-card:hover {
  border-color: var(--border-strong); box-shadow: var(--shadow-lg); transform: translateY(-2px);
}
.level-badge, .diff-badge {
  font-size: .7rem; font-weight: 600; letter-spacing: 0; text-transform: none;
  padding: .16rem .5rem; border-radius: 6px; border: 1px solid transparent;
}
.level-beginner { background: color-mix(in srgb, var(--success) 10%, transparent); color: var(--success); border-color: color-mix(in srgb, var(--success) 20%, transparent); }
.level-intermediate { background: color-mix(in srgb, var(--warn) 10%, transparent); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.level-advanced, .level-expert { background: color-mix(in srgb, var(--danger) 9%, transparent); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 20%, transparent); }
.course-icon, .project-icon {
  border-radius: 9px; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--accent); box-shadow: none;
}
.course-meta { color: var(--text-dim); font-size: .82rem; font-weight: 500; }
.progress-track { background: var(--surface-2); border-radius: 99px; box-shadow: inset 0 0 0 1px var(--border); }
.progress-fill { background: var(--accent, var(--brand-1)); border-radius: 99px; }
.progress-label { color: var(--text-dim); font-size: .8rem; font-weight: 500; }

/* chips / filters */
.filter-chips {
  padding: 3px; gap: 2px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.chip {
  border: 0; background: transparent; color: var(--text-dim);
  font-weight: 500; font-size: .85rem; border-radius: 7px; padding: .38rem .8rem;
}
.chip:hover { color: var(--text); border-color: transparent; }
.chip.on, [data-theme="dark"] .chip.on {
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs), 0 0 0 1px var(--border);
}

/* ── page headers ─────────────────────────────────────────────────── */
.section { max-width: var(--content-wide); padding: 4rem 1.5rem; }
.section.alt { background: var(--bg-soft); border-block: 1px solid var(--border); }
.section.alt > * { max-width: var(--content-wide); }
.section-title { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.section-title.left { font-size: 1.25rem; font-weight: 650; margin: 2.75rem 0 1rem; }

.page-head {
  max-width: var(--content-wide); padding: 3.25rem 1.5rem 2.25rem;
  background: none; border: 0; box-shadow: none;
}
.page-head::after { display: none; }
.page-head h1 { font-size: clamp(2rem, 3.6vw, 2.75rem); font-weight: 650; letter-spacing: -.032em; }
.page-head > p, .page-head p { color: var(--text-dim); font-size: 1.04rem; line-height: 1.65; }
.crumbs { font-size: .84rem; color: var(--text-faint); margin-bottom: 1rem; }
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--text); }

.directory-hero {
  max-width: var(--content-wide); min-height: 400px;
  margin: 2rem auto 0; border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  grid-template-columns: 1fr 1fr;
}
.directory-copy { padding: clamp(2rem, 4.5vw, 3.75rem); }
.directory-copy h1 {
  font-size: clamp(2.2rem, 4vw, 3.3rem); font-weight: 650;
  letter-spacing: -.035em; line-height: 1.06; margin: .75rem 0 1rem;
}
.directory-copy > p { font-size: 1.04rem; line-height: 1.65; }
.directory-copy h1 span:not(.grad) { color: var(--brand-1); }
.directory-dark { background: var(--ink); border-color: var(--ink-2); }
.directory-dark .directory-copy h1 { color: #fff; }
.directory-dark .directory-copy h1 span { color: #9ab8ff; }
.directory-dark .eyebrow, .auth-context .eyebrow { color: #9ab8ff; }
.arena-score { border-radius: 10px; background: rgba(6, 12, 24, .82); }

.catalog-head { margin-bottom: 1.75rem; gap: 2.5rem; }
.catalog-head h2 { font-size: clamp(1.55rem, 2.6vw, 2rem); font-weight: 650; margin-top: .4rem; }
.catalog-head > p { color: var(--text-dim); font-size: .98rem; }

.starter-callout {
  border-left-width: 1px; background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand-1) 22%, var(--border));
}
.notice { background: var(--surface-2); box-shadow: none; }

/* ── listings ─────────────────────────────────────────────────────── */
.course-row { padding: 1.4rem 1.5rem; gap: 1.25rem; }
.course-row::before { width: 3px; flex-basis: 3px; opacity: .9; }
.course-row h2 { font-size: 1.15rem; font-weight: 650; }
.course-row p { color: var(--text-dim); font-size: .94rem; }
.course-row-go {
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-dim); box-shadow: none;
}
a.course-row:hover .course-row-go { color: var(--text); border-color: var(--border-strong); }
.challenge-card { padding: 1.25rem; }
.challenge-card h3 { font-size: 1rem; font-weight: 600; }
.diff-easy .diff-badge { background: color-mix(in srgb, var(--success) 10%, transparent); color: var(--success); }
.diff-medium .diff-badge { background: color-mix(in srgb, var(--warn) 10%, transparent); color: var(--warn); }
.diff-hard .diff-badge { background: color-mix(in srgb, var(--danger) 9%, transparent); color: var(--danger); }
.project-card h2, .project-card h3 { font-weight: 650; }
.project-card p { color: var(--text-dim); }
.project-go { color: var(--brand-1); font-weight: 600; }
.done-badge { color: var(--success); font-weight: 600; }
.lesson-row { border-radius: 10px; }
.lesson-row h3 { font-weight: 600; }
.lesson-num { font-family: var(--mono); font-weight: 500; }
.next-up-badge {
  background: var(--brand-soft); color: var(--brand-1);
  font-weight: 600; text-transform: none; letter-spacing: 0; border-radius: 6px;
}
.use-case-icon, .usecase-icon, .learn-icon, .practice-icon, .how-icon, .achieve-tile-icon {
  border-radius: 9px; box-shadow: none;
}

/* dashboard */
.stat { padding: 1.25rem; }
.stat strong { font-weight: 650; letter-spacing: -.02em; }
.stat span { color: var(--text-dim); font-size: .82rem; }
.achieve-tile.locked { opacity: .55; filter: grayscale(1); }

/* ── lesson & workspace ───────────────────────────────────────────── */
.lesson-content, .lesson-section { line-height: 1.7; }
.callout { border-radius: var(--radius); box-shadow: none; }
.side-lesson, .spy-nav a { border-radius: 8px; }
.editor-chrome { background: #0f1522; border-bottom-color: #1e2738; }
.editor-bar { background: #0f1522; border-top-color: #1e2738; }
.code-input { background: #0b101b; color: #e4ebf7; font-size: .9rem; }
.code-output { background: #070b13; color: #b7f0d4; font-size: .86rem; }
.editor-badge {
  background: rgba(122, 162, 255, .14); border-color: rgba(122, 162, 255, .28); color: #a9c2ff;
  font-family: var(--mono); font-weight: 600;
}
.editor-title { font-family: var(--mono); color: #8b97ad; }
.copy-btn { background: #172034; border-color: #253049; color: #a5b1c6; border-radius: 6px; font-weight: 500; }

/* quiz */
.quiz-option { border-radius: 10px; }

/* ── forms & auth ─────────────────────────────────────────────────── */
input[type="text"], input[type="email"], input[type="password"], input[type="search"], textarea:not(.code-input), select {
  font-family: var(--font);
}
.auth-wrap { padding: 3rem 1.5rem 4rem; align-items: stretch; }
.auth-context {
  border-radius: var(--radius-lg); background: var(--ink);
  border: 1px solid var(--ink-2); box-shadow: none;
}
.auth-context h1, .auth-context h2 { color: #fff; font-weight: 650; }
.auth-card {
  border-radius: var(--radius-lg); box-shadow: var(--shadow); justify-content: center;
}
.auth-card h1 { font-size: 1.75rem; font-weight: 650; }
.auth-card label { font-weight: 500; font-size: .86rem; color: var(--text); }
.auth-card input {
  border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface);
  font-size: .95rem; box-shadow: var(--shadow-xs);
}
.auth-card input:focus { outline: 0; border-color: var(--brand-1); box-shadow: var(--ring); }
.form-error { border-radius: 9px; }

/* ── closing CTA ──────────────────────────────────────────────────── */
.global-cta {
  max-width: var(--content-wide); margin: 4rem auto 0;
  border-radius: var(--radius-lg); padding: clamp(2rem, 4.5vw, 3.25rem);
  background:
    radial-gradient(600px 240px at 0% 0%, rgba(122, 162, 255, .16), transparent 70%),
    var(--ink);
  border: 1px solid var(--ink-2); box-shadow: none;
}
.global-cta h2 { color: #fff; font-weight: 650; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.global-cta .eyebrow { color: #9ab8ff; }
.global-cta p { color: #a9b4c8; }
.global-cta::before, .global-cta::after { display: none; }

/* ── footer ───────────────────────────────────────────────────────── */
.footer { background: var(--bg); border-top: 1px solid var(--border); margin-top: 5rem; }
.footer-inner { max-width: var(--content-wide); padding: 3.5rem 1.5rem 2.5rem; }
.footer-brand strong { font-weight: 650; letter-spacing: -.02em; }
.footer-tag { font-weight: 600; }
.footer-col h4 {
  font-size: .8rem; font-weight: 600; text-transform: none; letter-spacing: 0;
  color: var(--text); margin-bottom: .5rem;
}
.footer-col a { color: var(--text-dim); font-size: .9rem; }
.footer-col a:hover { color: var(--text); text-decoration: none; }
.footer-copy { font-size: .8rem; color: var(--text-faint); border-top: 1px solid var(--border); }
.footer-copy a { color: var(--text-dim); }

/* ── overlays ─────────────────────────────────────────────────────── */
.cmdk-panel { border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.toast { border-radius: 10px; box-shadow: var(--shadow-lg); }
.modal-card { border-radius: var(--radius-lg); }
.to-top { border-radius: 10px; }
.read-progress { background: var(--brand-1); height: 2px; }

/* ═══════════════════════════════════════════════════════════════════
   Home page (lp-*). New class names so nothing from the old hero
   cascade leaks in.
   ═══════════════════════════════════════════════════════════════════ */
.lp-wrap { max-width: var(--content-wide); margin: 0 auto; padding: 0 1.5rem; }

/* hero */
.lp-hero { position: relative; padding: 5rem 0 4.5rem; overflow: hidden; isolation: isolate; }
.lp-hero-glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(720px 360px at 78% 18%, color-mix(in srgb, var(--brand-1) 10%, transparent), transparent 70%),
    radial-gradient(520px 300px at 12% 0%, color-mix(in srgb, var(--brand-2) 7%, transparent), transparent 70%);
}
.lp-hero-glow::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px; opacity: .45;
  -webkit-mask-image: radial-gradient(800px 420px at 60% 10%, #000, transparent 75%);
  mask-image: radial-gradient(800px 420px at 60% 10%, #000, transparent 75%);
}
.lp-hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center;
}
.lp-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .3rem .75rem .3rem .6rem; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: .8rem; font-weight: 500; color: var(--text-dim); box-shadow: var(--shadow-xs);
}
.lp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 18%, transparent); }
.lp-hero h1 {
  font-size: clamp(2.5rem, 5.2vw, 4.1rem); line-height: 1.02;
  letter-spacing: -.045em; font-weight: 650; margin: 1.25rem 0 1.25rem;
  max-width: 13ch;
}
.lp-lead { font-size: 1.12rem; line-height: 1.65; color: var(--text-dim); max-width: 34rem; }
.lp-lead strong { color: var(--text); font-weight: 600; }
.lp-cta { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 2rem; }
.lp-assure {
  list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem;
  margin-top: 1.5rem; font-size: .85rem; color: var(--text-dim);
}
.lp-assure li { display: inline-flex; align-items: center; gap: .4rem; }
.lp-assure .ui-icon { color: var(--success); width: 1rem; height: 1rem; }
.lp-beginner {
  margin-top: 2rem; display: flex; align-items: center; gap: .85rem;
  padding: .85rem 1rem; max-width: 34rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text-dim); font-size: .9rem;
  box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s;
}
.lp-beginner:hover { text-decoration: none; color: var(--text-dim); border-color: var(--border-strong); box-shadow: var(--shadow); }
.lp-beginner b { color: var(--text); font-weight: 600; }
.lp-beginner-icon {
  flex: 0 0 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-1);
}
.lp-beginner-go { margin-left: auto; flex: 0 0 auto; width: 1.1rem; height: 1.1rem; color: var(--text-faint); transition: transform .15s, color .15s; }
.lp-beginner:hover .lp-beginner-go { transform: translateX(2px); color: var(--brand-1); }
.has-resume .lp-beginner { margin-top: .75rem; opacity: .85; }
.lp-hero-copy .resume-slot { margin-top: 1.5rem; max-width: 34rem; }

/* signed-in cockpit */
.lp-cockpit {
  margin-top: 2.25rem; max-width: 36rem; padding: 1.25rem;
  display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.5rem; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow);
}
.lp-level { position: relative; width: 76px; height: 76px; display: grid; place-items: center; text-align: center; }
.lp-level svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.lp-level circle { fill: none; stroke-width: 6; }
.lp-level-track { stroke: var(--surface-2); }
.lp-level-fill { stroke: var(--brand-1); stroke-linecap: round; }
.lp-level b { font-size: 1.45rem; font-weight: 650; line-height: 1; letter-spacing: -.03em; margin-top: .3rem; }
.lp-level small { font-size: .62rem; color: var(--text-faint); font-weight: 600; margin-top: -.6rem; }
.lp-cockpit-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.lp-cockpit-stats dt { font-size: .72rem; color: var(--text-faint); font-weight: 500; }
.lp-cockpit-stats dd { font-size: 1rem; font-weight: 650; display: flex; align-items: center; gap: .3rem; letter-spacing: -.02em; }
.lp-cockpit-stats dd span { color: var(--text-faint); font-weight: 500; }
.lp-cockpit-stats .ui-icon { width: .95rem; height: .95rem; color: var(--brand-1); }
.lp-cockpit-bar { grid-column: 1 / -1; }
.lp-cockpit-bar span { display: block; margin-top: .5rem; font-size: .8rem; color: var(--text-dim); }

/* console */
.lp-term-wrap { min-width: 0; }
.lp-term {
  position: relative; overflow: hidden; border-radius: 14px;
  background: #0b101b; border: 1px solid #1c2537;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .02) inset,
    0 30px 60px -20px rgba(10, 18, 34, .45),
    0 12px 24px -12px rgba(10, 18, 34, .25);
}
[data-theme="dark"] .lp-term { border-color: #243049; }
.lp-term .editor-chrome { border-radius: 0; padding: .65rem 1rem; }
.lp-term-status {
  margin-left: auto; display: inline-flex; align-items: center; gap: .4rem;
  font: 500 .74rem var(--mono); color: #8b97ad;
}
.lp-term-status i { width: 6px; height: 6px; border-radius: 50%; background: #5b6880; }
.is-executing .lp-term-status i { background: #f0b43a; box-shadow: 0 0 0 3px rgba(240, 180, 58, .2); }
.is-complete .lp-term-status i { background: #34c38f; box-shadow: 0 0 0 3px rgba(52, 195, 143, .2); }
.lp-term .copy-btn { margin-left: .75rem; }
.lp-tabs-wrap { position: relative; background: #0f1522; border-bottom: 1px solid #1e2738; }
.lp-tabs-wrap.can-scroll::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 40px; pointer-events: none;
  background: linear-gradient(90deg, transparent, #0f1522);
}
.lp-tabs { display: flex; gap: 0; padding: 0 .5rem; overflow-x: auto; scrollbar-width: none; }
.lp-tabs::-webkit-scrollbar { display: none; }
.lp-tabs .scenario-chip {
  flex: 0 0 auto; position: relative; cursor: pointer;
  background: none; border: 0; border-radius: 0; box-shadow: none;
  padding: .6rem .75rem; min-height: 0;
  font: 500 .78rem var(--mono); color: #7d89a0;
}
.lp-tabs .scenario-chip:hover { color: #c9d3e6; background: none; }
.lp-tabs .scenario-chip.on { color: #fff; background: none; }
.lp-tabs .scenario-chip.on::after {
  content: ''; position: absolute; left: .75rem; right: .75rem; bottom: -1px; height: 2px;
  background: #7aa2ff; border-radius: 2px;
}
.lp-term .code-input { min-height: 200px; padding: 1.1rem 1.25rem; font-size: .9rem; border-radius: 0; resize: none; }
.lp-term .code-input.is-autotyping { caret-color: #7aa2ff; }
.lp-term .editor-bar { padding: .6rem 1rem; }
.lp-term .btn-run { min-height: 34px; padding: .35rem .9rem; font-size: .85rem; border-radius: 8px; }
.lp-term .btn-run .ui-icon { width: .85rem; height: .85rem; fill: currentColor; }
.lp-term .code-output { border-radius: 0; min-height: 7.5rem; padding: 1rem 1.25rem; border-top: 1px solid #161e2e; }
.lp-term .out-line { display: block; animation: lpLine .25s var(--ease) both; }
@keyframes lpLine { from { opacity: 0; transform: translateY(3px); } }
.lp-term-note {
  display: flex; align-items: center; gap: .45rem; margin-top: .9rem;
  font-size: .82rem; color: var(--text-faint); justify-content: center;
}

/* proof strip */
.lp-proof { border-block: 1px solid var(--border); background: var(--surface); }
.lp-proof-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.lp-proof-row > div { padding: 1.6rem 1rem; text-align: center; }
.lp-proof-row > div + div { border-left: 1px solid var(--border); }
.lp-proof strong { display: block; font-size: 1.9rem; font-weight: 650; letter-spacing: -.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.lp-proof span { font-size: .82rem; color: var(--text-dim); }

/* sections */
.lp-section { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.lp-alt { background: var(--bg-soft); border-block: 1px solid var(--border); }
.lp-head { max-width: 44rem; margin: 0 auto 3rem; text-align: center; }
.lp-head-left { margin: 0; text-align: left; }
.lp-eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 600; color: var(--brand-1);
  margin-bottom: .85rem;
}
.lp-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -.035em; line-height: 1.1; }
.lp-head p { margin-top: 1rem; font-size: 1.06rem; color: var(--text-dim); line-height: 1.65; }

/* curriculum: a two-column syllabus, numbered in the order to take it */
.lp-courses {
  list-style: none; display: grid; gap: .75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.lp-course {
  height: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .2rem 1rem;
  align-items: start; padding: 1.2rem 1.35rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  color: inherit; transition: border-color .18s, box-shadow .18s, transform .18s var(--ease);
}
.lp-course:hover { text-decoration: none; color: inherit; border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.lp-course-top { grid-row: 1 / span 3; display: flex; flex-direction: column; align-items: center; gap: .45rem; }
.lp-course-icon {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
}
.lp-course-icon .ui-icon { width: 19px; height: 19px; }
.lp-course-num { font: 500 .74rem var(--mono); color: var(--text-faint); }
.lp-course h3 { font-size: 1.04rem; font-weight: 650; margin-top: .1rem; }
.lp-course p { font-size: .9rem; color: var(--text-dim); line-height: 1.55; }
.lp-course-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; margin-top: .55rem; font-size: .78rem; color: var(--text-faint); }
@media (max-width: 760px) { .lp-courses { grid-template-columns: minmax(0, 1fr); } }
.lp-more { display: flex; justify-content: center; margin-top: 2.25rem; }

/* method */
.lp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; counter-reset: step; }
.lp-step {
  position: relative; padding: 1.75rem; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column;
}
.lp-step-num {
  position: absolute; top: 1.5rem; right: 1.6rem;
  font: 500 .8rem var(--mono); color: var(--text-faint);
}
.lp-step-icon, .lp-habit-icon, .lp-tool-icon, .lp-use-icon, .lp-project-icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-1); margin-bottom: 1.1rem;
}
.lp-step-icon .ui-icon, .lp-habit-icon .ui-icon, .lp-tool-icon .ui-icon, .lp-use-icon .ui-icon, .lp-project-icon .ui-icon { width: 19px; height: 19px; }
.lp-step h3 { font-size: 1.12rem; margin-bottom: .5rem; }
.lp-step p { color: var(--text-dim); font-size: .94rem; line-height: 1.6; }
.lp-step-demo {
  margin-top: auto; padding-top: 1.5rem;
}
.lp-step-demo > * { display: block; }
.lp-demo-read { display: grid; gap: .45rem; }
.lp-demo-read i { display: block; height: 7px; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.lp-demo-read i:nth-child(1) { width: 90%; } .lp-demo-read i:nth-child(2) { width: 70%; } .lp-demo-read i:nth-child(3) { width: 82%; }
.lp-demo-code { display: flex; flex-direction: column; gap: .4rem; }
.lp-demo-code code {
  display: block; padding: .6rem .8rem; border-radius: 8px;
  background: #0b101b; color: #e4ebf7; font-family: var(--mono); font-size: .8rem;
}
.lp-demo-code span { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 500; color: var(--success); }
.lp-demo-review span { height: 7px; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.lp-demo-review b { display: block; height: 100%; background: var(--brand-1); border-radius: 99px; }
.lp-demo-review small { margin-top: .5rem; font-size: .78rem; color: var(--text-faint); }

/* projects */
.lp-split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.lp-checks { list-style: none; display: grid; gap: .6rem; margin: 1.6rem 0 2rem; }
.lp-checks li { display: flex; align-items: center; gap: .55rem; font-size: .95rem; }
.lp-checks .ui-icon { color: var(--success); }
.lp-projects {
  list-style: none; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow); overflow: hidden;
}
.lp-projects li + li { border-top: 1px solid var(--border); }
.lp-project {
  display: flex; align-items: center; gap: .9rem; padding: .85rem 1.15rem;
  color: inherit; transition: background-color .15s;
}
.lp-project:hover { background: var(--surface-2); text-decoration: none; color: inherit; }
.lp-project-icon {
  margin: 0; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 8px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
.lp-project-icon .ui-icon { width: 17px; height: 17px; }
.lp-project-body { display: flex; flex-direction: column; min-width: 0; }
.lp-project-body strong { font-weight: 600; font-size: .95rem; }
.lp-project-body small { font-size: .8rem; color: var(--text-faint); }
.lp-project-go { margin-left: auto; color: var(--text-faint); flex: 0 0 auto; transition: transform .15s, color .15s; }
.lp-project:hover .lp-project-go { color: var(--brand-1); transform: translateX(2px); }

/* habits */
.lp-habits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.lp-habit {
  display: flex; flex-direction: column; padding: 1.5rem; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs);
}
.lp-habit h3 { font-size: 1.02rem; margin-bottom: .5rem; }
.lp-habit p { font-size: .9rem; color: var(--text-dim); line-height: 1.6; flex: 1; }
.lp-habit-here {
  margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border);
  font-size: .82rem; color: var(--text); font-weight: 500;
}

/* use cases */
.lp-uses { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.lp-use {
  display: flex; flex-direction: column; padding: 1.4rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  color: inherit; transition: border-color .18s, box-shadow .18s;
}
.lp-use:hover { text-decoration: none; color: inherit; border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.lp-use-icon { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.lp-use h3 { font-size: 1rem; margin-bottom: .4rem; }
.lp-use p { font-size: .88rem; color: var(--text-dim); line-height: 1.55; flex: 1; }
.lp-use-course {
  display: inline-flex; align-items: center; gap: .35rem; margin-top: 1.1rem;
  font-size: .8rem; font-weight: 600; color: var(--text-dim);
}
.lp-use-course .ui-icon { width: .9rem; height: .9rem; transition: transform .15s; }
.lp-use:hover .lp-use-course { color: var(--brand-1); }
.lp-use:hover .lp-use-course .ui-icon { transform: translateX(2px); }

/* tools */
.lp-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.lp-tool {
  display: flex; flex-direction: column; padding: 1.75rem; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  color: inherit; transition: border-color .18s, box-shadow .18s;
}
.lp-tool:hover { text-decoration: none; color: inherit; border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.lp-tool-stat { font-size: .84rem; color: var(--text-dim); }
.lp-tool-stat strong { font-size: 1.6rem; font-weight: 650; letter-spacing: -.035em; color: var(--text); margin-right: .25rem; }
.lp-tool h3 { font-size: 1.1rem; margin: .9rem 0 .45rem; }
.lp-tool p { font-size: .92rem; color: var(--text-dim); line-height: 1.6; flex: 1; }
.lp-tool-go { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1.4rem; font-size: .88rem; font-weight: 600; color: var(--brand-1); }
.lp-tool-go .ui-icon { transition: transform .15s; }
.lp-tool:hover .lp-tool-go .ui-icon { transform: translateX(3px); }

/* faq */
.lp-faq-grid { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.lp-faq { border-top: 1px solid var(--border); }
.lp-faq details { border-bottom: 1px solid var(--border); }
.lp-faq summary {
  list-style: none; cursor: pointer; padding: 1.2rem 2.5rem 1.2rem 0; position: relative;
  font-weight: 600; font-size: 1.02rem; letter-spacing: -.012em;
}
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after {
  content: ''; position: absolute; right: .35rem; top: 50%; width: 9px; height: 9px;
  border-right: 1.5px solid var(--text-faint); border-bottom: 1.5px solid var(--text-faint);
  transform: translateY(-70%) rotate(45deg); transition: transform .2s var(--ease);
}
.lp-faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.lp-faq summary:hover { color: var(--brand-1); }
.lp-faq details p { padding: 0 2.5rem 1.3rem 0; color: var(--text-dim); line-height: 1.65; }

/* final band */
.lp-final { padding: 0 0 2rem; }
.lp-final-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: clamp(2.25rem, 5vw, 3.5rem) clamp(1.75rem, 5vw, 3.5rem);
  border-radius: var(--radius-lg); color: #fff;
  background:
    radial-gradient(640px 280px at 100% 0%, rgba(122, 162, 255, .22), transparent 70%),
    radial-gradient(520px 260px at 0% 100%, rgba(60, 207, 185, .12), transparent 70%),
    var(--ink);
  border: 1px solid var(--ink-2);
  max-width: calc(var(--content-wide) - 3rem);
}
.lp-final h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -.035em; max-width: 22ch; }
.lp-final p { color: #a9b4c8; margin-top: .6rem; }
.lp-final-actions { display: flex; flex-wrap: wrap; gap: .65rem; flex-shrink: 0; }
.lp-final .btn-primary, [data-theme="dark"] .lp-final .btn-primary { background: #fff; color: var(--ink); box-shadow: none; }
.lp-final .btn-primary:hover { background: #e8edf7; color: var(--ink); }

/* home responsive */
@media (max-width: 1080px) {
  .lp-habits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .lp-hero { padding: 3.25rem 0 3rem; }
  .lp-hero-grid, .lp-split, .lp-faq-grid { grid-template-columns: minmax(0, 1fr); }
  .lp-hero h1 { max-width: 16ch; }
  .lp-steps, .lp-tools { grid-template-columns: minmax(0, 1fr); }
  .lp-proof-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lp-proof-row > div:nth-child(4) { border-left: 0; }
  .lp-proof-row > div:nth-child(n+4) { border-top: 1px solid var(--border); }
  .lp-final-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .lp-wrap { padding: 0 1rem; }
  .lp-hero h1 { font-size: clamp(2.15rem, 10vw, 2.6rem); }
  .lp-lead { font-size: 1.02rem; }
  .lp-cta .btn { flex: 1 1 100%; }
  .lp-habits { grid-template-columns: minmax(0, 1fr); }
  .lp-proof-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-proof-row > div { border-left: 0 !important; border-top: 1px solid var(--border); padding: 1.1rem .75rem; }
  .lp-proof-row > div:nth-child(-n+2) { border-top: 0; }
  .lp-proof-row > div:nth-child(even) { border-left: 1px solid var(--border) !important; }
  .lp-proof-row > div:last-child { grid-column: 1 / -1; border-left: 0 !important; }
  .lp-cockpit { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .lp-cockpit-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .lp-head { margin-bottom: 2.25rem; }
  .lp-final-inner { max-width: none; border-radius: var(--radius); }
  .lp-final-actions, .lp-final-actions .btn { width: 100%; }
  .lp-term .code-input { min-height: 170px; font-size: 16px; }
}
@media (pointer: coarse) {
  .lp-tabs .scenario-chip { min-height: 40px; }
  .lp-faq summary { min-height: 44px; }
}

/* ── shared responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .directory-hero { grid-template-columns: minmax(0, 1fr); margin: 1rem 1rem 0; }
  .section { padding: 3rem 1.25rem; }
  .page-head { padding: 2.25rem 1.25rem 1.5rem; }
  .global-cta { margin: 3rem 1rem 0; }
}

/* Ten outcomes: five across keeps the grid whole instead of leaving two orphans. */
@media (min-width: 1101px) { .lp-uses { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 641px) and (max-width: 1100px) { .lp-uses { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Older layers pin headings at 800 with class-level selectors; one weight
   scale across the site is most of what makes it read as one product. */
h1, h2 { font-weight: 650 !important; }
h3, h4 { font-weight: 600 !important; }

/* The page header was a card; without its frame, its old offsets left a gap. */
.page-head {
  margin: 0 auto; padding: 2.5rem 1.5rem 1.75rem;
  border: 0; border-radius: 0; background: none; box-shadow: none;
}
.course-head, .project-head { border-top: 0; }
.course-head-row { align-items: center; }
.course-icon.xl { width: 64px; height: 64px; border-radius: 14px; }

/* Auth panels size to their content instead of to the viewport. */
.auth-wrap { min-height: 0; padding-top: 3rem; padding-bottom: 3rem; }
.auth-context { min-height: 480px; }

/* Stroke icons must not depend on the <style> inside the sprite: iOS Safari
   ignores it for external <use> references, which fills the chevron of the
   brand mark into a solid triangle and drops its underscore entirely. */
.brand-glyph, .theme-icon, .achievement-glyph, .cmdk-glass, .resource-out {
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.brand-glyph { stroke-width: 2.2; }

/* The three icon controls on the right of the bar read as one set. */
.nav-burger {
  display: none; place-items: center; padding: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
}
.nav-burger span { width: 18px; height: 1.75px; margin: 4px auto; }
@media (max-width: 1000px) {
  .nav-burger { display: block; }
  .nav-right .cmdk-btn, .nav-right .theme-toggle {
    background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Phone pass. Reviewed page by page at 390px; each rule below fixes
   something that read as broken or wasteful on a real handset.
   ═══════════════════════════════════════════════════════════════════ */

/* Code keeps its shape: long lines scroll sideways instead of wrapping
   mid-expression, which is how every real editor behaves. */
.code-input { white-space: pre; overflow-wrap: normal; overflow-x: auto; }

@media (max-width: 640px) {
  /* The promo bar wrapped to two lines and pushed the hero down; the
     playground is one tap away in the menu anyway. */
  .announce { display: none; }

  /* home */
  .lp-hero { padding: 2rem 0 2.5rem; }
  .lp-hero h1 { margin: 1rem 0; }
  .lp-cta { margin-top: 1.5rem; }
  .lp-beginner { margin-top: 1.5rem; }
  .lp-hero-grid { gap: 2rem; }
  .lp-term .code-input { min-height: 132px; padding: .9rem 1rem; }
  .lp-term .code-output { min-height: 5rem; padding: .85rem 1rem; }
  .lp-term-note { justify-content: flex-start; text-align: left; }
  .lp-proof-row > div { padding: 1rem .5rem; }
  .lp-proof strong { font-size: 1.55rem; }
  .lp-section { padding: 3.25rem 0; }
  .lp-head h2 { font-size: 1.65rem; }
  .lp-head p { font-size: 1rem; }
  .lp-step, .lp-tool { padding: 1.35rem; }
  .lp-faq summary { font-size: .97rem; }

  /* section heads: heading and intro belong together */
  .catalog-head { flex-direction: column; align-items: flex-start; gap: .6rem; margin-bottom: 1.25rem; }

  /* Course catalog: icon beside the text, whole card is the link. */
  .course-row {
    display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: .25rem .9rem;
    align-items: start; padding: 1.1rem; border-left: 3px solid var(--accent);
  }
  .course-row::before, .course-row .course-row-go { display: none; }
  .course-row .course-icon.lg { width: 44px; height: 44px; }
  .course-row-top { flex-wrap: wrap; gap: .35rem .5rem; }
  .course-row h2 { font-size: 1.05rem; }
  .course-row p { font-size: .9rem; margin: .3rem 0 .5rem; }

  /* Course roadmap: number, title and a compact action on one row. */
  .lesson-row {
    display: grid; grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center; gap: .75rem; padding: .85rem .9rem;
  }
  .lesson-row .lesson-num { width: 34px; height: 34px; margin: 0; }
  .lesson-row h3 { font-size: .98rem; }
  .lesson-row .course-meta { gap: .2rem .6rem; font-size: .76rem; }
  .lesson-row .course-row-go {
    width: auto; min-height: 34px; padding: .3rem .65rem; margin: 0;
    font-size: .78rem; white-space: nowrap;
  }
  .course-head-row { flex-direction: row; align-items: flex-start; gap: .9rem; }
  .course-head-row .course-icon.xl { width: 48px; height: 48px; flex: 0 0 48px; }
  .course-head-row h1 { font-size: 1.75rem; }

  /* Challenge arena: two compact columns instead of one long scroll. */
  .challenge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .challenge-card { padding: .9rem; }
  .challenge-card h3 { font-size: .92rem; margin: .5rem 0 .35rem; }

  /* Sign-in: the form is the reason for the visit, so it comes first. */
  .auth-wrap { display: flex; flex-direction: column; padding: 1.25rem 1rem 2.5rem; }
  .auth-card { order: -1; padding: 1.5rem; }
  .auth-context { min-height: 0; padding: 1.5rem; }
  .auth-context h1, .auth-context h2 { font-size: 1.4rem; }

  /* Footer: link columns side by side. */
  .footer-inner { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.25rem; padding: 2.5rem 1rem 2rem; }
  .footer-brand { grid-column: 1 / -1; }
  .footer { margin-top: 3rem; }
  .global-cta { margin-top: 2.5rem; }
}
@media (max-width: 640px) {
  .course-head-row .course-icon.xl { display: none; }
  .lp-term .code-input { height: 150px; }
}

/* ═══════════════════════════════════════════════════════════════════
   /reference: a dense lookup table. Sticky category rail on the left,
   entries as two-column rows (what it is | what it does when run).
   ═══════════════════════════════════════════════════════════════════ */
.ref-head h1 { margin-top: .5rem; }
.ref-head > p { max-width: 46rem; }
.ref-tools { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; max-width: 46rem; }
.ref-search {
  flex: 1 1 320px; display: flex; align-items: center; gap: .6rem;
  min-height: 46px; padding: 0 .9rem; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-xs);
}
.ref-search:focus-within { border-color: var(--brand-1); box-shadow: var(--ring); }
.ref-search .ui-icon { color: var(--text-faint); flex: 0 0 auto; }
.ref-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  color: var(--text); font: 400 1rem var(--font);
}
.ref-search kbd {
  font: 500 .75rem var(--mono); color: var(--text-faint);
  border: 1px solid var(--border); border-radius: 5px; padding: .05rem .4rem;
}
.ref-count { margin-top: .75rem; font-size: .85rem; color: var(--text-faint); }

.ref-layout {
  max-width: var(--content-wide); margin: 0 auto; padding: 1rem 1.5rem 0;
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2.5rem; align-items: start;
}
.ref-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: .2rem; }
.ref-nav-title { font-size: .75rem; font-weight: 600; color: var(--text-faint); margin: 0 0 .4rem .6rem; }
.ref-nav-list { display: flex; flex-direction: column; gap: 1px; }
.ref-nav-list a {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .38rem .6rem; border-radius: 7px; font-size: .88rem; color: var(--text-dim);
}
.ref-nav-list a small { font: 500 .72rem var(--mono); color: var(--text-faint); }
.ref-nav-list a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.ref-nav-list a.active { background: var(--brand-soft); color: var(--brand-1); font-weight: 500; }
.ref-nav-list a.is-empty { opacity: .4; }
.ref-nav-alt {
  display: inline-flex; align-items: center; gap: .4rem; margin: 1rem 0 0 .6rem;
  font-size: .82rem; color: var(--text-dim);
}

.ref-section { scroll-margin-top: 84px; margin-bottom: 3rem; }
.ref-section-head { padding-bottom: .9rem; margin-bottom: .25rem; border-bottom: 1px solid var(--border); }
.ref-section-head h2 { font-size: 1.45rem; }
.ref-section-head p { color: var(--text-dim); font-size: .92rem; margin-top: .3rem; }
.ref-section-head a { font-weight: 500; white-space: nowrap; }

.ref-entry {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 1.25rem;
  padding: 1.25rem 0; border-bottom: 1px solid var(--border); scroll-margin-top: 84px;
}
.ref-entry:target { background: var(--brand-soft); margin: 0 -1rem; padding: 1.25rem 1rem; border-radius: 10px; }
.ref-text h3 { font-size: 1rem; font-weight: 600; }
.ref-anchor { color: var(--text); }
.ref-anchor:hover { color: var(--brand-1); text-decoration: none; }
.ref-anchor::after { content: ' #'; color: var(--text-faint); opacity: 0; transition: opacity .15s; }
.ref-entry:hover .ref-anchor::after { opacity: 1; }
.ref-syntax {
  margin: .5rem 0; padding: .45rem .65rem; border-radius: 7px; overflow-x: auto;
  background: var(--surface-2); border: 1px solid var(--border);
  font: 500 .82rem/1.55 var(--mono); color: var(--code-inline-fg);
}
.ref-text p { font-size: .9rem; color: var(--text-dim); line-height: 1.55; }
.ref-actions { display: flex; gap: .4rem; margin-top: .7rem; }
.ref-btn {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 30px; padding: .25rem .6rem;
  border-radius: 7px; border: 1px solid var(--border); background: var(--surface);
  font: 500 .78rem var(--font); color: var(--text-dim); cursor: pointer;
}
.ref-btn:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.ref-btn .ui-icon { width: .85rem; height: .85rem; }
.ref-example { min-width: 0; display: flex; flex-direction: column; }
.ref-code, .ref-out {
  margin: 0; padding: .7rem .9rem; overflow-x: auto;
  font: 400 .8rem/1.6 var(--mono); white-space: pre;
}
.ref-code { background: #0b101b; color: #e4ebf7; border-radius: 9px 9px 0 0; }
.ref-out {
  background: #070b13; color: #b7f0d4; border-radius: 0 0 9px 9px; border-top: 1px solid #1a2233;
  position: relative;
}
.ref-out::before {
  content: 'Output'; position: absolute; top: .45rem; right: .65rem;
  font: 500 .62rem var(--font); color: #5b6880; letter-spacing: .04em;
}
.ref-example .ref-code:last-child { border-radius: 9px; }
.ref-empty { padding: 2rem 0; color: var(--text-dim); }

@media (max-width: 960px) {
  .ref-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 1.25rem; }
  .ref-nav {
    top: 64px; z-index: 5; margin: 0 -1.25rem 1rem; padding: .5rem 1.25rem;
    background: var(--nav-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
  }
  .ref-nav-title, .ref-nav-alt { display: none; }
  .ref-nav-list { flex-direction: row; overflow-x: auto; gap: .3rem; scrollbar-width: none; }
  .ref-nav-list::-webkit-scrollbar { display: none; }
  .ref-nav-list a { flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); }
  .ref-section, .ref-entry { scroll-margin-top: 124px; }
  .ref-entry { grid-template-columns: minmax(0, 1fr); gap: .8rem; }
}
@media (max-width: 640px) {
  .ref-tools .btn { display: none; }        /* printing from a phone is rare */
  .ref-entry:target { margin: 0 -.75rem; padding: 1.25rem .75rem; }
}
@media (pointer: coarse) {
  .ref-btn { min-height: 40px; padding: .4rem .8rem; }
  .ref-nav-list a { min-height: 40px; }
}

/* Print: the one-pager. Syntax and meaning only, three tight columns. */
@media print {
  .announce, .nav, .footer, .global-cta, .ref-tools, .ref-count, .ref-nav,
  .ref-actions, .ref-example, .to-top, .toasts, .read-progress, .skip-link { display: none !important; }
  body { background: #fff; color: #000; font-size: 9pt; }
  main { animation: none !important; }
  .page-head { padding: 0 0 6pt; }
  .page-head h1 { font-size: 16pt; }
  .page-head > p { font-size: 8pt; color: #333; }
  .ref-layout { display: block; padding: 0; max-width: none; }
  .ref-main { column-count: 3; column-gap: 14pt; }
  .ref-section { margin: 0 0 8pt; break-inside: auto; }
  .ref-section-head { break-after: avoid; border-color: #999; padding-bottom: 2pt; }
  .ref-section-head h2 { font-size: 10.5pt; }
  .ref-section-head p { display: none; }
  .ref-entry { display: block; padding: 3pt 0; border-color: #ddd; break-inside: avoid; }
  .ref-text h3 { font-size: 8.5pt; }
  .ref-syntax { background: none; border: 0; padding: 0; margin: 1pt 0; color: #000; font-size: 7.5pt; white-space: pre-wrap; }
  .ref-text p { font-size: 7.5pt; color: #333; line-height: 1.3; }
  .ref-anchor::after { content: none; }
  a { color: #000 !important; }
}

/* Four practice tools: four across on wide screens, a 2x2 grid in between. */
.lp-tools { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1080px) { .lp-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .lp-tools { grid-template-columns: minmax(0, 1fr); } }
