:root {
  --bg: #f3eee4;
  --surface: #faf7f0;
  --fg: #1c1915;
  --muted: #6a6358;
  --primary: #1e3d32;
  --primary-fg: #f4efe6;
  --accent: #2f5d4c;
  --border: #d8d0c3;
  --danger: #8f2d2d;
  --ok: #2a5a3c;
  --paper: #faf7f0;
  --shadow: 0 1px 0 rgba(28, 25, 21, 0.04), 0 12px 32px -18px rgba(28, 25, 21, 0.18);
  --font-display: "Newsreader", "Iowan Old Style", Palatino, serif;
  --font-sans: "Figtree", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 14px;
}

html[data-theme="high-vis"] {
  --bg: #0a0a0a; --surface: #161616; --fg: #ffe566; --muted: #d6c24a;
  --primary: #ffe566; --primary-fg: #0a0a0a; --accent: #fff3a0; --border: #8a7a20;
  --danger: #ff6b6b; --ok: #9dffb0; --paper: #161616;
}
html[data-theme="matrix"] {
  --bg: #030805; --surface: #07140c; --fg: #b7ffce; --muted: #5d9a72;
  --primary: #1dff7a; --primary-fg: #03140a; --accent: #12c45e; --border: #1a4a2c;
  --danger: #ff5d5d; --ok: #1dff7a; --paper: #07140c;
  --font-sans: var(--font-mono); --font-display: var(--font-mono);
}
html[data-theme="calm"] {
  --bg: #eef2f4; --surface: #f7f9fa; --fg: #1c2428; --muted: #5b6a72;
  --primary: #2c4a56; --primary-fg: #f4f8f9; --accent: #3d6574; --border: #cdd6db;
}
html[data-theme="ink"] {
  --bg: #121410; --surface: #1b1e19; --fg: #ece7dc; --muted: #9a9488;
  --primary: #c5d4c8; --primary-fg: #121410; --accent: #8fa897; --border: #2e332c;
  --danger: #e08a8a; --ok: #9dcea8; --paper: #1b1e19;
}
html[data-theme="ink"], html[data-theme="matrix"], html[data-theme="high-vis"] { color-scheme: dark; }
html[data-dyslexia="true"] body { font-family: "Lexend", var(--font-sans); }
html[data-spacing="roomy"] body { letter-spacing: 0.02em; line-height: 1.7; }
html[data-text="lg"] { font-size: 112.5%; }
html[data-text="xl"] { font-size: 125%; }

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
}
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.18; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 4vw, 3.2rem); margin: 0.2rem 0 0.6rem; }
h2 { font-size: clamp(1.25rem, 2.4vw, 2rem); margin: 1.4rem 0 0.5rem; }
h3 { font-size: 1.15rem; margin: 0.4rem 0 0.35rem; }
p { margin: 0.4rem 0; text-wrap: pretty; }
a { color: inherit; }
img { max-width: 100%; height: auto; }
button, [role="button"] { cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.skip { position: absolute; left: 12px; top: -40px; z-index: 80; background: var(--primary); color: var(--primary-fg); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 12px; }

.official {
  margin: 0;
  padding: 0.5rem 1.5rem;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.site-header { background: var(--primary); color: var(--primary-fg); }
.site-header .bar {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; min-width: 0; }
.logo { width: 44px; height: 44px; border-radius: 999px; object-fit: contain; background: var(--paper); }
.org { display: block; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.8; }
.mark { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.desk { display: none; gap: 1.15rem; font-size: 0.9rem; }
.desk a { color: inherit; text-decoration: none; opacity: 0.9; }
.actions { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.ghost-btn, .enrol, .btn, .ghost-light {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.6rem; padding: 0.4rem 0.9rem; border-radius: 10px;
  border: 1px solid transparent; font: inherit; font-weight: 500; text-decoration: none;
}
.ghost-btn {
  border-color: rgba(244, 239, 230, 0.28);
  color: var(--primary-fg); background: transparent; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.enrol { background: var(--primary-fg); color: var(--primary); }
.mobile { display: flex; gap: 1rem; overflow-x: auto; padding: 0.5rem 1.25rem; border-top: 1px solid rgba(244, 239, 230, 0.12); font-size: 0.88rem; }
.mobile a { color: inherit; text-decoration: none; white-space: nowrap; opacity: 0.9; }
@media (min-width: 980px) {
  .desk { display: flex; }
  .mobile { display: none; }
}

.a11y[data-a11y] { display: none !important; }
.a11y-panel[hidden] { display: none !important; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 2.2rem 1.25rem 3.5rem; }
.narrow { max-width: 40rem; }
.print-wide { max-width: 52rem; }
.kicker { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0; }
.lede { font-size: 1.05rem; line-height: 1.6; max-width: 40rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mono { font-family: var(--font-mono); font-size: 0.85rem; }
.display { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0.3rem 0; }
.code { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); margin-right: 0.4rem; }
.danger { color: var(--danger); }
.ok { color: var(--ok); }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }
.inline { display: inline; }

.btn { background: var(--primary); color: var(--primary-fg); border: 0; }
.btn.secondary { background: var(--surface); color: var(--fg); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); color: #faf7f0; }
.btn.invert { background: var(--paper); color: var(--primary); }
.btn.ghost-light {
  background: transparent; color: var(--primary-fg);
  border: 1px solid rgba(244, 239, 230, 0.3);
}

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 1.2rem 1.3rem; margin: 0.75rem 0; box-shadow: var(--shadow);
}
.primacy { border-left: 4px solid var(--primary); }
.grid2, .grid3 { display: grid; gap: 0.9rem; }
@media (min-width: 760px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr 1fr; }
}
.stack { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.6rem; }
.row-item { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: baseline; text-decoration: none; }
.form { display: grid; gap: 0.75rem; }
.form label, fieldset { display: grid; gap: 0.3rem; font-size: 0.9rem; font-weight: 500; border: 0; padding: 0; margin: 0.4rem 0; }
.form input, .form textarea, .form select {
  min-height: 2.6rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: inherit; font: inherit; padding: 0.4rem 0.7rem; width: 100%;
}
textarea { min-height: 8rem; }
.check { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 400; }
.check input { width: auto; min-height: 0; margin-top: 0.25rem; }
.split { display: grid; gap: 0.7rem; align-items: end; }
@media (min-width: 640px) { .split { grid-template-columns: 1fr auto; } }
.split-desk { display: grid; gap: 1rem; }
@media (min-width: 900px) { .split-desk { grid-template-columns: 1.3fr 0.9fr; } }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th { text-align: left; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding: 0.7rem 0.9rem; }
td { padding: 0.7rem 0.9rem; border-top: 1px solid var(--border); vertical-align: top; }
.empty { color: var(--muted); }

.hero, .hero-stage {
  position: relative; overflow: hidden; background: var(--primary); color: var(--primary-fg);
  padding: 2.6rem 1.4rem 2.2rem; border-radius: 0 0 18px 18px; margin: -2.2rem -1.25rem 1.6rem;
}
.hero h1 { max-width: 16ch; font-size: clamp(1.7rem, 5vw, 3.6rem); }
.light, .lede.light, .muted.light { color: var(--primary-fg); opacity: 0.88; }
.kicker.light { color: var(--primary-fg); opacity: 0.7; }
.stats, .hero-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 1.8rem; max-width: 42rem;
  overflow: hidden; border-radius: 16px; border: 1px solid rgb(244 239 230 / 0.12); background: rgb(244 239 230 / 0.08);
}
.stats div, .hero-stats div { padding: 0.9rem 1rem; background: rgb(12 24 20 / 0.35); }
.stats dt, .hero-stats dt { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(244 239 230 / 0.6); }
.stats dd, .hero-stats dd { margin: 0.15rem 0 0; font-family: var(--font-display); font-size: 1.25rem; }
.stats.invert { background: var(--surface); border: 1px solid var(--border); color: var(--fg); }
.stats.invert div { background: var(--bg); }
.stats.invert dt { color: var(--muted); }
@media (min-width: 720px) { .stats, .hero-stats { grid-template-columns: repeat(4, 1fr); } }

.fact-strip {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; justify-content: center;
  padding: 0.7rem 1.25rem; margin: -1.6rem -1.25rem 1.6rem; background: var(--primary);
  color: var(--primary-fg); opacity: 0.95; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
}
.rights-rotate { margin: 1rem 0 0; font-family: var(--font-display); font-style: italic; font-size: 1.05rem; }
[data-rights-dots] { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.6rem 0 0; }
[data-rights-dots] button { width: 0.55rem; height: 0.55rem; padding: 0; border-radius: 999px; border: 1px solid rgb(244 239 230 / 0.35); background: transparent; }
[data-rights-dots] button.on { background: rgb(244 239 230 / 0.9); border-color: rgb(244 239 230 / 0.9); }
.path-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.6rem; }
.path-list li { display: grid; grid-template-columns: 3rem 1fr; gap: 0.8rem; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 0.9rem 1rem; }
.path-n { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
@media (min-width: 800px) { .path-list { grid-template-columns: repeat(5, 1fr); } .path-list li { grid-template-columns: 1fr; } }
.module-list { list-style: none; padding: 0; margin: 1rem 0; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; background: var(--surface); }
.module-list li, .module-list details { padding: 0.7rem 1.1rem; border-top: 1px solid var(--border); }
.module-list li:first-child, .module-list details:first-child { border-top: 0; }
.module-list summary { cursor: pointer; }
.progress { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; margin: 0.8rem 0 1rem; }
.progress span { display: block; height: 100%; background: var(--primary); }
.gates { padding-left: 1.1rem; }
.callout { border-left: 4px solid var(--primary); padding: 0.7rem 0.9rem; background: var(--surface); border-radius: 0 12px 12px 0; margin: 0.8rem 0; }
.callout.caution { border-left-color: var(--danger); }
.callout.statute { border-left-color: var(--accent); }
.ok-box { border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 1rem 1.1rem; margin: 0.8rem 0; }
.links { padding-left: 1.1rem; }
.links li { margin: 0.35rem 0; }
.chip { display: inline-block; margin: 0.2rem 0.25rem 0.2rem 0; padding: 0.35rem 0.7rem; border: 1px solid var(--border); border-radius: 999px; font-size: 0.8rem; }
.letter-draft { white-space: pre-wrap; font-family: inherit; }
.tiny { width: 3.2rem; min-height: 2.2rem; }
.nal-row { display: flex; gap: 0.5rem; align-items: center; margin: 0.35rem 0; }
.lab-choice { display: block; width: 100%; text-align: left; margin: 0.4rem 0; padding: 0.75rem 0.9rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: inherit; font: inherit; }
[data-lab] { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
[data-lab]:first-of-type { margin-top: 0.75rem; padding-top: 0; border-top: 0; }
.lab-choice.ok { border-color: var(--ok); }
.lab-choice.no { border-color: var(--danger); }
.home-rent { display: grid; gap: 0.7rem; }
.tool-grid { display: grid; gap: 0.75rem; }
@media (min-width: 760px) { .tool-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .tool-grid { grid-template-columns: 1fr 1fr 1fr 1fr; } }

.exam-lock { user-select: none; -webkit-user-select: none; }
.exam { max-width: 40rem; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 2rem 0 1.2rem; margin-top: 2rem; }
.site-footer .wrap { padding-top: 0; padding-bottom: 0; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin: 0.3rem 0; }
.fine { max-width: 72rem; margin: 1.2rem auto 0; padding: 0 1.25rem; font-size: 0.75rem; color: var(--muted); }

.certificate-sheet { position: relative; overflow: hidden; background: #f7f1e6; color: #1c1915; border-radius: 4px; box-shadow: 0 24px 60px -32px rgb(28 25 21 / 0.45); }
.certificate-specimen { position: absolute; z-index: 2; inset: 42% auto auto 50%; margin: 0; transform: translateX(-50%) rotate(-18deg); font-size: clamp(2rem, 6vw, 3.5rem); letter-spacing: 0.18em; text-transform: uppercase; color: rgb(143 45 45 / 0.16); pointer-events: none; font-weight: 600; }
.certificate-frame { margin: 14px; border: 2px solid #1e3d32; padding: 8px; }
.certificate-inner { border: 1px solid #c9bfb0; padding: clamp(1.4rem, 4vw, 2.8rem) clamp(1.2rem, 4vw, 2.4rem); text-align: center; }
.certificate-brand { display: flex; align-items: center; justify-content: center; gap: 1rem; text-align: left; }
.certificate-brand img { width: 72px; height: 72px; border-radius: 999px; object-fit: contain; background: #faf7f0; }

.print-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin: 0 0 1.2rem;
}
body.is-print { background: #fff; color: #1c1915; }
body.is-print .site-header,
body.is-print .site-footer,
body.is-print .official,
body.is-print .a11y,
body.is-print .a11y-bar { display: none; }
body.is-print .hero,
body.is-print .hero-stage {
  margin: 0 0 1rem; padding: 1rem 0; background: #fff; color: #1c1915; border-radius: 0;
}
body.is-print .kicker.light,
body.is-print .lede.light,
body.is-print .muted.light { color: #1c1915; }
body.is-print .btn.ghost-light { color: #1c1915; border-color: #c9bfb0; }

@media print {
  .no-print, .a11y, .a11y-bar, .official, .site-header, .site-footer, .print-bar { display: none !important; }
  html, body, body.is-print { background: white !important; color: #111 !important; }
  a { text-decoration: none; }
  .certificate-sheet { box-shadow: none !important; }
  .hero, .hero-stage { background: #fff !important; color: #111 !important; margin: 0 !important; padding: 0 0 1rem !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 979px) {
  .official { letter-spacing: 0.08em; padding: 0.4rem 0.9rem; font-size: 10px; }
  .site-header .bar { padding: 0.55rem 0.85rem; gap: 0.5rem; }
  .logo { width: 36px; height: 36px; }
  .org { font-size: 9px; letter-spacing: 0.12em; }
  .mark { font-size: 0.92rem; }
  .ghost-btn { font-size: 0.68rem; letter-spacing: 0.06em; min-height: 2.2rem; padding: 0.25rem 0.55rem; }
  .enrol { min-height: 2.2rem; padding: 0.25rem 0.7rem; font-size: 0.85rem; }
  .mobile { gap: 0.85rem; padding: 0.45rem 0.85rem; -webkit-overflow-scrolling: touch; }
  .wrap { padding: 1.25rem 0.9rem 2.5rem; }
  .hero, .hero-stage {
    margin: -1.25rem -0.9rem 1.1rem;
    padding: 1.4rem 0.9rem 1.3rem;
    border-radius: 0;
  }
  .hero h1 { font-size: clamp(1.55rem, 8vw, 2.2rem); max-width: none; }
  .fact-strip { margin-left: -0.9rem; margin-right: -0.9rem; padding: 0.55rem 0.9rem; letter-spacing: 0.1em; }
  .row .btn, .hero .btn { width: 100%; }
  .card { padding: 1rem 0.95rem; }
}
@media (max-width: 420px) {
  .brand span .org { display: none; }
}
