/* ==========================================================================
   MySchool.Life — production site stylesheet
   Tokens: palette "06 Graphite & Gold" + type "T2 Modern Registrar" (Bricolage
   Grotesque / Source Sans 3 / JetBrains Mono). 06 is 05 Highlighter retuned for a
   dark-led site — lifted graphite ground, muted gold accent (Dennis 2026-09-04;
   projects/msl/MSL-WWW-DESIGN.md D3 / §3.6 records the history and how to revert).
   Rebrand = swap the :root token blocks — plus the four <meta name="theme-color">
   pairs, js/theme.js THEME_COLOR and delete-me/index.html, which cannot read a CSS
   variable (all listed in §3.5).
   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 — 06: graphite neutrals, gold accent (ALWAYS ink text; gold on white is
     only 1.83:1 so the light button also takes a 1px ink border), blue for links */
  --bg: #F5F5F3;
  --surface: #FFFFFF;
  --surface-2: #EBEBE8;
  --text: #1C1F24;
  --muted: #52585F;
  --border: #D4D5D1;
  --accent: #E8AE29;
  --on-accent: #1C1F24;
  --accent-border: #1C1F24;
  --accent-2: #2A56CC;
  --accent-inv: #D9A441;
  --on-accent-inv: #1C1F24;
  --link: #2A56CC;
  --ok: #1F7A4D;
  --warn: #8A5A00;
  --bad: #B3261E;
  --focus: #2A56CC;
  --border-strong: #868D95;
  --shadow: 0 1px 0 rgba(28, 31, 36, 0.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1C1F24;
    --surface: #24282F;
    --surface-2: #2C313A;
    --text: #DADDE2;
    --muted: #9AA1AC;
    --border: #363B44;
    --accent: #D9A441;
    --on-accent: #1C1F24;
    --accent-border: #D9A441;
    --accent-2: #93B4F0;
    --accent-inv: #D9A441;
    --on-accent-inv: #1C1F24;
    --link: #93B4F0;
    --ok: #6FCF97;
    --warn: #D9A441;
    --bad: #F08A80;
    --focus: #D9A441;
    --border-strong: #6B7280;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1C1F24;
  --surface: #24282F;
  --surface-2: #2C313A;
  --text: #DADDE2;
  --muted: #9AA1AC;
  --border: #363B44;
  --accent: #D9A441;
  --on-accent: #1C1F24;
  --accent-border: #D9A441;
  --accent-2: #93B4F0;
  --accent-inv: #D9A441;
  --on-accent-inv: #1C1F24;
  --link: #93B4F0;
  --ok: #6FCF97;
  --warn: #D9A441;
  --bad: #F08A80;
  --focus: #D9A441;
  --border-strong: #6B7280;
  --shadow: none;
  color-scheme: dark;
}

/* ---- self-hosted fonts ------------------------------------------------
   Served from this origin, NOT fonts.googleapis.com. Google's domains are
   blocked in mainland China, and the stylesheet <link> was render-blocking:
   a dropped (not refused) connection left the page BLANK until the browser
   gave up — measured at >120 s, not a graceful fallback. Self-hosting also
   removes an undisclosed transfer of every visitor's IP to Google.

   All three families are SIL Open Font License 1.1 (see fonts/OFL-*.txt).
   Each file is a VARIABLE font: one file per subset covers the whole weight
   range, which is why `font-weight` below is a range, not a single value.
   That is also what gives us JetBrains Mono 600 — previously requested as
   400;500 only, so the 600 uses were being faux-bolded by the browser.

   Downloaded from Google Fonts 2026-09-05, unmodified, unicode-range
   subsetting preserved exactly as Google served it.
   ---------------------------------------------------------------------- */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('/fonts/bricolage-grotesque-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('/fonts/bricolage-grotesque-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/source-sans-3-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/source-sans-3-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- 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 { background: color-mix(in srgb, var(--accent) 85%, var(--text)); filter: none; }
.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; }
