/* ============================================================
   Mathematics with Ash — Component library styles
   Each block maps to a component from PRD §7 / §10.3.
   ============================================================ */

/* ---------------------------------------------------------------
   Sticky site header (FR-9): book/chapter context, English toggle,
   reading-progress rail.
   --------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.1) blur(8px);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 56px;
  padding-block: var(--sp-2);
}
.site-header__context {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}
.site-header__home {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-head);
  font-weight: var(--fw-semibold);
  color: var(--navy);
  text-decoration: none;
  font-size: var(--fs-350);
  white-space: nowrap;
}
.site-header__home:hover { color: var(--blue); }
.site-header__crumb {
  color: var(--color-text-muted);
  font-size: var(--fs-300);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header__tools { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
/* Back-link to the main marketing site, sitting as the breadcrumb root. */
.site-header__back {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  flex: none;
  color: var(--color-text-muted);
  font-size: var(--fs-300);
  text-decoration: none;
  white-space: nowrap;
}
.site-header__back:hover { color: var(--navy); }
.site-header__back::after {
  content: "";
  width: 1px;
  height: 1.05em;
  margin-left: var(--sp-2);
  background: var(--hairline);
}
/* On small screens collapse to just the arrow so the chapter header stays uncrowded. */
@media (max-width: 30rem) { .site-header__back-label { display: none; } }

/* Reading-progress rail (driven by nav.js) */
.progress-rail { height: 3px; background: transparent; }
.progress-rail__fill {
  height: 100%;
  width: var(--reading-progress, 0%);
  background: var(--coral);
  transition: width 80ms linear;
}

/* English toggle (FR-4) */
.toggle-en { white-space: nowrap; }
.toggle-en .toggle-en__icon { width: 1.1em; height: 1.1em; }
.toggle-en .label-show { display: none; }
.toggle-en .label-hide { display: inline; }
html.fwa-hide-en .toggle-en .label-show { display: inline; }
html.fwa-hide-en .toggle-en .label-hide { display: none; }

/* ---------------------------------------------------------------
   Chapter shell & section rhythm
   --------------------------------------------------------------- */
.chapter { padding-top: var(--sp-5); padding-bottom: var(--sp-6); }

.chapter-head { padding-block: var(--sp-5) var(--sp-4); border-bottom: var(--rule-w) solid var(--coral); margin-bottom: var(--sp-6); }
.chapter-head__eyebrow { font-size: var(--fs-300); letter-spacing: 0.08em; text-transform: uppercase; color: var(--coral); font-weight: var(--fw-bold); margin-bottom: var(--sp-2); }
.chapter-head__title { font-size: var(--fs-900); color: var(--navy); }
.chapter-head__sub { font-size: var(--fs-600); font-weight: var(--fw-normal); color: var(--color-text-muted); margin-top: var(--sp-2); font-style: italic; }

.section { margin-block: var(--sp-7); scroll-margin-top: 5rem; }
.section__title {
  font-size: var(--fs-700);
  color: var(--navy);
  display: inline-block;
}
.section__title::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  background: var(--coral);
  margin-top: var(--sp-2);
  border-radius: 2px;
}
.section > p, .section > ul, .section > ol { margin-block: var(--sp-4); }
.section > p { max-width: 38rem; }
.subhead { font-family: var(--font-head); font-weight: var(--fw-semibold); font-size: var(--fs-600); color: var(--navy); margin-top: var(--sp-5); margin-bottom: var(--sp-2); }

/* "What you'll be able to do" — can-do list */
.cando { list-style: none; padding-left: 0; }
.cando li {
  position: relative;
  padding-left: 1.9rem;
  margin-top: var(--sp-3);
}
.cando li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.35em;
  width: 1.1rem; height: 1.1rem;
  background: var(--coral);
  -webkit-mask: var(--ico-check) center / 0.8rem no-repeat;
  mask: var(--ico-check) center / 0.8rem no-repeat;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--coral);
}

/* ---------------------------------------------------------------
   Audio button (FR-1)
   --------------------------------------------------------------- */
.audio {
  --sz: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--sz); height: var(--sz);
  flex: none;
  vertical-align: middle;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--color-surface);
  color: var(--navy);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.audio::before {
  content: "";
  width: 56%; height: 56%;
  background: currentColor;
  -webkit-mask: var(--ico-speaker) center / contain no-repeat;
  mask: var(--ico-speaker) center / contain no-repeat;
}
.audio:hover { border-color: var(--coral); color: var(--coral); }
.audio.is-playing { color: var(--coral); border-color: var(--coral); animation: audio-pulse 1s var(--ease) infinite; }
.audio.is-error { color: var(--color-err); border-color: var(--color-err); }
@keyframes audio-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
/* leave inline a fixed slot so rendering controls causes no layout shift */
.has-audio { display: inline-flex; align-items: center; gap: 0.45em; }

/* ---------------------------------------------------------------
   Dialogue block (FR-8)
   --------------------------------------------------------------- */
.dialogue {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-1);
  margin-block: var(--sp-4);
}
.dialogue__line {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  font-family: var(--font-fr);
  font-size: var(--fs-500);
  color: var(--navy);
  padding-block: var(--sp-2);
}
.dialogue__line + .dialogue__line { border-top: 1px solid var(--color-border); }
.dialogue__line .audio { margin-top: 0.1em; }
.dialogue__text { flex: 1; }
.dialogue__translation {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px dashed var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--fs-350);
}
.dialogue__translation .dialogue__tline { padding-block: 0.15rem; }
.dialogue__transhint { font-style: italic; font-size: var(--fs-300); color: var(--color-text-muted); margin-bottom: var(--sp-2); }

/* ---------------------------------------------------------------
   Example block (FR-8) — cream box, navy left border
   --------------------------------------------------------------- */
.example {
  background: var(--cream);
  border-left: 4px solid var(--navy);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--sp-3) var(--sp-4);
  margin-block: var(--sp-4);
}
.example__line {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  font-family: var(--font-fr);
  font-size: var(--fs-500);
  color: var(--navy);
  padding-block: var(--sp-1);
}
.example__fr { flex: 1; }
.example .en { color: var(--color-text-muted); font-family: var(--font-body); font-size: var(--fs-350); font-style: italic; }

/* ---------------------------------------------------------------
   Inline reference strip (numbers 0–20)
   --------------------------------------------------------------- */
.ref-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--cream);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-block: var(--sp-4);
  list-style: none;
}
.ref-strip li { margin: 0; }
.ref-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  padding: 0.3rem 0.55rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: var(--fs-350);
}
.ref-chip b { font-family: var(--font-fr); color: var(--navy); }
.ref-chip span { color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------
   Flashcard deck (FR-2) — carousel + static-table fallback
   --------------------------------------------------------------- */
.deck {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-1);
  padding: var(--sp-4);
  margin-block: var(--sp-4);
}
.deck__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.deck__title { font-family: var(--font-head); font-weight: var(--fw-semibold); font-size: var(--fs-500); color: var(--navy); }
.deck__count { font-size: var(--fs-300); color: var(--color-text-muted); white-space: nowrap; }

.deck__stage { perspective: 1200px; }
.deck__cards { list-style: none; padding: 0; margin: 0; }
.card {
  position: relative;
  width: 100%;
  min-height: 9.5rem;
}
.card__inner {
  position: relative;
  width: 100%;
  min-height: 9.5rem;
  transition: transform var(--dur) var(--ease);
  transform-style: preserve-3d;
}
.card.is-flipped .card__inner { transform: rotateY(180deg); }
.card__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  text-align: center;
  padding: var(--sp-4);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.card__face--fr { background: var(--cream); }
.card__face--en { background: var(--color-surface); transform: rotateY(180deg); }
.card__fr { font-family: var(--font-fr); font-size: var(--fs-700); color: var(--navy); line-height: var(--lh-snug); }
.card__en { font-size: var(--fs-600); color: var(--navy); }
.card__hint { font-size: var(--fs-300); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.card__flip {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  background: transparent;
  border-radius: var(--radius);
  z-index: 1;
}
.card__face .audio { z-index: 2; position: relative; }
/* When English is globally hidden, the back shows a prompt instead */
html.fwa-hide-en .card__en { display: none; }
html.fwa-hide-en .card__face--en .en-hidden-note { display: block; }

.deck__controls {
  display: grid;
  grid-template-columns: var(--tap) 1fr var(--tap);
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.deck__nav {
  width: var(--tap); height: var(--tap);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  background: var(--color-surface); color: var(--navy);
}
.deck__nav:hover { border-color: var(--navy); }
.deck__nav::before { content: ""; width: 0.7rem; height: 0.7rem; background: currentColor; -webkit-mask: var(--ico-chevron) center/contain no-repeat; mask: var(--ico-chevron) center/contain no-repeat; }
.deck__nav--prev::before { transform: rotate(180deg); }
.deck__center { display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); }
.deck__pos { font-size: var(--fs-300); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.deck__known { font-size: var(--fs-350); }

.deck__meter { margin-top: var(--sp-3); }
.deck__bar { height: 6px; border-radius: 999px; background: var(--hairline); overflow: hidden; }
.deck__bar-fill { height: 100%; width: 0%; background: var(--color-ok); transition: width var(--dur) var(--ease); }
.deck__meta { display: flex; justify-content: space-between; margin-top: var(--sp-2); font-size: var(--fs-300); color: var(--color-text-muted); }

.deck__table { width: 100%; margin-top: var(--sp-3); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.deck__table[hidden] { display: none; }
.deck__table th { background: var(--cream); font-family: var(--font-body); font-size: var(--fs-300); text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); }
.deck__table td:first-child { font-family: var(--font-fr); color: var(--navy); }
.deck__table .en { color: var(--color-text-muted); }
.deck__table-toggle { margin-top: var(--sp-2); }

/* ---------------------------------------------------------------
   Conjugation table (FR-3) + quiz mode
   --------------------------------------------------------------- */
.conj {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-1);
  padding: var(--sp-4);
  margin-block: var(--sp-4);
}
.conj__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.conj__title { font-family: var(--font-head); font-weight: var(--fw-semibold); font-size: var(--fs-600); color: var(--navy); }
.conj__title .fr { font-style: normal; }
.conj__grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-2); }
@media (min-width: 30rem) { .conj__grid { grid-template-columns: 1fr 1fr; } }
.conj__cell {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: var(--sp-2) var(--sp-3);
  background: var(--cream);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-fr);
  font-size: var(--fs-500);
  color: var(--navy);
  min-height: var(--tap);
}
.conj__pron { color: var(--color-text-muted); }
.conj__form { font-weight: var(--fw-semibold); }
.conj__cell .audio { margin-left: auto; }

/* quiz mode */
.conj__quiz-input {
  font-family: var(--font-fr);
  font-size: var(--fs-500);
  color: var(--navy);
  border: 1.5px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.5rem;
  width: 7.5rem;
  background: var(--color-surface);
  min-height: 38px;
}
.conj__quiz-input:focus-visible { border-color: var(--blue); }
.conj__cell.is-correct { background: var(--color-ok-bg); border-color: var(--color-ok); }
.conj__cell.is-wrong { background: var(--color-err-bg); border-color: var(--color-err); }
.conj__mark { display: none; width: 1.1rem; height: 1.1rem; flex: none; }
.conj__cell.is-correct .conj__mark, .conj__cell.is-wrong .conj__mark { display: block; }
.conj__mark::before { content: ""; display: block; width: 100%; height: 100%; background: currentColor; }
.conj__cell.is-correct .conj__mark { color: var(--color-ok); }
.conj__cell.is-correct .conj__mark::before { -webkit-mask: var(--ico-check) center/contain no-repeat; mask: var(--ico-check) center/contain no-repeat; }
.conj__cell.is-wrong .conj__mark { color: var(--color-err); }
.conj__cell.is-wrong .conj__mark::before { -webkit-mask: var(--ico-cross) center/contain no-repeat; mask: var(--ico-cross) center/contain no-repeat; }
.conj__quiz-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); align-items: center; flex-wrap: wrap; }
.conj__quiz-msg { font-size: var(--fs-350); }
.conj__quiz-msg.is-correct { color: var(--color-ok); }
.conj__quiz-msg.is-wrong { color: var(--color-err); }

/* ---------------------------------------------------------------
   Montréal comprehension callout (FR-6) — distinct cream band
   --------------------------------------------------------------- */
.section--montreal {
  background: var(--cream);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--coral);
  border-radius: var(--radius);
  padding: var(--sp-5);
}
.section--montreal .section__title::after { display: none; }
.callout-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-size: var(--fs-300);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--coral);
  border: 1.5px solid var(--coral);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  margin-bottom: var(--sp-3);
}
.callout-badge::before { content: ""; width: 0.9em; height: 0.9em; background: currentColor; -webkit-mask: var(--ico-ear) center/contain no-repeat; mask: var(--ico-ear) center/contain no-repeat; }
.section--montreal ul { padding-left: 1.2em; }
.section--montreal li strong, .section--montreal li b { font-family: var(--font-fr); color: var(--navy); }

/* ---------------------------------------------------------------
   Exercises (FR-5)
   --------------------------------------------------------------- */
.exercise {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: var(--sp-4);
  margin-block: var(--sp-4);
}
.exercise__title { font-family: var(--font-head); font-weight: var(--fw-semibold); font-size: var(--fs-500); color: var(--navy); margin-bottom: var(--sp-1); }
.exercise__instr { color: var(--color-text-muted); font-size: var(--fs-350); margin-bottom: var(--sp-3); }
.exercise__items { list-style: decimal; padding-left: 1.5rem; }
.exercise__item { margin-block: var(--sp-3); font-family: var(--font-fr); font-size: var(--fs-500); color: var(--navy); }
.exercise__item .en { font-family: var(--font-body); font-size: var(--fs-350); color: var(--color-text-muted); }

.gap-input {
  font-family: var(--font-fr);
  font-size: var(--fs-500);
  color: var(--navy);
  border: none;
  border-bottom: 2px solid var(--coral);
  background: var(--cream);
  padding: 0.1rem 0.4rem;
  min-width: 5rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.gap-input:focus-visible { outline: var(--focus-outline); outline-offset: 1px; }
.gap-input.is-correct { background: var(--color-ok-bg); border-bottom-color: var(--color-ok); }
.gap-input.is-wrong { background: var(--color-err-bg); border-bottom-color: var(--color-err); }
.gap-feedback { margin-left: 0.4em; font-family: var(--font-body); font-size: var(--fs-350); }
.gap-feedback.is-correct { color: var(--color-ok); }
.gap-feedback.is-wrong { color: var(--color-err); }

/* matching */
.match { list-style: none; padding-left: 0; }
.match__row { display: flex; align-items: center; gap: var(--sp-3); margin-block: var(--sp-2); }
.match__num { font-variant-numeric: tabular-nums; color: var(--color-text-muted); min-width: 1.4em; }
.match__prompt { flex: 1; font-family: var(--font-fr); color: var(--navy); }
.match__select { min-height: var(--tap); border: 1.5px solid var(--hairline); border-radius: var(--radius-sm); padding: 0.3rem 0.5rem; background: var(--color-surface); font: inherit; color: var(--navy); }
.match__select.is-correct { border-color: var(--color-ok); background: var(--color-ok-bg); }
.match__select.is-wrong { border-color: var(--color-err); background: var(--color-err-bg); }
.match__legend { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px dashed var(--color-border); list-style: none; padding-left: 0; }
.match__legend li { font-size: var(--fs-350); color: var(--color-text-muted); margin-block: var(--sp-1); }
.match__legend b { color: var(--navy); }

/* open production */
.exercise__open .exercise__prompt { background: var(--cream); border-left: 4px solid var(--navy); border-radius: 0 var(--radius) var(--radius) 0; padding: var(--sp-3) var(--sp-4); font-family: var(--font-fr); color: var(--navy); margin-block: var(--sp-3); }
.exercise__write { width: 100%; min-height: 6rem; font: inherit; font-family: var(--font-fr); color: var(--navy); padding: var(--sp-3); border: 1.5px solid var(--hairline); border-radius: var(--radius); background: var(--color-surface); resize: vertical; }
.exercise__write:focus-visible { border-color: var(--blue); }

.exercise__actions { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; margin-top: var(--sp-3); }
.exercise__score { font-size: var(--fs-350); color: var(--color-text-muted); }
.exercise__model { margin-top: var(--sp-3); }

/* native <details> reveal — answers (FR-5) & model answers */
.reveal { border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--cream); margin-block: var(--sp-3); overflow: hidden; }
.reveal > summary {
  cursor: pointer;
  list-style: none;
  display: flex; align-items: center; gap: 0.5em;
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-body); font-weight: var(--fw-semibold);
  color: var(--navy);
  min-height: var(--tap);
}
.reveal > summary::-webkit-details-marker { display: none; }
.reveal > summary::before { content: ""; width: 0.7rem; height: 0.7rem; background: var(--coral); -webkit-mask: var(--ico-chevron) center/contain no-repeat; mask: var(--ico-chevron) center/contain no-repeat; transition: transform var(--dur-fast) var(--ease); }
.reveal[open] > summary::before { transform: rotate(90deg); }
.reveal__body { padding: 0 var(--sp-4) var(--sp-4); }
.reveal__body .answer-line { font-family: var(--font-fr); color: var(--navy); margin-block: var(--sp-2); }
.answers-block { margin-top: var(--sp-5); }

/* ---------------------------------------------------------------
   Check yourself — persisted checklist (FR-7)
   --------------------------------------------------------------- */
.checklist { list-style: none; padding-left: 0; }
.checklist__item { margin-block: var(--sp-2); }
.checklist__label {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
  min-height: var(--tap);
}
.checklist__label:hover { border-color: var(--navy); }
.checklist__cb {
  appearance: none; -webkit-appearance: none;
  width: 1.4rem; height: 1.4rem; flex: none; margin-top: 0.1em;
  border: 2px solid var(--hairline); border-radius: 5px; background: var(--color-surface);
  display: grid; place-content: center;
}
.checklist__cb::before { content: ""; width: 0.9rem; height: 0.9rem; background: var(--color-surface); -webkit-mask: var(--ico-check) center/contain no-repeat; mask: var(--ico-check) center/contain no-repeat; transform: scale(0); transition: transform var(--dur-fast) var(--ease); }
.checklist__cb:checked { background: var(--color-ok); border-color: var(--color-ok); }
.checklist__cb:checked::before { transform: scale(1); }
.checklist__item.is-done .checklist__text { color: var(--color-text-muted); }
.checklist__text .fr, .checklist__text em { font-family: var(--font-fr); font-style: normal; }

.chapter-done {
  margin-top: var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  background: var(--color-ok-bg);
  color: var(--color-ok);
  font-weight: var(--fw-semibold);
  border: 1px solid color-mix(in srgb, var(--color-ok) 30%, transparent);
}
.chapter-done[hidden] { display: none; }

/* ---------------------------------------------------------------
   Next-chapter preview card + prev/next nav (FR-9)
   --------------------------------------------------------------- */
.next-card {
  display: block;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--coral);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: var(--sp-4);
  text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.next-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.next-card__eyebrow { font-size: var(--fs-300); text-transform: uppercase; letter-spacing: 0.06em; color: var(--coral); font-weight: var(--fw-bold); }
.next-card__title { font-family: var(--font-head); font-size: var(--fs-600); color: var(--navy); margin-top: var(--sp-1); }
.next-card__desc { color: var(--color-text-muted); margin-top: var(--sp-2); font-size: var(--fs-350); }

.chapter-nav { display: flex; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--color-border); }
.chapter-nav a { flex: 1; }
.chapter-nav .chapter-nav__next { text-align: right; }
.chapter-nav__spacer { flex: 1; }

/* ---------------------------------------------------------------
   Book index page
   --------------------------------------------------------------- */
.index-hero { padding-block: var(--sp-6) var(--sp-5); border-bottom: var(--rule-w) solid var(--coral); margin-bottom: var(--sp-5); }
.index-hero__eyebrow { font-size: var(--fs-300); text-transform: uppercase; letter-spacing: 0.08em; color: var(--coral); font-weight: var(--fw-bold); }
.index-hero__title { font-size: var(--fs-900); margin-top: var(--sp-2); }
.index-hero__sub { font-size: var(--fs-600); color: var(--color-text-muted); margin-top: var(--sp-2); font-weight: var(--fw-normal); }

.book-progress { margin-block: var(--sp-5); }
.book-progress__bar { height: 10px; border-radius: 999px; background: var(--hairline); overflow: hidden; }
.book-progress__fill { height: 100%; width: 0%; background: var(--coral); transition: width var(--dur) var(--ease); }
.book-progress__label { display: flex; justify-content: space-between; margin-top: var(--sp-2); font-size: var(--fs-350); color: var(--color-text-muted); }

.intro-panel { background: var(--cream); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--sp-5); margin-block: var(--sp-5); }
.intro-panel h2 { font-size: var(--fs-700); margin-bottom: var(--sp-3); }
.intro-panel h2::after { content: ""; display: block; width: 2.5rem; height: 3px; background: var(--coral); margin-top: var(--sp-2); }

.chapter-list { list-style: none; padding-left: 0; display: grid; gap: var(--sp-3); }
.chapter-card {
  display: flex; align-items: center; gap: var(--sp-3);
  border: 1px solid var(--color-border); border-radius: var(--radius);
  background: var(--color-surface); padding: var(--sp-3) var(--sp-4);
  text-decoration: none; box-shadow: var(--shadow-1);
  transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.chapter-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); border-color: var(--navy); }
.chapter-card__num {
  width: 2.4rem; height: 2.4rem; flex: none;
  display: grid; place-content: center;
  background: var(--cream); border: 1px solid var(--color-border); border-radius: 50%;
  font-family: var(--font-head); font-weight: var(--fw-bold); color: var(--navy);
}
.chapter-card.is-complete .chapter-card__num { background: var(--color-ok); color: #fff; border-color: var(--color-ok); }
.chapter-card.is-complete .chapter-card__num span { display: none; }
.chapter-card.is-complete .chapter-card__num::after { content: ""; width: 1.1rem; height: 1.1rem; background: #fff; -webkit-mask: var(--ico-check) center/contain no-repeat; mask: var(--ico-check) center/contain no-repeat; }
.chapter-card__body { flex: 1; min-width: 0; }
.chapter-card__title { font-family: var(--font-head); font-weight: var(--fw-semibold); color: var(--navy); }
.chapter-card__title .fr { font-style: normal; }
.chapter-card__meta { font-size: var(--fs-300); color: var(--color-text-muted); margin-top: 0.1em; }
.chapter-card__status { font-size: var(--fs-300); color: var(--color-text-muted); white-space: nowrap; }
.chapter-card.is-complete .chapter-card__status { color: var(--color-ok); }
.chapter-card.is-upcoming { opacity: 0.62; pointer-events: none; }

.reset-row { margin-top: var(--sp-5); display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }
.reset-note { font-size: var(--fs-300); color: var(--color-text-muted); }

/* Workbook — links to standalone exercise pages on the book index */
.workbook { margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--color-border); }
.workbook__title { font-family: var(--font-head); font-weight: var(--fw-semibold); font-size: var(--fs-600); color: var(--navy); }
.workbook__lede { font-size: var(--fs-300); color: var(--color-text-muted); margin-top: var(--sp-1); }
.workbook__list { list-style: none; padding-left: 0; margin-top: var(--sp-4); display: grid; gap: var(--sp-3); }
.workbook__card {
  display: flex; align-items: center; gap: var(--sp-3);
  border: 1px solid var(--color-border); border-left: 3px solid var(--coral);
  border-radius: var(--radius); background: var(--color-surface);
  padding: var(--sp-3) var(--sp-4); text-decoration: none; box-shadow: var(--shadow-1);
  transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.workbook__card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); border-color: var(--navy); }
.workbook__card-label { flex: 1; min-width: 0; font-family: var(--font-head); font-weight: var(--fw-semibold); color: var(--navy); }
.workbook__card-go { flex: none; font-size: var(--fs-300); font-weight: var(--fw-semibold); color: var(--coral); white-space: nowrap; }

/* ---------------------------------------------------------------
   Landing page
   --------------------------------------------------------------- */
.landing-hero { padding-block: var(--sp-8) var(--sp-6); text-align: center; }
.landing-hero__brand { font-family: var(--font-head); font-style: italic; color: var(--coral); font-size: var(--fs-500); }
.landing-hero__title { font-size: var(--fs-900); margin-top: var(--sp-2); }
.landing-hero__lede { font-size: var(--fs-600); color: var(--color-text-muted); max-width: 32rem; margin: var(--sp-3) auto 0; font-weight: var(--fw-normal); }
.landing-hero__cta { margin-top: var(--sp-5); display: inline-flex; }

.arc { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); flex-wrap: wrap; margin-block: var(--sp-6); color: var(--color-text-muted); font-size: var(--fs-350); }
.arc__node { font-family: var(--font-head); font-weight: var(--fw-bold); color: var(--navy); background: var(--cream); border: 1px solid var(--color-border); border-radius: 999px; padding: 0.3rem 0.8rem; }
.arc__sep { color: var(--coral); }

.books-grid { display: grid; gap: var(--sp-4); margin-block: var(--sp-6); }
@media (min-width: 52rem) { .books-grid { grid-template-columns: repeat(3, 1fr); } }
/* Track chooser (/beginner/): two Book 1 editions side by side */
.tracks-lede { text-align: center; color: var(--color-text-muted); max-width: 34rem; margin: var(--sp-4) auto 0; }
@media (min-width: 52rem) { .books-grid--tracks { grid-template-columns: repeat(2, 1fr); max-width: 52rem; margin-inline: auto; } }
.book-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--color-border); border-top: 4px solid var(--coral);
  border-radius: var(--radius-lg); background: var(--color-surface);
  padding: var(--sp-5); text-decoration: none; box-shadow: var(--shadow-1);
  transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.book-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.book-card__num { font-family: var(--font-head); font-weight: var(--fw-bold); color: var(--coral); font-size: var(--fs-700); }
.book-card__title { font-family: var(--font-head); font-size: var(--fs-600); color: var(--navy); margin-top: var(--sp-1); }
.book-card__level { font-size: var(--fs-300); text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); margin-top: var(--sp-1); }
.book-card__desc { color: var(--color-text-muted); font-size: var(--fs-350); margin-top: var(--sp-3); flex: 1; }
.book-card__status { margin-top: var(--sp-3); font-size: var(--fs-300); font-weight: var(--fw-semibold); color: var(--navy); }
.book-card.is-soon { opacity: 0.7; }
.book-card.is-soon:hover { transform: none; }

/* ---------------------------------------------------------------
   Progressive enhancement: deck interactivity needs JS.
   Without JS the static table is the fallback (PRD FR-2).
   --------------------------------------------------------------- */
.deck__interactive { display: none; }
html.js .deck__interactive { display: block; }
html.js .deck__table { display: none; }
html.js .deck__table.is-shown { display: table; }
.deck__title--muted { color: var(--color-text-muted); font-weight: var(--fw-medium); font-size: var(--fs-350); }

/* Header crumb as a link */
a.site-header__crumb { text-decoration: none; }
a.site-header__crumb::before { content: "·"; margin-right: var(--sp-2); color: var(--hairline); }
a.site-header__crumb:hover { color: var(--navy); text-decoration: underline; }

/* Generic (non-component) tables */
.generic-table { border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; margin-block: var(--sp-4); }
.generic-table th { background: var(--cream); font-family: var(--font-body); font-size: var(--fs-300); text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); }
.generic-table td:first-child { font-family: var(--font-fr); color: var(--navy); }

/* Next-chapter sign-off line ("À la semaine prochaine.") */
.next-signoff { font-family: var(--font-head); font-style: italic; color: var(--color-text-muted); margin-top: var(--sp-4); }

/* ---------------------------------------------------------------
   Pronunciation drill ("How it sounds") — per-word tappable audio,
   minimal pairs paired. These are NOT flashcards (Ch3 build note).
   --------------------------------------------------------------- */
.drill { display: flex; flex-direction: column; gap: var(--sp-3); margin-block: var(--sp-4); }
.drill__row {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--cream);
  border-left: 4px solid var(--navy);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.drill__label { width: 100%; color: var(--color-text-muted); font-size: var(--fs-350); font-style: italic; margin-bottom: var(--sp-1); }
.drill__words { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.drill__word {
  font-family: var(--font-fr);
  font-size: var(--fs-500);
  color: var(--navy);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.7rem;
  min-height: 40px;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.drill__word:hover { border-color: var(--coral); color: var(--coral); }
.drill__word.is-playing { border-color: var(--coral); color: var(--coral); background: color-mix(in srgb, var(--coral) 10%, var(--color-surface)); }
.drill__pair { display: inline-flex; align-items: center; gap: var(--sp-1); padding: 0.2rem; background: var(--paper); border: 1px dashed var(--hairline); border-radius: var(--radius-sm); }
.drill__slash { color: var(--coral); font-weight: var(--fw-bold); }
/* Phrase rows (liaison / contrast lines): audio on the French part + glosses */
.drill__row--phrase { gap: 0.5em; }
.drill__phrase { font-family: var(--font-fr); color: var(--navy); font-size: var(--fs-500); }
.drill__phrase .en { color: var(--color-text-muted); font-family: var(--font-body); font-style: italic; font-size: var(--fs-350); }

/* Example block nested inside a list item (e.g. question examples) */
.example--inline { margin-top: var(--sp-2); margin-bottom: 0; }

/* ============================================================
   Account control (header) + sign-in modal
   ============================================================ */
.site-header__account { display: flex; align-items: center; gap: var(--sp-2); }
.account__who { font-size: var(--fs-300); color: var(--navy); font-weight: var(--fw-semibold); white-space: nowrap; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.account__who:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.account__link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: var(--fs-300); color: var(--color-text-muted); text-decoration: underline; text-underline-offset: 2px; }
.account__link:hover { color: var(--navy); }
.account__signin { white-space: nowrap; }
@media (max-width: 30rem) { .account__who { max-width: 5rem; } }

body.auth-open { overflow: hidden; }
.auth-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: var(--sp-4); }
.auth-modal[hidden] { display: none; }
.auth-modal__backdrop { position: absolute; inset: 0; background: rgba(26, 44, 78, 0.45); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.auth-modal__card { position: relative; width: 100%; max-width: 25rem; background: var(--paper); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: var(--sp-6); animation: auth-pop var(--dur-fast) var(--ease); }
@keyframes auth-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.auth-modal__x { position: absolute; top: var(--sp-3); right: var(--sp-3); width: 2rem; height: 2rem; border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--color-text-muted); cursor: pointer; border-radius: 50%; }
.auth-modal__x:hover { background: var(--cream); color: var(--navy); }
.auth-modal__brand { font-family: var(--font-head); font-style: italic; color: var(--coral); font-size: var(--fs-350); margin: 0; }
.auth-modal__title { font-family: var(--font-head); font-weight: var(--fw-semibold); color: var(--navy); font-size: var(--fs-700); margin: var(--sp-1) 0 var(--sp-2); }
.auth-modal__sub { color: var(--color-text-muted); font-size: var(--fs-300); margin: 0 0 var(--sp-4); line-height: 1.5; }

.auth-google { width: 100%; display: flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: var(--tap); border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); color: var(--navy); font: inherit; font-weight: var(--fw-semibold); cursor: pointer; transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.auth-google:hover { border-color: var(--navy); box-shadow: var(--shadow-1); }
.auth-google__g { font-family: var(--font-head); font-weight: var(--fw-bold); color: var(--coral); font-size: 1.1em; }

.auth-or { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-4) 0; color: var(--color-text-muted); font-size: var(--fs-300); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

.auth-form { display: grid; gap: var(--sp-3); }
.auth-field { display: grid; gap: 0.3em; }
.auth-field[hidden] { display: none; } /* [hidden] is overridden by display:grid without this */
.auth-field > span { font-size: var(--fs-300); font-weight: var(--fw-semibold); color: var(--navy); }
.auth-field input { min-height: var(--tap); border: 1.5px solid var(--hairline); border-radius: var(--radius-sm); padding: 0.4rem 0.7rem; font: inherit; color: var(--navy); background: var(--color-surface); }
.auth-field input:focus { outline: none; border-color: var(--navy); }
.auth-error { color: #b03a2e; background: #f7e9e7; border: 1px solid #ecc9c4; border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); font-size: var(--fs-300); margin: 0; }
.auth-submit { width: 100%; min-height: var(--tap); margin-top: var(--sp-1); }
.auth-switch { text-align: center; font-size: var(--fs-300); color: var(--color-text-muted); margin: var(--sp-4) 0 0; }

/* Account page */
.account-cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-2); }
.account-card { display: grid; gap: var(--sp-3); margin: 0 0 var(--sp-6); padding: var(--sp-5); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-1); }
.account-card__row { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); align-items: baseline; }
.account-card__row dt { flex: none; min-width: 7rem; margin: 0; font-size: var(--fs-300); font-weight: var(--fw-semibold); color: var(--color-text-muted); }
.account-card__row dd { margin: 0; color: var(--navy); }
.account-progress { margin-bottom: var(--sp-6); }
.account-progress__title { font-family: var(--font-head); font-weight: var(--fw-semibold); font-size: var(--fs-500); color: var(--navy); margin-bottom: var(--sp-3); }
.account-progress__list { list-style: none; padding: 0; display: grid; gap: var(--sp-2); }
.account-progress__row { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); }
.account-progress__book { font-family: var(--font-head); font-weight: var(--fw-semibold); color: var(--navy); }
.account-progress__count { font-size: var(--fs-300); color: var(--color-text-muted); white-space: nowrap; }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); padding-top: var(--sp-5); border-top: 1px solid var(--color-border); }
.account__danger { margin-left: auto; padding: var(--sp-2); border: 0; background: none; cursor: pointer; font: inherit; font-size: var(--fs-300); color: #b03a2e; text-decoration: underline; text-underline-offset: 2px; }
.account__danger:hover { color: #8a2d23; }
@media (max-width: 30rem) { .account__danger { margin-left: 0; } }

/* ---------------------------------------------------------------
   Generic table: horizontal scroll on narrow screens (Book 3 tables)
   --------------------------------------------------------------- */
.generic-table-wrap { margin-block: var(--sp-4); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.generic-table { margin-block: 0; }
/* NCLC 7 target column emphasis (threshold table) */
.generic-table th.is-target { background: var(--navy); color: var(--cream); }
.generic-table td.is-target {
  background: color-mix(in srgb, var(--coral) 12%, var(--color-surface));
  color: var(--navy);
  font-weight: var(--fw-semibold);
  box-shadow: inset 3px 0 0 var(--coral), inset -3px 0 0 var(--coral);
}

/* ---------------------------------------------------------------
   Self-locator (Book 3 · Module 1) — per-skill NCLC level + priority
   --------------------------------------------------------------- */
.locator {
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--coral);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-1);
  padding: var(--sp-5);
  margin-block: var(--sp-5);
}
.locator__eyebrow { font-size: var(--fs-300); font-weight: var(--fw-bold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--coral); }
.locator__title { font-family: var(--font-head); font-weight: var(--fw-semibold); font-size: var(--fs-600); color: var(--navy); margin-top: var(--sp-1); }
.locator__lede { color: var(--color-text-muted); font-size: var(--fs-350); margin-top: var(--sp-2); max-width: 40rem; }

.locator__skills { display: grid; gap: var(--sp-3); margin-top: var(--sp-4); }
.locator__skill {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--cream);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.locator__skill-head { display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; }
.locator__skill-name { font-family: var(--font-head); font-weight: var(--fw-semibold); font-size: var(--fs-500); color: var(--navy); }
.locator__skill-fr { font-family: var(--font-fr); font-style: italic; color: var(--color-text-muted); font-size: var(--fs-350); }

.locator__levels { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.locator__level {
  flex: 1 1 auto;
  min-width: 4.2rem;
  min-height: var(--tap);
  padding: 0.4rem 0.6rem;
  border: 1.5px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--navy);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-350);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.locator__level:hover { border-color: var(--navy); }
.locator__level.is-selected { background: var(--navy); border-color: var(--navy); color: var(--cream); }

.locator__flag { font-size: var(--fs-300); font-weight: var(--fw-semibold); min-height: 1.1em; }
.locator__flag.is-ok { color: var(--color-ok); }
.locator__flag.is-below { color: var(--color-err); }
.locator__flag.is-unknown { color: var(--color-text-muted); }

.locator__result {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--radius);
  background: var(--cream);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--coral);
}
.locator__result[hidden] { display: none; }
.locator__result-eyebrow { font-size: var(--fs-300); font-weight: var(--fw-bold); letter-spacing: 0.05em; text-transform: uppercase; color: var(--coral); }
.locator__result-eyebrow.is-clear { color: var(--color-ok); }
.locator__result-head { font-family: var(--font-head); font-size: var(--fs-500); color: var(--navy); margin-top: var(--sp-1); }
.locator__result-head strong { color: var(--navy); }
.locator__result-note { color: var(--color-text-muted); font-size: var(--fs-350); margin-top: var(--sp-2); }
.locator__result-unknown { color: var(--color-text-muted); font-size: var(--fs-300); margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px dashed var(--color-border); }
.locator__cta { display: inline-flex; margin-top: var(--sp-3); }
.locator__cta--soon { color: var(--color-text-muted); font-size: var(--fs-350); font-style: italic; }

.locator__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); }
.locator__save-note { font-size: var(--fs-300); color: var(--color-text-muted); }

@media (min-width: 34rem) {
  .locator__skill { grid-template-columns: 11rem 1fr; align-items: center; }
  .locator__skill-head { flex-direction: column; align-items: flex-start; gap: 0; }
  .locator__flag { grid-column: 2; }
}

/* ---------------------------------------------------------------
   Anchor sample cards + tappable move annotations (Book 3 · Module 2)
   --------------------------------------------------------------- */
.anchor-label {
  display: inline-block;
  margin-top: var(--sp-5);
  margin-bottom: calc(-1 * var(--sp-1));
  font-family: var(--font-body);
  font-size: var(--fs-300);
  font-weight: var(--fw-bold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--coral);
}
.anchor-label strong { color: inherit; font-weight: inherit; }

/* Tappable highlight span — inline() renders [[text|label]] as a .anno button. */
.anno {
  display: inline;
  font: inherit;
  color: var(--navy);
  background: color-mix(in srgb, var(--coral) 16%, transparent);
  border: 0;
  border-bottom: 2px solid var(--coral);
  border-radius: 2px;
  padding: 0 0.08em;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.anno:hover { background: color-mix(in srgb, var(--coral) 32%, transparent); }
.anno[aria-pressed="true"] { background: var(--navy); color: var(--cream); border-bottom-color: var(--navy); }
.anno:focus-visible { outline: var(--focus-outline); outline-offset: 2px; }
.anno__num { font-size: 0.62em; font-weight: var(--fw-bold); color: var(--coral); vertical-align: super; margin-left: 0.12em; }
.anno[aria-pressed="true"] .anno__num { color: var(--cream); }

/* Readout strip below an annotated essay (created by annotations.js). */
.anno-readout {
  margin-top: calc(-1 * var(--sp-2));
  margin-bottom: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  background: var(--cream);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--hairline);
  color: var(--color-text-muted);
  font-size: var(--fs-350);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.anno-readout.is-showing { background: var(--navy); border-color: var(--navy); color: var(--cream); font-weight: var(--fw-medium); }

/* ---------------------------------------------------------------
   Multiple-choice (pill selection) exercises — auto-checked on tap
   --------------------------------------------------------------- */
.mcq { list-style: none; padding-left: 0; display: grid; gap: var(--sp-4); }
.mcq__row { display: grid; gap: var(--sp-2); }
.mcq__prompt { font-family: var(--font-fr); font-size: var(--fs-500); color: var(--navy); }
.mcq__prompt .en { font-family: var(--font-body); font-size: var(--fs-350); color: var(--color-text-muted); font-style: italic; }
.mcq__slot {
  display: inline-block; min-width: 3.5ch; margin-inline: 0.15em; padding: 0 0.3em;
  text-align: center; font-weight: var(--fw-semibold);
  border-bottom: 2px solid var(--coral);
}
.mcq__slot.is-correct { color: var(--color-ok); border-color: var(--color-ok); }
.mcq__slot.is-wrong { color: var(--color-err); border-color: var(--color-err); }
.mcq__options { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.mcq__option {
  min-height: var(--tap); padding: 0.4rem 0.95rem;
  border: 1.5px solid var(--hairline); border-radius: 999px;
  background: var(--color-surface); color: var(--navy);
  font-family: var(--font-fr); font-size: var(--fs-400); font-weight: var(--fw-medium);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.mcq__option:hover { border-color: var(--navy); }
.mcq__option.is-selected { border-color: var(--navy); }
.mcq__option.is-correct { background: var(--color-ok-bg); border-color: var(--color-ok); color: var(--color-ok); }
.mcq__option.is-wrong { background: var(--color-err-bg); border-color: var(--color-err); color: var(--color-err); }
.mcq__option:focus-visible { outline: var(--focus-outline); outline-offset: 2px; }
.mcq__mark { font-size: var(--fs-350); font-weight: var(--fw-semibold); min-height: 1.1em; }
.mcq__mark.is-correct { color: var(--color-ok); }
.mcq__mark.is-wrong { color: var(--color-err); }

/* Reading/listening single-item MCQs (Book 3 Mod 3+): a labelled question with
   stacked, full-width options (letter chip + text), distinct from the inline
   A1 pills above. Same is-selected/correct/wrong states apply. */
.exercise__tag { font-size: var(--fs-300); font-weight: var(--fw-semibold); letter-spacing: 0.05em; text-transform: uppercase; color: var(--blue); margin-bottom: var(--sp-2); }
.mcq--choice { gap: 0; }
.mcq--choice .mcq__prompt { display: block; margin-bottom: var(--sp-3); }
.mcq--choice .mcq__options { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: var(--sp-2); }
.mcq--choice .mcq__option { display: flex; align-items: flex-start; gap: var(--sp-3); width: 100%; text-align: left; border-radius: var(--radius); padding: var(--sp-3) var(--sp-4); font-size: var(--fs-400); }
.mcq__letter { flex: none; font-family: var(--font-head); font-weight: var(--fw-bold); color: var(--color-text-muted); }
.mcq__option.is-selected .mcq__letter { color: var(--navy); }
.mcq__option.is-correct .mcq__letter { color: var(--color-ok); }
.mcq__option.is-wrong .mcq__letter { color: var(--color-err); }
.mcq__optext { flex: 1; }
.mcq--choice .mcq__mark { margin-top: var(--sp-2); }

/* ============================================================
   Production drills (Book 3 Mod 5 writing / Mod 6 speaking):
   a prompt picker + a timed writing area with a live word
   counter, or an on-device record/playback workspace. Wired by
   drills.js; static + readable with no JS.
   ============================================================ */
.prod-drill { border: var(--border-ink); box-shadow: var(--shadow-1); border-radius: var(--radius-lg); background: var(--color-surface); padding: var(--sp-4); margin-block: var(--sp-4); display: grid; gap: var(--sp-3); }
/* [hidden] toggles (timer Pause, recorder Stop/Record, inactive panels) — .btn
   sets display:flex, which otherwise defeats the UA [hidden] rule. */
.prod-drill [hidden] { display: none; }
.drill__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; }
.drill__badge { font-family: var(--font-head); font-weight: var(--fw-bold); font-size: var(--fs-300); text-transform: uppercase; letter-spacing: 0.05em; color: var(--paper); background: var(--navy); padding: 0.2rem 0.6rem; border-radius: 999px; }
.drill__meta { font-size: var(--fs-350); color: var(--color-text-muted); }
.drill__tabs { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.drill__tab { min-height: var(--tap); padding: 0.35rem 0.85rem; border: 1.5px solid var(--hairline); border-radius: 999px; background: var(--color-surface); color: var(--navy); font-family: var(--font-body); font-size: var(--fs-350); font-weight: var(--fw-medium); transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.drill__tab:hover { border-color: var(--navy); }
.drill__tab[aria-selected="true"] { background: var(--navy); color: var(--paper); border-color: var(--navy); }
.drill__tab:focus-visible { outline: var(--focus-outline); outline-offset: 2px; }
.drill__prompt-note { font-size: var(--fs-350); color: var(--color-text-muted); margin-bottom: var(--sp-2); }
.drill__objections { margin-top: var(--sp-2); border-left: 3px solid var(--coral); padding-left: var(--sp-3); }
.drill__obj-label { font-size: var(--fs-300); text-transform: uppercase; letter-spacing: 0.04em; color: var(--coral); font-weight: var(--fw-semibold); margin-bottom: var(--sp-1); }
.drill__obj-list { padding-left: 1.2rem; color: var(--navy); font-family: var(--font-fr); }
.drill__obj-list li { margin-block: var(--sp-1); }

.drill__timer { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-2) var(--sp-3); background: var(--cream); border-radius: var(--radius); }
.drill__timer-time { font-family: var(--font-head); font-size: var(--fs-700); font-weight: var(--fw-bold); color: var(--navy); font-variant-numeric: tabular-nums; min-width: 3.5ch; }
.drill__timer.is-warning .drill__timer-time { color: var(--coral); }
.drill__timer.is-done .drill__timer-time { color: var(--color-err); }
.drill__timer-controls { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.drill__write { width: 100%; min-height: 12rem; font: inherit; font-family: var(--font-fr); font-size: var(--fs-400); color: var(--navy); padding: var(--sp-3); border: 1.5px solid var(--hairline); border-radius: var(--radius); background: var(--paper); resize: vertical; }
.drill__write:focus-visible { border-color: var(--blue); outline: none; }
.drill__count { font-size: var(--fs-350); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.drill__count.is-met { color: var(--color-ok); font-weight: var(--fw-semibold); }

.drill__recorder { display: grid; gap: var(--sp-2); padding: var(--sp-3); background: var(--cream); border-radius: var(--radius); }
.drill__rec-status { font-size: var(--fs-400); color: var(--navy); }
.drill__recorder.is-recording .drill__rec-status { color: var(--coral); font-weight: var(--fw-semibold); }
.drill__recorder.is-unsupported .drill__rec-status { color: var(--color-text-muted); }
.drill__rec-controls { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.drill__audio { width: 100%; margin-top: var(--sp-1); }
.drill__rec-note { font-size: var(--fs-300); color: var(--color-text-muted); }

/* ============================================================
   Neo-brutalist "paper" redesign overrides (2026)
   Layered last so it re-skins the components above to match the
   marketing site (fwa.css) without editing each rule. "Dialed for
   study": loud display + hard-shadow cards on hub/interactive
   surfaces; readable French/body typography kept intact.
   ============================================================ */

/* --- Sticky header: ink border + F-badge wordmark --- */
.site-header { background: color-mix(in srgb, var(--paper) 85%, transparent); border-bottom: 2px solid var(--navy); }
.site-header__inner { min-height: 64px; }
.site-header__home { gap: 0.55rem; font-family: var(--font-display); font-weight: 400; font-size: var(--fs-600); letter-spacing: 0.03em; text-transform: uppercase; }
.site-header__home:hover { color: var(--coral); }
.site-header__logo {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: 10px; text-transform: none;
  background: var(--coral); border: 2.5px solid var(--navy); box-shadow: 3px 3px 0 var(--navy);
  font-family: var(--font-fr); font-style: italic; font-weight: 500; font-size: 1.25rem; color: #fff;
}
@media (max-width: 26rem) { .site-header__wordmark { display: none; } }

/* --- Hub display titles → Anton (chapter titles stay Lora via :lang(fr)) --- */
.landing-hero__title, .index-hero__title {
  font-family: var(--font-display); font-weight: 400; letter-spacing: 0.5px;
  text-transform: uppercase; line-height: 0.96;
}
.section__title { font-weight: var(--fw-black); }

/* --- Eyebrows / brand → Space Mono label --- */
.landing-hero__brand, .index-hero__eyebrow, .chapter-head__eyebrow {
  font-family: var(--font-mono); font-style: normal; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--coral-ink);
}
.landing-hero__brand { font-size: var(--fs-300); }

/* --- Heros: swap the coral underline for a cleaner display block --- */
.index-hero { border-bottom: 0; }
.chapter-head { border-bottom: 3px solid var(--navy); }

/* --- Learning arc → neo pills; final node coral --- */
.arc__node {
  background: #fff; border: 2px solid var(--navy); box-shadow: 2px 2px 0 var(--navy);
  border-radius: 999px; font-family: var(--font-mono); font-weight: 700; padding: 0.4rem 0.9rem; color: var(--navy);
}
.arc .arc__node:last-of-type { background: var(--coral); color: #fff; }
.arc__sep { color: var(--dashed); }

/* --- Cards → thick ink border + hard offset shadow + snappy hover --- */
.book-card, .chapter-card, .workbook__card, .intro-panel,
.account-card, .account-progress__row {
  border: var(--border-ink); box-shadow: var(--shadow-1);
}
.book-card, .intro-panel, .account-card { border-radius: var(--radius-lg); }
.chapter-card, .workbook__card, .account-progress__row { border-radius: var(--radius); }
.book-card { border-top: 2.5px solid var(--navy); }
.workbook__card { border-left: 2.5px solid var(--navy); }
.book-card:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-coral); }
.chapter-card:hover, .workbook__card:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--coral); border-color: var(--navy); }

/* Book-card number → coral square badge */
.book-card__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 14px; margin-bottom: var(--sp-2);
  background: var(--coral); border: 2.5px solid var(--navy); box-shadow: 3px 3px 0 var(--navy);
  color: #fff; font-family: var(--font-display); font-size: 1.6rem;
}
.book-card__title { font-family: var(--font-head); font-weight: var(--fw-black); text-wrap: balance; }
.book-card__level { font-family: var(--font-mono); }
.book-card__status { font-family: var(--font-mono); color: var(--coral-ink); font-weight: 700; }

/* Keep level ranges like "NCLC 1–4" on one line — wraps happen only at the
   " · " separator, never mid-range. */
.u-nowrap { white-space: nowrap; }

/* Chapter-list number → rounded ink badge */
.chapter-card__num { border: 2px solid var(--navy); border-radius: 12px; background: var(--cream); }
.chapter-card__title, .workbook__card-label { font-weight: var(--fw-black); }
.workbook__card-go { font-family: var(--font-mono); color: var(--coral-ink); }

/* Progress bar → ink outline */
.book-progress__bar { border: 2px solid var(--navy); height: 14px; }

/* Interactive study components → card treatment (readable, not loud) */
.deck, .conj, .exercise { border: var(--border-ink); box-shadow: var(--shadow-1); border-radius: var(--radius-lg); }

/* Landing "exercises + account" utility row (comp: merged Exercises into Guides) */
.landing-util { display: grid; gap: var(--sp-4); margin-block: var(--sp-4) var(--sp-6); }
@media (min-width: 40rem) { .landing-util { grid-template-columns: 1fr 1fr; } }
/* Three util cards (Exercises · Examens blancs · Account): the odd one spans
   the 2-col row on mid widths; all three sit side by side on wide screens. */
@media (min-width: 40rem) and (max-width: 63.999rem) { .landing-util--3 > .util-card:last-child { grid-column: 1 / -1; } }
@media (min-width: 64rem) { .landing-util--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Four util cards: a clean 2×2 from the ≥40rem rule above holds through most
   desktop widths. Four-across only kicks in on very wide screens — and each
   card then switches to a stacked layout, otherwise the horizontal flex card
   (icon + text + arrow) gets crushed and the text wraps one word per line. */
@media (min-width: 80rem) {
  .landing-util--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .landing-util--4 .util-card { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  .landing-util--4 .util-card__go { display: none; }
}
/* Five util cards (adds Speaking drills): 3+2 on wide desktop, five-across
   only on very wide screens, with the same stacked treatment as --4. */
@media (min-width: 64rem) and (max-width: 79.999rem) {
  .landing-util--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 80rem) {
  .landing-util--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .landing-util--5 .util-card { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  .landing-util--5 .util-card__go { display: none; }
}

/* ============================================================
   Essay pages (/essays/) — whole-markdown collections rendered by
   markdown-it, so style the raw elements: model texts arrive as
   blockquotes, the self-eval grid as a table, sujets as h2.
   ============================================================ */
.essay-body { max-width: 46rem; margin-inline: auto; }
.essay-body h2 { font-size: var(--fs-700); margin: var(--sp-7) 0 var(--sp-3); padding-top: var(--sp-4); border-top: 1px solid var(--hairline); }
.essay-body h3 { font-size: var(--fs-600); margin: var(--sp-5) 0 var(--sp-2); }
.essay-body p, .essay-body li { line-height: 1.7; }
.essay-body ul, .essay-body ol { padding-left: 1.4rem; margin-block: var(--sp-3); }
.essay-body li { margin-block: var(--sp-1); }
.essay-body blockquote {
  margin: var(--sp-4) 0; padding: var(--sp-4) var(--sp-5);
  background: var(--cream); border-left: var(--rule-w) solid var(--coral);
  border-radius: var(--radius-sm); font-family: var(--font-fr, inherit);
}
.essay-body blockquote p { margin-block: var(--sp-2); }
.essay-body hr { border: 0; border-top: 2.5px solid var(--navy); opacity: 0.15; margin: var(--sp-6) auto; width: 6rem; }
.essay-body table { width: 100%; border-collapse: collapse; margin-block: var(--sp-4); font-size: var(--fs-350); }
.essay-body th, .essay-body td { border: 1px solid var(--hairline); padding: var(--sp-2) var(--sp-3); text-align: left; vertical-align: top; }
.essay-body th { background: var(--cream); font-weight: var(--fw-bold); color: var(--navy); }
.essay-body .table-wrap, .essay-body table { overflow-x: auto; display: block; }
@media (min-width: 40rem) { .essay-body table { display: table; } }

/* Essays level page — empty state while a level has no published collections */
.essay-empty {
  background: var(--cream); border: 2px dashed var(--navy); border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6); color: var(--color-text-muted); font-size: var(--fs-400);
}
.util-card {
  display: flex; align-items: center; gap: var(--sp-4);
  background: var(--cream); border: 2px dashed var(--navy); border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5); text-decoration: none;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.util-card:hover { background: var(--color-surface); transform: translate(-1px,-1px); }
.util-card__icon {
  width: 46px; height: 46px; flex: none; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-surface); border: 2px solid var(--navy);
}
.util-card__body { flex: 1; min-width: 0; }
.util-card__label { display: block; font-family: var(--font-head); font-weight: var(--fw-black); font-size: var(--fs-400); color: var(--navy); }
.util-card__desc { display: block; font-size: var(--fs-300); color: var(--color-text-muted); margin-top: 2px; }
.util-card__go { flex: none; font-family: var(--font-mono); font-size: var(--fs-400); color: var(--faint); }

/* ---- Listing-card scroll reveal (added by reveal.js; below-the-fold cards only).
   Classes are removed once the fade completes, so the cards' :hover lift is kept. ---- */
.book-card.fw-hidden,.chapter-card.fw-hidden,.workbook__card.fw-hidden,.util-card.fw-hidden{opacity:0;transform:translateY(20px)}
.book-card.fw-in,.chapter-card.fw-in,.workbook__card.fw-in,.util-card.fw-in{opacity:1;transform:none;transition:opacity .55s ease,transform .55s cubic-bezier(.16,1,.3,1)}

/* ============================================================
   Checkpoint (milestone) tiles + page accent. Warm terracotta,
   deliberately distinct from the blue-accented chapter cards, so a
   milestone reads as a milestone at a glance. Sits inside the same
   .chapter-list as the chapter cards. Layered last to win the cascade.
   ============================================================ */
.checkpoint-card {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--milestone-bg);
  border: 2.5px solid var(--milestone);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--milestone);
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.checkpoint-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--milestone); }
.checkpoint-card:focus-visible { outline: var(--focus-outline); outline-offset: 3px; }
.checkpoint-card__badge {
  flex: none; display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem; border-radius: 12px;
  background: var(--milestone); color: var(--on-milestone);
}
.checkpoint-card__body { flex: 1; min-width: 0; }
.checkpoint-card__kicker {
  display: block; font-family: var(--font-mono); font-size: var(--fs-300);
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--milestone-ink); font-weight: var(--fw-bold);
}
.checkpoint-card__title {
  display: block; font-family: var(--font-head); font-weight: var(--fw-black);
  color: var(--navy); font-size: var(--fs-600); margin-top: 0.1em;
}
.checkpoint-card__meta {
  display: block; font-size: var(--fs-300); color: var(--color-text-muted); margin-top: 0.1em;
}
.checkpoint-card__go {
  flex: none; font-family: var(--font-mono); font-size: var(--fs-300);
  font-weight: var(--fw-bold); color: var(--milestone-ink); white-space: nowrap;
}
.checkpoint-card.is-upcoming { opacity: 0.6; pointer-events: none; box-shadow: none; }

/* Checkpoint page: tint the header rule + eyebrow to match the milestone */
.chapter-head--checkpoint { border-left: var(--rule-w) solid var(--milestone); padding-left: var(--sp-4); }
.chapter-head--checkpoint .chapter-head__eyebrow { color: var(--milestone-ink); }
