/* ============================================================
   French B1 Course — Apple-inspired design system
   Display: Didot (the classic French typeface)
   Body: SF Pro / system sans
   ============================================================ */

:root {
  /* French blue + refined accents */
  --blue: #0b57d0;
  --blue-deep: #0842a0;
  --blue-soft: #e8f0fe;
  --red: #e5484d;
  --red-soft: #fdecec;
  --gold: #c9a227;
  --gold-soft: #faf3dd;
  --green: #2f9e63;
  --green-soft: #e6f6ec;

  --ink: #1d1d1f;
  --ink-2: #424245;
  --ink-3: #6e6e73;
  --line: rgba(0,0,0,0.08);
  --card: #ffffff;
  --bg: #f5f5f7;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, rgba(11,87,208,0.10), transparent 60%),
             radial-gradient(900px 500px at -10% 20%, rgba(229,72,77,0.07), transparent 55%),
             radial-gradient(rgba(11,87,208,0.045) 1px, transparent 1px),
             #f5f5f7;
  --bg-size: auto, auto, 26px 26px, auto;

  --radius-s: 12px;
  --radius-m: 20px;
  --radius-l: 28px;

  --shadow-s: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-m: 0 2px 6px rgba(0,0,0,0.05), 0 12px 32px rgba(0,0,0,0.08);
  --shadow-l: 0 8px 24px rgba(0,0,0,0.08), 0 32px 80px rgba(0,0,0,0.12);

  --font-display: "Didot", "Bodoni MT", "Playfair Display", "Georgia", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, "Cascadia Code", "Roboto Mono", monospace;

  --spring: cubic-bezier(0.22, 1, 0.36, 1);   /* ease-out expo-ish */
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1); /* slight overshoot */
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5f5f7;
    --ink-2: #d2d2d7;
    --ink-3: #a1a1a6;
    --line: rgba(255,255,255,0.10);
    --card: #1c1c1e;
    --bg: #0a0a0c;
    --bg-grad: radial-gradient(1200px 600px at 80% -10%, rgba(11,87,208,0.18), transparent 60%),
               radial-gradient(900px 500px at -10% 20%, rgba(229,72,77,0.10), transparent 55%),
               radial-gradient(rgba(138,180,248,0.05) 1px, transparent 1px),
               #0a0a0c;
    --bg-size: auto, auto, 26px 26px, auto;
    --blue-soft: rgba(11,87,208,0.18);
    --red-soft: rgba(229,72,77,0.16);
    --gold-soft: rgba(201,162,39,0.16);
    --green-soft: rgba(47,158,99,0.16);
    --shadow-s: 0 1px 2px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.3);
    --shadow-m: 0 2px 6px rgba(0,0,0,0.35), 0 12px 32px rgba(0,0,0,0.4);
    --shadow-l: 0 8px 24px rgba(0,0,0,0.4), 0 32px 80px rgba(0,0,0,0.5);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-grad);
  background-size: var(--bg-size);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 17px;
}

::selection { background: rgba(11,87,208,0.22); }

/* ---------- Typography ---------- */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.12;
  color: var(--ink);
}
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.7rem); }
p  { color: var(--ink-2); }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}

.fr { font-style: italic; }
.ipa { font-family: var(--font-mono); font-size: 0.85em; color: var(--ink-3); }

/* ---------- Layout ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
section { padding: 72px 0; }

/* ---------- Top nav (frosted) ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, #0b57d0 0%, #0b57d0 33%, #ffffff 33%, #ffffff 66%, #e5484d 66%);
  box-shadow: var(--shadow-s);
}
.brand-name { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 0.01em; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  text-decoration: none; color: var(--ink-2); font-size: 0.9rem; font-weight: 500;
  padding: 7px 12px; border-radius: 999px; transition: background 0.2s var(--spring), color 0.2s;
}
.nav-links a:hover { background: rgba(120,120,128,0.14); color: var(--ink); }
.nav-progress { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--ink-3); }
.nav-progress .bar { width: 90px; height: 5px; border-radius: 999px; background: rgba(120,120,128,0.2); overflow: hidden; }
.nav-progress .bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--blue), #4d8ef7); border-radius: 999px; transition: width 0.6s var(--spring); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; text-decoration: none;
  transition: transform 0.18s var(--spring-bounce), box-shadow 0.18s var(--spring), background 0.18s;
  will-change: transform;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 4px 14px rgba(11,87,208,0.35); }
.btn-primary:hover { background: var(--blue-deep); box-shadow: 0 6px 20px rgba(11,87,208,0.45); transform: translateY(-1px); }
.btn-ghost { background: rgba(120,120,128,0.12); color: var(--ink); }
.btn-ghost:hover { background: rgba(120,120,128,0.2); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 96px 0 64px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.hero h1 .accent { color: var(--blue); }
.hero .lede { font-size: 1.2rem; color: var(--ink-2); margin: 20px 0 28px; max-width: 52ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 40px; }
.hero-stats .stat b { display: block; font-family: var(--font-display); font-size: 2rem; color: var(--ink); font-weight: 400; }
.hero-stats .stat span { font-size: 0.85rem; color: var(--ink-3); }

/* floating decorative letters */
.hero-art { position: relative; min-height: 380px; }
.float-letter {
  position: absolute; font-family: var(--font-display); font-weight: 400;
  color: var(--blue); opacity: 0.12; user-select: none; pointer-events: none;
  animation: drift 9s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translateY(-10px) rotate(-3deg); }
  to   { transform: translateY(14px) rotate(3deg); }
}

/* ---------- Cards ---------- */
.card {
  background: var(--card); border-radius: var(--radius-m);
  box-shadow: var(--shadow-s); border: 1px solid var(--line);
  transition: transform 0.35s var(--spring), box-shadow 0.35s var(--spring);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-m); }

/* ---------- Module cards ---------- */
.modules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 36px; }
.module-card { padding: 28px; position: relative; overflow: hidden; cursor: pointer; }
.module-card .num {
  font-family: var(--font-display); font-size: 3.4rem; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px var(--blue); opacity: 0.5;
}
.module-card h3 { margin: 12px 0 6px; }
.module-card p { font-size: 0.92rem; }
.module-card .tag { display: inline-block; margin-top: 14px; font-size: 0.78rem; font-weight: 600; color: var(--blue); background: var(--blue-soft); padding: 4px 12px; border-radius: 999px; }
.module-card::after {
  content: "→"; position: absolute; right: 24px; bottom: 20px; font-size: 1.3rem; color: var(--blue);
  opacity: 0; transform: translateX(-8px); transition: all 0.3s var(--spring);
}
.module-card:hover::after { opacity: 1; transform: translateX(0); }

/* accent stripe per module */
.module-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.module-card.m1::before { background: linear-gradient(90deg, #0b57d0, #4d8ef7); }
.module-card.m2::before { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.module-card.m3::before { background: linear-gradient(90deg, #c9a227, #e3c866); }
.module-card.m4::before { background: linear-gradient(90deg, #e5484d, #f08a8d); }

/* ---------- Lesson list ---------- */
.lesson-list { display: grid; gap: 12px; margin-top: 32px; }
.lesson-row {
  display: flex; align-items: center; gap: 16px; padding: 18px 22px;
  background: var(--card); border-radius: var(--radius-s); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
  transition: transform 0.3s var(--spring), box-shadow 0.3s var(--spring);
}
.lesson-row:hover { transform: translateX(6px); box-shadow: var(--shadow-s); }
.lesson-num {
  width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.15rem; color: #fff; background: linear-gradient(135deg, var(--blue), #4d8ef7);
}
.lesson-row .meta { flex: 1; min-width: 0; }
.lesson-row .meta b { display: block; font-weight: 600; font-size: 1rem; }
.lesson-row .meta span { font-size: 0.85rem; color: var(--ink-3); }
.lesson-row .status { font-size: 0.78rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; flex: none; }
.status.done { background: var(--green-soft); color: var(--green); }
.status.todo { background: rgba(120,120,128,0.12); color: var(--ink-3); }

/* ---------- Lesson page ---------- */
.lesson-hero { padding: 64px 0 32px; }
.lesson-hero .crumbs { font-size: 0.85rem; color: var(--ink-3); margin-bottom: 16px; }
.lesson-hero .crumbs a { color: var(--blue); text-decoration: none; }
.lesson-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.lesson-hero .sub { color: var(--ink-3); font-size: 1.05rem; margin-top: 8px; font-style: italic; font-family: var(--font-display); }

.objectives {
  background: var(--blue-soft); border: 1px solid color-mix(in srgb, var(--blue) 25%, transparent);
  border-radius: var(--radius-m); padding: 28px 32px; margin: 28px 0 8px;
}
.objectives h3 { color: var(--blue-deep); margin-bottom: 14px; font-size: 1.15rem; font-family: var(--font-body); font-weight: 700; }
@media (prefers-color-scheme: dark) { .objectives h3 { color: #8ab4f8; } }
.objectives ul { list-style: none; display: grid; gap: 10px; }
.objectives li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-size: 0.95rem; }
.objectives li::before { content: "✓"; color: var(--green); font-weight: 700; flex: none; }

/* section headers in lesson */
.sec-head { display: flex; align-items: center; gap: 14px; margin: 56px 0 20px; }
.sec-head .icon {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; flex: none;
  background: var(--blue-soft);
}
.sec-head h2 { font-size: 1.7rem; }
.sec-head .fr-sub { display: block; font-family: var(--font-display); font-style: italic; color: var(--ink-3); font-size: 1rem; font-weight: 400; }

/* tables */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-s); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th { text-align: left; padding: 12px 16px; background: color-mix(in srgb, var(--blue) 6%, var(--card)); font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: color-mix(in srgb, var(--blue) 4%, transparent); }
td .fr-word { font-weight: 600; color: var(--ink); }

/* callouts */
.callout { border-radius: var(--radius-s); padding: 18px 22px; margin: 20px 0; display: flex; gap: 14px; align-items: flex-start; }
.callout .ico { font-size: 1.2rem; flex: none; }
.callout.tip { background: var(--blue-soft); }
.callout.warn { background: var(--red-soft); }
.callout.gold { background: var(--gold-soft); }
.callout.green { background: var(--green-soft); }
.callout p { font-size: 0.93rem; color: var(--ink-2); }
.callout b { color: var(--ink); }

/* formula box */
.formula {
  background: linear-gradient(135deg, var(--blue), var(--blue-deep)); color: #fff;
  border-radius: var(--radius-m); padding: 24px 28px; margin: 22px 0; box-shadow: var(--shadow-m);
}
.formula .label { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.8; font-weight: 600; margin-bottom: 8px; }
.formula .expr { font-family: var(--font-display); font-size: 1.35rem; }
.formula .expr em { font-style: normal; color: #ffd666; }

/* SVG concept maps: one visual grammar model per lesson */
.concept-map { margin: 22px 0 30px; color: var(--ink); }
.concept-map figcaption {
  margin-bottom: 10px; color: var(--ink-3); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.concept-map svg { display: block; width: 100%; height: auto; overflow: visible; }
.concept-line {
  fill: none; stroke: var(--line); stroke-width: 8; stroke-linecap: round;
}
.concept-node circle {
  fill: var(--card); stroke: var(--line); stroke-width: 2;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.08));
}
.concept-node-2 circle {
  fill: var(--blue-soft); stroke: color-mix(in srgb, var(--blue) 36%, transparent);
}
.concept-label {
  fill: var(--ink); font-family: var(--font-body); font-size: 15px;
  font-weight: 600; text-anchor: middle;
}
.concept-arrow {
  fill: var(--blue); font-family: var(--font-body); font-size: 28px;
  font-weight: 600; text-anchor: middle;
}
@media (max-width: 620px) {
  .concept-map { overflow-x: auto; padding-bottom: 8px; }
  .concept-map svg { min-width: 620px; }
}

/* dialogue */
.dialogue { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow-s); padding: 28px 32px; margin: 24px 0; }
.dialogue .scene { font-style: italic; color: var(--ink-3); font-size: 0.9rem; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.d-line { display: flex; gap: 14px; margin-bottom: 16px; align-items: flex-start; }
.d-speaker {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 0.85rem; color: #fff;
}
.d-speaker.a { background: linear-gradient(135deg, #0b57d0, #4d8ef7); }
.d-speaker.b { background: linear-gradient(135deg, #e5484d, #f08a8d); }
.d-speaker.c { background: linear-gradient(135deg, #c9a227, #e3c866); }
.d-text { flex: 1; }
.d-text .name { font-weight: 600; font-size: 0.85rem; color: var(--ink-3); margin-bottom: 2px; }
.d-text .fr-line { color: var(--ink); }
.d-text .en-line { color: var(--ink-3); font-size: 0.88rem; font-style: italic; }
.d-text .fr-line mark { background: var(--gold-soft); color: inherit; border-radius: 4px; padding: 0 3px; font-weight: 600; }

/* accordion */
.acc { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--card); margin: 12px 0; overflow: hidden; }
.acc-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; background: none; border: none; cursor: pointer; text-align: left;
  font-family: var(--font-body); font-size: 0.98rem; font-weight: 600; color: var(--ink);
  transition: background 0.2s;
}
.acc-head:hover { background: color-mix(in srgb, var(--blue) 4%, transparent); }
.acc-head .chev { transition: transform 0.35s var(--spring); flex: none; color: var(--ink-3); }
.acc.open .acc-head .chev { transform: rotate(180deg); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height 0.45s var(--spring); }
.acc-body-inner { padding: 0 20px 20px; color: var(--ink-2); font-size: 0.93rem; }

/* quiz */
.quiz { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow-s); padding: 26px 30px; margin: 22px 0; }
.quiz .q-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue); margin-bottom: 8px; }
.quiz .q-text { font-weight: 600; color: var(--ink); margin-bottom: 16px; font-size: 1.02rem; }
.quiz .q-text .fr-word { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 1.1em; }
.q-options { display: grid; gap: 10px; }
.q-opt {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: var(--radius-s);
  border: 1.5px solid var(--line); background: var(--card); cursor: pointer; text-align: left;
  font-family: var(--font-body); font-size: 0.95rem; color: var(--ink-2);
  transition: border-color 0.2s, background 0.2s, transform 0.15s var(--spring);
}
.q-opt:hover { border-color: var(--blue); transform: translateX(3px); }
.q-opt .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; transition: all 0.2s; }
.q-opt .dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); transform: scale(0); transition: transform 0.25s var(--spring-bounce); }
.q-opt.selected { border-color: var(--blue); background: var(--blue-soft); }
.q-opt.selected .dot { border-color: var(--blue); }
.q-opt.selected .dot::after { transform: scale(1); }
.q-opt.correct { border-color: var(--green); background: var(--green-soft); }
.q-opt.correct .dot { border-color: var(--green); }
.q-opt.correct .dot::after { background: var(--green); transform: scale(1); }
.q-opt.wrong { border-color: var(--red); background: var(--red-soft); }
.q-opt.wrong .dot { border-color: var(--red); }
.q-opt.wrong .dot::after { background: var(--red); transform: scale(1); }
.q-opt:disabled { cursor: default; }
.q-feedback { margin-top: 14px; padding: 12px 16px; border-radius: var(--radius-s); font-size: 0.9rem; display: none; }
.q-feedback.show { display: block; animation: fadeUp 0.4s var(--spring); }
.q-feedback.ok { background: var(--green-soft); color: var(--green); }
.q-feedback.no { background: var(--red-soft); color: var(--red); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* summary box */
.summary {
  background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 8%, var(--card)), var(--card));
  border: 1px solid color-mix(in srgb, var(--blue) 25%, transparent);
  border-radius: var(--radius-l); padding: 36px 40px; margin: 56px 0 24px; box-shadow: var(--shadow-m);
}
.summary h2 { font-size: 1.6rem; margin-bottom: 20px; }
.summary .takeaway {
  font-family: var(--font-display); font-size: 1.25rem; font-style: italic; color: var(--ink);
  border-left: 3px solid var(--blue); padding-left: 20px; margin-top: 24px; line-height: 1.5;
}

/* prev/next pager */
.pager { display: flex; justify-content: space-between; gap: 16px; margin: 40px 0 80px; flex-wrap: wrap; }
.pager a {
  flex: 1; min-width: 220px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 18px 22px;
  transition: transform 0.3s var(--spring), box-shadow 0.3s var(--spring);
}
.pager a:hover { transform: translateY(-3px); box-shadow: var(--shadow-s); }
.pager a .dir { font-size: 0.78rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.pager a .ttl { font-weight: 600; margin-top: 4px; }
.pager a.next { text-align: right; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--spring), transform 0.7s var(--spring); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* footer */
footer { border-top: 1px solid var(--line); padding: 40px 0 56px; margin-top: 40px; }
footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
footer p { font-size: 0.85rem; color: var(--ink-3); }

/* responsive */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .nav-links { display: none; }
  section { padding: 48px 0; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Chapter layout (editorial module list) ---------- */
.chapters { margin-top: 40px; display: grid; gap: 16px; }
.chapter {
  position: relative; display: grid; grid-template-columns: 96px 1fr auto; gap: 28px; align-items: center;
  padding: 30px 36px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-m);
  box-shadow: var(--shadow-s); cursor: pointer; overflow: hidden;
  transition: transform 0.4s var(--spring), box-shadow 0.4s var(--spring);
}
.chapter:hover { transform: translateY(-4px); box-shadow: var(--shadow-m); }
.chapter::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.chapter.m1::before { background: linear-gradient(180deg, #0b57d0, #4d8ef7); }
.chapter.m2::before { background: linear-gradient(180deg, #7c3aed, #a78bfa); }
.chapter.m3::before { background: linear-gradient(180deg, #c9a227, #e3c866); }
.chapter.m4::before { background: linear-gradient(180deg, #e5484d, #f08a8d); }
.chapter .ch-num {
  font-family: var(--font-display); font-size: 4.6rem; line-height: 0.9; font-weight: 400;
  color: transparent; -webkit-text-stroke: 1.6px currentColor; opacity: 0.85;
}
.chapter.m1 .ch-num { color: #0b57d0; }
.chapter.m2 .ch-num { color: #7c3aed; }
.chapter.m3 .ch-num { color: #c9a227; }
.chapter.m4 .ch-num { color: #e5484d; }
.chapter .ch-body h3 { font-size: 1.55rem; margin-bottom: 6px; }
.chapter .ch-body p { font-size: 0.95rem; max-width: 56ch; }
.chapter .ch-meta { text-align: right; flex: none; }
.chapter .ch-tag { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 5px 14px; border-radius: 999px; }
.chapter.m1 .ch-tag { background: var(--blue-soft); color: var(--blue); }
.chapter.m2 .ch-tag { background: rgba(124,58,237,0.12); color: #7c3aed; }
.chapter.m3 .ch-tag { background: var(--gold-soft); color: #9a7b16; }
.chapter.m4 .ch-tag { background: var(--red-soft); color: var(--red); }
.chapter .ch-arrow { display: block; margin-top: 10px; font-size: 1.4rem; color: var(--ink-3); transition: transform 0.3s var(--spring), color 0.3s; }
.chapter:hover .ch-arrow { transform: translateX(6px); color: var(--ink); }
@media (max-width: 720px) {
  .chapter { grid-template-columns: 1fr; gap: 12px; padding: 24px; }
  .chapter .ch-num { font-size: 3rem; }
  .chapter .ch-meta { text-align: left; }
}

/* ---------- Feature strip under hero ---------- */
.feature-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius-m); overflow: hidden; margin-top: 48px; box-shadow: var(--shadow-s); }
.feature-strip .feat { background: var(--card); padding: 24px 28px; }
.feature-strip .feat .ico { font-size: 1.6rem; }
.feature-strip .feat b { display: block; margin: 10px 0 4px; font-size: 1rem; color: var(--ink); }
.feature-strip .feat span { font-size: 0.86rem; color: var(--ink-3); }

/* mark-complete done state */
#mark-complete.done-state { background: var(--green-soft); color: var(--green); }

/* section intro large number */
.section-num { font-family: var(--font-display); font-size: 1rem; color: var(--ink-3); }

/* ---------- Grammar Spotlight (hero showcase) ---------- */
.spotlight {
  position: relative; z-index: 2;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-l);
  box-shadow: var(--shadow-l); padding: 34px 36px 28px; max-width: 460px; margin-left: auto;
  overflow: hidden;
}
.spotlight::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, #0b57d0 0%, #0b57d0 33%, #e5484d 33%, #e5484d 66%, #c9a227 66%);
}
.spotlight .sp-label {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 18px;
}
.spotlight .sp-label .live { display: inline-flex; align-items: center; gap: 6px; color: var(--green); }
.spotlight .sp-label .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: 0.4; transform: scale(0.7);} }
.sp-slide { display: none; animation: spIn 0.6s var(--spring); }
.sp-slide.active { display: block; }
@keyframes spIn { from { opacity: 0; transform: translateY(14px);} to { opacity: 1; transform: translateY(0);} }
.sp-fr { font-family: var(--font-display); font-size: 1.75rem; line-height: 1.35; color: var(--ink); margin-bottom: 10px; }
.sp-fr .g1 { color: var(--blue); border-bottom: 2px solid color-mix(in srgb, var(--blue) 40%, transparent); }
.sp-fr .g2 { color: var(--red); border-bottom: 2px solid color-mix(in srgb, var(--red) 40%, transparent); }
.sp-en { font-size: 0.92rem; color: var(--ink-3); font-style: italic; margin-bottom: 16px; }
.sp-note { font-size: 0.85rem; color: var(--ink-2); background: var(--blue-soft); border-radius: var(--radius-s); padding: 10px 14px; margin-bottom: 18px; }
.sp-note b { color: var(--blue); }
.sp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sp-dots { display: flex; gap: 7px; }
.sp-dots button { width: 8px; height: 8px; border-radius: 50%; border: none; background: rgba(120,120,128,0.28); cursor: pointer; padding: 0; transition: all 0.3s var(--spring); }
.sp-dots button.on { background: var(--blue); transform: scale(1.35); }
.sp-link { font-size: 0.85rem; font-weight: 600; color: var(--blue); text-decoration: none; transition: gap 0.2s; display: inline-flex; align-items: center; gap: 4px; }
.sp-link:hover { text-decoration: underline; }
@media (max-width: 860px) { .spotlight { margin: 0 auto; } }
