:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #646b82;
  --border: #e6e8f0;
  --accent: #2563eb;
  --success: #10b981;
  --danger: #ef4444;
  --ink: #0b1220;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 18, 34, 0.04), 0 6px 20px rgba(15, 18, 34, 0.05);
  --shadow-lg: 0 2px 4px rgba(15, 18, 34, 0.04), 0 20px 50px rgba(15, 18, 34, 0.12);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-family: var(--font);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.2; }

a { color: var(--accent); }

::selection { background: rgba(37, 99, 235, 0.2); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 32px;
  height: 64px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(230, 232, 240, 0.8);
  transition: box-shadow 0.2s ease;
}
.topbar.scrolled { box-shadow: 0 4px 24px rgba(15, 18, 34, 0.06); }

body:has(#app > .home-hero) .topbar:not(.scrolled) {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body:has(#app > .home-hero) .topbar:not(.scrolled) .topnav a:not(.btn) { color: var(--text); }
body:has(#app > .home-hero) .topbar:not(.scrolled) .menu-toggle { border-color: rgba(15, 23, 42, 0.3); color: var(--text); }
body:has(#app > .home-hero) .topbar.scrolled { background: var(--surface); }

.brand {
  display: inline-block;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.1vw, 1.7rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.topnav { display: flex; gap: 4px; align-items: center; }
.topnav a { color: var(--muted); text-decoration: none; font-size: 0.94rem; font-weight: 500; padding: 8px 12px; border-radius: 8px; transition: color 0.15s, background 0.15s; }
.topnav a:hover { color: var(--text); background: rgba(15, 18, 34, 0.04); }
.topnav a.btn { margin-left: 8px; }

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { color: var(--danger); }

main { outline: none; }

.container { max-width: 1180px; margin: 0 auto; padding: 40px 32px 80px; }

/* ---------- Inner page heroes ---------- */
.hero { text-align: center; margin: 28px 0 48px; }
.hero h1 { font-size: 3rem; margin: 0 0 12px; letter-spacing: -0.035em; }
.hero p { color: var(--muted); font-size: 1.15rem; margin: 0 auto; max-width: 640px; }

/* ---------- Course cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }

.card-banner {
  position: relative;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1.2px, transparent 1.2px);
  background-size: 16px 16px;
  mask-image: linear-gradient(to bottom, #000, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
}
.card-banner::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -60px;
  bottom: -110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}
.card-icon {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(6px);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card:hover .card-icon { transform: scale(1.08) rotate(-4deg); }
.card-level {
  position: absolute;
  z-index: 1;
  top: 14px;
  left: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(4px);
}
.card-body { padding: 24px 24px 22px; display: flex; flex-direction: column; flex: 1; }
.card-body h2 { margin: 0 0 8px; font-size: 1.3rem; }
.card-body p { margin: 0 0 18px; color: var(--muted); flex: 1; font-size: 0.97rem; }
.card-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.86rem; color: var(--muted); margin-bottom: 18px; }
.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.card-price { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; }
.card-link { font-weight: 600; color: var(--accent); font-size: 0.93rem; display: inline-flex; gap: 6px; align-items: center; }
.card-link .arrow { transition: transform 0.2s ease; }
.card:hover .card-link .arrow { transform: translateX(4px); }

.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pill {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}

.progress { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.progress-label { font-size: 0.82rem; color: var(--muted); margin-top: 6px; }

/* ---------- Course overview ---------- */
.crumbs { font-size: 0.88rem; color: var(--muted); margin: 0 0 18px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }

.course-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 52px 52px 48px;
  color: #fff;
  margin-bottom: 36px;
  box-shadow: var(--shadow-lg);
}
.course-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1.2px, transparent 1.2px);
  background-size: 18px 18px;
  mask-image: linear-gradient(120deg, transparent 40%, #000);
  -webkit-mask-image: linear-gradient(120deg, transparent 40%, #000);
}
.course-hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -120px;
  top: -160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.course-hero > * { position: relative; z-index: 1; }
.course-hero .icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.3rem;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.course-hero h1 { margin: 20px 0 10px; font-size: 2.7rem; letter-spacing: -0.035em; max-width: 760px; }
.course-hero p { margin: 0 0 22px; opacity: 0.94; max-width: 720px; font-size: 1.08rem; }
.course-hero .pill { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.2); color: #fff; }
.course-hero .progress { background: rgba(255, 255, 255, 0.28); max-width: 420px; }
.course-hero .progress > span { background: #fff; }
.course-hero .progress-label { color: rgba(255, 255, 255, 0.9); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, filter 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px -6px var(--accent); }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 10px 24px -8px var(--accent); }
.btn-light { background: #fff; color: var(--text); box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.3); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg); border-color: #d6d9e4; }
.btn-success { background: var(--success); color: #fff; box-shadow: 0 6px 18px -6px var(--success); }
.btn-outline-light { background: rgba(255, 255, 255, 0.06); color: #fff; border-color: rgba(255, 255, 255, 0.22); }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.12); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.panel h3 { margin-top: 0; }

.module { margin-bottom: 10px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.module:last-child { border-bottom: none; padding-bottom: 0; }
.module-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.module-head h3 { margin: 0; font-size: 1.08rem; }
.module-head .count { color: var(--muted); font-size: 0.82rem; white-space: nowrap; background: var(--bg); padding: 2px 10px; border-radius: 999px; }
.module p.summary { color: var(--muted); margin: 6px 0 10px; font-size: 0.95rem; }

.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s ease;
}
.lesson-list li a:hover { background: var(--bg); }
.lesson-list .check {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #d4d7e2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #fff;
}
.lesson-list .done .check { background: var(--success); border-color: var(--success); }
.lesson-list .mins { margin-left: auto; color: var(--muted); font-size: 0.82rem; }

.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { margin-bottom: 16px; font-size: 0.95rem; }
.info-list li:last-child { margin-bottom: 0; }
.info-list strong { display: block; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 2px; }

/* ---------- Lesson view ---------- */
.lesson-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.sidebar-toggle { display: none; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 22px 14px;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}
.sidebar .back { display: block; font-size: 0.88rem; color: var(--muted); text-decoration: none; margin: 0 8px 14px; }
.sidebar h4 { margin: 0 8px 6px; font-size: 1rem; }
.sidebar .progress { margin: 0 8px; }
.sidebar .progress-label { margin: 6px 8px 16px; }
.sidebar .mod-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 18px 8px 6px;
  font-weight: 600;
}
.sidebar .lesson-list li a { font-size: 0.9rem; padding: 7px 8px; }
.sidebar .lesson-list li a.active { background: var(--bg); font-weight: 600; }
.sidebar .lesson-list .check { width: 18px; height: 18px; }

.lesson-main { padding: 40px 56px 80px; max-width: 860px; width: 100%; }
.crumb { color: var(--muted); font-size: 0.88rem; margin-bottom: 6px; }
.lesson-main h1 { margin: 0 0 6px; font-size: 2rem; letter-spacing: -0.02em; }
.lesson-main .lesson-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 28px; }

.prose { font-size: 1.05rem; }
.prose h3 { margin-top: 1.8em; font-size: 1.25rem; }
.prose p, .prose li { color: #30354a; }
.prose code {
  background: #eef0f7;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.9em;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.prose pre {
  background: #1e2030;
  color: #e3e6f3;
  padding: 18px 20px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.55;
}
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.prose blockquote {
  margin: 1.4em 0;
  padding: 12px 18px;
  border-left: 4px solid var(--accent);
  background: #eff6ff;
  border-radius: 0 10px 10px 0;
}
.prose blockquote p { margin: 0.3em 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose th { background: var(--bg); }

.box { border-radius: var(--radius); padding: 22px 26px; margin: 32px 0; border: 1px solid var(--border); }
.box h3 { margin: 0 0 12px; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.box.takeaways { background: #f0fdf7; border-color: #bbf0d8; }
.box.takeaways ul { margin: 0; padding-left: 20px; }
.box.exercise { background: #fffaf0; border-color: #fde3b0; }
.box.quiz { background: var(--surface); box-shadow: var(--shadow); }

.question { margin-bottom: 22px; }
.question p.q { font-weight: 600; margin: 0 0 10px; }
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
  cursor: pointer;
  color: var(--text);
}
.option:hover:not(:disabled) { border-color: var(--accent); background: #f4f8ff; }
.option:disabled { cursor: default; }
.option.correct { border-color: var(--success); background: #ecfdf5; }
.option.wrong { border-color: var(--danger); background: #fef2f2; }
.explain { font-size: 0.93rem; padding: 10px 14px; border-radius: 10px; background: var(--bg); margin-top: 4px; }
.quiz-score { font-weight: 600; margin-top: 8px; }

.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.checklist { list-style: none; padding: 0; }
.checklist li { margin-bottom: 8px; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.checklist input { margin-top: 5px; width: 17px; height: 17px; accent-color: var(--success); }

/* ---------- Certificate ---------- */
.certificate {
  max-width: 820px;
  margin: 20px auto;
  background: #fff;
  border: 10px double #c9b26b;
  padding: 60px 50px;
  text-align: center;
  box-shadow: var(--shadow);
}
.certificate .small { text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted); font-size: 0.85rem; }
.certificate h1 { font-family: Georgia, serif; font-size: 2.4rem; margin: 12px 0; }
.certificate .name { font-family: Georgia, serif; font-size: 2rem; border-bottom: 1px solid #ccc; display: inline-block; padding: 0 30px 6px; margin: 18px 0; min-width: 300px; }
.certificate input.name { border: none; border-bottom: 1px solid #ccc; text-align: center; outline: none; }
.certificate h2 { font-size: 1.5rem; margin: 10px 0 28px; }

.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---------- Site chrome ---------- */
.topnav a.active { color: var(--text); font-weight: 600; }
.topnav a.btn, .topnav a.btn:hover { color: #fff; background: #2563eb; box-shadow: 0 6px 18px -6px #2563eb; }
.btn-sm { padding: 8px 16px; font-size: 0.88rem; border-radius: 10px; }
.btn-lg { padding: 15px 28px; font-size: 1.03rem; border-radius: 14px; }
.btn-block { display: flex; width: 100%; }
.menu-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 10px; font-size: 1.15rem; padding: 4px 11px; cursor: pointer; }

.muted { color: var(--muted); }
.center { text-align: center; }
.narrow { max-width: 800px; margin-left: auto; margin-right: auto; }

.footer { position: relative; background: var(--ink); color: #c5cddc; padding: 64px 0 24px; overflow: hidden; }
.footer::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 300px;
  left: 50%;
  top: -220px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(37, 99, 235, 0.35), transparent);
  pointer-events: none;
}
body.lesson-mode .footer { display: none; }
.footer-inner { position: relative; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-top: 0; padding-bottom: 28px; }
.footer .brand { color: #fff; }
.footer h4 { color: #fff; margin: 4px 0 14px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.footer a:not(.brand) { display: block; color: #a0aabd; text-decoration: none; margin-bottom: 10px; font-size: 0.93rem; transition: color 0.15s; }
.footer a:hover { color: #fff; }
.footer .muted { color: #8792a6; max-width: 340px; margin-top: 14px; }
.footer-bottom { position: relative; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 22px; padding-bottom: 0; font-size: 0.85rem; color: #78839a; }

/* ---------- Home: hero ---------- */
.home-hero {
  position: relative;
  margin-top: -64px;
  overflow: hidden;
  background: #6ea2f2;
  color: #0b1b3a;
  isolation: isolate;
}

/* ---------- Animated sky ---------- */
.sky { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.sky-bg {
  position: absolute;
  inset: -4% -6%;
  background: #6ea2f2 url("assets/clouds/ben-day-clouds-v4.jpg") center bottom / cover no-repeat;
  animation: sky-pan 90s ease-in-out infinite alternate;
  will-change: transform;
}
.cloud {
  position: absolute;
  left: 0;
  top: var(--top);
  width: var(--w);
  max-width: none;
  height: auto;
  opacity: var(--o);
  filter: brightness(1.28) saturate(0.8);
  transform: translate3d(-110%, 0, 0);
  animation: cloud-drift var(--dur) linear var(--delay) infinite;
  will-change: transform;
}
.sky-fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(246, 247, 251, 0) 62%, var(--bg) 100%),
    linear-gradient(to right, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 55%);
}
@keyframes sky-pan {
  from { transform: translate3d(-2.5%, 0, 0) scale(1.04); }
  to { transform: translate3d(2.5%, -1.5%, 0) scale(1.1); }
}
@keyframes cloud-drift {
  from { transform: translate3d(-110%, 0, 0); }
  to { transform: translate3d(calc(100vw + 10%), 0, 0); }
}

.hero-grid {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-height: calc(clamp(530px, 44vw, 650px) + 64px);
  padding-top: 118px;
  padding-bottom: 112px;
}

.hero-intro {
  --hero-ink: #172945;
  --hero-blue: #17366a;
  width: min(100%, 470px);
  padding: clamp(22px, 3.3vw, 40px);
  background: #fffcf5;
  color: var(--hero-ink);
}

.hero-eyebrow {
  margin: 0 0 18px;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-hero h1 {
  max-width: 11ch;
  margin: 0 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 5.8vw, 5.25rem);
  font-weight: 400;
  line-height: 0.97;
  letter-spacing: -0.043em;
}

.hero-description {
  max-width: 41ch;
  margin: 0 0 24px;
  font-size: clamp(1rem, 1.5vw, 1.1rem);
  line-height: 1.6;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.hero-primary,
.hero-secondary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.94rem;
  font-weight: 650;
}

.hero-primary {
  background: var(--hero-blue);
  color: #fff;
  padding: 10px 14px;
  text-decoration: none;
}

.hero-primary:hover { background: #244b82; }
.hero-secondary { color: var(--hero-ink); text-underline-offset: 4px; }
.hero-primary:focus-visible,
.hero-secondary:focus-visible {
  outline: 2px solid var(--hero-blue);
  outline-offset: 4px;
}

@media (max-width: 600px) {
  .hero-grid {
    align-items: flex-start;
    min-height: 0;
    padding-top: calc(clamp(144px, 36vw, 204px) + 64px);
    padding-bottom: 102px;
  }

  .hero-eyebrow { margin-bottom: 12px; }
  .home-hero h1 { max-width: none; font-size: clamp(2.5rem, 9vw, 3.55rem); margin-bottom: 14px; }
  .hero-description { margin-bottom: 18px; }
}

/* ---------- Home: stats ---------- */
.stats-wrap { padding-top: 0; padding-bottom: 0; margin-top: -64px; position: relative; z-index: 2; }
.stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 1000px;
  margin: 0 auto;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}
.stats > div { padding: 26px 20px; text-align: center; }
.stats > div + div { border-left: 1px solid var(--border); }
.stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stats span { color: var(--muted); font-size: 0.9rem; }

/* ---------- Sections ---------- */
.section { padding-top: 88px; padding-bottom: 88px; }
.section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section.alt > .container { padding-top: 0; padding-bottom: 0; }
.cta-wrap { padding-top: 0; padding-bottom: 0; }
.section-head { text-align: center; margin: 0 auto 52px; max-width: 680px; }
.section-head h2 { font-size: 2.6rem; letter-spacing: -0.035em; margin: 14px 0 12px; }
.section-head p { color: var(--muted); font-size: 1.1rem; margin: 0 auto; }

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.16);
  padding: 5px 12px;
  border-radius: 999px;
}

/* ---------- Home: how it works ---------- */
.steps { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.steps::before {
  content: "";
  position: absolute;
  top: 46px;
  left: 16%;
  right: 16%;
  border-top: 2px dashed #d4d7e2;
}
.step { position: relative; text-align: center; padding: 0 18px; }
.step-icon {
  width: 92px;
  height: 92px;
  margin: 0 auto 20px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  position: relative;
}
.step-num {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px var(--surface);
}
.step h3 { margin: 0 0 8px; font-size: 1.25rem; }
.step p { margin: 0 auto; color: var(--muted); max-width: 300px; }

/* ---------- Home: features ---------- */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 72px; }
.feature {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-icon {
  flex: none;
  font-size: 1.35rem;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eaf2ff;
}
.feature:nth-child(2) .feature-icon { background: #fff7ed; }
.feature:nth-child(3) .feature-icon { background: #f0fdfa; }
.feature:nth-child(4) .feature-icon { background: #fffbeb; }
.feature:nth-child(5) .feature-icon { background: #ecfdf5; }
.feature:nth-child(6) .feature-icon { background: #f0f9ff; }
.feature h3 { margin: 2px 0 4px; font-size: 1.02rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

/* ---------- Home: course explorer ---------- */
.explorer {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px;
  box-shadow: var(--shadow);
}
.explorer-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.explorer-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.explorer-tab:hover { background: rgba(255, 255, 255, 0.7); }
.explorer-tab:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.explorer-tab.active { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); }
.explorer-tab strong { display: block; font-family: var(--font-display); font-size: 0.98rem; line-height: 1.25; letter-spacing: -0.01em; }
.explorer-tab small { color: var(--muted); font-size: 0.8rem; }
.explorer-tab-icon {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  filter: grayscale(0.85);
  opacity: 0.7;
  transition: filter 0.2s ease, opacity 0.2s ease;
}
.explorer-tab.active .explorer-tab-icon, .explorer-tab:hover .explorer-tab-icon { filter: none; opacity: 1; }

.explorer-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 40px;
  margin-top: 10px;
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
}
.explorer-label { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c); margin-bottom: 6px; }
.explorer-info p { margin: 0 0 22px; color: var(--muted); font-size: 0.97rem; }
.explorer-info p.explorer-outcome { font-family: var(--font-display); font-size: 1.14rem; font-weight: 600; line-height: 1.45; letter-spacing: -0.015em; color: var(--text); }
.explorer-project {
  display: grid;
  gap: 2px;
  padding: 16px 18px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--c) 7%, #fff);
  border: 1px solid color-mix(in srgb, var(--c) 22%, #fff);
}
.explorer-project strong { font-size: 1rem; }
.explorer-project span { color: var(--muted); font-size: 0.86rem; }
.explorer-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.explorer-modules { list-style: none; margin: 0; padding: 0; position: relative; }
.explorer-modules li:not(:last-child)::before { content: ""; position: absolute; left: 17px; top: 47px; bottom: -11px; width: 2px; background: var(--border); }
.explorer-modules li { position: relative; display: flex; align-items: flex-start; gap: 16px; padding: 11px 0; }
.explorer-num {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--c);
  background: #fff;
  border: 2px solid var(--c);
  box-shadow: 0 0 0 5px #fff;
}
.explorer-modules strong { display: block; font-size: 0.98rem; line-height: 1.35; padding-top: 6px; }
.explorer-modules p { margin: 2px 0 0; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.explorer-modules li > div { flex: 1; min-width: 0; }
.explorer-count { flex: none; margin-top: 7px; font-size: 0.78rem; color: var(--muted); background: var(--bg); padding: 2px 10px; border-radius: 999px; white-space: nowrap; }

.price { font-family: var(--font-display); font-size: 2.8rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; }
.ticks { list-style: none; padding: 0; margin: 20px 0 26px; }
.ticks li { padding-left: 30px; position: relative; margin-bottom: 10px; }
.ticks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #d1fae5;
  color: #059669;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.enroll .price { font-size: 2.4rem; }
.enroll .muted { margin: 4px 0 18px; font-size: 0.92rem; }

/* ---------- FAQ ---------- */
.faq-split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; }
.faq-split .section-head { text-align: left; margin: 0; }
.faq-split .section-head h2 { font-size: 2.4rem; }
.faq-split .section-head p { margin: 0 0 20px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.faq details[open] { box-shadow: var(--shadow); border-color: #d6d9e4; }
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--muted);
  transition: transform 0.2s ease, background 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); background: #eaf2ff; color: var(--accent); }
.faq details p { margin: 12px 0 0; color: var(--muted); }

/* ---------- Newsletter band ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin: 0 0 96px;
  padding: 72px 32px;
  border-radius: 28px;
  text-align: center;
  color: #0b1b3a;
  background: #6ea2f2;
  box-shadow: var(--shadow-lg);
}
.cta-band .sky-fade { background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.35)); }
.cta-band h2 { margin: 0 0 10px; font-size: 2.3rem; letter-spacing: -0.03em; }
.cta-band p { margin: 0 0 28px; color: #1b2e52; font-size: 1.08rem; font-weight: 500; }
.signup {
  display: flex;
  gap: 8px;
  justify-content: center;
  max-width: 480px;
  margin: 0 auto;
  padding: 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #fff;
  box-shadow: 0 12px 30px -10px rgba(11, 27, 58, 0.35);
}
.signup input { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 11px; border: none; font: inherit; background: transparent; color: var(--text); outline: none; }
.signup input::placeholder { color: #7b859c; }
.signup .btn-light { background: var(--accent); color: #fff; box-shadow: none; }
.thanks { font-weight: 600; }

.learning-list { display: grid; gap: 14px; }
.learning-row { display: flex; align-items: center; gap: 20px; margin: 0; }
.learning-icon { flex: none; width: 60px; height: 60px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.learning-info { flex: 1; }
.learning-info h3 { margin: 0 0 8px; }
.empty-panel { text-align: center; padding: 40px; }

/* ---------- Scroll reveal ---------- */
.js-reveal .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.js-reveal .reveal.in { opacity: 1; transform: none; }
.js-reveal .reveal.d1 { transition-delay: 0.08s; }
.js-reveal .reveal.d2 { transition-delay: 0.16s; }
.js-reveal .reveal.d3 { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  .sky-bg { animation: none; }
  .cloud { animation: none; transform: translate3d(calc(var(--delay) * -0.4), 0, 0); left: 10%; }
  html { scroll-behavior: auto; }
}

.back-link { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
/* ---------- Interactive lessons ---------- */
.read-progress { position: fixed; top: 64px; left: 0; right: 0; height: 3px; z-index: 19; pointer-events: none; }
.read-progress > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.12s linear; }

.prose h3, .box, .widget { scroll-margin-top: 92px; }

.lesson-outline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: -10px 0 30px; }
.lesson-outline .lo-label { color: var(--muted); font-size: 0.82rem; margin-right: 4px; }
.lesson-outline button {
  font: inherit; font-size: 0.82rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.lesson-outline button:hover { border-color: var(--accent); color: var(--accent); }

/* Code blocks */
.code-block { margin: 1.3em 0; border-radius: 12px; overflow: hidden; background: #1e2030; box-shadow: 0 1px 2px rgba(15, 18, 34, 0.1); }
.code-block:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.code-block { max-width: 100%; }
.code-block > pre, .prose .code-block > pre { margin: 0; border-radius: 0; background: transparent; padding: 16px 20px; overflow-x: auto; max-width: 100%; }
.code-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 10px 7px 16px; background: #171929; color: #a9b0cc; font-size: 0.76rem; }
.code-lang { font-weight: 600; letter-spacing: 0.04em; }
.code-lang em { font-style: normal; font-weight: 400; color: #7f88a8; letter-spacing: 0; }
.code-actions { display: flex; gap: 6px; }
.code-btn { font: inherit; font-size: 0.76rem; font-weight: 600; color: #d6dbf0; background: rgba(255, 255, 255, 0.08); border: 0; border-radius: 7px; padding: 5px 11px; cursor: pointer; }
.code-btn:hover { background: rgba(255, 255, 255, 0.17); }
.code-btn.run { background: #10b981; color: #fff; }
.code-btn.run:hover { background: #0ea371; }
.code-btn:disabled { opacity: 0.6; cursor: wait; }
.code-block.runnable pre code { display: block; outline: none; cursor: text; white-space: pre; min-height: 1.5em; }
.code-out { border-top: 1px solid rgba(255, 255, 255, 0.1); background: #0f111c; }
.code-out-head { padding: 7px 16px 0; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: #7f88a8; }
.prose .code-out-body { margin: 0; padding: 4px 16px 14px; background: transparent; border-radius: 0; color: #d6f5e3; font-size: 0.86rem; overflow-x: auto; }
.code-out-body span { display: block; white-space: pre-wrap; word-break: break-word; }
.code-out-body .o-warn { color: #fcd34d; }
.code-out-body .o-error { color: #fca5a5; }
.code-out-body .o-muted { color: #7f88a8; }

/* Checklists, exercise steps, notes */
.box-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.box-head h3 { margin: 0; }
.box-count { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
.box-hint { margin: 12px 0 0; font-size: 0.85rem; color: var(--muted); }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { margin: 0 0 4px; }
.check-list label { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 7px 8px; margin: 0 -8px; border-radius: 10px; }
.check-list label:hover { background: rgba(255, 255, 255, 0.7); }
.check-list input[type="checkbox"], .step-check { flex: none; width: 19px; height: 19px; margin: 2px 0 0; accent-color: var(--success); cursor: pointer; }
.check-list input:checked + span { color: var(--muted); }
.step-list { list-style: none; padding-left: 0; margin: 14px 0; }
.step-list > li { display: flex; gap: 12px; align-items: flex-start; padding: 9px 12px; margin: 0 -12px 2px; border-radius: 10px; }
.step-list > li:hover { background: rgba(255, 255, 255, 0.7); }
.step-list > li.done .step-text { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(100, 107, 130, 0.45); }
.step-text { flex: 1; min-width: 0; }
.notes-wrap { margin-top: 20px; }
.notes-wrap label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.notes-wrap textarea {
  display: block; width: 100%; min-height: 110px; resize: vertical; padding: 12px 14px;
  border: 1px solid #f0d9a6; border-radius: 12px; background: #fffefb; color: var(--text);
  font: inherit; font-size: 0.95rem; line-height: 1.55;
}
.notes-wrap textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.notes-status { font-size: 0.78rem; color: var(--muted); margin-top: 4px; min-height: 1.2em; }

/* Quiz */
.quiz-dots { display: inline-flex; gap: 6px; align-items: center; }
.quiz-dots i { width: 10px; height: 10px; border-radius: 50%; background: #d4d7e2; }
.quiz-dots i.now { background: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22); }
.quiz-dots i.right { background: var(--success); }
.quiz-dots i.wrong { background: var(--danger); }
.quiz-tip { font-size: 0.82rem; color: var(--muted); margin: -4px 0 16px; }
.question.active .q { color: var(--text); }
.question:not(.active) .q { color: #3a4058; }
.opt-key { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); font-size: 0.72rem; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.option.correct .opt-key { background: var(--success); border-color: var(--success); color: #fff; }
.option.wrong .opt-key { background: var(--danger); border-color: var(--danger); color: #fff; }
.opt-text { flex: 1; min-width: 0; }
.quiz-result { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 12px; background: var(--bg); margin-top: 6px; }
.quiz-result strong { font-family: var(--font-display); font-size: 1.1rem; }
.quiz-result .spacer { flex: 1; }

/* Lesson progress card */
.lesson-progress { margin: 36px 0 0; padding: 18px 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.lp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; font-weight: 600; }
.lp-head span { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.lp-bar { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; margin-bottom: 14px; }
.lp-bar > span { display: block; height: 100%; width: 0; background: var(--success); border-radius: 999px; transition: width 0.3s ease; }
.lp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lp-list li { display: flex; gap: 10px; align-items: center; font-size: 0.92rem; color: var(--muted); }
.lp-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #d4d7e2; display: inline-flex; align-items: center; justify-content: center; font-size: 0.62rem; color: #fff; }
.lp-list li.done { color: var(--text); }
.lp-list li.done .lp-dot { background: var(--success); border-color: var(--success); }

.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2000; }

/* ---------- Lesson tools (widgets) ---------- */
.widget { margin: 34px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.widget-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); background: #fafbfe; }
.widget-kicker { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.widget-head h3 { margin: 2px 0 2px; font-size: 1.2rem; }
.widget-head p { margin: 0; color: var(--muted); font-size: 0.93rem; }
.widget-body { padding: 20px 22px 24px; font-size: 0.95rem; }
.widget-body > * + * { margin-top: 16px; }
.widget-body p { color: var(--text); }

.wd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.wd-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wd-field { display: flex; flex-direction: column; gap: 5px; font-size: 0.85rem; font-weight: 600; color: var(--text); min-width: 0; }
.wd-field.wide { grid-column: 1 / -1; }
.wd-field small { font-weight: 400; color: var(--muted); font-size: 0.78rem; }
.wd-field input, .wd-field select, .wd-field textarea, .wd-item input, .wd-item select {
  font: inherit; font-weight: 400; font-size: 0.95rem; padding: 9px 12px; width: 100%; min-width: 0;
  border: 1px solid #d9dce8; border-radius: 10px; background: #fff; color: var(--text);
}
.wd-field textarea { resize: vertical; line-height: 1.5; }
.wd-field input:focus, .wd-field select:focus, .wd-field textarea:focus, .wd-item input:focus, .wd-item select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.wd-affix { position: relative; display: block; }
.wd-affix[data-affix] input { padding-left: 26px; }
.wd-affix[data-affix]::before { content: attr(data-affix); position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 500; pointer-events: none; }
.wd-affix[data-suffix] input { padding-right: 40px; }
.wd-affix[data-suffix]::after { content: attr(data-suffix); position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 0.85rem; font-weight: 500; pointer-events: none; }
input[type="range"] { accent-color: var(--accent); width: 100%; }

.wd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.wd-stat { padding: 14px 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.wd-stat strong { display: block; font-family: var(--font-display); font-size: 1.55rem; letter-spacing: -0.02em; line-height: 1.15; }
.wd-stat span { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.wd-stat.good strong, .wd-good { color: #047857; }
.wd-stat.warn strong, .wd-warn { color: #b45309; }
.wd-stat.bad strong, .wd-bad { color: #b91c1c; }
.wd-out { padding: 16px 18px; border-radius: 12px; background: #f4f8ff; border: 1px solid #dbe6fb; }
.wd-callout { padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); font-size: 0.92rem; line-height: 1.5; }
.wd-callout.good { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.wd-callout.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.wd-callout.bad { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

.wd-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.wd-table th, .wd-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.wd-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; }
.wd-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.wd-table tr:last-child td { border-bottom: 0; }

.wd-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--border); }
.wd-bar i { display: block; height: 100%; transition: width 0.25s ease; }
.wd-bar .s1, .wd-legend .s1::before { background: #2563eb; }
.wd-bar .s2, .wd-legend .s2::before { background: #0ea5e9; }
.wd-bar .s3, .wd-legend .s3::before { background: #10b981; }
.wd-bar .s4, .wd-legend .s4::before { background: #f59e0b; }
.wd-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.82rem; color: var(--muted); margin-top: 8px; }
.wd-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.wd-list { display: grid; gap: 8px; }
.wd-item { display: flex; gap: 8px; align-items: center; }
.wd-item > input, .wd-item > select { flex: 1 1 90px; }
.wd-icon { flex: none; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: #fff; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.wd-icon:hover { color: var(--danger); border-color: #fecaca; }

.wd-btn { font: inherit; font-weight: 600; font-size: 0.9rem; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; background: var(--accent); color: #fff; cursor: pointer; }
.wd-btn:hover { filter: brightness(1.08); }
.wd-btn.ghost { background: #fff; color: var(--text); border-color: var(--border); }
.wd-btn.ghost:hover { background: var(--bg); filter: none; }
.wd-btn.small { padding: 5px 11px; font-size: 0.82rem; }
.wd-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.wd-choices { display: grid; gap: 8px; }
.wd-choice { text-align: left; font: inherit; font-size: 0.95rem; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; }
.wd-choice:hover:not(:disabled) { border-color: var(--accent); background: #f4f8ff; }
.wd-choice.picked { border-color: var(--accent); background: #eaf2ff; }
.wd-choice.right { border-color: var(--success); background: #ecfdf5; }
.wd-choice.wrong { border-color: var(--danger); background: #fef2f2; }
.wd-choice:disabled { cursor: default; }
.wd-note { font-size: 0.82rem; color: var(--muted); margin: 0; }
.wd-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 6px; }
.wd-pre { margin: 0; padding: 14px 16px; border-radius: 10px; background: #161828; color: #e3e6f3; font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 0.84rem; line-height: 1.55; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.wd-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.wd-steps span { font-size: 0.78rem; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.wd-steps span.on { background: #eaf2ff; color: var(--accent); border-color: #bcd2fb; font-weight: 600; }

.wd-challenge { padding: 20px 0; border-top: 1px solid var(--border); }
.wd-challenge:first-child { border-top: 0; padding-top: 0; }
.wd-challenge:last-child { padding-bottom: 0; }
.wd-challenge h4 { margin: 0 0 6px; font-size: 1.05rem; }
.wd-prompt p { margin: 0 0 10px; font-size: 0.93rem; color: #30354a; }
.wd-prompt code, .wd-callout code, .widget-body p code { background: #eef0f7; padding: 1px 6px; border-radius: 5px; font-size: 0.88em; font-family: "SF Mono", Menlo, Consolas, monospace; }
.wd-code { display: block; width: 100%; font: 0.88rem/1.55 "SF Mono", Menlo, Consolas, monospace; background: #161828; color: #e3e6f3; border: 0; border-radius: 10px; padding: 14px 16px; resize: vertical; tab-size: 2; white-space: pre; overflow: auto; }
.wd-code:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.wd-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 0; }
.wd-keyhint { font-size: 0.76rem; color: var(--muted); margin-left: auto; }
.wd-reveal { margin-top: 12px; }
.wd-results { margin-top: 12px; }
.wd-results > * + * { margin-top: 10px; }
.wd-tests { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wd-tests li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 9px; background: var(--bg); font-size: 0.88rem; }
.wd-tests li.no { background: #fef2f2; }
.wd-tests .mark { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 800; color: #fff; background: #c5c9d8; }
.wd-tests li.ok .mark { background: var(--success); }
.wd-tests li.no .mark { background: var(--danger); }
.wd-tests code { display: block; font-size: 0.78rem; color: var(--muted); font-family: "SF Mono", Menlo, Consolas, monospace; word-break: break-word; margin-top: 2px; }

@media (max-width: 700px) {
  .wd-grid, .wd-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .widget-head { padding: 16px; }
  .widget-body { padding: 16px 16px 20px; }
  .wd-table { display: block; overflow-x: auto; }
  .wd-keyhint { display: none; }
  .lesson-outline { margin-top: -14px; }
  .code-lang em { display: none; }
}

/* ---------- Pricing ---------- */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
.price-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 34px 30px; box-shadow: var(--shadow); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.price-card:hover { box-shadow: var(--shadow-lg); }
.price-card.highlight { border: 2px solid var(--accent); transform: scale(1.04); box-shadow: 0 30px 60px -20px rgba(37, 99, 235, 0.35); }
.price-card h3 { margin: 0; font-size: 1.2rem; }
.price-card .muted { margin: 4px 0 16px; }
.price-card .ticks { flex: 1; }
.badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 0.75rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.price span { font-size: 0.95rem; font-weight: 500; color: var(--muted); }
.save-chip { display: inline-block; vertical-align: middle; margin-left: 10px; font-family: var(--font); font-style: normal; font-size: 0.78rem; font-weight: 700; letter-spacing: 0; color: #047857; background: #d1fae5; padding: 4px 10px; border-radius: 999px; }
.addon-note { text-align: center; color: var(--muted); margin: 28px 0 0; }
.addon-note.small { font-size: 0.85rem; margin: 14px 0 0; }
.learning-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Checkout ---------- */
.checkout h1 { font-size: 2rem; letter-spacing: -0.02em; margin: 8px 0 24px; }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.checkout-grid aside { position: sticky; top: 80px; }

.field { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 14px; }
.field input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: 10px; font: inherit; font-weight: 400;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.course-picker { display: grid; gap: 10px; }
.course-option { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.course-option:has(input:checked) { border-color: var(--accent); background: #f4f8ff; }
.course-option input { accent-color: var(--accent); width: 18px; height: 18px; }
.course-option-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.course-option small { display: block; color: var(--muted); }

.order-bump {
  display: block; cursor: pointer; margin-bottom: 24px; padding: 20px 22px;
  border: 2px dashed #f59e0b; border-radius: var(--radius); background: #fffbeb;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.order-bump:hover { background: #fef3c7; }
.order-bump.checked { border-style: solid; border-color: var(--success); background: #ecfdf5; }
.bump-head { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.05rem; color: #92400e; }
.order-bump.checked .bump-head { color: #065f46; }
.bump-head input { width: 22px; height: 22px; accent-color: var(--success); flex: none; }
.order-bump p { margin: 10px 0 8px; color: #57534e; }
.order-bump .ticks { margin: 8px 0 10px; }
.bump-price { font-size: 0.92rem; color: #57534e; }
.bump-price s { color: var(--muted); }
.bump-price strong { color: #b45309; font-size: 1.1rem; }

.summary .line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.summary .line[hidden] { display: none; }
.summary .line.total { font-weight: 800; font-size: 1.15rem; border-bottom: none; margin-bottom: 14px; }
.small-print { font-size: 0.82rem; text-align: center; margin: 10px 0 0; }

.confirm, .locked { text-align: center; }
.confirm h1, .locked h1 { margin: 6px 0 4px; font-size: 1.8rem; }
.confirm-icon { font-size: 3rem; }
.confirm .summary { text-align: left; max-width: 440px; margin: 20px auto 0; }
.locked { margin-top: 40px; padding: 40px; }
.locked .ticks { display: inline-block; text-align: left; margin: 20px auto; }
.locked-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Workbook document ---------- */
.wb-toolbar { position: sticky; top: 64px; z-index: 5; background: rgba(255, 255, 255, 0.95); border-bottom: 1px solid var(--border); backdrop-filter: blur(6px); }
.wb-toolbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-top: 12px; padding-bottom: 12px; }
.wb-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.wb-toggle { display: flex; gap: 8px; align-items: center; font-size: 0.92rem; cursor: pointer; }
.wb-toggle input { width: 17px; height: 17px; accent-color: var(--accent); }

.workbook { padding: 32px 16px 80px; background: #e9eaf1; }
.wb-page {
  background: #fff; max-width: 816px; margin: 0 auto 28px; padding: 64px 72px;
  box-shadow: 0 4px 24px rgba(20, 20, 50, 0.12); border-radius: 4px;
}
.wb-page h2 { font-size: 1.5rem; margin: 0 0 14px; }
.wb-page h2 + ol, .wb-page ol { padding-left: 22px; }
.wb-page ol + h2 { margin-top: 32px; }

.wb-cover { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 1000px; }
.wb-cover-band { color: #fff; padding: 90px 72px 70px; }
.wb-cover-icon { font-size: 4rem; }
.wb-cover-kicker { letter-spacing: 0.3em; text-transform: uppercase; font-weight: 700; font-size: 0.85rem; opacity: 0.9; margin-top: 18px; }
.wb-cover-band h1 { font-size: 2.6rem; line-height: 1.15; margin: 8px 0 12px; letter-spacing: -0.02em; }
.wb-cover-band p { font-size: 1.1rem; opacity: 0.92; margin: 0; }
.wb-cover-fields { padding: 48px 72px; flex: 1; display: grid; gap: 26px; align-content: start; }
.wb-cover-fields span { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.wb-two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.wb-cover-foot { padding: 20px 72px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; }

.write-lines { margin: 4px 0 8px; }
.write-lines > div { height: 2em; border-bottom: 1px solid #b9bccb; }

.wb-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.wb-table th, .wb-table td { border: 1px solid #d5d7e2; padding: 7px 10px; text-align: left; vertical-align: top; }
.wb-table th { background: #f3f4f8; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.wb-table td:first-child { width: 36px; text-align: center; color: var(--muted); }
.wb-box-cell { width: 50px; text-align: center !important; font-size: 1.2rem; }
.wb-date { width: 110px; }

.wb-module-head { border-bottom: 3px solid var(--wb); padding-bottom: 14px; margin-bottom: 26px; }
.wb-module-head p { color: var(--muted); margin: 0; }
.wb-kicker { color: var(--wb); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.8rem; }
.wb-module-head h2 { margin: 4px 0 6px; }

.wb-lesson { padding-bottom: 28px; margin-bottom: 32px; border-bottom: 1px dashed #d5d7e2; }
.wb-lesson:last-child { border-bottom: none; margin-bottom: 0; }
.wb-lesson h3 { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.wb-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--wb); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem;
}
.wb-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: var(--wb); margin: 18px 0 6px; }
.wb-boxes { list-style: none; padding: 0; margin: 0; }
.wb-boxes li { padding-left: 28px; position: relative; margin-bottom: 6px; }
.wb-boxes li::before { content: ""; position: absolute; left: 0; top: 4px; width: 15px; height: 15px; border: 1.5px solid #8b8fa3; border-radius: 3px; }
.wb-exercise { font-size: 0.97rem; }
.wb-exercise h3 { font-size: 1rem; margin: 0 0 6px; display: block; }
.wb-exercise pre, .wb-page .prose pre { background: #f5f6fa; color: #1f2333; border: 1px solid #d5d7e2; }
.wb-quiz { padding-left: 22px; margin: 0; }
.wb-quiz > li { margin-bottom: 12px; }
.wb-quiz p { margin: 0 0 6px; font-weight: 600; }
.wb-quiz ul { list-style: none; padding: 0; margin: 0; }
.wb-quiz ul li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 4px; }
.wb-circle {
  flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #8b8fa3;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.68rem; font-weight: 700; color: #6b7080; margin-top: 2px;
}

@media (max-width: 900px) {
  .pricing-grid, .checkout-grid { grid-template-columns: minmax(0, 1fr); }
  .price-card.highlight { transform: none; }
  .checkout-grid aside { position: static; }
  .wb-toolbar-inner { flex-direction: column; align-items: stretch; }
  .menu-toggle { display: block; }
  .topnav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: #fff; border-bottom: 1px solid var(--border); padding: 12px 20px 18px; gap: 4px; }
  .topnav.open { display: flex; }
  .topnav a { padding: 10px 4px; }
  .topnav a.btn { text-align: center; margin-top: 6px; }
  .container { padding-left: 20px; padding-right: 20px; }
  .topbar { padding: 12px 20px; }
  .explorer-info p.explorer-outcome { font-size: 1.04rem; }
  .explorer-tabs { grid-template-columns: minmax(0, 1fr); }
  .explorer-panel { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 22px 18px; }
  .explorer-count { display: none; }
  .features { margin-top: 48px; }
  .cta-band { padding: 48px 20px; margin-bottom: 64px; }
  .cta-band h2 { font-size: 1.8rem; }
  .signup { flex-direction: column; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats > div:nth-child(3) { border-left: none; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .section { padding-top: 64px; padding-bottom: 64px; }
  .section-head h2 { font-size: 2rem; }
  .hero h1 { font-size: 2.2rem; }
  .steps::before { display: none; }
  .faq-split { grid-template-columns: 1fr; gap: 28px; }
  .steps, .features, .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .steps { gap: 36px; }
  .course-hero { padding: 32px 24px; }
  .course-hero h1 { font-size: 2rem; }
  .learning-row { flex-wrap: wrap; }
}

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .two-col aside { position: static; }
  .lesson-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar-toggle { display: block; margin: 0 0 4px; }
  .sidebar-lessons { display: none; }
  .sidebar.expanded .sidebar-lessons { display: block; }
  .prose table { display: block; overflow-x: auto; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .lesson-main { padding: 28px 22px 60px; }
}

@media print {
  @page { margin: 14mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .topbar, .footer, .no-print { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .certificate { box-shadow: none; margin: 0 auto; }

  /* Single lesson */
  .lesson-layout { display: block; }
  .sidebar, .lesson-nav, #retry-quiz { display: none !important; }
  .lesson-main { padding: 0; max-width: none; }
  .prose pre { background: #f5f6fa; color: #1f2333; border: 1px solid #d5d7e2; white-space: pre-wrap; }
  .box, .prose pre, .prose table, .question { break-inside: avoid; }
  .box.quiz { box-shadow: none; }

  /* Workbook */
  .workbook { padding: 0; background: #fff; }
  .wb-page { box-shadow: none; max-width: none; margin: 0; padding: 0; border-radius: 0; break-after: page; }
  .wb-page:last-child { break-after: auto; }
  .wb-cover { min-height: calc(100vh - 28mm); }
  .wb-cover-band { padding: 60px 48px 50px; }
  .wb-cover-fields { padding: 40px 48px; }
  .wb-cover-foot { padding: 16px 48px; }
  .wb-lesson h3, .wb-label, .wb-exercise h3, .wb-exercise p:has(+ ol), .wb-exercise p:has(+ ul) { break-after: avoid; }
  .wb-quiz > li, .wb-boxes li, .wb-exercise pre, .wb-table tr { break-inside: avoid; }
  .write-lines { break-inside: avoid; }
}

.prose :not(pre) > code { overflow-wrap: anywhere; }
