@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&display=swap');

:root {
  --accent: #2f5fd8;
  --accent-dark: #1c3f9e;
  --ink: #1a1f29;
  --ink-soft: #333c4a;
  --muted: #5b6472;
  --muted-2: #8b93a3;
  --border: #e2e6ec;
  --surface: #f5f6f8;
  --bg: #eef1f5;
  --success-bg: #eef8f0;
  --success-border: #3fa35a;
  --success-text: #1f6b34;
  --danger-bg: #fdeeee;
  --danger-border: #d3554f;
  --danger-text: #a53a35;

  /* Marketing/blog surfaces (home, blog, resources) — a warm paper tone
     and a serif display face, layered on top of the tokens above rather
     than replacing them, so the lesson pages are untouched. */
  --paper: #f7f5ef;
  --card: #ffffff;
  --hub-tint: #eaf0fd;
  --hub-tint-line: #cdddf9;
  --live-tag-bg: #fdeee0;
  --live-tag-text: #a3541b;
  --display-font: "Fraunces", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", system-ui, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

/* ---------- top nav ---------- */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 40px;
  background: #0a0a0c;
  border-bottom: 1px solid #232327;
}
.topnav-left { display: flex; align-items: center; gap: 36px; }
.logo-link { display: flex; align-items: center; flex-shrink: 0; }
.logo { height: 38px; width: auto; display: block; }
.topnav-links { display: flex; align-items: center; gap: 26px; }
.topnav-links span, .topnav-links a { color: #c7c9cf; font-size: 14px; text-decoration: none; }
.topnav-links a:hover { color: #fff; }
.topnav-links .active { color: #fff; font-weight: 700; }
.topnav-right { display: flex; align-items: center; }
.topnav-cta {
  background: var(--accent); color: #fff; border: none; padding: 10px 20px; border-radius: 8px;
  font-size: 13.5px; font-weight: 700; font-family: inherit; cursor: pointer; text-decoration: none; display: inline-block;
}
.topnav-cta:hover { color: #fff; text-decoration: none; background: var(--accent-dark); }
.avatar {
  width: 34px; height: 34px; border-radius: 999px; background: #2b2f3a;
  display: flex; align-items: center; justify-content: center;
  color: #e8eaf0; font-size: 13px; font-weight: 700;
}
.hamburger-btn {
  display: none; width: 34px; height: 34px; border-radius: 8px; border: none;
  background: #1a1a1e; color: #f3f3f3; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ---------- lesson banner ---------- */
.lesson-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 40px;
  background: linear-gradient(180deg, #b7c3d3, #aebccc);
  border-bottom: 1px solid #9aabbe;
}
.lesson-banner .chapter-label { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; color: #3a4b60; margin-bottom: 6px; }
.lesson-banner .lesson-title { font-size: 26px; font-weight: 800; color: #12203a; }
.banner-right { display: flex; align-items: center; gap: 22px; }
.time-est, .progress-ring-wrap { display: flex; align-items: center; gap: 10px; }
.time-est span, .progress-ring-wrap span { font-size: 13px; color: #3a4b60; font-weight: 600; }
.progress-ring {
  width: 34px; height: 34px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
}
.progress-ring-inner {
  width: 24px; height: 24px; border-radius: 999px; background: #c3cddb;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; color: #12203a;
}
.btn-primary {
  background: var(--accent); color: #fff; border: none;
  padding: 12px 22px; border-radius: 8px; font-size: 14px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(47,95,216,0.35);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
/* Completed state of #complete-btn / #complete-btn-2 — still clickable,
   styled to look "done" while making clear a click undoes it. */
.btn-primary.is-done {
  background: #fff; color: var(--accent); border: 1.5px solid var(--accent);
  box-shadow: none;
}
.btn-primary.is-done:hover { background: #eef2fd; }
.btn-secondary {
  background: #fff; color: var(--muted); border: 1.5px solid #cbd2dc;
  padding: 10px 18px; border-radius: 8px; font-size: 13.5px; font-weight: 700;
}

/* ---------- layout ---------- */
.layout { display: flex; align-items: flex-start; position: relative; }

.sidebar-scrim {
  display: none; position: fixed; inset: 0; background: rgba(10,12,18,0.4);
  opacity: 0; pointer-events: none; transition: opacity 0.22s ease; z-index: 59;
}
.sidebar-scrim.open { opacity: 1; pointer-events: auto; }

.sidebar {
  width: 296px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky; top: 0; align-self: flex-start;
  max-height: 100vh; overflow-y: auto;
}
.sidebar-close-btn {
  display: none; margin: 14px 14px 0 auto; width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  align-items: center; justify-content: center;
}
.sidebar-header { padding: 22px 22px 18px 22px; border-bottom: 1px solid #e6e9ee; }
.sidebar-header .label { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--muted); margin-bottom: 10px; }
.progress-track { height: 8px; border-radius: 999px; background: #e2e6ec; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.sidebar-header .count { font-size: 12.5px; color: var(--muted); font-weight: 600; }

.chapters { padding: 10px 12px 24px 12px; }
.chapter { margin-bottom: 6px; }
.chapter-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px; border-radius: 8px; }
.chapter-head.current { background: #eef2fb; }
.chapter-head span { font-size: 13px; font-weight: 800; letter-spacing: 0.3px; color: #12203a; }
.chapter-head.locked span { color: #9aa3b2; }
.lessons { padding-left: 16px; }
.lesson-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; text-decoration: none; color: inherit; }
a.lesson-row:hover { background: #eef1f5; }
a.lesson-row:hover span { text-decoration: none; color: var(--accent); }
.lesson-row span { font-size: 13.5px; color: #3a4250; }
.lesson-row.active span { color: #12203a; font-weight: 700; }
.lesson-row.done span { color: var(--muted); text-decoration: line-through; }
.lesson-row.todo.locked span { color: #aab1bd; }
.status-icon { width: 18px; height: 18px; flex-shrink: 0; }
.status-dot {
  width: 18px; height: 18px; border-radius: 999px; border: 2.5px solid var(--accent);
  position: relative; flex-shrink: 0;
}
.status-dot::after {
  content: ""; position: absolute; inset: 3px; border-radius: 999px; background: var(--accent);
}
.status-empty { width: 18px; height: 18px; border-radius: 999px; border: 2px solid #cbd2dc; flex-shrink: 0; }
.status-done {
  width: 18px; height: 18px; border-radius: 999px; background: var(--success-border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.main { flex-grow: 1; padding: 44px 56px 90px 56px; max-width: 880px; }

/* ---------- content tabs (video / slides) ---------- */
.content-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 9px 9px 0 0; border: none;
  background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 700;
}
.tab-btn:hover { color: var(--ink-soft); background: #e9edf3; }
.tab-btn.active { background: #12141c; color: #fff; }
.tab-panel[hidden] { display: none; }

/* ---------- video ---------- */
.video-shell { border-radius: 0 14px 14px 14px; overflow: hidden; background: #12141c; box-shadow: 0 10px 30px rgba(15,20,35,0.18); margin-bottom: 14px; }
.video-frame-wrap { position: relative; aspect-ratio: 16/9; background: #000; }
.video-frame-wrap iframe { width: 100%; height: 100%; border: none; }
.video-caption { font-size: 12.5px; color: var(--muted-2); margin-bottom: 40px; }

.subtab-divider {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.6px; color: var(--muted-2);
  text-transform: uppercase; margin: 8px 0 12px 0; padding-top: 24px; border-top: 1px solid var(--border);
}

/* ---------- slides ---------- */
.slides-shell {
  border-radius: 0 14px 14px 14px; overflow: hidden; background: #e7eaef;
  box-shadow: 0 10px 30px rgba(15,20,35,0.1); margin-bottom: 14px;
  border: 1px solid var(--border);
}
.slides-shell iframe { width: 100%; height: 720px; border: none; display: block; }

/* ---------- flashcards / quiz embeds ---------- */
.embed-shell {
  border-radius: 14px; overflow: hidden; background: #fff;
  box-shadow: 0 10px 30px rgba(15,20,35,0.1); border: 1px solid var(--border);
}
.embed-shell iframe { width: 100%; height: 78vh; min-height: 560px; border: none; display: block; }

/* ---------- cheat sheet ---------- */
.cheat-useful { font-size: 14px; color: var(--muted); margin: 0 0 10px 0; font-style: italic; }
.cheat-block { margin: 22px 0 8px 0; }
.cheat-block-title {
  font-size: 13px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.cheat-table, .cheat-glossary {
  width: 100%; border-collapse: collapse; border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; margin-bottom: 6px;
}
.cheat-table th, .cheat-table td,
.cheat-glossary th, .cheat-glossary td {
  border-top: 1px solid var(--border); padding: 12px 14px; text-align: left;
  font-size: 14.5px; line-height: 1.6; vertical-align: top;
}
.cheat-table tr:first-child th, .cheat-table tr:first-child td,
.cheat-glossary tr:first-child th, .cheat-glossary tr:first-child td { border-top: none; }
.cheat-table th, .cheat-glossary th {
  width: 30%; background: #f6f8fb; font-weight: 700; color: #12203a;
}
.cheat-table td, .cheat-glossary td { color: var(--ink-soft); }
.cheat-table ul { margin: 0; padding-left: 18px; }
.cheat-table ul li { margin-bottom: 6px; }
.cheat-table ul li:last-child { margin-bottom: 0; }
.cheat-spec-note {
  margin-top: 10px; padding: 12px 16px; border-radius: 10px;
  background: var(--danger-bg, #fdecec); border: 1px solid var(--danger-border, #f3c6c6);
  color: var(--danger-ink, #9a2b2b); font-size: 14px; line-height: 1.6;
}
.cheat-eval-table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 6px; }
.cheat-eval-table th {
  background: #f6f8fb; text-align: left; padding: 10px 14px; font-size: 12px;
  font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; color: #12203a;
  border-bottom: 1px solid var(--border);
}
.cheat-eval-table td {
  width: 50%; padding: 14px; font-size: 14px; line-height: 1.6; color: var(--ink-soft);
  vertical-align: top; border-top: 1px solid var(--border);
}
.cheat-eval-table tr:first-child td { border-top: none; }
.cheat-eval-table td + td { border-left: 1px solid var(--border); }
.eval-tag { font-size: 12px; font-weight: 800; color: var(--accent); margin-bottom: 6px; letter-spacing: 0.3px; }

.cheat-evallist { display: flex; flex-direction: column; gap: 8px; }
.evallist-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border-radius: 10px; border: 1px solid var(--border); font-size: 14px; line-height: 1.6;
}
.evallist-item.strength { background: var(--success-bg); border-color: var(--success-border); }
.evallist-item.weakness { background: var(--danger-bg); border-color: var(--danger-border); }
.evallist-icon {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; font-size: 12px;
  display: flex; align-items: center; justify-content: center; font-weight: 800; margin-top: 1px;
}
.evallist-item.strength .evallist-icon { background: var(--success-border); color: #fff; }
.evallist-item.weakness .evallist-icon { background: var(--danger-border); color: #fff; }
.evallist-body { color: var(--ink-soft); }
.evallist-item.strength .evallist-body strong { color: var(--success-text); }
.evallist-item.weakness .evallist-body strong { color: var(--danger-text); }
.cheat-peel-intro { font-size: 14px; color: var(--muted); margin: 0 0 12px 0; }
.peel-row { display: flex; gap: 14px; padding: 10px 0; border-top: 1px solid var(--border); }
.peel-row:first-of-type { border-top: none; }
.peel-tag {
  flex: 0 0 78px; font-size: 12px; font-weight: 800; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--accent); padding-top: 2px;
}
.peel-row p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); }
.cheat-footer { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }

/* ---------- sections ---------- */
.section { margin-bottom: 8px; }
.section-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--accent); margin-bottom: 8px; }
.section h2 { font-size: 23px; font-weight: 800; color: #12203a; margin: 0 0 14px 0; }
.section p { font-size: 15.5px; line-height: 1.7; color: var(--ink-soft); margin: 0 0 14px 0; }
.section p:last-child { margin-bottom: 0; }

/* ---------- check-understanding ---------- */
.check {
  margin: 26px 0 40px 0; padding: 20px 22px; border-radius: 12px;
  background: #f6f8fb; border: 1px solid #e3e8f0;
}
.check-label { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12px; font-weight: 800; letter-spacing: 0.6px; color: var(--accent); }
.check-question { font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 14px; line-height: 1.5; }
.options { display: flex; flex-direction: column; gap: 9px; }
.option {
  padding: 11px 14px; border-radius: 8px; border: 1.5px solid #d7dce3;
  background: #fff; color: var(--ink); font-weight: 500; font-size: 14px; cursor: pointer;
}
.option.selected { border-color: var(--accent); background: #eef2fb; font-weight: 600; }
.option.correct { border-color: var(--success-border); background: var(--success-bg); color: var(--success-text); font-weight: 700; }
.option.incorrect { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger-text); font-weight: 700; }
.option.disabled { cursor: default; }
.check-explain { margin-top: 12px; font-size: 13.5px; line-height: 1.5; color: #3a4b60; }

/* ---------- worksheet activities ---------- */
.activity {
  margin-top: 24px; padding: 26px 28px; border-radius: 14px; background: #fff;
  border: 1.5px solid var(--border); box-shadow: 0 6px 20px rgba(20,25,40,0.06);
}
.activity-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; flex-wrap: wrap; gap: 6px; }
.activity-head h3 { font-size: 17px; font-weight: 800; color: #12203a; margin: 0; }
.activity-head .meta { font-size: 12px; font-weight: 700; color: var(--muted-2); }
.activity > p { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0 0 18px 0; }
.activity-actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.score { font-size: 14px; font-weight: 800; color: #12203a; }
.example-row {
  font-size: 13.5px; color: var(--ink-soft); background: #f6f8fb; border: 1px solid #e3e8f0;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 18px;
}

/* term-matching (Activity 1) */
.match-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.match-row .term { width: 160px; flex-shrink: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.match-select {
  flex-grow: 1; min-width: 0; max-width: 100%; padding: 10px 12px; border-radius: 8px; border: 1.5px solid #d7dce3;
  font-size: 13.5px; font-family: inherit; background: #fff; color: var(--ink);
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
}
.match-select.correct { border-color: var(--success-border); background: var(--success-bg); color: var(--success-text); }
.match-select.incorrect { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger-text); }
.match-correction { font-size: 12.5px; color: var(--success-text); margin-top: -6px; margin-bottom: 12px; margin-left: 174px; }

/* gap-fill (Activity 2) */
.gap-passage { font-size: 15px; line-height: 2.4; color: var(--ink-soft); }
.gap-select {
  display: inline-block; margin: 0 2px; padding: 4px 8px; border-radius: 6px;
  border: 1.5px solid #d7dce3; font-size: 13.5px; font-family: inherit; font-weight: 700;
  background: #f6f8fb; color: var(--ink); min-width: 110px;
}
.gap-select.correct { border-color: var(--success-border); background: var(--success-bg); color: var(--success-text); }
.gap-select.incorrect { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger-text); }

/* write-then-reveal pattern (Activities 3, 4, 5) */
.reveal-item { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #eef1f5; }
.reveal-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.reveal-prompt { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.reveal-textarea {
  width: 100%; min-height: 64px; padding: 10px 12px; border-radius: 8px; border: 1.5px solid #d7dce3;
  font-size: 13.5px; font-family: inherit; color: var(--ink); resize: vertical;
}
.reveal-textarea:focus { outline: none; border-color: var(--accent); }
.reveal-btn {
  margin-top: 8px; background: #fff; color: var(--accent); border: 1.5px solid var(--accent);
  padding: 7px 14px; border-radius: 7px; font-size: 12.5px; font-weight: 700;
}
.reveal-model {
  margin-top: 10px; padding: 12px 14px; border-radius: 8px; background: #eef2fb;
  border: 1px solid #c7d3f0; font-size: 13.5px; line-height: 1.6; color: #1c3f9e;
}
.reveal-model .label { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.4px; color: var(--accent); margin-bottom: 4px; }

/* classification pills (Activity 4) */
.classify-row { margin-bottom: 10px; }
.classify-stem { font-size: 14px; color: var(--ink); margin-bottom: 8px; line-height: 1.5; }
.classify-options { display: flex; gap: 8px; margin-bottom: 10px; }
.classify-pill {
  padding: 8px 16px; border-radius: 999px; border: 1.5px solid #d7dce3; background: #fff;
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
}
.classify-pill.selected { border-color: var(--accent); background: #eef2fb; color: #1a1f29; }
.classify-pill.correct { border-color: var(--success-border); background: var(--success-bg); color: var(--success-text); }
.classify-pill.incorrect { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger-text); }

/* blank inputs (Activity 5) */
.blank-row { margin-bottom: 8px; }
.blank-label { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.blank-input {
  padding: 9px 12px; border-radius: 8px; border: 1.5px solid #d7dce3; font-size: 13.5px;
  font-family: inherit; width: 160px;
}
.blank-input.correct { border-color: var(--success-border); background: var(--success-bg); color: var(--success-text); font-weight: 700; }
.blank-input.incorrect { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger-text); font-weight: 700; }
.blank-answer-note { font-size: 12.5px; color: var(--success-text); margin-top: 4px; }

/* ---------- more practice ---------- */
.more-practice { margin-top: 34px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.more-practice .label { font-size: 12.5px; font-weight: 700; color: var(--muted-2); letter-spacing: 0.4px; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { display: flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--border); background: #fff; font-size: 13px; font-weight: 600; color: #3a4b60; }

/* ---------- bottom cta ---------- */
.bottom-cta { margin-top: 46px; display: flex; align-items: center; justify-content: space-between; padding-top: 26px; border-top: 1px solid #e6e9ee; }
.bottom-cta .next-up { font-size: 13.5px; color: var(--muted-2); }

/* ---------- auth pages ---------- */
.auth-wrap { min-height: calc(100vh - 76px); display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 32px; box-shadow: 0 10px 30px rgba(20,25,40,0.06); }
.auth-card h1 { font-size: 20px; font-weight: 800; color: #12203a; margin: 0 0 6px 0; }
.auth-card .sub { font-size: 13.5px; color: var(--muted); margin: 0 0 24px 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 12px; border-radius: 8px; border: 1.5px solid var(--border);
  font-size: 14px; font-family: inherit;
}
.field input:focus { outline: none; border-color: var(--accent); }
.auth-error { font-size: 13px; color: var(--danger-text); background: var(--danger-bg); border: 1px solid var(--danger-border); border-radius: 8px; padding: 10px 12px; margin-bottom: 16px; display: none; }
.auth-error.show { display: block; }
.auth-submit { width: 100%; padding: 12px; margin-top: 6px; }
.auth-switch { margin-top: 18px; font-size: 13.5px; color: var(--muted); text-align: center; }

.loading-note { padding: 60px 40px; text-align: center; color: var(--muted); font-size: 14px; }

/* =========================================================
   Responsive — tablet and phone
   ========================================================= */

/* ---------- tablet and below (<=900px): sidebar becomes a drawer ---------- */
@media (max-width: 900px) {
  .topnav { padding: 0 16px; height: 60px; }
  .topnav-left { gap: 14px; }
  .topnav-links { display: none; }
  .hamburger-btn { display: flex; }
  .logo { height: 28px; }

  .sidebar-scrim { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; height: 100dvh; z-index: 60;
    transform: translateX(-100%); transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    box-shadow: 2px 0 24px rgba(0,0,0,0.18); width: 82%; max-width: 300px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close-btn { display: flex; }

  .main { padding: 24px 20px 60px 20px; max-width: 100%; }

  .content-tabs {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; margin: 0 -20px 14px -20px; padding: 0 20px;
  }
  .content-tabs::-webkit-scrollbar { display: none; }
  .tab-btn { flex-shrink: 0; padding: 9px 13px; font-size: 12.5px; }

  .activity-actions { flex-wrap: wrap; }
  .activity-actions .btn-primary, .activity-actions .btn-secondary { flex: 1 1 auto; }
}

/* ---------- phone (<=600px) ---------- */
@media (max-width: 600px) {
  .lesson-banner {
    flex-direction: column; align-items: flex-start; gap: 14px; padding: 18px 20px;
  }
  .lesson-banner .lesson-title { font-size: 20px; }
  .banner-right { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
  .time-est span { display: none; }
  .progress-ring-wrap span { display: none; }
  #complete-btn { padding: 10px 16px; font-size: 13px; }

  .main { padding: 18px 14px 50px 14px; }

  .video-shell, .slides-shell, .embed-shell { border-radius: 12px; }
  .slides-shell iframe { height: 60vh; height: 60dvh; min-height: 340px; }
  .embed-shell iframe { height: 72vh; height: 72dvh; min-height: 420px; }

  /* cheat sheet: tables become stacked cards */
  .cheat-table, .cheat-glossary { border: none; border-radius: 0; }
  .cheat-table tbody, .cheat-glossary tbody { display: block; }
  .cheat-table tr, .cheat-glossary tr {
    display: block; border: 1px solid var(--border); border-radius: 10px;
    margin-bottom: 10px; overflow: hidden;
  }
  .cheat-table th, .cheat-table td,
  .cheat-glossary th, .cheat-glossary td {
    display: block; width: auto !important; border-top: none;
  }
  .cheat-table th, .cheat-glossary th {
    border-bottom: 1px solid var(--border); font-size: 12px;
  }
  .cheat-eval-table, .cheat-eval-table tbody, .cheat-eval-table tr, .cheat-eval-table td {
    display: block; width: auto;
  }
  .cheat-eval-table thead { display: none; }
  .cheat-eval-table tr {
    border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden;
  }
  .cheat-eval-table td { border-top: 1px solid var(--border); }
  .cheat-eval-table tr td:first-child { border-top: none; }
  .cheat-eval-table td + td { border-left: none; }

  .peel-row { flex-direction: column; gap: 4px; }
  .peel-tag { flex: 0 0 auto; }

  /* worksheet: rows stack, controls get bigger tap targets */
  .match-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .match-row .term { width: auto; }
  .match-select { width: 100%; padding: 11px 12px; }

  .gap-passage { line-height: 2.6; }

  .classify-options { gap: 8px; }
  .classify-pill { padding: 10px 16px; }

  .blank-input { width: 100%; padding: 11px 12px; }

  .activity-actions { flex-direction: column; align-items: stretch; }
  .activity-actions .score { text-align: center; }

  .bottom-cta { flex-direction: column; align-items: flex-start; gap: 14px; }
  .bottom-cta button { width: 100%; }
}

/* ============================================================ */
/* Marketing / blog / resources pages (home, blog, resources)   */
/* ============================================================ */

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); margin: 0 0 10px 0; }

/* ---- home hero ---- */
.hero {
  background: linear-gradient(165deg, #0a0a0c 0%, #101827 55%, #142042 100%);
  padding: 88px 40px 96px; color: #fff;
}
.hero-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.hero .eyebrow { color: #9fb4f0; }
.hero h1 {
  font-family: var(--display-font); font-weight: 600; font-size: 52px; line-height: 1.12;
  margin: 0 0 20px 0; letter-spacing: -0.01em;
}
.hero h1 em { font-style: italic; color: #9fb4f0; }
.hero p.sub { font-size: 18px; line-height: 1.6; color: #c7cee2; max-width: 560px; margin: 0 auto 34px; }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-primary-lg {
  background: var(--accent); color: #fff; border: none; padding: 15px 30px; border-radius: 9px;
  font-size: 15.5px; font-weight: 700; font-family: inherit; cursor: pointer;
  box-shadow: 0 8px 22px rgba(47,95,216,0.4); text-decoration: none; display: inline-block;
}
.btn-primary-lg:hover { color: #fff; text-decoration: none; }
.btn-ghost-lg {
  background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.35); padding: 15px 26px;
  border-radius: 9px; font-size: 15.5px; font-weight: 700; font-family: inherit; cursor: pointer;
  text-decoration: none; display: inline-block;
}
.btn-ghost-lg:hover { color: #fff; text-decoration: none; border-color: rgba(255,255,255,0.6); }
.hero-stats { display: flex; gap: 40px; justify-content: center; margin-top: 56px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat .num { font-family: var(--display-font); font-size: 30px; font-weight: 600; color: #fff; }
.hero-stat .lbl { font-size: 12.5px; color: #93a0bd; letter-spacing: 0.03em; margin-top: 2px; }

.section-wrap { max-width: 1080px; margin: 0 auto; padding: 76px 40px; }
.section-head { text-align: center; max-width: 560px; margin: 0 auto 44px; }
.section-head h2 { font-family: var(--display-font); font-size: 32px; font-weight: 600; margin: 0 0 12px 0; color: var(--ink); }
.section-head p { font-size: 15.5px; color: var(--muted); margin: 0; line-height: 1.6; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 26px 22px; }
.feature-icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--hub-tint); color: var(--accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.feature-card h3 { font-size: 15.5px; font-weight: 800; color: var(--ink); margin: 0 0 8px 0; }
.feature-card p { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin: 0; }

.chapter-strip { background: var(--paper); }
.chapter-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 30px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.chapter-card .chapter-num { font-family: var(--display-font); font-size: 15px; color: var(--accent); font-weight: 600; }
.chapter-card h3 { font-family: var(--display-font); font-size: 24px; font-weight: 600; margin: 6px 0 10px; color: var(--ink); }
.lesson-pills { display: flex; flex-wrap: wrap; gap: 8px; max-width: 480px; }
.lesson-pill {
  font-size: 12.5px; padding: 6px 12px; border-radius: 999px; background: var(--hub-tint);
  color: var(--accent-dark); border: 1px solid var(--hub-tint-line); font-weight: 600;
}
.chapter-cta { text-align: right; flex-shrink: 0; }
.chapter-cta .count { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.chapter-card + .chapter-card { margin-top: 16px; }
.chapter-card-next { opacity: 0.6; }
.chapter-card-next h3 { font-size: 18px; }

.hub-section { background: var(--hub-tint); border-top: 1px solid var(--hub-tint-line); border-bottom: 1px solid var(--hub-tint-line); }
.hub-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 32px;
  display: flex; align-items: center; gap: 28px; justify-content: space-between; flex-wrap: wrap;
}
.hub-left { display: flex; align-items: center; gap: 20px; }
.hub-ring { position: relative; width: 66px; height: 66px; flex-shrink: 0; }
.hub-ring svg { transform: rotate(-90deg); }
.hub-ring .pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: var(--ink); }
.hub-copy .eyebrow2 { font-size: 11.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 0 0 4px 0; }
.hub-copy h3 { font-size: 19px; font-weight: 800; margin: 0 0 4px 0; color: var(--ink); }
.hub-copy p { font-size: 13.5px; color: var(--muted); margin: 0; }
.hub-cta { flex-shrink: 0; }
.hub-cta .btn-primary-lg { padding: 13px 26px; font-size: 14.5px; box-shadow: none; }

.footer { padding: 44px 40px; text-align: center; font-size: 13px; color: var(--muted-2); }
.footer a { color: var(--muted-2); }
.footer a:hover { color: var(--muted); }

.blog-strip { background: var(--paper); border-top: 1px solid var(--border); }
.blog-teaser-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 32px; gap: 20px; flex-wrap: wrap; }
.blog-teaser-head h2 { font-family: var(--display-font); font-size: 30px; font-weight: 600; margin: 0; color: var(--ink); }
.blog-teaser-head .view-all { font-size: 13.5px; font-weight: 700; color: var(--accent); text-decoration: none; white-space: nowrap; }
.blog-teaser-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.blog-teaser-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 24px 24px 26px; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.blog-teaser-card .post-meta { margin-bottom: 12px; }
.blog-teaser-card h3 { font-family: var(--display-font); font-size: 19px; font-weight: 600; line-height: 1.32; margin: 0 0 10px; color: var(--ink); }
.blog-teaser-card p { font-size: 13.5px; line-height: 1.6; color: var(--muted); margin: 0; }
.blog-empty-note { text-align: center; color: var(--muted); font-size: 14px; }

/* ---- "Beyond the lessons" services teaser (home) ---- */
.extra-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.extra-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 24px 22px;
  text-decoration: none; color: inherit; display: flex; flex-direction: column; position: relative;
}
.extra-tag {
  align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; margin-bottom: 14px;
}
.extra-tag.paid { background: var(--hub-tint); color: var(--accent-dark); }
.extra-tag.live { background: var(--live-tag-bg); color: var(--live-tag-text); }
.extra-card h3 { font-size: 15.5px; font-weight: 800; color: var(--ink); margin: 0 0 8px 0; }
.extra-card p { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin: 0 0 14px; flex: 1; }
.extra-card .go { font-size: 13px; font-weight: 700; color: var(--accent); }

/* ---- Resources hub page ---- */
.hub-hero { background: var(--paper); padding: 56px 40px 44px; border-bottom: 1px solid var(--border); text-align: center; }
.hub-hero h1 { font-family: var(--display-font); font-size: 38px; font-weight: 600; margin: 0 0 12px; color: var(--ink); }
.hub-hero p { font-size: 15.5px; color: var(--muted); margin: 0 auto; max-width: 560px; }
.hub-group { max-width: 1080px; margin: 0 auto; padding: 56px 40px; }
.hub-group-head { margin-bottom: 26px; }
.hub-group-head .eyebrow { margin-bottom: 6px; }
.hub-group-head h2 { font-family: var(--display-font); font-size: 26px; font-weight: 600; margin: 0 0 8px; color: var(--ink); }
.hub-group-head p { font-size: 14.5px; color: var(--muted); margin: 0; max-width: 640px; line-height: 1.6; }
.hub-group.alt { background: var(--paper); }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 26px; display: flex; flex-direction: column; }
.service-card h3 { font-size: 16.5px; font-weight: 800; color: var(--ink); margin: 0 0 8px; }
.service-card p { font-size: 13.5px; color: var(--muted); line-height: 1.65; margin: 0 0 18px; flex: 1; }
.service-card .service-cta {
  align-self: flex-start; background: var(--accent); color: #fff; border: none; padding: 10px 18px;
  border-radius: 8px; font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer;
  text-decoration: none; display: inline-block;
}
.service-card .service-cta:hover { color: #fff; text-decoration: none; background: var(--accent-dark); }
.service-card .service-cta.secondary { background: transparent; color: var(--accent); border: 1.5px solid var(--hub-tint-line); }
.service-card .service-cta.secondary:hover { background: var(--hub-tint); color: var(--accent); }
.service-card .price-note { font-size: 12px; color: var(--muted-2); margin-top: 8px; }

/* ---- blog index ---- */
.blog-hero { background: var(--paper); padding: 56px 40px 40px; border-bottom: 1px solid var(--border); }
.blog-hero-inner { max-width: 720px; margin: 0 auto; text-align: center; }
.blog-hero h1 { font-family: var(--display-font); font-size: 40px; font-weight: 600; margin: 0 0 12px; color: var(--ink); }
.blog-hero p { font-size: 15.5px; color: var(--muted); margin: 0; }

.post-list { max-width: 720px; margin: 0 auto; padding: 48px 40px 90px; display: flex; flex-direction: column; gap: 0; }
.post-card { padding: 34px 0; border-bottom: 1px solid var(--border); display: block; text-decoration: none; color: inherit; }
.post-card:first-child { padding-top: 0; }
.post-meta { font-size: 12.5px; color: var(--muted-2); display: flex; gap: 10px; align-items: center; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }
.post-card h2 { font-family: var(--display-font); font-size: 25px; font-weight: 600; margin: 0 0 10px; color: var(--ink); line-height: 1.3; }
.post-card p.excerpt { font-size: 15px; line-height: 1.65; color: var(--ink-soft); margin: 0 0 12px; max-width: 62ch; }
.post-card .read-more { font-size: 13.5px; font-weight: 700; color: var(--accent); }

/* ---- blog post ---- */
.article-hero { background: var(--paper); padding: 54px 40px 44px; border-bottom: 1px solid var(--border); }
.article-hero-inner { max-width: 680px; margin: 0 auto; }
.back-link { font-size: 13px; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 22px; }
.article-hero h1 { font-family: var(--display-font); font-size: 40px; font-weight: 600; line-height: 1.18; margin: 0 0 18px; color: var(--ink); }
.article-meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }

.article-body { max-width: 680px; margin: 0 auto; padding: 50px 40px 100px; }
.article-body h2 { font-family: var(--display-font); font-size: 24px; font-weight: 600; color: var(--ink); margin: 40px 0 14px; }
.article-body h3, .article-body h4 { color: var(--ink); margin: 28px 0 12px; }
.article-body p { font-size: 16.5px; line-height: 1.8; color: var(--ink-soft); margin: 0 0 18px; }
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 22px; }
.article-body li { font-size: 16.5px; line-height: 1.8; color: var(--ink-soft); margin-bottom: 6px; }
.article-body blockquote {
  margin: 28px 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--accent);
  font-family: var(--display-font); font-style: italic; font-size: 19px; color: var(--ink); line-height: 1.55;
}
.article-body hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.article-body code { background: var(--surface); border-radius: 4px; padding: 2px 6px; font-size: 0.9em; }
.article-loading, .article-error { max-width: 680px; margin: 0 auto; padding: 60px 40px; color: var(--muted); font-size: 15px; }

@media (max-width: 860px) {
  .topnav-links { display: none; }
  .hero h1 { font-size: 38px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-teaser-grid { grid-template-columns: 1fr; }
  .extra-grid { grid-template-columns: repeat(2, 1fr); }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .hero, .section-wrap { padding-left: 22px; padding-right: 22px; }
  .hero h1 { font-size: 32px; }
  .feature-grid { grid-template-columns: 1fr; }
  .extra-grid { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: 1fr; }
  .chapter-card { flex-direction: column; align-items: flex-start; }
  .chapter-cta { text-align: left; }
  .hub-card { flex-direction: column; align-items: flex-start; }
  .hub-cta { width: 100%; }
  .hub-cta .btn-primary-lg { width: 100%; text-align: center; }
}

/* ---------- mobile main-nav menu (hamburger-triggered dropdown) ----------
   Reuses .hamburger-btn's existing look/breakpoint (see the <=900px block
   above). One panel per page, toggled by public/nav.js (or home.js on the
   home page, which wires its own nav). Below 900px .topnav-links is
   already hidden, so this is the only way to reach Home/Blog/Course/etc
   on a phone or narrow tablet without this panel. */
.mobile-nav-panel {
  display: none;
  position: fixed; top: 60px; left: 0; right: 0; z-index: 55;
  background: #0a0a0c; border-bottom: 1px solid #232327;
  flex-direction: column; padding: 8px 16px 16px;
  max-height: calc(100vh - 60px); max-height: calc(100dvh - 60px);
  overflow-y: auto;
}
.mobile-nav-panel.open { display: flex; }
.mobile-nav-panel a, .mobile-nav-panel span {
  color: #c7c9cf; font-size: 15px; padding: 13px 4px; border-bottom: 1px solid #1c1c1f; text-decoration: none;
}
.mobile-nav-panel a.active { color: #fff; font-weight: 700; }
.mobile-nav-panel a:last-child, .mobile-nav-panel span:last-child { border-bottom: none; }
@media (min-width: 901px) {
  .mobile-nav-panel { display: none !important; }
}
