/* Neutral, accessible base theme. Brand colours go in the tokens below once a logo exists. */
:root {
  --bg: #f7f7f5; --surface: #ffffff; --text: #1b1d21; --muted: #555b65;
  --brand: #2f4b7c; --brand-ink: #ffffff; --line: #dcdfe4; --focus: #b35c00;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161a; --surface: #1d2026; --text: #eceef2; --muted: #a6adb8;
    --brand: #8fb0e8; --brand-ink: #10141b; --line: #2e333b; --focus: #ffb259;
  }
}
:root[data-theme="dark"] {
  --bg: #14161a; --surface: #1d2026; --text: #eceef2; --muted: #a6adb8;
  --brand: #8fb0e8; --brand-ink: #10141b; --line: #2e333b; --focus: #ffb259;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--text); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 16px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.2; margin: 24px 0 8px; }
h2 { font-size: 22px; margin: 28px 0 10px; }
.lead { font-size: 19px; color: var(--muted); max-width: 65ch; }
.muted { color: var(--muted); }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; min-height: 60px; }
.brand { font-weight: 700; font-size: 19px; color: var(--text); text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.who { color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }

.btn { display: inline-block; background: var(--brand); color: var(--brand-ink); padding: 10px 18px;
       border-radius: 999px; text-decoration: none; font-weight: 600; border: 0; font: inherit; cursor: pointer; }
.btn.secondary { background: transparent; color: var(--brand); border: 1px solid var(--brand); }

.home .hero { padding: 24px 0 8px; }
.how ol li { margin: 4px 0; }

.crumbs { margin-top: 20px; font-size: 15px; color: var(--muted); }
.lessons { list-style: none; padding: 0; margin: 0; }
.lessons a { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center;
             padding: 14px 16px; margin: 8px 0; background: var(--surface); border: 1px solid var(--line);
             border-radius: var(--radius); text-decoration: none; color: var(--text); }
.lessons .num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
                background: var(--bg); border: 1px solid var(--line); font-weight: 700; }
.lessons .d { color: var(--muted); font-size: 15px; }
.lessons li.done .num { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.lessons .done-label { color: var(--muted); font-weight: 400; }
.complete { display: block; margin-bottom: 10px; }

.cards { list-style: none; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cards li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.cards h2 { margin: 0 0 6px; font-size: 20px; }
.cards p { margin: 0 0 12px; color: var(--muted); }

.lesson-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
.lesson-grid aside { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 18px 12px; position: sticky; top: 16px; }
.lesson-grid aside h2 { font-size: 17px; }
.lesson-grid aside ol { padding-left: 0; list-style: none; margin: 0; }
.lesson-grid aside li { margin: 6px 0; }
.lesson-grid aside a[aria-current="page"] { font-weight: 700; color: var(--text); text-decoration: none; }
@media (max-width: 820px) { .lesson-grid { grid-template-columns: 1fr; } .lesson-grid aside { position: static; } }

.player { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; }
.player video { display: block; width: 100%; height: auto; }
.wm { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.wm span { position: absolute; color: rgba(255,255,255,.4); text-shadow: 0 0 2px rgba(0,0,0,.6);
           font-size: clamp(10px, 1.5vw, 13px); white-space: nowrap; transform: rotate(-18deg); }
.player-tools { display: flex; gap: 10px; align-items: center; margin: 10px 0; }
.player-tools label { font-weight: 600; }
select, input[type="email"], input[type="text"] { font: inherit; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); max-width: 100%; }
.transcript-box summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 4px 0; }
.transcript-box p { margin: 6px 0; }

.prose { max-width: 70ch; }
.prose table { border-collapse: collapse; width: 100%; margin: 12px 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose code { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 28px 0; }

.admin-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 16px 0; }
.admin-group h2 { margin-top: 0; }
.admin-group ul { padding-left: 0; list-style: none; }
.admin-group li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.admin-group form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.linkbtn { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; padding: 4px; }
.status { min-height: 1.6em; }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; margin-top: 40px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
