/* The Academy: design tokens (design-tokens, Nov 9, 2026; approved by the owner
   9:40-9:48 PM). One file, loaded first by English Academy, History, Economics
   and the parents' panel. Every look is a set of values for the same names, so
   a new page is right in every look by default. Names already in use are kept
   (--page, --card, --ink ...); the new roles sit beside them. Every text pair
   is held to WCAG AA by tests/tokens-contrast.test.js.

   Roles: page --page; surface --card; raised surface --raised; sunk --soft;
   headings --ink; text --body; secondary --text2; muted --muted; accent
   --primary (+ --primary-dark, --on-primary); link --link; focus --focus
   (and --focus-on-dark for the dark bar); rules --border, --border-strong;
   a control's edge --field-border; right, wrong, due, learning and warning
   (--right, --right-bg, --right-line ...). */

/* ---- Daylight, and the plain look of History, Economics and the panel ---- */
:root {
  --page: #F3F5F8;
  --card: #FFFFFF;
  --raised: #FFFFFF;
  --soft: #F6F8FB;
  --border: #DCE2EA;
  --border-strong: #B8C4D6;
  --field-border: #6E7A8C; /* a field's edge: 3:1 on the page and on cards */
  --topbar: #14213D;
  --on-topbar: #D6DEEB;
  --ink: #14213D;
  --body: #1F2937;
  --text2: #374151;
  --muted: #4B5563;
  --primary: #2457A6;
  --primary-dark: #163A73;
  --on-primary: #FFFFFF;
  --link: #2457A6;
  --focus: #2457A6;          /* owner, 9:46 PM: the accent blue (was yellow on white, about 1.7:1) */
  --focus-on-dark: #F2B705;  /* the yellow stays on the dark bar */
  --track: #E6EBF1;
  --green: #1F6E54;
  /* Right, wrong, due, learning: the same in every school, always with a word or a mark. */
  --right: #166534; --right-bg: #ECF7F1; --right-line: #2E7D57;
  --wrong: #991B1B; --wrong-bg: #FEF2F2; --wrong-line: #C53030;
  --due: #92400E;   --due-bg: #FEF3C7;   --due-line: #A8700F;
  --info: #1E40AF;  --info-bg: #E8EFFA;  --info-line: #6E8FC9;
  --warning: #92400E; --warning-bg: #FFFBEB;
  --right-text: #166534; --warn-text: #92400E; /* (older names, used inline by a few views) */

  /* Type: six steps. 13px is the smallest text anywhere. */
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-1: 13px; --fs-2: 15px; --fs-3: 16px; --fs-4: 20px; --fs-5: 26px; --fs-6: 38px; --fs-display: 46px;
  --lh-text: 1.5; --lh-read: 1.65; --lh-head: 1.2;
  --measure: 66ch;

  /* Space, shape, depth, motion. */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --r-1: 6px;   /* chips, small controls */
  --r-2: 10px;  /* buttons, fields, choices */
  --r-3: 14px;  /* cards, dialogs */
  --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(20,33,61,.06);
  --sh-2: 0 6px 18px rgba(20,33,61,.12);
  --sh-3: 0 18px 48px rgba(20,33,61,.22);
  --dur-1: 150ms; --dur-2: 220ms; --ease: cubic-bezier(.2,.7,.2,1);
  --target: 44px;
}
@media (prefers-reduced-motion: reduce) { :root { --dur-1: 0ms; --dur-2: 0ms; } }

/* ---- Lamplight ---- */
html.lamplight {
  --page: #EFE6D3;
  --card: #FBF6EB;
  --raised: #FFFBF2;
  --soft: #F5EDDC;
  --border: #DDCFB2;
  --border-strong: #C2AE88;
  --field-border: #7A6644;
  --topbar: #2B1D14;
  --on-topbar: #E9DBBF;
  --ink: #2A1E15;
  --body: #2E2419;
  --text2: #4B3D2E;
  --muted: #6B5A45;
  --primary: #7A2E1E;
  --primary-dark: #57200F;
  --on-primary: #FBF3E2;
  --link: #7A2E1E;
  --focus: #7A2E1E;
  --focus-on-dark: #E2B85A;
  --track: #E7DCC4;
  --green: #4E6B2F;
  --right: #3D5A1E; --right-bg: #EEF1DE; --right-line: #5E7A34;
  --wrong: #8B1E12; --wrong-bg: #F8E6DE; --wrong-line: #A8392A;
  --due: #7A4E0C;   --due-bg: #F5E6C4;   --due-line: #9C6A10;
  --info: #5A3A1A;  --info-bg: #F1E6D0;  --info-line: #A88A5A;
  --warning: #7A4E0C; --warning-bg: #F8EED7;
  --right-text: #3D5A1E; --warn-text: #7A4E0C;
  --sans: 'Newsreader', Georgia, serif;
}

/* ---- Quill & Ink: light inks on the dark stone ---- */
html.quill {
  --page: #1A1611; --card: #EFE3C6; --raised: #F5EBD2; --soft: #E6D6B2; --track: #D9C79E; --topbar: #100E0B; --on-topbar: #DCC79A;
  --ink: #F0DFAF; --body: #E8D9B5; --text2: #D8C59A; --muted: #C4AE80;
  --primary: #E3C77C; --primary-dark: #F2DFA6; --on-primary: #F2DFA6; --link: #E3C77C; --rubric: #EE9478;
  --border: #8E7340; --border-strong: #A88A4E; --field-border: #A88A4E; --green: #A9C98A;
  --seal: #7E1618; --seal-ink: #F2DFA6; --focus: #E9C46A; --focus-on-dark: #E9C46A;
  --right: #A9C98A; --right-bg: rgba(169,201,138,.12); --right-line: #A9C98A;
  --wrong: #EE9478; --wrong-bg: rgba(238,148,120,.12); --wrong-line: #EE9478;
  --due: #F0A868;   --due-bg: rgba(240,168,104,.12);   --due-line: #F0A868;
  --info: #E3C77C;  --info-bg: rgba(227,199,124,.10);  --info-line: #B08D3C;
  --warning: #F0A868; --warning-bg: rgba(240,168,104,.12);
  --right-text: #A9C98A; --warn-text: #F0A868;
  --serif: 'IM Fell English', Georgia, serif; --sans: 'IM Fell DW Pica', 'IM Fell English', Georgia, serif;
}
/* Quill & Ink's vellum: every element whose background is the card, the soft
   fill or another light colour (gathered from the stylesheets in quill-contrast)
   takes the dark inks again. :where keeps this from raising any rule's weight.
   (Their text colour at zero weight is in css/app.css.) */
html.quill :where(
  .about, .about-card, .academy-schools li, .alpha-card, .an-box, .an-figure, .an-node, .an-tree, .anchor-card,
  .anchor-hl, .arrival, .audio-bar, .book-divider, .btn.danger, .btn.danger:hover, .btn.warn, .btn.warn:hover,
  .callout, .callout.returned, .callout.suggest-note, .card, .ch-tile:hover, .chip, .chip-done, .chip-due,
  .chip-learning, .chip-locked, .chip-mastered, .chip-poem, .chip-ready, .choice, .choice.is-correct,
  .choice.is-wrong, .classmenu .menu a[aria-current], .conc input[type="search"], .copybook,
  .corner-choice.corner-right, .corner-choice.corner-right[disabled], .corner-choice.corner-wrong,
  .corner-choice.corner-wrong[disabled], .corner-form input, .corner-form select, .corner-form textarea,
  .corner-tabs a, .corner-trial, .demo-banner, .desk-class, .dg-answer, .dg-box, .dg-build, .dg-chip,
  .dg-chip:hover, .dg-paper-list, .dg-s:focus-visible, .dg-s:hover, .dg-sentence, .dj-q, .ed-add input,
  .ed-add select, .ed-addsec:hover, .ed-choice.right, .ed-diff > div, .ed-draft, .ed-form input[type="search"],
  .ed-form input[type="text"], .ed-form select, .ed-form textarea, .ed-iconbtn, .ed-just, .ed-main .field input,
  .ed-main .field select, .ed-main .field textarea, .ed-merged, .ed-nav, .ed-nav a, .ed-nav a:hover,
  .ed-nav a[aria-current="page"], .ed-passage, .ed-passage .ed-focus, .ed-pick, .ed-pill-draft, .ed-pill-live,
  .ed-published, .ed-results, .ed-search input, .ed-search-row input, .ed-section,
  .ed-section .ed-section-title:focus, .ed-section .ed-section-title:hover, .ed-section-title:focus,
  .ed-section-title:hover, .ed-start-row input, .ed-startpill.on, .ed-text .ed-active, .ed-text .ed-new,
  .ed-try-choice, .ed-try-passage .focus-mark, .ed-try-right, .ed-try-wrong, .ed-warning, .ed-withdrawn,
  .ed-work, .ed-works.ed-over, .example, .fc-card, .fc-card:hover, .feast.next, .feedback, .feedback.correct,
  .feedback.neutral, .feedback.wrong, .fold-card, .gal-frame, .gal-player, .glosses-on .device:hover,
  .glosses-on .device[aria-expanded="true"], .glosses-on .gloss:hover, .glosses-on .gloss[aria-expanded="true"],
  .glosses-on mark.famous, .glosses-on mark.famous:hover, .glosses-on mark.famous[aria-expanded="true"],
  .google-btn, .google-btn:hover, .hl-note, .honours-bar, .idea-kind-mock, .idea-kind-stub, .idea-kind-text,
  .idea-kind-working, .idea-status, .landed, .lib-filter, .lib-search input, .mark-note, .menu, .menu a:hover,
  .menu button:hover, .menu details.menu-more > summary:hover, .mnote, .mnote-device, .mnote-famous,
  .msg-student, .msg-tutor, .msg-wait, .owe-card, .passage, .pick, .pick:hover, .pick[aria-pressed="true"],
  .pill input + span, .placard, .placard:hover, .poem-text.picking .line:hover,
  .poem-text.picking .line[aria-pressed="true"], .poem-toggles .btn[aria-pressed="true"], .programme, .q-box,
  .rline.shown, .round-tab.now, .round-tab:hover, .rung, .rung-card, .rung.start, .sat-cross, .sat-data,
  .sat-foot, .sat-nav button, .sat-nav button.done, .sat-navbox, .sat-table thead th, .sentence:hover,
  .sentence[aria-pressed="true"], .shelf-btn:hover, .show-scan .scan-line, .skill, .skill.locked, .skip-link,
  .so-far, .stanza-tab, .stanza-tab.now, .strand-card, .subbar-nav a:hover, .tag-verify, .task, .task.done,
  .taste, .taste-intro, .ten-book, .thesis-box textarea, .title-page, .vocab-chip, .week-card .terms li,
  .week-list a:hover, .week-list a[aria-current], .why-panel, .work-card, .work-card.book,
  .writing-box[readonly], .ws-col, .ws-grid th, .ws-note, .xq-feedback, .xq-focus-el, .yard-choice,
  .yard-choice.own, .yard-choice:has(input:checked), .yard-game.coming, .yard-reason textarea,
  [data-gloss-toggle][aria-pressed="true"], [data-meter]:not([hidden]),
  [data-middle-school][aria-pressed="true"], input, input[type="email"], input[type="number"],
  input[type="text"], select, textarea) {
  --ink: #2A1A0E; --body: #2A1A0E; --text2: #45331F; --muted: #5E4A33;
  --primary: #7E1618; --primary-dark: #5C0F10; --link: #7E1618; --rubric: #7E1618; --focus: #7E1618;
  --border: #B89B62; --border-strong: #7A6438; --field-border: #7A6438; --green: #3E5A2A;
  --right: #2F5220; --right-bg: #E3E6C4; --right-line: #4E6B2F;
  --wrong: #7E1618; --wrong-bg: #F1D9C9; --wrong-line: #8E2A1E;
  --due: #7A3409;   --due-bg: #EED9B0;   --due-line: #8A5A10;
  --info: #45331F;  --info-bg: #E6D6B2;  --info-line: #8E7340;
  --warning: #7A3409; --warning-bg: #EED9B0;
  --right-text: #2F5220; --warn-text: #7A3409;
}

/* ---- Large type: every step grows at once ---- */
html.large-type { --fs-1: 15px; --fs-2: 17px; --fs-3: 19px; --fs-4: 23px; --fs-5: 29px; --fs-6: 42px; --fs-display: 50px; --lh-read: 1.8; }
