/* Chalkboard layer, injected on every page by the Worker (injectSiteWidgets) just before high-contrast.css, so the
   accessibility themes still win. Dark theme = chalkboard (slate green, chalk-white ink, faint dust); Caveat is the
   hand-lettered accent font. Static only: no animation. */
@font-face{font-family:'Caveat';font-style:normal;font-weight:600 700;font-display:swap;src:url('/fonts/caveat-latin.woff2') format('woff2')}

[data-theme="dark"]{
  /* site pages (homepage, about, help, tips, planner, dashboard...) */
  --bg:#1b2a25; --bg-card:#243630; --bg-header:#16231f; --border:#3b524a; --border-hover-soon:#4d6a5f;
  --text:#f1eee3; --text-muted:#c3ccc0; --nav-text:#f1eee3; --chip-bg:#2a3f37;
  /* guide pages */
  --surface:#243630; --surface-2:#202f2a; --surface-hover:#2b4038; --border-strong:#4f6a60; --control-border:#7f9a8e;
  --ink:#f1eee3; --ink-muted:#c3ccc0; --ink-dim:#a9b6ac;
  --accent:oklch(0.84 0.1 160); --accent-ink:oklch(0.9 0.07 160); --accent-soft:rgba(168,226,196,.14);
  --diagram-bg:var(--surface);
}
/* Chalk dust: a few faint smudges behind everything, painted once. */
[data-theme="dark"] body::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;
  background:
    radial-gradient(ellipse 60% 18% at 22% 12%,rgba(241,238,227,.045),transparent 70%),
    radial-gradient(ellipse 50% 14% at 78% 38%,rgba(241,238,227,.035),transparent 70%),
    radial-gradient(ellipse 70% 20% at 40% 82%,rgba(241,238,227,.04),transparent 70%)}
/* Chalk-line edges instead of soft shadows on cards. */
[data-theme="dark"] :is(.unit,.fun-fact,.ss-card,.card){border-color:rgba(241,238,227,.2)}

/* Hand-lettered accents (Caveat runs small, so each is nudged up). */
.hand,.edition,.trap::before,.face .lbl,.qr-k,.sgt-label,.dcap,.fun-fact b,.sage-toast p,.sage-loading p,.ss-hero h1 em.chalk-u{
  font-family:'Caveat','Kalam','Segoe Print',cursive!important;font-weight:700;letter-spacing:0;text-transform:none}
.edition,.face .lbl,.qr-k{font-size:1.35em}
.trap::before,.sgt-label{font-size:1.25em}
.dcap,.fun-fact b{font-size:1.2em}
.sage-toast p,.sage-loading p{font-size:1.3em}
.ss-hero h1 em.chalk-u{font-size:1.2em}
.chalk-doodle text,.chalkboard text,.guide-chalk text{font-family:'Caveat','Kalam',cursive!important;font-weight:700}

/* Bricolage Grotesque: the thick, rounded site font for headings, buttons and labels. */
/* Bricolage Grotesque is the default for all text: headings, titles, buttons, tabs, labels, chips and other short UI text.
   Longer reading text stays Atkinson Hyperlegible Next so it is easy to read: paragraphs, list items, tables, questions, answer
   choices, explanations and form fields. Math, code, the Caveat chalk accents and SVG doodles keep their own fonts,
   and dyslexia mode keeps Atkinson. :not(#x) beats the guides' body-wide font rule. */
html:not([data-dys]) body *:not(.katex):not(.katex *):not(code):not(pre):not(kbd):not(svg *):not(:is(.hand,.edition,.face .lbl,.qr-k,.sgt-label,.dcap,.fun-fact b,.sage-toast p,.sage-loading p,.chalk-u,.pt-title,.pt-sub,.pt-done)):not(#x){font-family:'Bricolage Grotesque','Bricolage Grotesque Fallback','Atkinson Hyperlegible Next','Atkinson Hyperlegible Next Fallback',system-ui,sans-serif!important}
html:not([data-dys]) body :is(p,li:not(nav *):not([role="menu"] *),dd,td,blockquote,figcaption,textarea,input:not([type="submit"]):not([type="button"]),select,.q-text,.q-opt,.q-exp,.tp-stem-text,.tp-opt,.tp-exp,.ex-qtext,.mem-d,.mem-intro,.qr-v,.cbot-msg,.c-list,.trap,.def,.ex2-intro,.ex2-prompt,.c-text,.formula,.ex-exp,.ex-sa,.ex-fr-label,.ex-lockdown-label):not(.katex):not(.katex *):not(code):not(pre):not(kbd):not(svg *):not(:is(.hand,.edition,.face .lbl,.qr-k,.sgt-label,.dcap,.fun-fact b,.sage-toast p,.sage-loading p,.chalk-u,.pt-title,.pt-sub,.pt-done)):not(#x),
html:not([data-dys]) body :is(p,li:not(nav *):not([role="menu"] *),dd,td,blockquote,figcaption,textarea,input:not([type="submit"]):not([type="button"]),select,.q-text,.q-opt,.q-exp,.tp-stem-text,.tp-opt,.tp-exp,.ex-qtext,.mem-d,.mem-intro,.qr-v,.cbot-msg,.c-list,.trap,.def,.ex2-intro,.ex2-prompt,.c-text,.formula,.ex-exp,.ex-sa,.ex-fr-label,.ex-lockdown-label) *:not(.katex):not(.katex *):not(code):not(pre):not(kbd):not(svg *):not(:is(.hand,.edition,.face .lbl,.qr-k,.sgt-label,.dcap,.fun-fact b,.sage-toast p,.sage-loading p,.chalk-u,.pt-title,.pt-sub,.pt-done)):not(#x){font-family:'Atkinson Hyperlegible Next','Atkinson Hyperlegible Next Fallback',system-ui,sans-serif!important}
/* Headings, and buttons that sit inside a list item or paragraph, stay Bricolage Grotesque. */
html:not([data-dys]) body :is(h1,h2,h3,h4,.unit-title,.ss-sec-h,button,.btn,.tab-btn,[role="tab"]):not(.q-opt):not(.tp-opt):not(.tp-bank-row):not(.katex):not(.katex *):not(code):not(pre):not(kbd):not(svg *):not(:is(.hand,.edition,.face .lbl,.qr-k,.sgt-label,.dcap,.fun-fact b,.sage-toast p,.sage-loading p,.chalk-u,.pt-title,.pt-sub,.pt-done)):not(#x),
html:not([data-dys]) body :is(h1,h2,h3,h4,.unit-title,.ss-sec-h) *:not(.katex):not(.katex *):not(code):not(pre):not(kbd):not(svg *):not(:is(.hand,.edition,.face .lbl,.qr-k,.sgt-label,.dcap,.fun-fact b,.sage-toast p,.sage-loading p,.chalk-u,.pt-title,.pt-sub,.pt-done)):not(#x){font-family:'Bricolage Grotesque','Bricolage Grotesque Fallback','Atkinson Hyperlegible Next','Atkinson Hyperlegible Next Fallback',system-ui,sans-serif!important}
html:not([data-dys]) body :is(h1,h2,h3,.unit-title,.ss-sec-h,.ss-hero-title):not(#x){font-weight:700!important}
/* Homepage stats ("59 classes · 20,358 practice questions") are short labels, so they use the site font too. */
html:not([data-dys]) body .ss-hero-stats :is(li,li *):not(#x):not(#y){font-family:'Bricolage Grotesque','Bricolage Grotesque Fallback','Atkinson Hyperlegible Next','Atkinson Hyperlegible Next Fallback',system-ui,sans-serif!important;font-size:1.15em}

