/* ================================================================
   base.css — Academic Hub shared design system
   Light theme, DM Sans typography
   Loaded on every page via build.js injection (Step 15, 2026-05-03).
   Page-specific styles stay in each HTML file's <style> tag.
   ================================================================ */

/* ── Shared design tokens (spacing, type, shadow, radius, motion) ── */
@import url('tokens.css');

/* ── Google Fonts (Lora for titles, DM Sans body, DM Mono code) ── */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ── Page title (Lora serif — hero h1 / .page-title only) ──────── */
.page-title {
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--ink-2);
  text-decoration: none;
}
.btn:hover    { border-color: var(--ink-2); color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(108,92,231,0.32);
  border-color: transparent;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink-2);
}
.btn-ghost:hover { background: var(--paper-2); }

.btn-danger {
  background: var(--red-2);
  border-color: #fca5a5;
  color: var(--red);
}
.btn-danger:hover { background: #fecaca; }

.btn-sm   { padding: 5px 12px; font-size: 12px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; }

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}
.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

/* ── Badges / pills ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--paper-2);
  border: 1px solid var(--border);
  color: var(--ink-2);
}
.badge-accent { background: var(--accent-2); border-color: rgba(108,92,231,0.2); color: var(--accent); }
.badge-green  { background: var(--green-2);  border-color: rgba(5,150,105,0.2);  color: var(--green); }
.badge-amber  { background: var(--amber-2);  border-color: rgba(176,120,0,0.2);  color: var(--amber); }
.badge-red    { background: var(--red-2);    border-color: rgba(220,38,38,0.2);  color: var(--red); }
.badge-blue   { background: var(--blue-2);   border-color: rgba(26,95,168,0.2);  color: var(--blue); }

/* ── Role badge (e.g. "ADMIN" / "TEACHER" pills) ───────────────── */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink-2);
}
.role-badge .role-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.role-dot-admin   { background: #f5a623; }
.role-dot-teacher { background: var(--green); }

/* ── Progress pill ─────────────────────────────────────────────── */
.prog-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
}
.prog-bar-wrap   { width: 90px; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.prog-bar-fill   { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.5s ease; }
.prog-text       { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.prog-text strong{ color: var(--ink); }

/* ── Spinner ───────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ── Toast ─────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(60px);
  opacity: 0;
  transition: all 0.25s ease;
  z-index: var(--z-toast);
}
.toast.show      { transform: translateY(0); opacity: 1; }
.toast.show.warn { background: var(--amber); color: #fff3cd; }

/* ── Modal ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28,28,46,0.55);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 500px;
  margin: 20px;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.modal-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: var(--ink-3);
  transition: all 0.15s;
}
.modal-close:hover { background: var(--paper-2); color: var(--ink); }

.modal-field { margin-bottom: 16px; }
.modal-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.modal-input,
.modal-textarea,
.modal-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13.5px;
  font-family: var(--font-body);
  color: var(--ink);
  outline: none;
  background: var(--paper);
  transition: border-color 0.15s;
}
.modal-input:focus,
.modal-textarea:focus,
.modal-select:focus { border-color: var(--accent); background: var(--white); }
.modal-textarea     { min-height: 120px; resize: vertical; line-height: 1.6; }
.modal-footer       { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal-err          { font-size: 12px; color: var(--red); margin-top: 6px; }

/* ── Confirm dialog (lightweight modal for yes/no) ─────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28,28,46,0.45);
  backdrop-filter: blur(3px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.confirm-overlay.open { opacity: 1; visibility: visible; }
.confirm-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px 24px 20px;
  width: 100%;
  max-width: 380px;
  margin: 20px;
  transform: scale(0.96);
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
.confirm-overlay.open .confirm-box { transform: scale(1); }
.confirm-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.confirm-msg   { font-size: 13px; color: var(--ink-2); line-height: 1.55; margin-bottom: 20px; }
.confirm-btns  { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Search input ─────────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap svg {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.4;
  pointer-events: none;
}
.search-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 13px;
  padding: 7px 10px 7px 30px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus      { border-color: var(--accent); background: var(--white); }
.search-input::placeholder { color: var(--ink-3); }

/* ── Chips (filter pills) ─────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.6;
}
.chip:hover         { border-color: var(--accent); color: var(--accent); }
.chip.on            { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Page header (icon + title + subtitle) ─────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.page-header-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, black));
  box-shadow: 0 4px 14px rgba(108,92,231,0.28);
}
.page-header-icon svg { width: 24px; height: 24px; color: #fff; }
.page-header-title    { font-size: 22px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.page-header-sub      { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }

/* ── Page breadcrumb (Library › Documents › current) ──────────── */
.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.page-breadcrumb a {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.15s;
}
.page-breadcrumb a:hover { color: var(--accent); }
.page-breadcrumb-sep     { color: var(--border); font-size: 14px; line-height: 1; user-select: none; }
.page-breadcrumb-current {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

/* ── Empty state ───────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-3);
  font-size: 15px;
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }

/* ── Skeleton / shimmer loader ─────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}
.skel {
  background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper) 50%, var(--paper-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  display: block;
}

/* ── Screen-reader-only utility ────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ────────────────────────────────────────────────────────────────
   CANONICAL FEATURE-PAGE CHROME (2026-05-21 — rolled out to AH)
   ----------------------------------------------------------------
   .page-hero   — standard hero band; pick gradient via
                  data-accent="cyan|mor|dark" (see tokens.css
                  --hero-grad-* + docs/architecture/DESIGN_SYSTEM.md
                  "Page families").
   .page-empty  — canonical empty-state (icon + title + desc + CTA).

   Don't override .page-hero background or layout in page <style>
   blocks — that's exactly the drift the 2026-05-19 audit flagged.
   Page-local extras (tab bars, progress rings, action chips) must
   target page-local class names, NOT .page-hero* selectors.
─────────────────────────────────────────────────────────────────── */

.page-hero {
  position: relative;
  overflow: hidden;
  /* Vertical padding only on the outer. Horizontal padding lives on
     .page-hero__inner so it pads INSIDE the --container-max clamp, matching
     how body wrappers (page-wrap / mb-page / similar) pad their content.
     Otherwise hero text sits 40px right of body content on viewports > 1280px
     — same asymmetric clamp-then-pad bug as root CLAUDE.md Common Mistake #52
     (legacy 3-wrapper pages). Past incident 2026-05-22 on TH announcements
     / messageboard / surveys; rule lifted into canonical CSS so every hub
     gets the alignment for free. */
  padding: 52px 0;
  color: #fff;
  background: var(--hero-grad-cyan);
  /* Liveliness pass (2026-05-29, ported from CH): each family also exposes
     its bright accent + mesh so the icon, title glow, top rule + ::before
     pick it up. Defaults to cyan; the [data-accent] rules below set the
     rest. Pages with a bespoke page-local .page-hero override (the 4 My-CPD
     learning/portfolio/certificates/induction surfaces) keep their own look. */
  --hero-vivid: var(--hero-vivid-cyan);
  --hero-mesh:  var(--hero-mesh-cyan);
  /* 3px family-vivid top rule + a soft inset glow below it, so even the
     gradient's darkest stop reads as "this family" at a glance. */
  border-top: 3px solid var(--hero-vivid);
  box-shadow: inset 0 7px 26px -10px var(--hero-vivid);
  /* hero text + KPIs rise in on load (see keyframes below) */
  animation: heroFadeIn 0.5s ease both;
}
.page-hero[data-accent="cyan"]   { background: var(--hero-grad-cyan);   --hero-vivid: var(--hero-vivid-cyan);   --hero-mesh: var(--hero-mesh-cyan); }
.page-hero[data-accent="mor"]    { background: var(--hero-grad-mor);    --hero-vivid: var(--hero-vivid-mor);    --hero-mesh: var(--hero-mesh-mor); }
.page-hero[data-accent="dark"]   { background: var(--hero-grad-dark);   --hero-vivid: var(--hero-vivid-dark);   --hero-mesh: var(--hero-mesh-dark); }
/* Semantic family expansion (2026-05-27) — see tokens.css + root CLAUDE.md "Page Families" */
.page-hero[data-accent="amber"]  { background: var(--hero-grad-amber);  --hero-vivid: var(--hero-vivid-amber);  --hero-mesh: var(--hero-mesh-amber); }
.page-hero[data-accent="teal"]   { background: var(--hero-grad-teal);   --hero-vivid: var(--hero-vivid-teal);   --hero-mesh: var(--hero-mesh-teal); }
.page-hero[data-accent="rose"]   { background: var(--hero-grad-rose);   --hero-vivid: var(--hero-vivid-rose);   --hero-mesh: var(--hero-mesh-rose); }
.page-hero[data-accent="violet"] { background: var(--hero-grad-violet); --hero-vivid: var(--hero-vivid-violet); --hero-mesh: var(--hero-mesh-violet); }
.page-hero[data-accent="slate"]  { background: var(--hero-grad-slate);  --hero-vivid: var(--hero-vivid-slate);  --hero-mesh: var(--hero-mesh-slate); }
/* AH-only My-CPD families (bespoke heroes, set their own background locally).
   We still map their liveliness vivid/mesh so the new top rule + icon glow +
   KPI bars match their intended hue instead of falling back to cyan. */
.page-hero[data-accent="learning"]     { --hero-vivid: var(--hero-vivid-teal);   --hero-mesh: var(--hero-mesh-teal); }
.page-hero[data-accent="portfolio"]    { --hero-vivid: var(--hero-vivid-mor);    --hero-mesh: var(--hero-mesh-mor); }
.page-hero[data-accent="certificates"] { --hero-vivid: var(--hero-vivid-amber);  --hero-mesh: var(--hero-mesh-amber); }
.page-hero[data-accent="induction"]    { --hero-vivid: var(--hero-vivid-mor);    --hero-mesh: var(--hero-mesh-mor); }

/* Layered hero texture (2026-05-29) — replaces the single faint radial.
   Bottom→top: family mesh (two vivid blobs that brighten the gradient)
   · fine white dot-grid for subtle depth · the original soft radial-light
   highlight. All decorative, pointer-events:none. */
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    var(--hero-radial-light),
    var(--hero-dot-grid),
    var(--hero-mesh);
  background-size: auto, 22px 22px, auto;
  pointer-events: none;
  z-index: 0;
}

/* Soft 40px fade overlay rendered just BELOW the hero on the body background
   — gives the hero→content handoff a gradient bleed instead of a hard edge.
   Family token picked by the same data-accent the hero uses. */
.page-hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -40px;
  height: 40px;
  pointer-events: none;
  background: var(--hero-fade-cyan);
}
.page-hero[data-accent="cyan"]::after { background: var(--hero-fade-cyan); }
.page-hero[data-accent="mor"]::after  { background: var(--hero-fade-mor); }
.page-hero[data-accent="dark"]::after { background: var(--hero-fade-dark); }
/* Semantic family expansion (2026-05-27) */
.page-hero[data-accent="amber"]::after  { background: var(--hero-fade-amber); }
.page-hero[data-accent="teal"]::after   { background: var(--hero-fade-teal); }
.page-hero[data-accent="rose"]::after   { background: var(--hero-fade-rose); }
.page-hero[data-accent="violet"]::after { background: var(--hero-fade-violet); }
.page-hero[data-accent="slate"]::after  { background: var(--hero-fade-slate); }
/* My CPD per-page accent fades (2026-05-24) */
.page-hero[data-accent="learning"]::after     { background: var(--hero-fade-learning); }
.page-hero[data-accent="portfolio"]::after    { background: var(--hero-fade-portfolio); }
.page-hero[data-accent="certificates"]::after { background: var(--hero-fade-certificates); }
.page-hero[data-accent="induction"]::after    { background: var(--hero-fade-induction); }

/* Family-tinted body background — opt-in via <body data-page-accent="cyan|mor|dark|learning|portfolio|certificates|induction">.
   3-10% saturated off-white so content cards (var(--white)) still read as elevated. */
body[data-page-accent="cyan"] { background: var(--paper-tinted-cyan); }
body[data-page-accent="mor"]  { background: var(--paper-tinted-mor); }
body[data-page-accent="dark"] { background: var(--paper-tinted-dark); }
/* Semantic family expansion (2026-05-27) */
body[data-page-accent="amber"]  { background: var(--paper-tinted-amber); }
body[data-page-accent="teal"]   { background: var(--paper-tinted-teal); }
body[data-page-accent="rose"]   { background: var(--paper-tinted-rose); }
body[data-page-accent="violet"] { background: var(--paper-tinted-violet); }
body[data-page-accent="slate"]  { background: var(--paper-tinted-slate); }
/* My CPD per-page tints (2026-05-24) */
body[data-page-accent="learning"]    { background: var(--paper-tinted-learning); }
body[data-page-accent="portfolio"]   { background: var(--paper-tinted-portfolio); }
body[data-page-accent="certificates"]{ background: var(--paper-tinted-certificates); }
body[data-page-accent="induction"]   { background: var(--paper-tinted-induction); }

/* ── Accent bleed into content (2026-05-29 liveliness pass, ported from CH) ──
   The family colour stops at the hero today — scroll past it and the body
   reads un-themed. We carry it down via a DEDICATED --family-accent /
   --family-soft pair (NOT the global --accent — many pages deliberately
   set their own --accent, sometimes off-family; clobbering those would
   change page intent). Keys off the data-page-accent already declared.

   --family-accent = each family's MID accent (same hue the footer CTA uses),
   good against the white card surface. --family-soft = its pale tint for
   hairline top-rules / underlines. */
body[data-page-accent="cyan"]   { --family-accent: #0891b2; --family-soft: var(--accent-soft-cyan); }
body[data-page-accent="mor"]    { --family-accent: #6c5ce7; --family-soft: var(--accent-soft-mor); }
body[data-page-accent="dark"]   { --family-accent: #6c5ce7; --family-soft: var(--accent-soft-dark); }
body[data-page-accent="amber"]  { --family-accent: #d97706; --family-soft: var(--accent-soft-amber); }
body[data-page-accent="teal"]   { --family-accent: #0f9b8e; --family-soft: var(--accent-soft-teal); }
body[data-page-accent="rose"]   { --family-accent: #e11d48; --family-soft: var(--accent-soft-rose); }
body[data-page-accent="violet"] { --family-accent: #7c3aed; --family-soft: var(--accent-soft-violet); }
body[data-page-accent="slate"]  { --family-accent: #475569; --family-soft: var(--accent-soft-slate); }
/* AH-only My-CPD families (no CH analogue) — teal-ish CPD hues + soft tints. */
body[data-page-accent="learning"]     { --family-accent: #0f9b8e; --family-soft: var(--accent-soft-teal); }
body[data-page-accent="portfolio"]    { --family-accent: #6c5ce7; --family-soft: var(--accent-soft-mor); }
body[data-page-accent="certificates"] { --family-accent: #d97706; --family-soft: var(--accent-soft-amber); }
body[data-page-accent="induction"]    { --family-accent: #6c5ce7; --family-soft: var(--accent-soft-mor); }

/* Carry the family colour into the shared .card: a family-tinted top accent
   that appears on hover. Page-local card classes are untouched — this only
   lifts the generic shared .card so dashboards/listing grids read themed. */
body[data-page-accent] .card { border-top: 2px solid transparent; }
body[data-page-accent] .card:hover {
  border-top-color: var(--family-accent);
  box-shadow: var(--shadow), inset 0 2px 0 0 var(--family-accent);
  transform: translateY(-1px);
}

/* Family-tinted sticky toolbar underline + a thin family rule at the top of
   the info strip, so the chrome below the hero reads themed instead of flat
   grey on every page. */
body[data-page-accent] .page-toolbar { border-bottom-color: var(--family-soft); }
body[data-page-accent] .page-info-strip { border-top: 2px solid var(--family-soft); }

.page-hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.page-hero__icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  /* Family-vivid tinted glass tile + a soft glow ring in the family hue,
     so the icon slot reads as a coloured focal point rather than a flat
     white square (2026-05-29 liveliness pass, ported from CH). */
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--hero-vivid) 38%, transparent) 0%,
                            color-mix(in srgb, var(--hero-vivid) 14%, transparent) 100%);
  border: 1px solid color-mix(in srgb, var(--hero-vivid) 55%, transparent);
  box-shadow: 0 6px 22px -6px color-mix(in srgb, var(--hero-vivid) 70%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  margin-top: var(--space-1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.page-hero__icon svg { width: 30px; height: 30px; }
.page-hero:hover .page-hero__icon {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 28px -6px color-mix(in srgb, var(--hero-vivid) 80%, transparent);
}

.page-hero__text {
  flex: 1;
  min-width: 240px;
}
.page-hero__eyebrow {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--hero-eyebrow);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}
.page-hero__title {
  font-family: var(--font-title);
  font-size: 2.1rem;
  font-weight: var(--fw-semibold);
  color: #fff;
  margin-bottom: var(--space-3);
  line-height: 1.2;
  /* faint family-tinted glow behind the title text for depth */
  text-shadow: 0 2px 18px color-mix(in srgb, var(--hero-vivid) 45%, transparent);
}
.page-hero__desc {
  font-size: var(--text-base);
  color: var(--hero-desc);
  max-width: 560px;
  line-height: 1.6;
}

.page-hero__kpis {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-left: auto;
}
.page-hero__kpi {
  background: var(--hero-kpi-bg);
  border: 1px solid var(--hero-kpi-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  min-width: 120px;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
/* a thin family-vivid bar down the left edge of each KPI tile */
.page-hero__kpi::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--hero-vivid);
  opacity: 0.85;
}
.page-hero__kpi:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--hero-vivid) 55%, transparent);
  box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--hero-vivid) 70%, transparent);
}
.page-hero__kpi--primary {
  background: var(--hero-kpi-bg-primary);
  border-color: rgba(108,92,231,0.4);
}
/* Per-family primary-KPI tile (2026-05-27) */
.page-hero[data-accent="amber"]  .page-hero__kpi--primary { background: var(--hero-kpi-bg-primary-amber);  border-color: rgba(217,119,6,0.45); }
.page-hero[data-accent="teal"]   .page-hero__kpi--primary { background: var(--hero-kpi-bg-primary-teal);   border-color: rgba(20,184,166,0.45); }
.page-hero[data-accent="rose"]   .page-hero__kpi--primary { background: var(--hero-kpi-bg-primary-rose);   border-color: rgba(225,29,72,0.42); }
.page-hero[data-accent="violet"] .page-hero__kpi--primary { background: var(--hero-kpi-bg-primary-violet); border-color: rgba(124,58,237,0.45); }
.page-hero[data-accent="slate"]  .page-hero__kpi--primary { background: var(--hero-kpi-bg-primary-slate);  border-color: rgba(148,163,184,0.4); }
.page-hero__kpi-num {
  font-family: var(--font-title);
  font-size: 2.4rem;
  line-height: 1;
  font-weight: var(--fw-semibold);
  color: #fff;
}
.page-hero__kpi--primary .page-hero__kpi-num { font-size: 2.8rem; }
.page-hero__kpi-lbl {
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hero-kpi-lbl);
  margin-top: var(--space-2);
}
.page-hero__kpi-sub {
  font-size: var(--text-xs);
  color: var(--hero-kpi-sub);
  margin-top: var(--space-1);
  font-weight: var(--fw-normal);
}

@media (max-width: 768px) {
  .page-hero { padding: var(--space-8) 0; }
  .page-hero__inner { padding: 0 var(--space-6); flex-direction: column; gap: var(--space-4); }
  .page-hero__title { font-size: 1.7rem; }
  .page-hero__kpis { margin-left: 0; }
  .page-hero__kpi-num { font-size: 1.8rem; }
  .page-hero__kpi--primary .page-hero__kpi-num { font-size: 2.2rem; }
}

/* ── Hero entrance motion (2026-05-29 liveliness pass, ported from CH) ──
   The whole hero fades+rises in; text block and KPI aside stagger so the
   page feels alive on load instead of snapping into a static band.
   Honour prefers-reduced-motion — disable all of it. */
@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroRiseIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-hero__text { animation: heroRiseIn 0.55s ease 0.05s both; }
.page-hero__kpis { animation: heroRiseIn 0.55s ease 0.16s both; }
/* icon fades in only (no transform fill — it owns its own hover transform) */
@keyframes heroIconIn { from { opacity: 0; } to { opacity: 1; } }
.page-hero__icon { animation: heroIconIn 0.5s ease 0.02s both; }

@media (prefers-reduced-motion: reduce) {
  .page-hero,
  .page-hero__text,
  .page-hero__kpis,
  .page-hero__icon { animation: none; }
  .page-hero__kpi,
  .page-hero__icon { transition: none; }
}

/* ============================================================
   CANONICAL PAGE FOOTER (ported from CH shared-styles.css)
   Use on feature pages with a forward-flow CTA + nav columns.
   Sticky-footer pattern via :has() pushes the footer to the
   bottom of short pages without affecting pages that lack one.
   ============================================================ */
body:has(> .page-footer) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body:has(> .page-footer) > .page-footer { margin-top: auto; }

.page-footer {
  margin-top: var(--space-12);
  background: var(--hero-grad-dark);
  color: rgba(255,255,255,0.92);
  position: relative;
  overflow: hidden;
}
.page-footer::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 12% 30%, rgba(108,92,231,0.18) 0%, transparent 50%),
    radial-gradient(circle at 88% 80%, rgba(8,145,178,0.14) 0%, transparent 55%);
  pointer-events: none;
}
.page-footer__inner {
  position: relative; z-index: 1;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-10) var(--space-10) var(--space-6);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-10);
  align-items: start;
}
@media (max-width: 820px) {
  .page-footer__inner { grid-template-columns: 1fr; gap: var(--space-6); padding: var(--space-8) var(--space-6) var(--space-5); }
}

.page-footer__cta { display: flex; flex-direction: column; gap: var(--space-3); }
.page-footer__cta-eyebrow {
  font-size: 0.7rem; font-weight: 600;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.12em; text-transform: uppercase;
}
.page-footer__cta-title {
  font-family: 'Lora', serif;
  font-size: 1.5rem; font-weight: 600;
  color: #fff; line-height: 1.25;
  margin: 0;
}
.page-footer__cta-desc {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.55;
  max-width: 460px;
}
.page-footer__cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: var(--space-2);
  padding: 11px 22px;
  background: linear-gradient(135deg, #7c3aed 0%, #5a4bd1 100%);
  color: #fff; text-decoration: none;
  border-radius: 10px;
  font-size: 0.875rem; font-weight: 600;
  width: fit-content;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(108,92,231,0.35);
}
.page-footer__cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(108,92,231,0.45);
}
/* Family-matched footer CTA (2026-05-27) — set data-accent on <footer class="page-footer">
   and the CTA button picks up the family gradient automatically. Default (no attr) stays mor. */
.page-footer[data-accent="cyan"]   .page-footer__cta-btn { background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%); box-shadow: 0 4px 14px rgba(8,145,178,0.35); }
.page-footer[data-accent="cyan"]   .page-footer__cta-btn:hover { box-shadow: 0 6px 18px rgba(8,145,178,0.45); }
.page-footer[data-accent="amber"]  .page-footer__cta-btn { background: linear-gradient(135deg, #d97706 0%, #92400e 100%); box-shadow: 0 4px 14px rgba(217,119,6,0.35); }
.page-footer[data-accent="amber"]  .page-footer__cta-btn:hover { box-shadow: 0 6px 18px rgba(217,119,6,0.45); }
.page-footer[data-accent="teal"]   .page-footer__cta-btn { background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%); box-shadow: 0 4px 14px rgba(20,184,166,0.35); }
.page-footer[data-accent="teal"]   .page-footer__cta-btn:hover { box-shadow: 0 6px 18px rgba(20,184,166,0.45); }
.page-footer[data-accent="rose"]   .page-footer__cta-btn { background: linear-gradient(135deg, #e11d48 0%, #9f1239 100%); box-shadow: 0 4px 14px rgba(225,29,72,0.35); }
.page-footer[data-accent="rose"]   .page-footer__cta-btn:hover { box-shadow: 0 6px 18px rgba(225,29,72,0.45); }
.page-footer[data-accent="violet"] .page-footer__cta-btn { background: linear-gradient(135deg, #7c3aed 0%, #4c1d95 100%); box-shadow: 0 4px 14px rgba(124,58,237,0.35); }
.page-footer[data-accent="violet"] .page-footer__cta-btn:hover { box-shadow: 0 6px 18px rgba(124,58,237,0.45); }
.page-footer[data-accent="slate"]  .page-footer__cta-btn { background: linear-gradient(135deg, #475569 0%, #334155 100%); box-shadow: 0 4px 14px rgba(71,85,105,0.35); }
.page-footer[data-accent="slate"]  .page-footer__cta-btn:hover { box-shadow: 0 6px 18px rgba(71,85,105,0.45); }

.page-footer__nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}
@media (max-width: 480px) {
  .page-footer__nav { grid-template-columns: 1fr; }
}
.page-footer__nav-group { display: flex; flex-direction: column; gap: var(--space-2); }
.page-footer__nav-heading {
  font-size: 0.7rem; font-weight: 700;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: var(--space-1);
}
.page-footer__nav-link {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  transition: color 0.12s;
  line-height: 1.6;
}
.page-footer__nav-link:hover { color: #fff; }

.page-footer__meta {
  position: relative; z-index: 1;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-4) var(--space-10) var(--space-6);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
}
@media (max-width: 820px) {
  .page-footer__meta { padding: var(--space-3) var(--space-6) var(--space-5); }
}
.page-footer__meta-left { display: flex; align-items: center; gap: var(--space-2); }
.page-footer__meta-right { font-style: italic; color: rgba(255,255,255,0.42); }
/* ================================================================
   === A11Y (sync: shared-design/a11y.css) — WCAG 2.2 AA, 2026-05-31 ===
   Byte-identical copy of the block in shared-design/a11y.css.
   Edit there + all 3 hub copies together. Provides keyboard
   focus-visible ring (survives legacy outline:none), .skip-link
   (2.4.1 Bypass Blocks), .sr-only utility.
   ================================================================ */
:root {
  --focus-ring: #6c5ce7;
  --focus-ring-contrast: #ffffff;
}
*:focus-visible {
  outline: 2px solid var(--focus-ring) !important;
  outline-offset: 2px;
  border-radius: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-120%);
  z-index: 100000;
  margin: 8px;
  padding: 10px 16px;
  background: var(--focus-ring);
  color: var(--focus-ring-contrast);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--focus-ring-contrast) !important;
  outline-offset: 2px;
}
#main-content:focus,
#main-content:focus-visible {
  outline: 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;
}
.sr-only-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
