/* ==========================================================================
   MySchool.Life — production site stylesheet
   Tokens: palette "05 Highlighter" + type "T2 Modern Registrar" (Bricolage Grotesque /
   Source Sans 3 / JetBrains Mono) — chosen by Dennis 2026-09-01 (docs/MSL-WWW-DESIGN.md D3/D4). Swap ONLY the :root token blocks to rebrand.
   Theme: light on :root; dark via prefers-color-scheme (unless data-theme=light)
   and via data-theme=dark. Components never name a colour directly.
   ========================================================================== */

:root {
  /* light — Highlighter: graphite neutrals, school-bus yellow accent, ink text, blue reserved for links */
  --bg: #F6F6F4;
  --surface: #FFFFFF;
  --surface-2: #ECECE8;
  --text: #16181C;
  --muted: #4D5259;
  --border: #D6D7D3;
  --accent: #F5B700;
  --on-accent: #16181C;
  --accent-border: #16181C;
  --accent-2: #1F4FD8;
  --link: #1F4FD8;
  --ok: #1F7A4D;
  --warn: #8A5A00;
  --bad: #B3261E;
  --focus: #1F4FD8;
  --border-strong: #8E949B;
  --shadow: 0 1px 0 rgba(22, 24, 28, 0.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121316;
    --surface: #1B1D22;
    --surface-2: #22252C;
    --text: #EDEEF0;
    --muted: #A6AAB2;
    --border: #2B2E36;
    --accent: #FFC72C;
    --on-accent: #16181C;
    --accent-border: #FFC72C;
    --accent-2: #8DB0FF;
    --link: #8DB0FF;
    --ok: #6FCF97;
    --warn: #FFC72C;
    --bad: #F08A80;
    --focus: #FFC72C;
    --border-strong: #5F6672;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121316;
  --surface: #1B1D22;
  --surface-2: #22252C;
  --text: #EDEEF0;
  --muted: #A6AAB2;
  --border: #2B2E36;
  --accent: #FFC72C;
  --on-accent: #16181C;
  --accent-border: #FFC72C;
  --accent-2: #8DB0FF;
  --link: #8DB0FF;
  --ok: #6FCF97;
  --warn: #FFC72C;
  --bad: #F08A80;
  --focus: #FFC72C;
  --border-strong: #5F6672;
  --shadow: none;
  color-scheme: dark;
}

/* ---- base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 "Source Sans 3", "Helvetica Neue", Arial, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: "Bricolage Grotesque", "Source Sans 3", system-ui, sans-serif; font-optical-sizing: auto; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 0.5em; text-wrap: balance; color: var(--text); }
h1 { font-size: clamp(2.25rem, 4.5vw, 3.25rem); }
h2 { font-size: clamp(1.625rem, 3vw, 2.125rem); }
h3 { font-size: 1.25rem; font-family: "Source Sans 3", system-ui, sans-serif; font-weight: 600; letter-spacing: 0; }
p { margin: 0 0 1em; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
ul, ol { padding-left: 1.25rem; margin: 0 0 1em; }
li { margin: 0.25em 0; }
strong { font-weight: 600; }
small { font-size: 0.875rem; }
code, .mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
th { font-weight: 600; font-size: 0.8125rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.table-wrap { overflow-x: auto; margin: 0 0 1.25rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); position: relative; scrollbar-width: thin; }
.table-wrap::after { content: ""; position: sticky; right: 0; top: 0; display: block; float: right; width: 28px; height: 100%; margin-left: -28px; background: linear-gradient(to right, transparent, color-mix(in srgb, var(--surface) 92%, transparent)); pointer-events: none; }
@media (min-width: 700px) { .table-wrap::after { display: none; } }
.table-wrap table { min-width: 640px; }
.table-wrap th, .table-wrap td { padding: 0.7rem 0.9rem; }
.table-wrap tr:last-child td { border-bottom: 0; }

.skip-link { position: absolute; left: -999px; top: 0.5rem; background: var(--accent); color: var(--on-accent); padding: 0.5rem 0.75rem; border-radius: 4px; z-index: 100; }
.skip-link:focus { left: 0.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.75rem; }
/* highlighter stroke — the brand mark for key phrases */
mark, .hl { background: linear-gradient(transparent 6%, var(--accent) 6%, var(--accent) 94%, transparent 94%); color: var(--on-accent); padding: 0 0.12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.container { width: min(1120px, 100% - 3rem); margin-inline: auto; }
.narrow { width: min(760px, 100% - 3rem); margin-inline: auto; }

/* ---- header ---------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--border); }
.site-header .bar { display: flex; align-items: center; gap: 1.25rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; margin-right: auto; }
.brand svg { display: block; }
.brand .dot { color: var(--accent-2); }
.brand .mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--on-accent); }
.nav-links { display: flex; gap: 1.25rem; align-items: center; font-size: 0.9375rem; }
.nav-links a { color: var(--muted); text-decoration: none; padding: 0.4rem 0; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 0.6rem; }
@media (max-width: 820px) { .nav-links { display: none; } }
@media (max-width: 560px) {
  .site-header .bar { gap: 0.75rem; }
  .site-header .btn-ghost { display: none; }
  .site-header .btn-primary { padding-inline: 0.85rem; font-size: 0.875rem; }
  .brand { font-size: 1rem; gap: 0.45rem; }
}
.cta-short { display: none; }
@media (max-width: 600px) { .site-header .cta-long { display: none; } .site-header .cta-short { display: inline; } }
@media (max-width: 380px) { .brand > span { display: none; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 44px; padding: 0.6rem 1.15rem; border-radius: 6px; font: 600 0.9375rem/1 "Source Sans 3", system-ui, sans-serif; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform 0.08s ease, background-color 0.15s ease, border-color 0.15s ease; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent-border); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-ghost { background: transparent; color: var(--text); border-color: transparent; padding-inline: 0.75rem; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn[disabled] { opacity: 0.6; cursor: default; }

/* theme toggle */
.theme-toggle { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); display: inline-grid; place-items: center; cursor: pointer; }
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

/* ---- legal / document pages ----------------------------------------- */
.doc-hero { padding: 3.5rem 0 2rem; border-bottom: 1px solid var(--border); }
.doc-hero p.lede { font-size: 1.125rem; color: var(--muted); max-width: 62ch; margin: 0; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 0.875rem; color: var(--muted); margin-top: 1rem; }
.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 3rem; padding: 2.5rem 0 5rem; align-items: start; }
@media (max-width: 900px) { .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; } }
.doc, .toc { min-width: 0; }
.toc { position: sticky; top: 84px; font-size: 0.875rem; border-left: 1px solid var(--border); padding-left: 1rem; max-height: calc(100vh - 100px); overflow: auto; }
.toc h2 { font: 600 0.75rem/1 "Source Sans 3", system-ui, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.75rem; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 0.3rem 0; color: var(--muted); text-decoration: none; }
.toc a:hover, .toc a.is-active { color: var(--text); }
@media (max-width: 900px) { .toc { position: static; border-left: 0; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); max-height: none; } .toc ol { columns: 2; column-gap: 1.5rem; } }
.doc { max-width: 72ch; }
.doc section { padding-top: 1rem; margin-bottom: 2.5rem; scroll-margin-top: 88px; }
.doc h2 { font-size: 1.625rem; margin-top: 0; }
.doc h3 { margin-top: 1.5rem; }
.doc h2 .num { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.8rem; color: var(--accent-2); letter-spacing: 0.08em; display: block; margin-bottom: 0.35rem; }

.summary-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 6px; padding: 1.25rem 1.5rem; margin: 0 0 2rem; }
.summary-card h2 { font-size: 1.125rem; font-family: "Source Sans 3", system-ui, sans-serif; font-weight: 600; margin: 0 0 0.75rem; }
.summary-card ul { margin: 0; padding-left: 1.1rem; }
.summary-card li { margin: 0.35em 0; }

.callout { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1rem 1.25rem; margin: 1.25rem 0; font-size: 0.9375rem; }
.callout.warn { border-left: 4px solid var(--warn); }
.callout.info { border-left: 4px solid var(--accent-2); }
.callout p:last-child { margin-bottom: 0; }

.defs dt { font-weight: 600; margin-top: 0.75rem; }
.defs dd { margin: 0.15rem 0 0; color: var(--muted); }

details.addendum { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); margin: 0.75rem 0; }
details.addendum summary { cursor: pointer; padding: 0.85rem 1.1rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.addendum summary::-webkit-details-marker { display: none; }
details.addendum summary::after { content: "+"; font-family: "JetBrains Mono", monospace; color: var(--muted); }
details.addendum[open] summary::after { content: "−"; }
details.addendum .body { padding: 0 1.1rem 1rem; font-size: 0.9375rem; }

/* ---- forms ------------------------------------------------------------ */
.form { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; }
.form .row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form .row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: 0.9375rem; }
.field .hint { font-size: 0.8125rem; color: var(--muted); }
.field input, .field select, .field textarea { font: inherit; font-size: 1rem; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px; padding: 0.7rem 0.85rem; min-height: 44px; width: 100%; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.check { display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.9375rem; margin: 0.5rem 0 1.25rem; }
.check input { width: 20px; height: 20px; margin-top: 0.2rem; flex: none; accent-color: var(--accent); }
.form-status { margin-top: 1rem; font-size: 0.9375rem; }
.form-status.ok { color: var(--ok); }
.form-status.bad { color: var(--bad); }
.success-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--ok); border-radius: 6px; padding: 1.25rem 1.5rem; }

/* ---- footer ----------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding: 2.5rem 0 3rem; font-size: 0.875rem; color: var(--muted); }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
@media (max-width: 820px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .site-footer .cols { grid-template-columns: 1fr; } }
.site-footer h4 { font: 600 0.75rem/1 "Source Sans 3", system-ui, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0.35rem 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.site-footer .legal { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; }
