/* LearnColorpuncture — the stylesheet.
 *
 * ⭐ THE INTENT: clear, calm, luminous, precise, grounded. A serious practitioner learning
 *    environment, not a wellness brochure and not Sacred Altar (which is deep violet, ornamented,
 *    and belongs to a different practice — nothing here borrows from it).
 *
 * ⚠️ COLOUR IS THE SUBJECT MATTER, so it is used as LIGHT: a warm near-white ground, deep
 *    ink text, and a narrow spectrum accent used sparingly for state — never a rainbow, and
 *    never carrying meaning that the words do not also carry (colour alone must not be the only
 *    signal for a locked state, which is why every tag has a word in it).
 *
 * Dark mode is honoured because people study at night.
 */

:root {
  --ink:        #17202a;
  --ink-soft:   #4a5764;
  --ink-faint:  #7c8894;
  --ground:     #fbfaf7;
  --panel:      #ffffff;
  --line:       #e4e2dc;
  --accent:     #2f6f7e;   /* teal-slate: calm, clinical, not corporate blue */
  --accent-ink: #1d4a55;
  --warm:       #c8783a;   /* used only for "awaiting", never for danger */
  --ok:         #3f7d58;
  --lock:       #8a6a3d;
  --radius:     10px;
  --shadow:     0 1px 2px rgba(23,32,42,.05), 0 8px 24px rgba(23,32,42,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9edf1; --ink-soft: #b3bec9; --ink-faint: #8593a0;
    --ground: #12171c; --panel: #182028; --line: #263039;
    --accent: #6fb3c4; --accent-ink: #a8d5e0;
    --warm: #d9975c; --ok: #6fb98a; --lock: #c3a171;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 16px/1.6 ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "kern" 1;
}
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
/* ⭐ A VISIBLE FOCUS RING EVERYWHERE. Keyboard navigation is not an afterthought — several of the
   people who will use this are studying with one hand on a manual. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── header ─────────────────────────────────────────────────────────────── */
.top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 650; letter-spacing: -.01em; text-decoration: none; color: var(--ink);
  display: inline-flex; align-items: center; gap: 10px; }
.mark {
  width: 18px; height: 18px; border-radius: 50%;
  background: conic-gradient(from 210deg, #d4574e, #d99a3f, #cbbf4a, #5aa46a, #3f7f9e, #6a5aa0, #d4574e);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.nav { display: flex; gap: 4px 14px; flex-wrap: wrap; align-items: center; margin-left: auto; }
.nav a { color: var(--ink-soft); text-decoration: none; padding: 6px 8px; border-radius: 6px; font-size: 15px; }
.nav a:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, transparent); font-weight: 600; }
.nav .cta { background: var(--accent); color: #fff; padding: 7px 14px; }
.nav .cta:hover { background: var(--accent-ink); color: #fff; }
.nav .quiet { color: var(--ink-faint); }
.navsec { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-faint);
  width: 100%; padding: 8px 8px 0; border-top: 1px solid var(--line); margin-top: 6px; }
.navtoggle, .navtoggle-input { display: none; }

/* ⭐ RESPONSIVE NAV WITHOUT JAVASCRIPT — a checkbox and a label. The CSP forbids inline script,
   and a menu that needs a script to open is a menu that fails when the script does. */
@media (max-width: 880px) {
  .navtoggle { display: flex; flex-direction: column; gap: 4px; margin-left: auto;
    padding: 10px; cursor: pointer; border-radius: 8px; }
  .navtoggle span { display: block; width: 22px; height: 2px; background: var(--ink); }
  .nav { display: none; width: 100%; margin-left: 0; flex-direction: column; align-items: stretch; }
  .navtoggle-input:checked ~ .nav { display: flex; }
  .nav a { padding: 10px 8px; border-bottom: 1px solid var(--line); }
  .navsec { margin-top: 10px; }
}

/* ── preview banner ─────────────────────────────────────────────────────── */
/* ⭐ IMPOSSIBLE TO MISS, AND THE EXIT IS ALWAYS IN IT. */
.preview-banner {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 20px; background: #2c2116; color: #f4e6d2;
  border-bottom: 2px solid var(--warm); font-size: 14px; letter-spacing: .02em;
}
.preview-banner strong { letter-spacing: .06em; }
.pb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warm); flex: none; }
.pb-persona { color: #c8b49a; }
.pb-exit { margin-left: auto; color: #f4e6d2; background: rgba(255,255,255,.12);
  padding: 5px 12px; border-radius: 6px; text-decoration: none; font-weight: 600; }
.pb-exit:hover { background: rgba(255,255,255,.22); color: #fff; }
.is-previewing .top { top: 41px; }

/* ── layout ─────────────────────────────────────────────────────────────── */
.wrap { max-width: 1040px; margin: 0 auto; padding: 32px 20px 64px; }
.narrow { max-width: 460px; margin: 0 auto; padding: 24px 0; }
h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 10px; }
h2 { font-size: 19px; letter-spacing: -.01em; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 6px; }
h4 { font-size: 14px; margin: 0 0 4px; }
.lede { color: var(--ink-soft); font-size: 18px; margin: 0 0 28px; max-width: 62ch; }
.fine { color: var(--ink-faint); font-size: 13.5px; line-height: 1.55; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.small { font-size: 13px; }
.big { font-size: 30px; font-weight: 650; margin: 0; letter-spacing: -.02em; }
.crumb { margin: 0 0 8px; font-size: 14px; }

/* ── hero ───────────────────────────────────────────────────────────────── */
.hero { position: relative; padding: 40px 0 28px; }
.hero-glow {
  position: absolute; inset: -60px -10% auto; height: 320px; pointer-events: none; z-index: -1;
  background: radial-gradient(60% 70% at 30% 20%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
              radial-gradient(50% 60% at 78% 10%, color-mix(in srgb, var(--warm) 14%, transparent), transparent 70%);
  filter: blur(8px);
}
/* ⚠️ 18ch broke the intended two-line hero into four at desktop width — the explicit <br>
   plus a narrow measure fought each other. Wide enough for the break to land where it was
   written, still narrow enough to stay a headline rather than a paragraph. */
.hero h1 { max-width: 26ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 16px; }

/* ── cards and grids ────────────────────────────────────────────────────── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin: 0 0 18px; box-shadow: var(--shadow); }
.card p:last-child { margin-bottom: 0; }
.quiet-card { background: transparent; box-shadow: none; }
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.grid .card { margin: 0; }
.mini { border-left: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); padding-left: 12px; }

/* ── empty states ───────────────────────────────────────────────────────── */
/* ⭐ Distinct from a card, so "nothing here yet" never reads as "something broke". */
.empty {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 20px 22px; background: color-mix(in srgb, var(--accent) 3%, transparent);
}
.empty h3 { color: var(--ink); }
.empty p { color: var(--ink-soft); margin: 0; font-size: 14.5px; max-width: 70ch; }

/* ── lists and tables ───────────────────────────────────────────────────── */
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between;
  padding: 13px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row p { margin: 2px 0 0; }
.list-row.locked { opacity: .72; }
.plain { margin: 0; padding-left: 20px; }
.plain li { margin-bottom: 8px; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 10px; }
.table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.table th, .table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line);
  vertical-align: top; white-space: nowrap; }
.table th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }

/* ── tags, notices ──────────────────────────────────────────────────────── */
/* ⚠️ EVERY TAG CARRIES A WORD. Colour is reinforcement, never the only signal. */
.tag { display: inline-block; font-size: 12px; letter-spacing: .03em; padding: 3px 9px;
  border-radius: 999px; background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink-soft); white-space: nowrap; }
.tag.ok   { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.tag.lock { background: color-mix(in srgb, var(--lock) 16%, transparent); color: var(--lock); }
.provenance { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 22px; }
.notice { border-radius: var(--radius); padding: 14px 18px; margin: 0 0 18px;
  border: 1px solid var(--line); background: var(--panel); }
.notice.lock { border-left: 4px solid var(--lock);
  background: color-mix(in srgb, var(--lock) 7%, var(--panel)); }
.error { color: #a3352c; background: color-mix(in srgb, #a3352c 8%, transparent);
  border-radius: 8px; padding: 10px 14px; }

/* ── buttons and forms ──────────────────────────────────────────────────── */
.btn { display: inline-block; background: var(--accent); color: #fff; border: 1px solid var(--accent);
  padding: 10px 20px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 15px;
  cursor: pointer; font-family: inherit; }
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn.ghost { background: transparent; color: var(--accent-ink); border-color: var(--line); }
.btn.ghost:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent-ink); }
.btn.small { padding: 6px 13px; font-size: 13.5px; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 10px; }
.inline { display: inline; }
.form { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-soft); }
.form input { font: inherit; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink); }
.form input:focus { border-color: var(--accent); }

/* ── progress and video ─────────────────────────────────────────────────── */
.progress { height: 7px; background: color-mix(in srgb, var(--ink) 8%, transparent);
  border-radius: 999px; overflow: hidden; margin: 6px 0 10px; }
/* 🔴 THE FULL-BAR-AT-ZERO BUG WAS THE CSP. `style="width:0%"` is an inline style attribute, and
   `style-src 'self'` (no unsafe-inline) makes the browser IGNORE it — so the bar defaulted to
   full width and an untouched dashboard read as "complete". Width lives in CLASSES now; there is
   no inline-style path in this codebase that can work, ever. */
.progress-bar { height: 100%; background: var(--accent); width: 0; }
.progress-bar.p0 { width: 0; } .progress-bar.p25 { width: 25%; } .progress-bar.p50 { width: 50%; }
.progress-bar.p75 { width: 75%; } .progress-bar.p100 { width: 100%; }
.progress-state { margin: 0 0 6px; }
.video { margin-bottom: 18px; }
/* ⚠️ A FULL-WIDTH 16:9 PLACEHOLDER SWALLOWED THE LESSON PAGE — 1,100px of hatching above
   the resources and the notes. A player that is not playing anything should not be the
   largest thing on the screen. */
.video-frame { max-width: 620px; aspect-ratio: 16 / 9; border-radius: var(--radius); display: grid; place-items: center;
  background: color-mix(in srgb, var(--ink) 6%, transparent); border: 1px solid var(--line);
  color: var(--ink-faint); margin-bottom: 10px; }
.video.pending .video-frame { border-style: dashed;
  background: repeating-linear-gradient(45deg, transparent, transparent 10px,
    color-mix(in srgb, var(--lock) 5%, transparent) 10px, color-mix(in srgb, var(--lock) 5%, transparent) 20px); }
.video-state { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--lock); }

/* ── gate and footer ────────────────────────────────────────────────────── */
.gate { position: relative; text-align: center; padding-top: 12vh; }
.gate .form { text-align: left; }
.foot { border-top: 1px solid var(--line); padding: 26px 20px 44px; margin-top: 40px; }
.foot p { max-width: 1000px; margin: 0 auto 8px; font-size: 13.5px; color: var(--ink-faint); }
.foot strong { color: var(--ink-soft); }

/* ── the public orientation layer (Round 6) ─────────────────────────────── */
.kicker { font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-ink); margin: 0 0 10px; font-weight: 650; }
/* the numbered stage ladder — pathways and the Stakeholder Tour share it */
.stages { list-style: none; margin: 0 0 18px; padding: 0; counter-reset: stage; }
.stage { display: flex; gap: 16px; align-items: flex-start; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin: 0 0 14px; }
.stage h2 { margin-bottom: 6px; }
.stage p { margin: 0 0 8px; }
.stage .btnrow { margin: 10px 0 0; }
.stage-n { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid;
  place-items: center; font-weight: 650; font-size: 15px; color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
/* ⭐ an external link is visibly external and never silently leaves the site */
a.ext { font-weight: 600; }
.vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0; }
/* keyboard users get a way past the navigation; invisible until focused */
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--panel);
  color: var(--accent-ink); padding: 10px 16px; border-radius: 0 0 8px 0; font-weight: 600; }
.skip:focus-visible { left: 0; }

/* ── feedback (Round 5) ─────────────────────────────────────────────────── */
/* the operator's flag — present on every page for the administrator, fixed so it never
   collides with content, and printed out of existence with the rest of the chrome */
.fb-report { position: fixed; right: 16px; bottom: 16px; z-index: 40;
  background: var(--panel); color: var(--accent-ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px; font-size: 13.5px; font-weight: 600;
  text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.fb-report:hover { border-color: var(--accent); }
.fb-context { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.fb-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.fb-row label { flex: 1 1 150px; }
.fb-row .grow { flex: 3 1 260px; }
.form select, .form textarea { font: inherit; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); color: var(--ink); width: 100%; }
.form select:focus, .form textarea:focus { border-color: var(--accent); outline: none; }
.fb-item h2 { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fb-update { margin: 10px 0 0; gap: 8px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .top, .foot, .preview-banner, .fb-report { display: none; } }
