/* ───────── DESIGN TOKENS ───────── */
:root {
  --bg: #f8fafc;
  --bg-soft: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.25);
  --text: #0f172a;
  --text-dim: #475569;
  --text-faint: #64748b;
  --accent: hsl(250, 84%, 54%);
  --accent-soft: hsla(250, 84%, 54%, 0.05);
  --accent-strong: hsl(250, 84%, 44%);
  --gold: hsl(38, 92%, 40%);
  --gold-soft: hsla(38, 92%, 40%, 0.06);
  --sage: hsl(150, 84%, 32%);
  --rose: hsl(346, 84%, 48%);
  --rose-soft: hsla(346, 84%, 48%, 0.06);
  --done: hsla(150, 84%, 32%, 0.85);

  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --max-w: 1200px;
  --content-w: 1040px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(at 0% 0%, hsla(220, 100%, 97%, 0.6) 0px, transparent 50%),
    radial-gradient(at 50% 0%, hsla(200, 100%, 98%, 0.7) 0px, transparent 50%),
    radial-gradient(at 100% 0%, hsla(240, 100%, 97%, 0.6) 0px, transparent 50%),
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 24px 24px, 24px 24px;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  font-variation-settings: "opsz" 16;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

body::before {
  display: none;
}
body::after {
  display: none;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: var(--bg); }

/* ───────── PROGRESS RAIL & TOPNAV ───────── */
.progress-rail {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border);
  z-index: 100;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.4s ease;
}

.topnav {
  position: fixed;
  top: 3px; left: 0; right: 0;
  z-index: 99;
  padding: 14px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow:
    0 1px 2px 0 rgba(0, 0, 0, 0.01),
    0 4px 20px -5px rgba(15, 23, 42, 0.02);
}
.topnav .brand {
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--text-dim);
}
.topnav .brand a { color: var(--text); transition: color 0.2s; }
.topnav .brand a:hover { color: var(--accent); }
.topnav .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}
.topnav .crumbs { color: var(--text-faint); display: flex; gap: 8px; align-items: center; }
.topnav .crumbs .sep { color: var(--border-strong); }
.topnav-links { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topnav-links::-webkit-scrollbar { display: none; }
.topnav-links a {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-dim);
  line-height: 1;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}
.topnav-links a:hover, .topnav-links a.active { border-color: var(--border-strong); background: var(--bg-soft); color: var(--accent); }
.topnav-links a.cta { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 15px rgba(255, 255, 255, 0.05); }
.topnav-links a.cta:hover { border-color: var(--accent-strong); background: var(--accent); color: #ffffff; box-shadow: 0 4px 16px hsla(250, 84%, 54%, 0.3); }
.topnav-right {
  display: flex;
  gap: 12px;
  align-items: center;
}
.topnav-right .progress-stats {
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--text-dim);
}
.topnav-right .pct { color: var(--accent); font-weight: 700; }
.btn-mono {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-mono:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-soft);
}
.btn-mono.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 8px hsla(250, 84%, 54%, 0.2);
}
.btn-mono.primary:hover {
  background: var(--accent-strong);
  color: #ffffff;
  box-shadow: 0 4px 16px hsla(250, 84%, 54%, 0.3);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  line-height: 1.2;
  padding: 10px 18px;
  text-transform: uppercase;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 12px var(--accent-soft); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #ffffff; box-shadow: 0 2px 8px hsla(250, 84%, 54%, 0.2); font-weight: 700; }
.btn.primary:hover { border-color: var(--accent-strong); background: var(--accent-strong); color: #ffffff; box-shadow: 0 4px 16px hsla(250, 84%, 54%, 0.3); }
.btn.gold { border-color: var(--gold); background: var(--gold-soft); color: var(--gold); }
.btn.gold:hover { border-color: var(--gold); background: var(--gold); color: #ffffff; box-shadow: 0 4px 16px hsla(38, 92%, 40%, 0.3); font-weight: 700; }

/* ───────── CONTAINER ───────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}
.container.hero {
  padding: 112px 32px 56px;
}
section.container {
  padding: 64px 32px;
}
.content {
  max-width: var(--content-w);
  margin: 0 auto;
}

/* ───────── HERO ───────── */
.hero {
  min-height: auto;
  position: relative;
}
.hero.compact {
  min-height: auto;
  padding-top: 120px;
  padding-bottom: 40px;
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 32px;
  align-items: stretch;
}
.hero-copy,
.course-panel,
.track-panel {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.01),
    0 4px 24px -2px rgba(15, 23, 42, 0.02);
}
.hero-copy {
  padding: 48px;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
  align-items: center;
}
.hero-eyebrow span { display: flex; align-items: center; gap: 8px; }
.hero-eyebrow .pulse {
  width: 6px; height: 6px;
  background: var(--sage);
  border-radius: 50%;
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 76px;
  line-height: 0.98;
  letter-spacing: 0;
  font-variation-settings: "opsz" 72;
  margin-bottom: 18px;
  color: var(--text);
}
.hero-title em {
  font-style: normal;
  font-weight: 700;
  color: var(--accent);
  font-variation-settings: "opsz" 72;
}

.hero-deck {
  font-family: var(--font-body);
  font-weight: 400;
  font-style: normal;
  font-size: 21px;
  line-height: 1.5;
  color: var(--text-dim);
  max-width: 760px;
  margin: 0 0 28px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0;
  margin-top: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.hero-meta-item {
  padding: 18px 20px;
  border-right: 1px solid var(--border);
}
.hero-meta-item:last-child { border-right: none; }
.hero-meta-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.hero-meta-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  font-variation-settings: "opsz" 36;
  color: var(--text);
}
.hero-meta-value em {
  font-style: normal;
  color: var(--accent);
  font-variation-settings: "opsz" 36, "SOFT" 100;
}

.course-panel {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.panel-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.course-panel-stat {
  display: grid;
  gap: 4px;
}
.course-panel-stat strong {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 0.9;
  color: var(--accent);
}
.course-panel-stat span {
  color: var(--text-dim);
}
.mini-route {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.mini-route div {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: baseline;
  color: var(--text-dim);
  font-size: 15px;
}
.mini-route span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

/* ───────── SECTIONS ───────── */
section { padding: 64px 0; position: relative; }
.section-mark {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 24px;
  display: flex;
  gap: 14px;
  align-items: baseline;
}
.section-mark .num { color: var(--accent); font-weight: 700; }
.section-mark .line {
  flex: 1; height: 1px; background: var(--border); max-width: 240px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--text);
  margin-bottom: 24px;
  font-variation-settings: "opsz" 96, "SOFT" 40;
}
.section-title em {
  font-style: normal;
  color: var(--accent);
  font-variation-settings: "opsz" 96, "SOFT" 100, "WONK" 1;
}
.section-intro {
  font-family: var(--font-body);
  font-weight: 400;
  font-style: normal;
  font-size: 19px;
  line-height: 1.5;
  color: var(--text-dim);
  max-width: 640px;
  margin-bottom: 32px;
  font-variation-settings: "opsz" 36;
}

/* ───────── DIAGNOSTIC ───────── */
.diagnostic-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
  align-items: start;
}
.diagnostic-checks {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.diagnostic-result {
  position: sticky;
  top: 96px;
  padding: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
}
.diagnostic-result::before {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent);
  margin-bottom: 20px;
}
.diagnostic-score {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.diagnostic-result h3 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  font-variation-settings: "opsz" 48, "SOFT" 40;
  margin-bottom: 14px;
}

/* ───────── OFFICIAL TRACKS ───────── */
.track-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.track-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow:
    0 1px 2px 0 rgba(0, 0, 0, 0.01),
    0 2px 12px -2px rgba(15, 23, 42, 0.01);
  padding: 28px;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.track-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 10px 30px -10px rgba(79, 70, 229, 0.08),
    0 1px 3px 0 rgba(79, 70, 229, 0.02);
}
.track-badge {
  width: fit-content;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 6px;
  padding: 5px 9px;
}
.track-card h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}
.track-card p {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.5;
}
.track-foot {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.credential-map {
  margin-top: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}
.credential-map h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 14px;
}
.skill-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
}
.skill-map li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.45;
}
.skill-map strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

@media (max-width: 920px) {
  .skill-map {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .track-grid {
    grid-template-columns: 1fr;
  }
}
.diagnostic-result p {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.55;
}

@media (max-width: 860px) {
  .diagnostic-layout { grid-template-columns: 1fr; gap: 28px; }
  .diagnostic-result { position: relative; top: auto; }
}

/* ───────── WEEK PLAN ───────── */
.week-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 12px;
}
.week-card {
  min-height: 190px;
  padding: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.week-card span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.week-card h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.05;
  font-variation-settings: "opsz" 48, "SOFT" 40;
  margin: 28px 0 12px;
}
.week-card p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-shell { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .week-grid { grid-template-columns: 1fr; }
  .week-card { min-height: auto; gap: 12px; }
  .week-card h3 { margin-top: 12px; }
}

/* ───────── PHASE CARDS (landing) ───────── */
.phase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 16px;
}
.phase-card {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 20px;
  padding: 30px;
  min-height: 270px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  align-items: start;
  cursor: pointer;
  box-shadow:
    0 1px 2px 0 rgba(0, 0, 0, 0.01),
    0 2px 12px -2px rgba(15, 23, 42, 0.01);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.phase-card::after {
  content: '→';
  position: absolute;
  right: 26px;
  top: 24px;
  font-size: 22px;
  color: var(--text-faint);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-mono);
}
.phase-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 12px 36px -12px rgba(79, 70, 229, 0.1),
    0 1px 3px 0 rgba(79, 70, 229, 0.02);
}
.phase-card:hover::after {
  color: var(--accent);
  transform: translateX(4px);
}
.phase-card-num {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 800;
  font-style: normal;
  font-variation-settings: "opsz" 72;
  line-height: 1;
  color: var(--accent);
  min-width: auto;
}
.phase-card-body {
  padding-right: 28px;
}
.phase-card-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.phase-card-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
  font-variation-settings: "opsz" 72, "SOFT" 30;
  margin-bottom: 10px;
  color: var(--text);
}
.phase-card-goal {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.5;
  max-width: none;
  margin-bottom: 16px;
}
.phase-card-progress {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: center;
}
.phase-card-progress .count { color: var(--accent); font-weight: 700; }
.phase-card-progress .duration { color: var(--gold); }
.phase-card-progress .bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.phase-card-progress .bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.5s ease;
}

@media (max-width: 980px) {
  .phase-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
}

/* ───────── LESSON PAGE HEADER ───────── */
header.lesson-header.container {
  padding: 112px 32px 48px;
  border-bottom: 1px solid var(--border);
}
.lesson-num {
  font-family: var(--font-display);
  font-size: 132px;
  font-weight: 800;
  font-style: normal;
  font-variation-settings: "opsz" 72;
  line-height: 0.9;
  color: var(--accent);
  margin-bottom: 16px;
}
.lesson-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
  display: flex;
  gap: 16px;
  align-items: center;
}
.lesson-kicker .duration { color: var(--gold); }
.lesson-title {
  font-family: var(--font-display);
  font-size: 68px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  font-variation-settings: "opsz" 96, "SOFT" 40;
  margin-bottom: 24px;
}
.lesson-title em {
  font-style: normal;
  color: var(--accent);
  font-variation-settings: "opsz" 96, "SOFT" 100, "WONK" 1;
}
.lesson-goal {
  font-family: var(--font-body);
  font-size: 21px;
  font-style: normal;
  font-weight: 400;
  color: var(--text-dim);
  line-height: 1.4;
  font-variation-settings: "opsz" 36;
  max-width: 640px;
}

/* ───────── INLINE GROUP HEADERS ───────── */
.sub-head {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 48px 0 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.sub-head::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  font-family: var(--font-display);
}
.sub-head:first-child { margin-top: 0; }

/* ───────── CHECKLIST ───────── */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.check-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  align-items: start;
}
.check-item:hover { padding-left: 28px; }
.diagnostic-checks .check-item,
.checklist .check-item {
  background: rgba(255, 255, 255, 0.7);
}
.checklist {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.01),
    0 4px 18px -4px rgba(15, 23, 42, 0.01);
}
.checklist .check-item:last-child,
.diagnostic-checks .check-item:last-child {
  border-bottom: none;
}
.check-item:hover {
  background: rgba(255, 255, 255, 0.95);
}
.checkbox {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.checkbox::after {
  content: '';
  width: 11px;
  height: 6px;
  border-left: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.check-item.done {
  background: rgba(16, 185, 129, 0.015) !important;
}
.check-item.done:hover {
  background: rgba(16, 185, 129, 0.03) !important;
}
.check-item.done .checkbox {
  background: var(--sage);
  border-color: var(--sage);
  box-shadow: 0 0 8px hsla(150, 84%, 32%, 0.2);
}
.check-item.done .checkbox::after {
  transform: rotate(-45deg) translate(1px, -1px) scale(1);
}
.check-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.check-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  flex-wrap: wrap;
}
.check-type { color: var(--accent); font-weight: 700; }
.check-source { color: var(--text-faint); }
.check-title {
  font-size: 17px;
  color: var(--text);
  line-height: 1.4;
  font-weight: 500;
}
.check-title a {
  border-bottom: 1px solid var(--border-strong);
  transition: all 0.2s;
}
.check-title a:hover { color: var(--accent); border-color: var(--accent); }
.check-desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-top: 2px;
}
.check-desc code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 2px;
  color: var(--gold);
}
.check-item.done .check-title { color: var(--text-faint); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.check-item.done .check-desc { color: var(--text-faint); opacity: 0.5; }
.check-item.done .check-type { color: var(--text-faint); }

/* ───────── NOTES BLOCK ───────── */
.notes-block {
  margin-top: 80px;
  padding: 36px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.01),
    0 4px 24px -2px rgba(15, 23, 42, 0.02);
  position: relative;
}
.notes-block::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 80px;
  height: 3px;
  background: var(--accent);
  border-radius: 3px 0 0 0;
}
.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}
.notes-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  font-variation-settings: "opsz" 36, "SOFT" 30;
}
.notes-title em { font-style: normal; color: var(--accent); }
.notes-status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.notes-status.saved { color: var(--sage); }
.notes-textarea {
  width: 100%;
  min-height: 180px;
  background: rgba(15, 23, 42, 0.015);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  padding: 16px;
  resize: vertical;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.notes-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.notes-textarea::placeholder {
  color: var(--text-faint);
  font-style: italic;
}

/* ───────── QUIZ ───────── */
.quiz-block {
  margin-top: 60px;
  padding-top: 60px;
  border-top: 1px solid var(--border);
}
.quiz-intro {
  margin-bottom: 32px;
}
.quiz-question {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 20px;
  box-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.01),
    0 4px 24px -2px rgba(15, 23, 42, 0.02);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.quiz-question.answered.correct { border-color: var(--sage); }
.quiz-question.answered.wrong { border-color: var(--rose); }

.quiz-q-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.quiz-q-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  font-variation-settings: "opsz" 36, "SOFT" 30;
  margin-bottom: 20px;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.015);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 16px;
  line-height: 1.5;
}
.quiz-option:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
}
.quiz-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.quiz-option-marker {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: all 0.2s;
  margin-top: 1px;
}
.quiz-option.selected .quiz-option-marker {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}
.quiz-question.answered .quiz-option { cursor: default; pointer-events: none; }
.quiz-question.answered .quiz-option.correct {
  border-color: var(--sage);
  background: rgba(143, 184, 114, 0.08);
}
.quiz-question.answered .quiz-option.correct .quiz-option-marker {
  border-color: var(--sage);
  background: var(--sage);
  color: var(--bg);
}
.quiz-question.answered .quiz-option.wrong-pick {
  border-color: var(--rose);
  background: var(--rose-soft);
}
.quiz-question.answered .quiz-option.wrong-pick .quiz-option-marker {
  border-color: var(--rose);
  background: var(--rose);
  color: var(--bg);
}
.quiz-explanation {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--bg);
  border-left: 2px solid var(--gold);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dim);
  display: none;
}
.quiz-question.answered .quiz-explanation { display: block; }
.quiz-explanation strong { color: var(--gold); font-weight: 500; }

.quiz-controls {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.quiz-score {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.quiz-score .pts { color: var(--accent); font-weight: 700; }
.quiz-score.perfect .pts { color: var(--sage); }

/* ───────── LESSON NAV (bottom) ───────── */
.lesson-nav {
  margin-top: 80px;
  padding: 40px 0 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
}
.lesson-nav-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 28px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow:
    0 1px 2px 0 rgba(0, 0, 0, 0.01),
    0 2px 12px -2px rgba(15, 23, 42, 0.01);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 100px;
  justify-content: center;
}
.lesson-nav-link:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 10px 30px -10px rgba(79, 70, 229, 0.08),
    0 1px 3px 0 rgba(79, 70, 229, 0.02);
}
.lesson-nav-link.next:hover {
  transform: translateX(4px);
}
.lesson-nav-link.prev:hover {
  transform: translateX(-4px);
}
.lesson-nav-link.next { text-align: right; }
.lesson-nav-link.disabled {
  opacity: 0.3;
  pointer-events: none;
}
.lesson-nav-direction {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}
.lesson-nav-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  font-variation-settings: "opsz" 36, "SOFT" 30;
}
.lesson-nav-center a {
  display: block;
  padding: 14px 28px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: all 0.2s;
}
.lesson-nav-center a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 720px) {
  .lesson-nav { grid-template-columns: 1fr; }
  .lesson-nav-link.next { text-align: left; }
  .lesson-nav-center { order: -1; }
}

/* ───────── PHASE PROGRESS BAR ───────── */
.phase-progress {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 24px;
}
.phase-progress .bar {
  height: 4px;
  background: var(--border);
  margin-top: 8px;
  overflow: hidden;
  position: relative;
}
.phase-progress .bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.5s ease;
}
.phase-progress .count { color: var(--accent); font-weight: 700; }

/* ───────── PROJECT CARD ───────── */
.project-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  padding: 48px;
  margin-top: 40px;
  position: relative;
  border-radius: 12px;
  box-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.01),
    0 4px 24px -2px rgba(15, 23, 42, 0.02);
}
.project-card::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 3px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
}
.project-ideas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.project-idea {
  padding: 24px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow:
    0 1px 2px 0 rgba(0, 0, 0, 0.01),
    0 2px 8px -2px rgba(15, 23, 42, 0.01);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-idea:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 8px 24px -8px rgba(79, 70, 229, 0.08);
}
.project-idea h4 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  font-variation-settings: "opsz" 36, "SOFT" 50;
  margin-bottom: 10px;
  color: var(--accent);
}
.project-idea p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.55;
}
.requirements {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.requirements h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}
.requirements ul { list-style: none; padding: 0; }
.requirements li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  color: var(--text-dim);
  font-size: 15px;
}
.requirements li::before {
  content: '◇';
  position: absolute;
  left: 0;
  color: var(--accent);
}
.rubric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.rubric-item {
  padding: 18px;
  background: var(--bg-elevated);
}
.rubric-item span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.rubric-item p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .rubric-grid { grid-template-columns: 1fr; }
}

/* ───────── TWO-COL ───────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; gap: 32px; }
}

/* ───────── PULL QUOTE ───────── */
.pullquote {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  font-size: 32px;
  line-height: 1.3;
  color: var(--text);
  padding: 64px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 64px 0;
  position: relative;
  font-variation-settings: "opsz" 72, "SOFT" 70, "WONK" 1;
}
.pullquote::before {
  display: none;
}
.pullquote em { color: var(--accent); font-style: normal; }

/* ───────── FOOTER & TOOLS ───────── */
.footer-tools {
  padding: 60px 0;
  border-top: 1px solid var(--border-strong);
  margin-top: 80px;
}
.tools-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
}
.tools-title {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  font-variation-settings: "opsz" 72, "SOFT" 50, "WONK" 1;
}
.tools-title em { font-style: normal; color: var(--accent); }
.tools-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .tools-grid { grid-template-columns: 1fr; }
}

footer {
  padding: 40px 0 60px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  text-align: center;
}
.footer-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  line-height: 1.8;
}

/* ───────── TOAST ───────── */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 16px 24px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  z-index: 200;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  max-width: 400px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--sage); }
.toast.error { border-color: var(--rose); }

/* ───────── MOBILE ───────── */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .container { padding: 0 20px; }
  .container.hero { padding: 96px 20px 44px; }
  section.container { padding: 60px 20px; }
  header.lesson-header.container { padding: 100px 20px 40px; }
  .topnav {
    position: sticky;
    display: grid;
    grid-template-areas:
      "brand stats"
      "links links";
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px 16px;
    padding: 12px 20px;
  }
  .topnav .brand { grid-area: brand; font-size: 10px; gap: 8px; }
  .topnav .crumbs { display: none; }
  .topnav-right { grid-area: stats; justify-self: end; }
  .topnav-right .progress-stats { font-size: 10px; gap: 10px; }
  .topnav-links {
    grid-area: links;
    display: flex;
    justify-content: flex-start;
    width: 100%;
    margin: 0;
    padding: 0 0 4px;
  }
  .topnav-links a { padding: 6px 8px; }
  .btn, .btn-mono { padding: 8px 12px; font-size: 9px; }
  .hero-copy,
  .course-panel {
    padding: 22px;
  }
  .hero-title { font-size: 42px; }
  .hero-deck { font-size: 18px; }
  .section-title { font-size: 34px; }
  .hero-meta { grid-template-columns: 1fr 1fr; }
  .hero-meta-item {
    padding: 16px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .hero-meta-item:nth-child(2n) { border-right: none; }
  .hero-meta-item:nth-last-child(-n+2) { border-bottom: none; }
  .lesson-num { font-size: 96px; }
  .lesson-title { font-size: 40px; }
  .lesson-goal { font-size: 18px; }
  .pullquote { font-size: 24px; }
  .tools-title { font-size: 30px; }
  .phase-card { grid-template-columns: 1fr; gap: 16px; padding: 24px; min-height: auto; }
  .phase-card::after { display: none; }
  .phase-card-body { padding-right: 0; }
  .project-card { padding: 28px 20px; }
  section { padding: 60px 0; }
  .notes-block { padding: 24px 20px; }
  .quiz-question { padding: 20px; }
  .toast { right: 20px; left: 20px; bottom: 20px; max-width: none; }
}

@media (max-width: 520px) {
  body { font-size: 15px; }
  .topnav { font-size: 9px; padding: 10px 16px; }
  .topnav-links { gap: 4px; }
  .topnav-links a { padding: 6px 8px; }
}

/* ───────── FADE IN ───────── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════
   ENHANCEMENTS: dark theme · desktop rails · search · a11y
   ═══════════════════════════════════════════════════ */

/* ───────── DARK THEME ───────── */
html[data-theme="dark"] {
  --bg: #0b1020;
  --bg-soft: #0f152a;
  --bg-elevated: #141c34;
  --bg-card: #141c34;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.30);
  --text: #e8ecf6;
  --text-dim: #aab4c8;
  --text-faint: #7e8aa0;
  --accent: hsl(255, 92%, 74%);
  --accent-soft: hsla(255, 92%, 74%, 0.12);
  --accent-strong: hsl(255, 92%, 82%);
  --gold: hsl(40, 90%, 62%);
  --gold-soft: hsla(40, 90%, 62%, 0.10);
  --sage: hsl(150, 60%, 58%);
  --rose: hsl(346, 80%, 68%);
  --rose-soft: hsla(346, 80%, 68%, 0.12);
  --done: hsla(150, 60%, 58%, 0.85);
}
html[data-theme="dark"] body {
  background-image:
    radial-gradient(at 0% 0%, hsla(255, 60%, 22%, 0.55) 0px, transparent 50%),
    radial-gradient(at 50% 0%, hsla(230, 60%, 18%, 0.55) 0px, transparent 50%),
    radial-gradient(at 100% 0%, hsla(268, 60%, 22%, 0.55) 0px, transparent 50%),
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 24px 24px, 24px 24px;
}
html[data-theme="dark"] .topnav { background: rgba(13, 18, 36, 0.82); }
html[data-theme="dark"] .hero-copy,
html[data-theme="dark"] .course-panel,
html[data-theme="dark"] .track-panel,
html[data-theme="dark"] .track-card,
html[data-theme="dark"] .phase-card,
html[data-theme="dark"] .notes-block,
html[data-theme="dark"] .quiz-question,
html[data-theme="dark"] .lesson-nav-link,
html[data-theme="dark"] .project-card,
html[data-theme="dark"] .project-idea,
html[data-theme="dark"] .checklist .check-item,
html[data-theme="dark"] .diagnostic-checks .check-item { background: rgba(255, 255, 255, 0.04); }
html[data-theme="dark"] .track-card:hover,
html[data-theme="dark"] .phase-card:hover,
html[data-theme="dark"] .lesson-nav-link:hover,
html[data-theme="dark"] .project-idea:hover,
html[data-theme="dark"] .check-item:hover { background: rgba(255, 255, 255, 0.07); }
html[data-theme="dark"] .btn-mono,
html[data-theme="dark"] .btn { background: var(--bg-elevated); color: var(--text); }
html[data-theme="dark"] .btn-mono.primary,
html[data-theme="dark"] .btn.primary { color: #0b1020; }
html[data-theme="dark"] .notes-textarea { background: rgba(255, 255, 255, 0.03); }
html[data-theme="dark"] .notes-textarea:focus { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .quiz-option { background: rgba(255, 255, 255, 0.03); }
html[data-theme="dark"] .quiz-option:hover { background: rgba(255, 255, 255, 0.07); }
html[data-theme="dark"] .check-item.done { background: rgba(16, 185, 129, 0.06) !important; }
html[data-theme="dark"] .check-item.done:hover { background: rgba(16, 185, 129, 0.10) !important; }
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

/* ───────── TOPNAV ICON BUTTONS ───────── */
.tn-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  font-family: var(--font-mono);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.tn-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ───────── SEARCH BAR ───────── */
.search-bar {
  position: fixed;
  left: 0; right: 0; top: 0;
  z-index: 120;
  display: none;
  gap: 14px;
  align-items: center;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-strong);
}
html[data-theme="dark"] .search-bar { background: rgba(13, 18, 36, 0.94); }
.search-bar.open { display: flex; }
.search-bar input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 19px;
}
.search-bar .search-count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}
.filter-hidden,
.status-hidden { display: none !important; }

/* ───────── STATUS FILTER CHIPS ───────── */
.status-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 20px;
}
.status-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  color: var(--text-dim);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: all 0.2s;
}
.status-chip:hover { border-color: var(--accent); color: var(--accent); }
.status-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ───────── COPY BUTTON ───────── */
.copy-btn {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  cursor: pointer;
  vertical-align: middle;
  transition: all 0.2s;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--sage); border-color: var(--sage); }

/* ───────── ACCESSIBILITY: FOCUS-VISIBLE ───────── */
a:focus-visible,
button:focus-visible,
textarea:focus-visible,
.check-item:focus-visible,
.quiz-option:focus-visible,
.status-chip:focus-visible,
.tn-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ───────── DESKTOP SIDE-RAILS ───────── */
.phase-rail,
.lesson-toc { display: none; }
.phase-rail-title,
.toc-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.phase-rail-item {
  display: block;
  padding: 9px 12px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.3;
  transition: all 0.2s;
}
.phase-rail-item:hover { background: var(--bg-soft); color: var(--text); }
.phase-rail-item.active { border-color: var(--border-strong); background: var(--accent-soft); color: var(--accent); }
.phase-rail-item .pr-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 2px;
}
.phase-rail-item.active .pr-num { color: var(--accent); }
.phase-rail-mini {
  height: 3px;
  background: var(--border);
  border-radius: 3px;
  margin-top: 7px;
  overflow: hidden;
}
.phase-rail-mini > span { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.5s ease; }
.lesson-toc a {
  display: block;
  padding: 6px 0 6px 14px;
  border-left: 2px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.35;
  transition: all 0.2s;
}
.lesson-toc a:hover { color: var(--text); border-color: var(--text-faint); }
.lesson-toc a.active { color: var(--accent); border-color: var(--accent); font-weight: 500; }

@media (min-width: 1280px) {
  section.container.has-rails {
    max-width: 1480px;
    display: grid;
    grid-template-columns: 212px minmax(0, 1fr) 200px;
    gap: 44px;
    align-items: start;
  }
  section.container.has-rails > .content { max-width: none; margin: 0; min-width: 0; }
  section.container.has-rails > .phase-rail,
  section.container.has-rails > .lesson-toc {
    display: block;
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-bottom: 24px;
  }
}
@media (min-width: 1660px) {
  section.container.has-rails {
    max-width: 1600px;
    grid-template-columns: 230px minmax(0, 1fr) 220px;
  }
}
