/* Master, Build, Orchestrate: site styles. Colour tokens come from tokens.css (generated from content/brand.json). */

@view-transition { navigation: auto; }

@font-face {
  font-family: "Cairo";
  src: url("../fonts/Cairo-Variable.ttf") format("truetype");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

/* The owner's portfolio display face, self-hosted (the exact WOFF2 embedded in the
   owner's portfolio page) under its SIL Open Font Licence (assets/fonts/Figtree-OFL.txt). */
@font-face {
  font-family: "Portfolio Figtree";
  src: url("../fonts/Figtree-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ease: cubic-bezier(.2,.74,.24,1);
  --font-latin-display: "Portfolio Figtree", Inter, system-ui, -apple-system, sans-serif;
  --font-latin: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-ar: "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --radius: 14px; --radius-sm: 8px; --radius-pill: 999px;
  --w-page: 1088px; --w-main: 768px; --w-aside: 288px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.04);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.05);
  --t-fast: 220ms var(--ease);
  --header-h: 58px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--c-base);
  color: var(--c-ink);
  font-family: var(--font-latin);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
html[lang="ar"] body { font-family: var(--font-ar); line-height: 1.85; }
:lang(ar) { font-family: var(--font-ar); }
html[lang="ar"] :lang(en) { font-family: var(--font-latin); line-height: 1.55; }
img, svg, iframe { max-width: 100%; }

/* Headings. English headings use the portfolio's own heavy Figtree; the hero carries the
   full 900 headline weight, secondary headings a slightly lighter one. Arabic keeps Cairo. */
h1, h2, h3, h4 {
  font-family: var(--font-latin-display);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: var(--c-ink);
}
h1 { letter-spacing: -0.03em; }
h2 { letter-spacing: -0.025em; }
h3 { letter-spacing: -0.015em; }
h4 { letter-spacing: -0.01em; }

html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 {
  font-family: var(--font-ar);
  font-weight: 650;
  letter-spacing: normal !important;
  line-height: 1.45;
}

p { margin: 0 0 var(--s-4); }
ul, ol { margin: 0; padding: 0; }
a { color: var(--c-primary); text-underline-offset: 0.18em; text-decoration-thickness: 1px; transition: color var(--t-fast); }
a:hover { color: var(--c-primary-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--c-soft); color: var(--c-ink); }
main:focus { outline: none; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.icon { flex: none; vertical-align: middle; }
[dir="rtl"] .icon--flip { transform: scaleX(-1); }

.skip-link {
  position: absolute; inset-inline-start: var(--s-4); top: -100px; z-index: 100;
  background: var(--c-primary); color: var(--c-primary-text); padding: var(--s-2) var(--s-4);
  border-radius: var(--radius-sm); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--s-2); color: var(--c-primary-text); }

.container { width: 100%; max-width: var(--w-page); margin-inline: auto; padding-inline: var(--s-4); }
.container--narrow { max-width: calc(var(--w-main) + 2 * var(--s-4)); }
@media (min-width: 640px) { .container { padding-inline: var(--s-5); } .container--narrow { max-width: calc(var(--w-main) + 2 * var(--s-5)); } }

/* ---------- buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 45px; padding: 10px 20px; border-radius: var(--radius-sm);
  border: 1px solid var(--c-interactive-border); font: inherit; font-weight: 650; font-size: 0.95rem; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.btn--primary { background: var(--c-primary); color: var(--c-primary-text); border-color: var(--c-primary); }
.btn--primary:hover { background: var(--c-primary-hover); color: var(--c-primary-text); border-color: var(--c-primary-hover); }
.btn--ghost { background: transparent; color: var(--c-primary); border-color: var(--c-interactive-border); }
.btn--ghost:hover { background: var(--c-soft); color: var(--c-primary-hover); border-color: var(--c-primary); }
.btn--quiet { background: var(--c-soft); color: var(--c-ink); border-color: var(--c-interactive-border); }
.btn--quiet:hover { background: var(--c-surface); border-color: var(--c-accent); }
.btn--danger { background: var(--c-surface); color: var(--c-accent); border-color: var(--c-interactive-border); }
.btn--danger:hover { background: var(--c-accent); color: var(--c-primary-text); border-color: var(--c-accent); }
.btn--small { min-height: 38px; padding: 6px 14px; font-size: 0.875rem; }
.btn[disabled] { cursor: not-allowed; opacity: 0.65; background: var(--c-soft); color: var(--c-muted); border-color: var(--c-border); }
.text-link { display: inline-flex; align-items: center; gap: var(--s-1); font-weight: 650; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.icon-btn {
  display: inline-grid; place-items: center; width: 45px; height: 45px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--c-ink); cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.icon-btn:hover { background: var(--c-soft); border-color: var(--c-interactive-border); }

/* ---------- header ---------- */
.site-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(8px);
}
.site-header__inner {
  max-width: var(--w-page); margin-inline: auto; padding-inline: var(--s-3);
  height: var(--header-h); min-height: var(--header-h); display: flex; align-items: center; gap: var(--s-2);
}
@media (min-width: 640px) { .site-header__inner { padding-inline: var(--s-5); gap: var(--s-5); } }
.wordmark {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0;
  font-family: var(--font-latin-display);
  font-weight: 800; font-size: 1.15rem; color: var(--c-primary); text-decoration: none; letter-spacing: -0.02em;
  white-space: nowrap;
  transition: color var(--t-fast);
}
.wordmark__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
html[lang="ar"] .wordmark { font-family: var(--font-ar); font-weight: 700; letter-spacing: normal; }
.wordmark:hover { color: var(--c-primary-hover); text-decoration: none; }
.primary-nav { display: none; }
.primary-nav__list { list-style: none; display: flex; align-items: center; gap: var(--s-1); }
.primary-nav__item { position: relative; }
.nav-btn, .nav-link {
  display: inline-flex; align-items: center; gap: var(--s-1); min-height: 40px; padding: 6px 12px;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--c-ink);
  font: inherit; font-size: 0.95rem; text-decoration: none; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.nav-btn:hover, .nav-link:hover, .nav-btn[aria-expanded="true"] { background: var(--c-soft); color: var(--c-ink); border-color: var(--c-interactive-border); }
.nav-btn[aria-expanded="true"] .nav-btn__chev { transform: rotate(180deg); }
.nav-btn__chev { width: 16px; height: 16px; transition: transform var(--t-fast); }

/* Explore menu with fade and slide */
.explore-menu {
  position: absolute; top: calc(100% + 6px); inset-inline-start: 0; min-width: 520px;
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5);
  padding: var(--s-5); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: menuIn 220ms var(--ease);
}
@keyframes menuIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.explore-menu ul, .mobile-menu ul { list-style: none; }
.explore-menu a, .mobile-menu a {
  display: block; padding: 6px 8px; margin-inline: -8px; border-radius: var(--radius-sm);
  color: var(--c-ink); text-decoration: none; transition: background var(--t-fast), color var(--t-fast);
}
.explore-menu a:hover, .mobile-menu a:hover { background: var(--c-soft); color: var(--c-primary); }
.menu__heading { font-size: 0.8rem; font-weight: 650; color: var(--c-muted); margin: 0 0 var(--s-2); text-transform: uppercase; letter-spacing: 0.04em; }
html[lang="ar"] .menu__heading { text-transform: none; letter-spacing: 0; }
.menu__eyebrow { display: block; font-size: 0.78rem; color: var(--c-muted); }
.explore-menu a.menu__course, .mobile-menu a.menu__course { display: flex; align-items: flex-start; gap: var(--s-3); }
.menu__glyph { flex: none; margin-top: 3px; color: var(--c-accent); }
.menu__label { min-width: 0; }
.site-header__end { margin-inline-start: auto; display: flex; align-items: center; gap: var(--s-2); }
.lang-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 12px;
  border-radius: var(--radius-sm); border: 1px solid transparent; color: var(--c-ink); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.lang-link:hover { background: var(--c-soft); border-color: var(--c-interactive-border); color: var(--c-ink); text-decoration: none; }
.lang-link .icon { width: 18px; height: 18px; }
/* In the header the language link wears the same outline as the theme and menu buttons
   beside it, so the end of the bar is one even group of controls whose outer edge lines up
   with the content edge, as the wordmark does at the start (same box, the border was
   already there, transparent). */
.site-header .lang-link { border-color: var(--c-border); background: var(--c-surface); }

/* Theme toggle button */
.theme-toggle {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-sm);
  border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-ink); cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.theme-toggle:hover { background: var(--c-soft); border-color: var(--c-interactive-border); transform: scale(1.04); }
.theme-toggle__icon { display: inline-grid; place-items: center; }
.theme-toggle__icon--sun { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--moon { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--sun { display: inline-grid; }

.menu-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-surface); color: var(--c-ink); cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.menu-btn:hover, .menu-btn[aria-expanded="true"] { background: var(--c-soft); border-color: var(--c-interactive-border); }
.mobile-menu {
  border-top: 1px solid var(--c-border); padding: var(--s-4); background: var(--c-surface);
  animation: menuIn 220ms var(--ease);
}
.mobile-menu nav ul { margin-bottom: var(--s-4); }
.mobile-menu__actions { padding: var(--s-3) 0 0; border-top: 1px solid var(--c-border); }
/* Below 1024px the wordmark may set on two balanced lines ("Master, Build," / "Orchestrate")
   rather than truncate; when one line fits (Arabic, wider phones) it stays on one. The
   header controls keep 44px touch targets at every width. */
@media (max-width: 1023.98px) {
  .wordmark { white-space: normal; line-height: 1.08; }
  .wordmark__text { text-wrap: balance; }
  /* Cairo's font box is ~1.87em and a tighter line clips its marks, so the Arabic wordmark
     keeps a tall line and is sized (below) to stay on one line from 360px up */
  html[lang="ar"] .wordmark { line-height: 1.9; }
}
/* Under 360px the English name no longer fits in two lines beside the controls: the header
   shows the mark and the brand abbreviation, and keeps the full name for screen readers. */
.wordmark__abbr { display: none; }
@media (max-width: 359.98px) {
  html[lang="en"] .site-header .wordmark__abbr { display: inline; }
  html[lang="en"] .site-header .wordmark__text {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
}
@media (max-width: 420px) {
  .site-header__inner { gap: 6px; }
  .site-header__end { gap: var(--s-1); }
  .wordmark { font-size: 0.98rem; gap: 8px; }
  html[lang="ar"] .wordmark { font-size: 0.94rem; }
  .wordmark__mark { width: 26px; height: 26px; }
  .lang-link { padding-inline: 6px; font-size: 0.85rem; }
}
@media (min-width: 1024px) {
  .primary-nav { display: block; }
  .menu-btn, .mobile-menu { display: none !important; }
}

/* ---------- common blocks & typography hierarchy ---------- */
.site-main { display: block; min-height: 60vh; padding-bottom: var(--s-8); }
.eyebrow { font-size: 0.82rem; font-weight: 650; color: var(--c-accent); margin: 0 0 var(--s-2); letter-spacing: 0.02em; }
.page-head { padding-top: var(--s-7); padding-bottom: var(--s-5); }
.page-head--flush { padding-top: var(--s-5); padding-bottom: var(--s-4); }
.page-title { font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem); font-weight: 800; margin-bottom: var(--s-3); }
html[lang="ar"] .page-title { font-weight: 700; }
.page-subtitle { color: var(--c-muted); margin-top: calc(-1 * var(--s-2)); }
.page-lead { font-size: 1.15rem; color: var(--c-muted); max-width: 46rem; line-height: 1.6; }
.section { padding-top: var(--s-7); }
.section--tight { padding-top: var(--s-6); }
.section__head { margin-bottom: var(--s-5); }
.section__head--row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-3); }
.section__title { font-size: 1.6rem; margin-bottom: var(--s-3); }
.section__intro { color: var(--c-muted); margin: var(--s-2) 0 0; }
.sub-title { display: flex; align-items: center; gap: var(--s-2); font-size: 1.2rem; margin: var(--s-5) 0 var(--s-3); }
.sub-title .icon { color: var(--c-accent); }
.prose { max-width: 48rem; line-height: 1.6; }
.link-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-4); }
.page--course .page-main > .lang-note { margin-top: var(--s-5); margin-bottom: 0; }
.lang-note {
  font-size: 0.92rem; color: var(--c-muted); background: var(--c-soft);
  border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: var(--s-2) var(--s-3);
}

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); font-size: 0.9rem; margin-bottom: var(--s-4); }
.crumbs li { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--c-muted); }
.crumbs li + li::before { content: "/"; color: var(--c-muted); }
.crumbs a { color: var(--c-muted); text-decoration: none; transition: color var(--t-fast); }
.crumbs a:hover { color: var(--c-primary); text-decoration: underline; }
.crumbs__back { width: 16px; height: 16px; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-3) 0 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--radius-pill);
  background: var(--c-surface); border: 1px solid var(--c-border); font-size: 0.85rem; color: var(--c-muted);
  transition: border-color var(--t-fast), color var(--t-fast);
}
.chip:hover { border-color: var(--c-interactive-border); color: var(--c-ink); }
.chip:empty { display: none; }
.chip .icon { width: 16px; height: 16px; color: var(--c-accent); }
.chip:has(> .chip__done[hidden]) { display: none; }
.chip__done { display: inline-flex; align-items: center; gap: 6px; color: var(--c-primary); font-weight: 650; }

.box {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: var(--s-5); margin-top: var(--s-5); box-shadow: var(--shadow-sm);
}
.box > :last-child { margin-bottom: 0; }
.box__title { font-size: 1.15rem; margin-bottom: var(--s-2); }
.box__sub { font-size: 0.92rem; color: var(--c-muted); margin-bottom: var(--s-3); }
.box-pair { display: grid; gap: 0 var(--s-4); }
@media (min-width: 720px) { .box-pair { grid-template-columns: 1fr 1fr; } }

.objectives__list { list-style: none; display: grid; gap: var(--s-3); }
.objectives__list li { position: relative; padding-inline-start: var(--s-5); }
.objectives__list li::before {
  content: ""; position: absolute; inset-inline-start: 4px; top: 0.6em; width: 8px; height: 8px;
  border-top: 2px solid var(--c-accent); border-inline-end: 2px solid var(--c-accent); transform: rotate(45deg);
}
[dir="rtl"] .objectives__list li::before { transform: rotate(-45deg); }
.objective__day { font-weight: 650; color: var(--c-primary); margin-inline-end: var(--s-1); }
.objectives__dl { margin: 0; display: grid; gap: var(--s-1); }
.objectives__dl dt { font-weight: 650; font-size: 0.92rem; color: var(--c-muted); margin-top: var(--s-2); }
.objectives__dl dd { margin: 0; }
.prereqs { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); }

/* Instructor: no portrait. The monogram is the brand mark's tile at a larger size (same
   cobalt and ink as brandMark() and the favicons, the brass cut offset toward the end like
   the mark's last step), so it reads as part of the identity, not a missing photo. */
.instructor {
  display: flex; align-items: flex-start; gap: var(--s-4); max-width: 48rem;
  margin: var(--s-3) 0 var(--s-4); padding: var(--s-5);
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.instructor__mono {
  flex: none; position: relative; display: grid; place-items: center;
  width: 64px; height: 64px; padding-bottom: 9px; box-sizing: border-box; border-radius: 14px;
  background: #14285c; color: #ecf3fb; border: 1px solid transparent;
  font: 800 1.45rem/1 var(--font-latin-display); letter-spacing: 0.01em;
}
.instructor__mono::after {
  content: ""; position: absolute; left: 40%; bottom: 12px; width: 40%; height: 5px; border-radius: 3px;
  background: var(--art-brass);
}
html[lang] .instructor__mono { font-family: var(--font-latin-display); line-height: 1; } /* Latin letters on AR pages too */
:root[data-theme="dark"] .instructor__mono { border-color: var(--c-interactive-border); }
.instructor__body { min-width: 0; }
.instructor__name { margin: 0; font-family: var(--font-latin-display); font-size: 1.15rem; font-weight: 750; color: var(--c-ink); line-height: 1.3; letter-spacing: -0.01em; }
html[lang="ar"] .instructor__name { font-family: var(--font-ar); font-weight: 700; letter-spacing: normal; line-height: 1.5; }
.instructor__place { margin: 2px 0 var(--s-3); font-size: 0.92rem; color: var(--c-muted); }
.instructor__bio { margin: 0; line-height: 1.6; max-width: 42rem; }
@media (min-width: 640px) {
  .instructor { gap: var(--s-5); }
  .instructor__mono { width: 80px; height: 80px; padding-bottom: 11px; border-radius: 18px; font-size: 1.8rem; }
  .instructor__mono::after { bottom: 15px; height: 6px; }
}
/* Home: the card spans the section like the full-width sections around it and, from 720px,
   sits on the three columns of the "How each lesson works" steps directly above (same
   track gap; each cell inset by the steps' own body padding): monogram, name and place in
   the first column, the bio across the other two. Course pages keep the compact card. */
.instructor--grid { display: block; max-width: none; margin: 0; }
.instructor__id { display: flex; align-items: center; gap: var(--s-4); }
.instructor--grid .instructor__place { margin-bottom: 0; }
.instructor--grid .instructor__bio { margin-top: var(--s-4); }
@media (min-width: 720px) {
  .instructor--grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--s-4);
    align-items: start; padding-inline: 0;
  }
  .instructor--grid .instructor__id { flex-direction: column; align-items: flex-start; gap: var(--s-3); padding-inline: var(--s-5); }
  .instructor--grid .instructor__bio { grid-column: 2 / 4; margin: 0; padding-inline: var(--s-5); max-width: none; }
}

/* ---------- progress ---------- */
.progress { margin-top: var(--s-3); }
.progress__text { font-size: 0.875rem; color: var(--c-muted); margin: 0 0 6px; }
.progress__track { height: 8px; border-radius: var(--radius-pill); background: var(--c-soft); overflow: hidden; border: 1px solid var(--c-border); }
.progress__fill { height: 100%; width: 0; background: var(--c-primary); border-radius: inherit; transition: width 400ms var(--ease); }
.progress.is-done .progress__text { color: var(--c-primary); font-weight: 650; }

/* ---------- home ---------- */
/* Home hero: an asymmetric editorial spread. The art plate (hero-plate.webp) sits in its
   own column and bleeds to the inline-end edge of the viewport; the type never overlaps it.
   Below 1024px the wide plate (hero-wide.webp) is a full-bleed band above the headline. */
.hero { background: var(--c-base); border-bottom: 1px solid var(--c-border); }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1fr); }
.hero__art { height: clamp(188px, 56.25vw, 480px); overflow: hidden; background: var(--art-ground); }
/* Below 1024px the <picture> serves hero-wide.webp (16:9, every object in frame). The band is
   exactly 16:9 up to 853px wide and never crops more than the open cobalt above the
   straightedge and a sliver below the folios beyond that. */
.hero__picture { display: block; width: 100%; height: 100%; }
.hero__img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 82%; }
@media (max-width: 1023.98px) { .hero__img { object-position: 50% 78%; } }
[dir="rtl"] .hero__img { transform: scaleX(-1); }
.hero__text { padding: var(--s-6) var(--s-4) var(--s-7); }
@media (min-width: 640px) { .hero__text { padding-inline: var(--s-5); } }
@media (min-width: 1024px) {
  .hero__inner {
    grid-template-columns: minmax(var(--s-5), 1fr) minmax(0, 616px) minmax(0, 472px) minmax(var(--s-5), 1fr);
    min-height: clamp(560px, calc(100vh - var(--header-h) - 120px), 700px);
  }
  .hero__text { grid-column: 2; grid-row: 1; align-self: center; padding-block: var(--s-8); padding-inline: var(--s-5) var(--s-8); }
  .hero__art { grid-column: 3 / 5; grid-row: 1; height: auto; min-height: 100%; }
}
.hero__title { font-size: clamp(2.3rem, 1.1rem + 3.4vw, 3.9rem); font-weight: 900; letter-spacing: -0.04em; line-height: 1.02; color: var(--c-ink); margin-bottom: var(--s-5); }
.hero__title-main, .hero__title-sub { display: block; }
.hero__title-sub { margin-top: var(--s-3); font-size: max(0.46em, 1.3rem); font-weight: 650; letter-spacing: -0.015em; line-height: 1.25; color: var(--c-muted); max-width: 26ch; }
html[lang="ar"] .hero__title { font-weight: 700; font-size: clamp(2.1rem, 1.2rem + 2.8vw, 3.4rem); }
html[lang="ar"] .hero__title-sub { font-weight: 600; line-height: 1.6; max-width: 30ch; }
.hero__lead { font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.2rem); color: var(--c-muted); max-width: 36rem; line-height: 1.6; }
.hero__facts { font-weight: 650; color: var(--c-primary); }
/* the spec line: a hairline rule with instrument ticks, echoing the art's scale */
.hero__text .hero__facts {
  max-width: 34rem; padding-top: var(--s-3); margin-top: var(--s-5);
  background: linear-gradient(var(--c-border), var(--c-border)) top / 100% 1px no-repeat,
    repeating-linear-gradient(to right, var(--c-interactive-border) 0 1px, transparent 1px 16px) top / 100% 6px no-repeat;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: flex-start; margin-top: var(--s-3); align-items: center; }
.course-hero .hero__actions { justify-content: flex-start; margin-top: var(--s-5); }
.hero__note { font-size: 0.9rem; color: var(--c-muted); margin-top: var(--s-3); }
.resume-card {
  margin-top: var(--s-6); width: 100%; max-width: 34rem; text-align: start;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: var(--s-4) var(--s-5); box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast), border-color var(--t-fast);
}
.resume-card:hover { transform: translateY(-2px); border-color: var(--c-interactive-border); }
.resume-card__label { font-size: 0.85rem; color: var(--c-muted); margin: 0 0 var(--s-1); }
.resume-card__link { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 650; font-size: 1.1rem; text-decoration: none; }
.resume-card__meta { font-size: 0.85rem; color: var(--c-muted); margin: var(--s-1) 0 0; }

.card-grid { list-style: none; display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 720px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
.card-link { text-decoration: none; color: inherit; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-link:hover { text-decoration: underline; color: var(--c-primary); }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 2px solid var(--c-accent); outline-offset: 2px; }

.course-card {
  position: relative; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow var(--t-fast), transform var(--t-fast), border-color var(--t-fast);
}
.course-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--c-interactive-border); }
.course-hero--p1 { background: var(--c-soft); }
.course-hero--p2 { background: var(--c-page-glow); }
.course-hero--p3 { background: var(--c-page-glow-secondary); }
/* Cover plate: each course has its own render (cover-<slug>.webp). Programme cards show it
   flush on top at 16:10; catalogue rows and the AIM series tip it in at its full 5:4. */
.course-card__plate { aspect-ratio: 16 / 10; overflow: hidden; background: var(--art-ground); border-bottom: 1px solid var(--c-border); }
.course-card__img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease); }
/* 16:10 crops (programme cards, course pages under 1024px) keep 78% of the cover's height;
   these centre each subject in that window. At 5:4 nothing is cropped, so they are inert. */
img[data-art="cover-master.webp"], img[data-art="cover-orchestrate.webp"] { object-position: 50% 40%; }
img[data-art="cover-aim-collab.webp"] { object-position: 50% 45%; }
img[data-art="cover-aim-fluency.webp"] { object-position: 50% 28%; }
.course-card:hover .course-card__img { transform: scale(1.025); }
/* Hover and keyboard-focus affordance on the art: the site's focus ring (2px accent) drawn
   inside the plate, over a hairline of the art ink so it also reads on the cobalt in the
   light theme. An overlay, so nothing moves; opacity only. Course cards light it on hover
   and when their link has keyboard focus; step cards (not links) on hover only. */
.course-card__plate, .step__plate { position: relative; }
.course-card__plate::after, .step__plate::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 2px var(--c-accent), inset 0 0 0 3px var(--art-rule);
  opacity: 0; transition: opacity var(--t-fast);
}
.course-card:hover .course-card__plate::after,
.course-card:has(.card-link:focus-visible) .course-card__plate::after,
.step:hover .step__plate::after { opacity: 1; }
.course-card__body { padding: var(--s-4) var(--s-5) var(--s-5); display: flex; flex-direction: column; flex: 1; }
.course-card__title { font-size: 1.35rem; margin-bottom: var(--s-2); }
.course-card__meta { font-size: 0.9rem; color: var(--c-muted); margin-bottom: var(--s-2); }
.course-card .progress { margin-top: auto; padding-top: var(--s-3); }
.course-card__listlabel { font-size: 0.82rem; font-weight: 650; color: var(--c-muted); margin: var(--s-2) 0 var(--s-1); }
.course-card__days { padding-inline-start: 1.3em; display: grid; gap: 2px; font-size: 0.95rem; margin-bottom: var(--s-3); columns: 1; }
.row-list { list-style: none; display: grid; gap: var(--s-4); }
/* catalogue: the AIM series method list hands over to the course rows with the same 24px
   the section heads and the series strip leave before what follows them */
.objectives__list[data-series-method] + .row-list { margin-top: var(--s-5); }
.course-card--row { display: grid; grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .course-card--row { grid-template-columns: 272px 1fr; align-items: start; }
  .course-card--row .course-card__plate { aspect-ratio: 5 / 4; margin: var(--s-4); margin-inline-end: 0; border: 0; border-radius: var(--radius-sm); }
  .course-card--row .course-card__body { padding-top: var(--s-5); }
  .course-card__days { display: block; columns: 2; column-gap: var(--s-6); }
}
/* AIM series on home: two by two, each card a tipped-in plate beside its text. */
@media (min-width: 720px) { .card-grid--series { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) {
  .card-grid--series .course-card { display: grid; grid-template-columns: 42% 1fr; align-items: start; }
  .card-grid--series .course-card__plate { aspect-ratio: 5 / 4; margin: var(--s-4); margin-inline-end: 0; border: 0; border-radius: var(--radius-sm); }
  .card-grid--series .course-card__body { padding-top: var(--s-4); }
}

.steps { list-style: none; display: grid; gap: var(--s-4); }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform var(--t-fast), border-color var(--t-fast);
}
/* Each step carries its plate (step-read/-lab/-done.webp): flush on top at 16:10 from 720px
   (the 4:3 plate keeps its middle 83%, every object in frame), a tipped-in 4:3 thumbnail
   beside the text on phones so the three steps stay compact. Not mirrored in RTL: each
   plate is one centred object, not a direction. */
.step__plate { aspect-ratio: 16 / 10; overflow: hidden; background: var(--art-ground); border-bottom: 1px solid var(--c-border); }
.step__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.step__body { padding: var(--s-4) var(--s-5) var(--s-5); }
@media (max-width: 719.98px) {
  .step { flex-direction: row; align-items: flex-start; }
  .step__plate { flex: none; width: 120px; aspect-ratio: 4 / 3; margin: var(--s-4); margin-inline-end: 0; border: 0; border-radius: var(--radius-sm); }
  .step__body { min-width: 0; padding: var(--s-4); }
}
.step:hover { transform: translateY(-2px); border-color: var(--c-interactive-border); }
.step__num {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--c-soft); color: var(--c-primary); border: 1px solid var(--c-interactive-border);
  font-weight: 750; margin-bottom: var(--s-3); font-family: var(--font-latin);
}
.step__title { font-size: 1.15rem; margin-bottom: var(--s-2); }
.step p { margin: 0; color: var(--c-muted); }

.mini-card, .outcome-card {
  position: relative; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: var(--s-5);
  transition: transform var(--t-fast), border-color var(--t-fast);
}
.mini-card:hover, .outcome-card:hover { transform: translateY(-2px); border-color: var(--c-interactive-border); }
.mini-card__title, .outcome-card__title { font-size: 1.15rem; margin-bottom: var(--s-2); }
.mini-card__text { margin: 0; color: var(--c-muted); font-size: 0.95rem; }
.outcome-card__dl { margin: 0; font-size: 0.95rem; }
.outcome-card__dl dt { font-weight: 650; color: var(--c-muted); font-size: 0.85rem; margin-top: var(--s-3); }
.outcome-card__dl dd { margin: 2px 0 0; }

/* ---------- toolbar / filter / lesson rows ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); padding-bottom: var(--s-4); border-bottom: 1px solid var(--c-border); }
.filter-group { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.filter-btn {
  min-height: 40px; padding: 6px 14px; border-radius: var(--radius-sm); border: 1px solid var(--c-border);
  background: var(--c-surface); color: var(--c-ink); font: inherit; font-size: 0.92rem; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.filter-btn:hover { border-color: var(--c-interactive-border); background: var(--c-soft); }
.filter-btn[aria-pressed="true"] { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-primary-text); }
.search-box { position: relative; flex: 1 1 220px; max-width: 360px; }
.search-box__icon { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--c-muted); width: 18px; height: 18px; }
.search-box__input {
  width: 100%; min-height: 44px; padding: 8px 14px; padding-inline-start: 40px; border-radius: var(--radius-sm);
  border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-ink); font: inherit;
  transition: border-color var(--t-fast);
}
.search-box__input:focus-visible { outline-offset: 0; border-color: var(--c-accent); }
.toolbar__count { margin: 0; margin-inline-start: auto; font-size: 0.9rem; color: var(--c-muted); }
.empty-note { padding: var(--s-5) 0; color: var(--c-muted); }
.lesson-group { padding-top: var(--s-5); }
.lesson-group__title { font-size: 1.25rem; margin-bottom: var(--s-3); }
.lesson-rows { list-style: none; display: grid; gap: var(--s-2); }
.lesson-row {
  position: relative; display: flex; align-items: center; gap: var(--s-3); background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: var(--s-3) var(--s-4);
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.lesson-row:hover { border-color: var(--c-interactive-border); background: var(--c-soft); }
.lesson-row__num {
  flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--c-soft); color: var(--c-ink); font-size: 0.85rem; font-weight: 650; font-family: var(--font-latin);
}
.lesson-row__num .icon { width: 18px; height: 18px; color: var(--c-accent); }
.lesson-row__body { flex: 1; min-width: 0; }
.lesson-row__title { font-weight: 600; }
.lesson-row__meta { margin: 0; font-size: 0.85rem; color: var(--c-muted); }
.status-tick {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--c-border); color: transparent;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.status-tick .icon { width: 16px; height: 16px; }
.is-done > .status-tick { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-primary-text); }
.is-done > .lesson-row__num { background: var(--c-soft); color: var(--c-primary); }
.lesson-rows--compact .lesson-row { padding: var(--s-2) var(--s-3); }
.lesson-row--homework { background: var(--c-soft); }

/* ---------- accordion ---------- */
.accordion { border-top: 1px solid var(--c-border); }
.accordion__item { border-bottom: 1px solid var(--c-border); }
.accordion__q {
  list-style: none; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-1);
  cursor: pointer; font-weight: 600; border-radius: var(--radius-sm);
  transition: color var(--t-fast);
}
.accordion__q::-webkit-details-marker { display: none; }
.accordion__q:hover { color: var(--c-primary); }
.accordion__chev { margin-inline-start: auto; transition: transform var(--t-fast); color: var(--c-muted); }
details[open] > summary .accordion__chev { transform: rotate(180deg); }
.accordion__a { padding: 0 var(--s-1) var(--s-5); }
.accordion__a > :last-child { margin-bottom: 0; }
.day-acc__q { flex-wrap: wrap; }
.day-acc__num { font-size: 0.85rem; color: var(--c-primary); font-weight: 700; min-width: 4.2em; }
.day-acc__title { flex: 1 1 14rem; }
.day-acc__meta { font-size: 0.85rem; color: var(--c-muted); font-weight: 400; }
.day-acc__outcome { color: var(--c-muted); font-size: 0.95rem; }
.day-acc__links { margin-top: var(--s-3); font-size: 0.92rem; }

/* ---------- course hero ---------- */
.course-hero { border-bottom: 1px solid var(--c-border); }
.course-hero__inner { display: grid; gap: var(--s-6); align-items: center; padding-top: var(--s-5); padding-bottom: var(--s-7); }
.course-hero .page-lead { color: var(--c-ink); }
.course-hero .crumbs a, .course-hero .crumbs li { color: var(--c-ink); }
.course-hero .chip { background: var(--c-surface); border-color: var(--c-border); }
.course-hero__art {
  position: relative; overflow: hidden; aspect-ratio: 16 / 10; border-radius: var(--radius);
  background: var(--art-ground); box-shadow: var(--shadow); border: 1px solid var(--c-border);
}
.course-hero__img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* catalogue index on the plate: part number or the AIM tag, set like an engraved label */
.course-hero__index {
  position: absolute; inset-block-start: var(--s-3); inset-inline-start: var(--s-3);
  font: 700 0.75rem/1 var(--font-latin); letter-spacing: 0.14em; color: var(--art-ink);
  padding: 6px 8px 5px; border: 1px solid var(--art-rule); border-radius: 4px;
  background: var(--art-ground); /* stays legible where a cover puts paper in this corner */
}
@media (min-width: 1024px) {
  .course-hero__inner { grid-template-columns: minmax(0, 1fr) 420px; }
  .course-hero__art { aspect-ratio: 5 / 4; }
}

/* ---------- page grid with course aside ---------- */
.page-grid { display: block; }
.page-main { min-width: 0; max-width: var(--w-main); }
@media (min-width: 1024px) {
  .page-grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--w-aside); gap: var(--s-7); align-items: start; }
  .course-aside, .page-aside { position: sticky; top: calc(var(--header-h) + var(--s-4)); max-height: calc(100vh - var(--header-h) - var(--s-6)); overflow: auto; margin-top: var(--s-5); padding-bottom: var(--s-4); }
  .page--course .course-aside { margin-top: var(--s-6); }
}
.aside-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.outline-toggle {
  display: flex; align-items: center; gap: var(--s-2); width: 100%; padding: var(--s-3) var(--s-4);
  border: 0; background: transparent; color: var(--c-ink); font: inherit; text-align: start; cursor: pointer; border-radius: var(--radius) var(--radius) 0 0;
  transition: background var(--t-fast);
}
.outline-toggle:hover { background: var(--c-soft); }
.outline-toggle__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.outline-toggle__meta { font-size: 0.8rem; color: var(--c-muted); }
.outline-toggle__title { font-weight: 650; font-size: 0.95rem; }
.outline-toggle__chev { color: var(--c-muted); transition: transform var(--t-fast); }
.outline-toggle[aria-expanded="true"] .outline-toggle__chev { transform: rotate(180deg); }
.progress--aside { margin: 0; padding: 0 var(--s-4) var(--s-3); }
.outline { border-top: 1px solid var(--c-border); padding: var(--s-2) var(--s-2) var(--s-3); }
.outline.is-collapsed { display: none; }
.outline__days, .outline__items, .outline__end { list-style: none; }
.outline__summary {
  list-style: none; display: grid; grid-template-columns: 1fr auto; gap: 0 var(--s-2); padding: var(--s-2);
  cursor: pointer; border-radius: var(--radius-sm);
  transition: background var(--t-fast);
}
.outline__summary::-webkit-details-marker { display: none; }
.outline__summary:hover { background: var(--c-soft); }
.outline__daynum { font-size: 0.75rem; color: var(--c-muted); font-weight: 650; grid-column: 1; }
.outline__daytitle { font-size: 0.9rem; font-weight: 600; grid-column: 1; line-height: 1.35; }
.outline__chev { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 16px; height: 16px; color: var(--c-muted); transition: transform var(--t-fast); }
.outline__day[open] .outline__chev { transform: rotate(180deg); }
.outline__items { padding: 0 0 var(--s-2); }
.outline__link {
  display: flex; align-items: flex-start; gap: var(--s-2); padding: 6px var(--s-2); padding-inline-start: var(--s-3);
  border-radius: var(--radius-sm); color: var(--c-ink); text-decoration: none; font-size: 0.88rem; line-height: 1.4;
  transition: background var(--t-fast), color var(--t-fast);
}
.outline__link:hover { background: var(--c-soft); color: var(--c-ink); }
.outline__link[aria-current="page"] { background: var(--c-soft); font-weight: 650; box-shadow: inset 3px 0 0 var(--c-primary); }
[dir="rtl"] .outline__link[aria-current="page"] { box-shadow: inset -3px 0 0 var(--c-primary); }
.outline__link--overview, .outline__link--homework { color: var(--c-muted); font-style: normal; }
.outline__tick {
  flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-top: 1px;
  border-radius: 50%; border: 1.5px solid var(--c-border); color: transparent;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.outline__tick .icon { width: 12px; height: 12px; }
.outline__link.is-done .outline__tick { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-primary-text); }
.outline__end { border-top: 1px solid var(--c-border); margin-top: var(--s-2); padding-top: var(--s-2); }

/* Table of Contents */
.toc { margin-top: var(--s-5); padding-inline: var(--s-2); }
.toc__title { font-size: 0.8rem; font-weight: 650; color: var(--c-muted); margin-bottom: var(--s-2); text-transform: uppercase; letter-spacing: 0.04em; }
html[lang="ar"] .toc__title { text-transform: none; letter-spacing: 0; }
.toc ul { list-style: none; border-inline-start: 2px solid var(--c-border); position: relative; }
.toc a {
  display: block; padding: 6px var(--s-3); margin-inline-start: -2px; border-inline-start: 2px solid transparent;
  color: var(--c-muted); text-decoration: none; font-size: 0.9rem;
  transition: color var(--t-fast), border-inline-start-color var(--t-fast);
}
.toc a:hover { color: var(--c-ink); }
.toc a.is-active { color: var(--c-primary); font-weight: 650; border-inline-start-color: var(--c-primary); }
.drawer__head { display: none; }

/* Outline bar and drawer on small screens */
.outline-bar {
  position: sticky; top: var(--header-h); z-index: 20; display: flex; align-items: center; gap: var(--s-3); width: 100%;
  padding: var(--s-2) var(--s-4); min-height: 52px; border: 0; border-bottom: 1px solid var(--c-border);
  background: var(--c-surface); color: var(--c-ink); font: inherit; text-align: start; cursor: pointer;
  backdrop-filter: blur(8px);
}
.outline-bar__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.outline-bar__meta { font-size: 0.8rem; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.outline-bar__title { font-weight: 650; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Backdrop with smooth fade */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgb(0 0 0 / 0.45); z-index: 40;
  animation: fadeIn 220ms var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 1024px) { .outline-bar, .drawer-backdrop { display: none !important; } }
@media (max-width: 1023.98px) {
  .course-aside {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 50; max-height: 85vh; overflow: auto;
    background: var(--c-surface); border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -8px 30px rgb(0 0 0 / 0.25);
    transform: translateY(100%); visibility: hidden;
    transition: transform 260ms var(--ease), visibility 0s linear 260ms;
    padding-bottom: var(--s-5);
  }
  .course-aside.is-open { transform: translateY(0); visibility: visible; transition: transform 260ms var(--ease); }
  .drawer__head {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1;
    padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4); background: var(--c-surface); border-bottom: 1px solid var(--c-border);
  }
  [dir="rtl"] .drawer__head { padding: var(--s-2) var(--s-4) var(--s-2) var(--s-2); }
  .drawer__title { margin: 0; font-weight: 700; font-size: 1.1rem; }
  .course-aside .aside-card { border: 0; border-radius: 0; box-shadow: none; }
  .course-aside .outline-toggle { display: none; }
  .course-aside .outline.is-collapsed { display: block; }
  .course-aside .progress--aside { padding-top: var(--s-3); }
  .course-aside .toc, .page-aside { display: none; }
  body.has-drawer, html.has-drawer { overflow: hidden; }
}

/* ---------- lesson ---------- */
.lesson-section { padding-top: var(--s-7); scroll-margin-top: calc(var(--header-h) + 16px); }
.video-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--c-base); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-frame--empty {
  background: linear-gradient(135deg, var(--c-soft) 0%, var(--c-page-glow) 100%);
  color: var(--c-ink); display: grid; place-items: center; border-bottom: 1px solid var(--c-border);
}
.video-frame__empty { text-align: center; padding: var(--s-4); }
.video-frame__icon { color: var(--c-accent); opacity: 0.95; margin-bottom: var(--s-2); }
.video-frame__title { font-weight: 650; font-size: 1.2rem; margin: 0; color: var(--c-ink); }
.video-frame__sub { margin: var(--s-1) 0 0; color: var(--c-muted); font-size: 0.95rem; }
/* No-video state with the still: the render sits behind the honest label, which keeps the
   start-top corner (open blue ground in both directions; the still mirrors in RTL). */
.video-frame--still { background: var(--art-ground); display: block; border-bottom: 1px solid var(--c-border); }
.video-frame__still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
[dir="rtl"] .video-frame__still { transform: scaleX(-1); }
.video-frame--still .video-frame__empty {
  position: absolute; inset-block-start: 0; inset-inline-start: 0; max-width: 58%; text-align: start;
  padding: clamp(14px, 6%, 44px) clamp(18px, 9%, 80px);
}
.video-frame--still .video-frame__icon { width: clamp(28px, 6vw, 40px); height: auto; color: var(--art-brass); }
.video-frame--still .video-frame__title { color: var(--art-ink); font-size: clamp(1rem, 0.8rem + 1vw, 1.3rem); }
.video-frame--still .video-frame__sub { color: var(--art-ink-soft); font-size: clamp(0.85rem, 0.78rem + 0.4vw, 0.95rem); }

/* Tabs with sliding pill */
.tabs__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--c-border); }
.tabs__caption { margin: 0; font-weight: 650; font-size: 0.95rem; }
.tabs__list { position: relative; display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: var(--c-soft); border: 1px solid var(--c-border); }
.tabs__pill {
  position: absolute; top: 3px; bottom: 3px; border-radius: var(--radius-pill);
  background: var(--c-surface); box-shadow: var(--shadow-sm);
  transition: inset-inline-start 220ms var(--ease), inset-inline-end 220ms var(--ease), width 220ms var(--ease);
  pointer-events: none;
}
.tabs__tab {
  position: relative; z-index: 1; min-height: 36px; padding: 4px 14px; border: 0; border-radius: var(--radius-pill); background: transparent;
  color: var(--c-muted); font: inherit; font-size: 0.9rem; font-weight: 650; cursor: pointer;
  transition: color var(--t-fast);
}
.tabs__tab[aria-selected="true"] { color: var(--c-ink); }
.tabs__panel { padding: var(--s-4) var(--s-4) var(--s-2); }

.example {
  border-inline-start: 4px solid var(--c-accent); background: var(--c-surface);
  border: 1px solid var(--c-border); border-inline-start-width: 4px;
  padding: var(--s-4) var(--s-5); border-radius: var(--radius-sm); margin-bottom: var(--s-4);
}
.example > :last-child { margin-bottom: 0; }
.rule {
  background: var(--c-soft); color: var(--c-ink); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: var(--s-4) var(--s-5); margin-bottom: var(--s-4);
}
.rule--lead { margin-top: var(--s-2); }
.rule__label { font-size: 0.82rem; font-weight: 700; margin: 0 0 var(--s-1); color: var(--c-accent); }
.rule__text { font-size: 1.2rem; font-weight: 650; margin: 0; line-height: 1.6; }

.pitfall { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: var(--s-4) var(--s-5); }
.pitfall__label { font-weight: 700; color: var(--c-accent); margin-bottom: var(--s-1); }
.pitfall > :last-child { margin-bottom: 0; }
.exercise { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: var(--s-2) var(--s-5) var(--s-5); margin-top: var(--s-4); }
.tick-row { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; cursor: pointer; font-weight: 600; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--c-primary); margin: 0; flex: none; }
.choice { border: 0; padding: 0; margin: var(--s-4) 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.choice__legend { font-weight: 650; margin-bottom: var(--s-2); padding: 0; width: 100%; }
.choice__opt {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 6px 16px; cursor: pointer;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.choice__opt:hover { border-color: var(--c-interactive-border); }
.choice__opt:has(input:checked) { border-color: var(--c-primary); background: var(--c-soft); font-weight: 650; }
.choice__opt:has(input:focus-visible) { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.choice__opt input:focus-visible { outline: none; }
.field-label { display: block; font-weight: 650; margin-top: var(--s-3); margin-bottom: var(--s-1); }
.field {
  width: 100%; padding: var(--s-3); border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-surface); color: var(--c-ink); font: inherit; resize: vertical;
}
.field-hint { font-size: 0.85rem; color: var(--c-muted); margin: var(--s-1) 0 0; }
.complete-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: var(--s-4) var(--s-5); box-shadow: var(--shadow-sm); }
.complete-row .progress { flex: 1 1 200px; margin: 0; }
.btn__check { display: none; }
.btn--complete[aria-pressed="true"] { background: var(--c-soft); color: var(--c-primary); border-color: var(--c-primary); }
.btn--complete[aria-pressed="true"] .btn__check { display: inline; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--c-border); }
.pager__link {
  display: flex; align-items: center; gap: var(--s-3); min-height: 72px; padding: var(--s-3) var(--s-4);
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); color: var(--c-ink); text-decoration: none;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.pager__link:hover { border-color: var(--c-interactive-border); color: var(--c-ink); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.pager__link--next { justify-content: flex-end; text-align: end; }
.pager__text { display: flex; flex-direction: column; min-width: 0; }
.pager__dir { font-size: 0.8rem; color: var(--c-muted); }
.pager__title { font-weight: 650; font-size: 0.95rem; line-height: 1.35; }
.pager__icon { flex: none; color: var(--c-accent); }
@media (max-width: 480px) { .pager__icon { display: none; } .pager__link { padding: var(--s-3); } }

/* ---------- review and completion ---------- */
.score { font-size: 1.1rem; font-weight: 700; color: var(--c-primary); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: var(--s-3) var(--s-4); display: inline-block; }
.review-day { padding-top: var(--s-5); }
.choice--review { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: var(--s-4); margin: 0 0 var(--s-3); display: block; }
.choice--review .choice__legend { float: left; width: 100%; }
[dir="rtl"] .choice--review .choice__legend { float: right; }
.choice__q { clear: both; color: var(--c-muted); font-size: 0.95rem; }
.choice__num { color: var(--c-primary); font-family: var(--font-latin); }
.choice__opts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.choice__link { font-size: 0.9rem; margin-inline-start: auto; }
.completion { display: flex; flex-wrap: wrap; gap: var(--s-5); align-items: center; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: var(--s-5); margin-top: var(--s-4); }
.completion__mark span {
  width: 112px; height: 112px; display: grid; place-items: center; border-radius: 50%;
  border: 4px dashed var(--c-border); color: var(--c-muted); font-size: 2.8rem; font-weight: 800; font-family: var(--font-latin);
}
.completion.is-done .completion__mark span { border: 4px solid var(--c-accent); background: var(--c-primary); color: var(--c-primary-text); }
.completion__body { flex: 1 1 240px; }
.completion__name { font-size: 1.5rem; margin-bottom: var(--s-2); }
.completion__status { font-weight: 650; }
.remaining { list-style: none; display: grid; gap: var(--s-1); }
.remaining li::before { content: "\25CB"; color: var(--c-muted); margin-inline-end: var(--s-2); }
.remaining .is-done { display: none; }
/* Completion emblem (both tracks): a standalone award emblem between the completion box
   and the lessons list, no card around it. The markup ships hidden and app.js reveals it
   only when every lesson of the course is marked complete ([hidden] keeps winning over
   this display rule). Shape per course from src/templates/badges.mjs: medallion
   (foundation), hexagon (applied), shield (synthesis); see DESIGN.md "Completion emblems".
   The emblem is the same in both themes, like the art: cobalt field, aluminium edge and
   one brass plate in the fixed art colours, with the glyph and course name in --art-ink on
   the cobalt and the earned label in --art-ground on the brass. Everything inside scales
   with the emblem's own width (container units), so a name that fits at one width fits at
   all. Nothing mirrors in RTL (every shape is symmetric; glyphs are identities). */
.badge {
  position: relative; width: min(100%, 22rem); margin: var(--s-6) auto var(--s-2);
  container-type: inline-size; aspect-ratio: 1 / 1;
  filter: drop-shadow(0 6px 14px rgb(2 39 119 / 0.22));
}
.badge--hexagon { aspect-ratio: 100 / 112; }
.badge--shield { aspect-ratio: 100 / 118; }
.badge__art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.badge__metal { fill: var(--art-ink-soft); stroke: var(--art-ground); stroke-opacity: 0.35; stroke-width: 0.5; }
.badge__field { fill: var(--art-ground); }
.badge__rim { fill: none; stroke: var(--art-rule); stroke-width: 0.5; }
.badge__knurl { fill: none; stroke: var(--art-ground); stroke-opacity: 0.5; stroke-width: 0.7; stroke-linecap: round; }
.badge__knurl--brass { stroke-opacity: 0.4; stroke-width: 0.6; }
.badge__plate { fill: var(--art-brass); }
.badge__shade { fill: color-mix(in srgb, var(--art-brass) 80%, var(--art-ground)); }
.badge__fold { fill: color-mix(in srgb, var(--art-brass) 40%, var(--art-ground)); }
.badge__engrave { fill: none; stroke: var(--art-ground); stroke-opacity: 0.3; stroke-width: 0.45; }
.badge__chevron { fill: none; stroke: var(--art-ink-soft); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.badge__glyph, .badge__label, .badge__course { position: absolute; margin: 0; }
.badge__glyph { left: 42.5%; width: 15%; top: 15%; height: 15%; color: var(--art-ink); }
.badge__glyph .glyph { display: block; width: 100%; height: 100%; }
.badge__label, .badge__course { display: flex; align-items: center; justify-content: center; text-align: center; }
.badge__label {
  inset-inline: 13%; top: 63%; height: 14.5%;
  color: var(--art-ground); font: 800 0.95rem/1 var(--font-latin-display); font-size: 4.5cqi;
  text-transform: uppercase; letter-spacing: 0.14em; padding-left: 0.14em;
}
.badge__course {
  inset-inline: 16%; top: 33.5%; bottom: 39.5%;
  color: var(--art-ink); font: 800 1.5rem/1.12 var(--font-latin-display); font-size: 7cqi;
  letter-spacing: -0.01em; text-wrap: balance; overflow-wrap: anywhere;
}
.badge__course--short { font-size: 2.6rem; font-size: 12cqi; letter-spacing: -0.025em; }
html[lang="ar"] .badge__label { font: 700 1.15rem/1.4 var(--font-ar); font-size: 5.4cqi; text-transform: none; letter-spacing: normal; padding-left: 0; }
html[lang="ar"] .badge__course { font: 700 1.35rem/1.5 var(--font-ar); font-size: 6.4cqi; letter-spacing: normal; }
html[lang="ar"] .badge__course--short { font-size: 2.4rem; font-size: 11cqi; line-height: 1.4; }
html[lang="ar"] .badge__course :lang(en) { font-family: var(--font-latin-display); line-height: 1.12; }
/* A long course name sets as its curated face (badges.mjs BADGE_FACES): one or two words
   large and bold, then a short context line in regular weight and the softer aluminium ink,
   at about half the headline's size, with open cobalt around both. The exact name is the
   sr-only span; the two visible lines are aria-hidden. */
.badge__course--split { flex-direction: column; gap: 3.2cqi; inset-inline: 13%; top: 31.5%; bottom: 38%; }
.badge__headline, .badge__context { display: block; max-width: 100%; }
.badge__headline { font-size: 2.1rem; font-size: 9.6cqi; line-height: 1.04; letter-spacing: -0.02em; }
.badge__context {
  color: var(--art-ink-soft); font-weight: 500; font-size: 1.05rem; font-size: 5cqi;
  line-height: 1.3; letter-spacing: 0.005em; max-width: 30ch;
}
html[lang="ar"] .badge__headline { font-weight: 700; font-size: 1.9rem; font-size: 8.6cqi; line-height: 1.45; letter-spacing: normal; }
html[lang="ar"] .badge__context { font-weight: 500; font-size: 1.1rem; font-size: 5.2cqi; line-height: 1.6; letter-spacing: normal; }
/* hexagon: the plate's straight top band carries the label, the chevron hangs below it */
.badge--hexagon .badge__glyph { left: 43%; width: 14%; top: 12.5%; height: 12.5%; }
.badge--hexagon .badge__label { inset-inline: 12%; top: 57.1%; height: 9.8%; }
.badge--hexagon .badge__course { inset-inline: 11%; top: 27.7%; bottom: 45.5%; }
/* shield: the brass chief carries the label, the glyph and name sit in the field below */
.badge--shield .badge__label { inset-inline: 11%; top: 6.4%; height: 13.1%; }
.badge--shield .badge__glyph { left: 43.5%; width: 13%; top: 28%; height: 11%; }
.badge--shield .badge__course { inset-inline: 17%; top: 41.5%; bottom: 33.9%; }
/* the two-line face's box per shape: a little wider than the whole-name box, and in the
   shield running further into the point, so both lines keep open cobalt around them */
.badge--hexagon .badge__course--split { inset-inline: 12%; top: 26.5%; bottom: 44%; gap: 2.6cqi; }
.badge--shield .badge__course--split { inset-inline: 14%; top: 41.5%; bottom: 24.5%; }
html[lang="en"] .badge--shield .badge__headline { font-size: 1.85rem; font-size: 8.4cqi; }
.status-note { color: var(--c-primary); font-weight: 650; min-height: 1.5em; }

/* ---------- help ---------- */
.faq-group { padding-top: var(--s-6); scroll-margin-top: calc(var(--header-h) + 16px); }
.page-grid--help .page-aside { margin-top: var(--s-8); }

/* ---------- footer ---------- */
/* Footer uses dark base/ink pair in light mode and dark mode */
.site-footer {
  background: #101a29;
  color: #ecf3fb;
  border-top: 1px solid var(--c-border);
}
.site-footer__inner { max-width: var(--w-page); margin-inline: auto; padding: var(--s-7) var(--s-4) var(--s-6); }
@media (min-width: 640px) { .site-footer__inner { padding-inline: var(--s-5); } }
.footer-nav { display: grid; gap: var(--s-6); grid-template-columns: 1fr; }
@media (min-width: 640px) { .footer-nav { grid-template-columns: repeat(3, 1fr); } }
.footer-col__title { font-size: 0.85rem; color: #afbdd0; font-weight: 650; margin-bottom: var(--s-3); text-transform: uppercase; letter-spacing: 0.04em; }
html[lang="ar"] .footer-col__title { text-transform: none; letter-spacing: 0; }
.footer-col ul { list-style: none; display: grid; gap: var(--s-1); }
.site-footer a { color: #ecf3fb; text-decoration: none; font-size: 0.92rem; transition: color var(--t-fast); }
.site-footer a:hover { text-decoration: underline; color: #a4c3ff; }
.site-footer :focus-visible { outline-color: #a4c3ff; }
.footer-bottom { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid rgb(255 255 255 / 0.1); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-5); }
.footer-bottom__brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-latin-display); font-weight: 800; margin: 0; font-size: 1.05rem; }
.footer-bottom__mark { flex: none; }
.footer-bottom__mark .mark__tile { stroke: rgb(255 255 255 / 0.18); }
html[lang="ar"] .footer-bottom__brand { font-family: var(--font-ar); font-weight: 700; }
.footer-bottom__note { margin: 0; color: #afbdd0; font-size: 0.88rem; flex: 1 1 18rem; }
.lang-link--footer { color: #ecf3fb; border: 1px solid rgb(255 255 255 / 0.2); }
.lang-link--footer:hover { background: rgb(255 255 255 / 0.1); color: #ecf3fb; }

/* ---------- root language chooser ---------- */
.root-choose { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: var(--s-5); }
.root-choose__list { list-style: none; display: flex; gap: var(--s-3); }

/* ---------- subtle content entrance fade and rise ---------- */
.reveal-init {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 320ms var(--ease), transform 320ms var(--ease);
}
.reveal-init.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .reveal-init { opacity: 1 !important; transform: none !important; }
  .course-card:hover .course-card__img { transform: none !important; }
  .course-card:hover, .step:hover, .mini-card:hover, .outcome-card:hover, .resume-card:hover, .pager__link:hover { transform: none !important; }
}

/* ---------- lesson sections built from the day snapshots ---------- */
.slide-points { list-style: none; display: grid; gap: var(--s-2); margin: 0 0 var(--s-4); }
.slide-points li { position: relative; padding-inline-start: var(--s-5); }
.slide-points li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.55em; width: 8px; height: 8px; border-radius: 50%; background: var(--c-accent); opacity: 0.85; }
.takeaway { display: flex; align-items: flex-start; gap: var(--s-2); background: var(--c-soft); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: var(--s-3) var(--s-4); font-weight: 600; margin: 0 0 var(--s-4); }
.takeaway__icon { color: var(--c-accent); margin-top: 0.2em; }
.slide-emph { font-size: 1.15em; font-weight: 700; color: var(--c-primary); margin: 0 0 var(--s-4); }
.lesson-section { margin-top: var(--s-6); }
.lesson-section > .section__title { margin-bottom: var(--s-4); }
/* quiet lesson rhythm: the first section follows the heading block without a double gap */
.lesson > .page-head + .lesson-section, .lesson > .lesson-lead + .lesson-section { margin-top: 0; padding-top: var(--s-5); }
.lesson-section > :last-child { margin-bottom: 0; }

/* ---------- labs ---------- */
.lab-callout { background: var(--c-surface); border: 1px solid var(--c-border); border-inline-start: 4px solid var(--c-accent); border-radius: var(--radius-sm); padding: var(--s-4) var(--s-5); }
.lab-callout__label { display: flex; align-items: center; gap: var(--s-2); font-weight: 700; color: var(--c-accent); margin-bottom: var(--s-3); }
.lesson-row--lab .lesson-row__num { color: var(--c-accent); }
.lab-nosheet { color: var(--c-muted); } /* a lab without a step sheet: the note above its description */
.outline__link--lab .outline__label { font-weight: 600; }
.lab-steps { list-style: none; display: grid; gap: var(--s-4); margin: 0 0 var(--s-4); counter-reset: none; }
.lab-step { display: flex; gap: var(--s-4); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: var(--s-4) var(--s-5); box-shadow: var(--shadow-sm); }
.lab-step__num { flex: none; width: 2.2em; height: 2.2em; display: grid; place-content: center; background: var(--c-soft); color: var(--c-primary); border: 1px solid var(--c-interactive-border); border-radius: 50%; font-weight: 700; margin: 0; }
.lab-step__body { flex: 1 1 auto; min-width: 0; }
.lab-step__body > :last-child { margin-bottom: 0; }
.lab-step__notes { list-style: none; display: grid; gap: var(--s-1); margin: var(--s-2) 0 var(--s-3); font-size: 0.92rem; color: var(--c-muted); }
.lab-step__notes li { position: relative; padding-inline-start: var(--s-4); }
.lab-step__notes li::before { content: "*"; position: absolute; inset-inline-start: 0; color: var(--c-accent); font-weight: 700; }

/* ---------- copyable cards ---------- */
.copy-card { background: var(--c-soft); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: var(--s-3) var(--s-4); margin-top: var(--s-3); }
.copy-card__name { font-weight: 700; margin: 0 0 var(--s-2); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.copy-card__badge { font-size: 0.78rem; font-weight: 600; color: var(--c-muted); border: 1px solid var(--c-border); border-radius: var(--radius-pill); padding: 1px var(--s-2); background: var(--c-surface); }
.copy-card__text { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88rem; line-height: 1.6; margin: 0 0 var(--s-3); white-space: pre-wrap; word-break: break-word; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: var(--s-3) var(--s-4); max-height: 22rem; overflow: auto; color: var(--c-ink); }
html[lang="ar"] .copy-card__text { font-family: var(--font-ar); font-size: 0.95rem; letter-spacing: normal; }
.copy-card__text:lang(ar) { font-family: var(--font-ar); letter-spacing: normal; }
.copy-card__row { display: flex; align-items: center; gap: var(--s-3); }
.copy-card__status { font-weight: 600; color: var(--c-primary); min-height: 1.2em; }
.btn__icon { margin-inline-end: var(--s-1); }

/* ---------- course card subtitle ---------- */
.course-card__sub { color: var(--c-muted); font-size: 0.95rem; margin: 0 0 var(--s-2); }

/* ---------- check your understanding (lesson card) ---------- */
.quiz {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: var(--s-5); box-shadow: var(--shadow-sm);
}
.quiz__intro > :last-child,
.quiz__panel > :last-child { margin-bottom: 0; }
.quiz__status { min-height: 0; margin: 0 0 var(--s-2); font-size: 0.9rem; color: var(--c-muted); }
.quiz__status:empty { margin: 0; }
.quiz__note {
  font-size: 0.9rem; color: var(--c-muted); background: var(--c-soft);
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  padding: var(--s-2) var(--s-3);
}
.quiz__off { margin: var(--s-3) 0 0; font-weight: 650; color: var(--c-muted); } /* legacy hook; the unconfigured reflection card is no longer rendered */
.quiz__intro .btn { margin-top: var(--s-4); }
.quiz__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-4); }
.quiz__actions .btn { flex: 1 1 12rem; }
@media (min-width: 640px) { .quiz__actions .btn { flex: 0 0 auto; min-width: 10rem; } }
.quiz__progress { margin: 0 0 var(--s-2); font-size: 0.85rem; font-weight: 700; color: var(--c-accent); }
.quiz__ack {
  margin: 0 0 var(--s-3); font-size: 0.95rem; color: var(--c-muted);
  border-inline-start: 3px solid var(--c-border); padding-inline-start: var(--s-3);
}
.quiz__question { font-size: 1.3rem; margin: 0 0 var(--s-4); }
.quiz__input { min-height: 9rem; }
.quiz__history { margin-top: var(--s-4); border-top: 1px solid var(--c-border); padding-top: var(--s-2); }
.quiz__history__summary {
  list-style: none; display: flex; align-items: center; min-height: 44px; cursor: pointer;
  font-weight: 650; color: var(--c-primary); border-radius: var(--radius-sm);
}
.quiz__history__summary::-webkit-details-marker { display: none; }
.quiz__history__summary:hover { color: var(--c-primary-hover); }
.quiz__history__list { list-style: none; display: grid; gap: var(--s-3); padding: var(--s-2) 0 0; }
.quiz__hist { border: 1px solid var(--c-border); background: var(--c-soft); border-radius: var(--radius-sm); padding: var(--s-3); }
.quiz__hist > :last-child { margin-bottom: 0; }
.quiz__hist__q, .quiz__hist__a { margin: 0; font-size: 0.92rem; overflow-wrap: break-word; }
.quiz__hist__a { margin-top: var(--s-1); }
.quiz__hist__label { font-weight: 700; color: var(--c-muted); }
.quiz__feedback { border-top: 1px solid var(--c-border); margin-top: var(--s-4); padding-top: var(--s-2); }
.quiz__panel--feedback .quiz__fbtitle { margin-bottom: 0; }
.quiz__fbhead { font-size: 1.05rem; margin: var(--s-4) 0 var(--s-1); }
.quiz__fbtext { overflow-wrap: break-word; }
.quiz__errorbox {
  border: 1px solid var(--c-accent); background: var(--c-soft); border-radius: var(--radius-sm);
  padding: var(--s-3) var(--s-4); margin-top: var(--s-4);
}
.quiz__error { margin: 0 0 var(--s-3); font-weight: 650; overflow-wrap: break-word; }
@media (max-width: 639.98px) { .quiz { padding: var(--s-4); } }

/* ---------- knowledge check (quiz checkpoint, multiple choice) ---------- */
.checkpoint {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: var(--s-5); box-shadow: var(--shadow-sm);
}
.checkpoint__intro { margin: 0; }
.checkpoint__start { margin: var(--s-4) 0 0; }
.checkpoint__start .btn { min-width: 10rem; }
.checkpoint__live > :last-child { margin-bottom: 0; }
.checkpoint__progress { margin: 0 0 var(--s-3); font-size: 0.85rem; font-weight: 700; color: var(--c-accent); }
.checkpoint__question { font-size: 1.25rem; margin: 0 0 var(--s-4); }
.checkpoint__options { display: grid; gap: var(--s-2); margin: 0 0 var(--s-2); padding: 0; border: 0; }
.checkpoint__option {
  display: flex; align-items: flex-start; gap: var(--s-3);
  padding: var(--s-3); border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-base); cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.checkpoint__option:hover { background: var(--c-soft); border-color: var(--c-interactive-border); }
.checkpoint__option input {
  flex: none; width: 1.15rem; height: 1.15rem; margin: 0.15em 0 0;
  accent-color: var(--c-primary); cursor: pointer;
}
.checkpoint__option-text { overflow-wrap: break-word; }
.checkpoint__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-4); }
.checkpoint__actions .btn { flex: 1 1 10rem; }
@media (min-width: 640px) { .checkpoint__actions .btn { flex: 0 0 auto; min-width: 9rem; } }
.checkpoint__hint { margin: var(--s-2) 0 0; font-size: 0.85rem; color: var(--c-muted); }
.checkpoint__score { font-size: 1.45rem; margin: 0 0 var(--s-4); }
.checkpoint__review { border-top: 1px solid var(--c-border); margin-top: var(--s-2); padding-top: var(--s-2); }
.checkpoint__review-title { font-size: 1.1rem; margin: var(--s-2) 0 var(--s-3); }
.checkpoint__review-list { list-style: none; display: grid; gap: var(--s-3); margin: 0 0 var(--s-4); }
.checkpoint__review-item {
  border: 1px solid var(--c-border); border-inline-start-width: 4px; border-radius: var(--radius-sm);
  background: var(--c-soft); padding: var(--s-3);
}
.checkpoint__review-item.is-right { border-inline-start-color: var(--c-primary); }
.checkpoint__review-item.is-wrong { border-inline-start-color: var(--c-accent); }
.checkpoint__review-item > :last-child { margin-bottom: 0; }
.checkpoint__review-q { font-weight: 650; margin: 0 0 var(--s-1); overflow-wrap: break-word; }
.checkpoint__review-verdict { margin: 0 0 var(--s-1); font-weight: 700; font-size: 0.9rem; color: var(--c-muted); }
.checkpoint__review-line { margin: 0 0 var(--s-1); font-size: 0.95rem; overflow-wrap: break-word; }
.checkpoint__review-why { margin: 0; font-size: 0.95rem; color: var(--c-muted); overflow-wrap: break-word; }
@media (max-width: 639.98px) { .checkpoint { padding: var(--s-4); } }

/* ---------- Supplemental AIM track ---------- */
/* Same tokens and conventions as the rest of the site; the AIM identity is carried by the
   track tag text and one tinted band, not by a new palette. */
.menu__heading--sub { margin-top: var(--s-4); }
.course-hero--sup { background: var(--c-soft); }
.sup-tag { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-muted); margin: 0 0 var(--s-2); }
.sup-example { border-inline-start: 3px solid var(--c-accent); padding-inline-start: var(--s-4); }
.sup-box { background: var(--c-soft); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: var(--s-4) var(--s-5); }
.sup-box .slide-points li::before { background: var(--c-primary); }
.sup-artifact { font-weight: 600; background: var(--c-surface); border: 1px dashed var(--c-interactive-border); border-radius: var(--radius-sm); padding: var(--s-3) var(--s-4); }
.sup-ref { background: var(--c-soft); border: 1px solid var(--c-border); border-radius: var(--radius); padding: var(--s-4) var(--s-5); margin: var(--s-6) 0 0; }
.sup-ref__row { display: flex; align-items: center; gap: var(--s-2); margin: 0; font-weight: 600; }
.sup-ref__row .icon { color: var(--c-accent); }

/* ---------- visual identity: art ground, brand mark, glyph vocabulary ---------- */
/* The art is the same in both themes (a deep cobalt ground), so its overlay colours are
   fixed rather than theme tokens. --art-ground is the ground's mean colour across the
   plates, shown while an image decodes; the inks are tints of the same hue. Ink on the
   ground measures above 12:1, the soft ink above 9:1. See DESIGN.md. */
:root {
  --art-ground: #022777;
  --art-ink: #f3f6fc;
  --art-ink-soft: #cad7f2;
  --art-rule: rgb(243 246 252 / 0.5);
  --art-brass: #c9a25e;
}
.mark { flex: none; display: block; }
.mark__tile { stroke: transparent; stroke-width: 1; }
:root[data-theme="dark"] .mark__tile { stroke: var(--c-interactive-border); }
.glyph { flex: none; vertical-align: middle; }
.eyebrow--glyph { display: flex; align-items: center; gap: var(--s-2); }
.eyebrow--glyph .glyph { color: var(--c-accent); }
.lesson-group__title { display: flex; align-items: center; gap: var(--s-3); }
.lesson-group__glyph { width: 22px; height: 22px; color: var(--c-accent); }

/* Page banners (completion pages, live sessions): complete.webp / live.webp in an
   aria-hidden layer, the page's own h1 set over the open cobalt at the start-top in the fixed
   art ink (same colours in both themes, like the still's label). The plate mirrors in RTL so
   the open cobalt stays under the heading. 2:1 keeps every object in frame (the 16:9 plate
   loses only open cobalt above and below). On phones the completion plate's open cobalt is
   too narrow for the heading, so there it sets below the plate in the page ink instead. */
.art-banner {
  /* overflow stays visible so the 2:1 box grows rather than clip a longer heading; only
     the art layer clips */
  position: relative; aspect-ratio: 2 / 1; margin: 0 0 var(--s-4);
  border-radius: var(--radius); background: var(--art-ground); border: 1px solid var(--c-border); box-shadow: var(--shadow-sm);
}
.page-head .art-banner:last-child { margin-bottom: 0; }
.art-banner__art { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.art-banner__img { display: block; width: 100%; height: 100%; object-fit: cover; }
[dir="rtl"] .art-banner__img { transform: scaleX(-1); }
.art-banner__title {
  position: relative; margin: 0; padding: var(--s-4); max-width: 62%;
  color: var(--art-ink); font-size: clamp(1.6rem, 1rem + 2.2vw, 2.5rem);
}
@media (min-width: 640px) { .art-banner__title { padding: var(--s-5); } }
@media (max-width: 639.98px) {
  .art-banner--complete { aspect-ratio: auto; background: none; border: 0; box-shadow: none; border-radius: 0; }
  .art-banner--complete .art-banner__art {
    position: relative; aspect-ratio: 2 / 1;
    border-radius: var(--radius); background: var(--art-ground); border: 1px solid var(--c-border);
  }
  .art-banner--complete .art-banner__title { color: var(--c-ink); padding: var(--s-4) 0 0; max-width: none; }
}

/* AIM Practice Series strip above the series method list (series-banner.webp, 21:9). The
   groups read Master, Build, Orchestrate in order; it mirrors in RTL so the first group the
   eye meets (at the right) is still the folio, matching the list's first item. 3:1 from
   640px trims only open cobalt above and below; on phones it runs edge to edge at 2.2:1,
   trimming only the cobalt margins at the sides, so each group is about 120px wide at 390px. */
.series-banner {
  aspect-ratio: 3 / 1; overflow: hidden; margin: 0 0 var(--s-5);
  border-radius: var(--radius); background: var(--art-ground); border: 1px solid var(--c-border);
}
.series-banner__img { display: block; width: 100%; height: 100%; object-fit: cover; }
[dir="rtl"] .series-banner__img { transform: scaleX(-1); }
@media (max-width: 639.98px) {
  .series-banner { aspect-ratio: 2.2 / 1; margin-inline: calc(-1 * var(--s-4)); border-radius: 0; border-inline: 0; }
}
.root-choose .wordmark { font-size: 1.4rem; }
