/* Wren Café (the Foundation site's design system: design/wren-cafe/DESIGN-SYSTEM.md), restated for a
   site that loads nothing from anywhere else: system font fallbacks stand in for the web fonts. */
:root {
  --wc-cream: #FAF7F0; --wc-deep-cream: #F1EAD8; --wc-charcoal: #2B2B28; --wc-ink-soft: #4C4A42;
  --wc-green: #2E7D4F; --wc-green-ink: #1F5E3A; --wc-green-deep: #0F4A2C;
  --wc-orange-ink: #9C4E12; --wc-gold: #E8B54A; --wc-board: #22302F; --wc-chalk: #EFE9D8;
  --wc-line: rgba(43, 43, 40, .14); --wc-card-line: rgba(43, 43, 40, .2);
  --wc-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --wc-sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --wc-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --wc-r-pill: 999px; --wc-r-card: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--wc-cream); color: var(--wc-ink-soft); font-family: var(--wc-sans); font-size: 1.0625rem; line-height: 1.65; }
.wrap { width: min(100% - 2rem, 46rem); margin-inline: auto; }
h1, h2, h3, h4 { font-family: var(--wc-serif); color: var(--wc-charcoal); line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); font-weight: 600; margin: 1.25rem 0 1rem; }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.65rem); margin: 2.25rem 0 .6rem; }
h3 { font-size: 1.2rem; margin: 1.75rem 0 .5rem; }
a { color: var(--wc-green-ink); text-underline-offset: .18em; }
a:hover { color: var(--wc-green-deep); }
code, pre { font-family: var(--wc-mono); font-size: .92em; }
code { background: var(--wc-deep-cream); padding: .05em .3em; border-radius: 4px; }
pre { background: var(--wc-board); color: var(--wc-chalk); padding: 1rem; border-radius: var(--wc-r-card); overflow-x: auto; white-space: pre-wrap; }
pre code { background: none; padding: 0; color: inherit; }
blockquote { margin: 1rem 0; padding: .25rem 1rem; border-left: 4px solid var(--wc-gold); background: var(--wc-deep-cream); }
.table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .97rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--wc-card-line); vertical-align: top; }
th { color: var(--wc-charcoal); }
.lede { font-size: 1.15rem; color: var(--wc-charcoal); }
.of { font-family: var(--wc-sans); font-size: .55em; font-weight: 400; color: var(--wc-ink-soft); }
.hint { font-style: italic; }
figure { margin: 1.5rem 0; max-width: 100%; overflow-x: auto; border-radius: var(--wc-r-card); }
figure img { display: block; min-width: 320px; max-width: 100%; height: auto; border-radius: var(--wc-r-card); }
figcaption { margin-top: .5rem; font-family: var(--wc-mono); font-size: .75rem; color: var(--wc-ink-soft); }
.not-yet { color: var(--wc-ink-soft); font-style: italic; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: absolute; left: 1rem; top: -4rem; background: var(--wc-charcoal); color: #fff; padding: .6rem 1rem; border-radius: var(--wc-r-pill); z-index: 1; }
.skip:focus { top: 1rem; color: #fff; }
.site-head { border-bottom: 1px solid var(--wc-line); }
.site-head .wrap { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; padding: .9rem 0; }
.brand { font-family: var(--wc-serif); font-weight: 700; font-size: 1.2rem; color: var(--wc-charcoal); text-decoration: none; }
.eyebrow { margin: 0; font-family: var(--wc-mono); font-weight: 600; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--wc-green-ink); }
main { padding-bottom: 3rem; }
main:focus { outline: none; }
.site-foot { border-top: 1px solid var(--wc-line); font-size: .95rem; padding: 1rem 0 2rem; }
.site-foot p { margin: .25rem 0; }
.crumbs { margin: 1.25rem 0 0; font-size: .95rem; }

.draft-banner { background: #FBEBD9; border: 2px solid var(--wc-orange-ink); color: var(--wc-charcoal); padding: .75rem 1rem; border-radius: var(--wc-r-card); margin: 1rem 0; }
.draft-banner strong { color: var(--wc-orange-ink); }

.gears { margin: 1rem 0 .5rem; }
.gears-label { margin: 0 0 .4rem; font-size: .95rem; }
.gears ul, .module-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.gears a { display: flex; flex-direction: column; min-height: 44px; padding: .45rem .9rem; border: 1px solid var(--wc-card-line); border-radius: var(--wc-r-card); background: #fff; text-decoration: none; color: var(--wc-charcoal); line-height: 1.3; }
.gears a[aria-current="page"] { border-color: var(--wc-green-ink); box-shadow: inset 0 0 0 2px var(--wc-green-ink); }
.gear-name { font-weight: 700; }
.gear-what { font-size: .85rem; color: var(--wc-ink-soft); }
.module-nav { margin: .75rem 0 0; border-bottom: 1px solid var(--wc-line); }
.module-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem; text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
.module-nav a[aria-current="page"] { color: var(--wc-charcoal); border-bottom-color: var(--wc-green); }

.lesson { color: var(--wc-charcoal); }
.objective { display: block; scroll-margin-top: 1rem; }
.cite { line-height: 0; font-size: .75em; }
.cite a { padding: 0 .15em; font-weight: 700; }
.cite:has(+ .cite) a, .cite + .cite a {
  display: inline-block; min-width: 24px; min-height: 24px; line-height: 24px; text-align: center;
}
.notes { font-size: .95rem; border-top: 1px solid var(--wc-line); margin-top: 2.5rem; }
.notes li { margin: .5rem 0; scroll-margin-top: 1rem; }
.notes li:target { background: var(--wc-deep-cream); }
.sid { font-family: var(--wc-mono); font-size: .75rem; color: var(--wc-green-ink); margin-right: .25rem; }
.checked { color: var(--wc-green-ink); }
.unchecked, .missing { color: var(--wc-orange-ink); font-weight: 600; }
.back { text-decoration: underline; padding: 0 .2em; }
.maths { background: var(--wc-deep-cream); color: var(--wc-charcoal); }

.stamp { margin: 2.5rem 0 1rem; padding: 1rem 1.25rem; background: var(--wc-deep-cream); border-radius: var(--wc-r-card); }
.stamp h2 { margin-top: 0; font-size: 1.2rem; }
.stamp dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.25rem; margin: 0; }
.stamp dt { font-family: var(--wc-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--wc-charcoal); padding-top: .2rem; }
.stamp dd { margin: 0; }
.stamp ul { margin: 0; padding: 0; list-style: none; }
@media (max-width: 30rem) { .stamp dl { grid-template-columns: 1fr; } .stamp dd { margin-bottom: .4rem; } }

.modules { list-style: none; padding: 0; margin: 0; }
.modules li { padding: .7rem 0; border-bottom: 1px solid var(--wc-line); display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; }
.module-title { font-weight: 700; color: var(--wc-charcoal); }
.status { font-size: .85rem; color: var(--wc-orange-ink); font-weight: 600; }
.gear-links { display: flex; flex-wrap: wrap; gap: .25rem .65rem; flex-basis: 100%; }
.gear-links a { display: inline-block; min-height: 24px; padding: .1rem .15rem; }
.progress-panel { padding: 1rem 1.25rem; background: var(--wc-deep-cream); border-radius: var(--wc-r-card); }
.progress-panel h2 { margin-top: 0; }
.progress-panel .actions { margin-top: .75rem; }
.progress-panel [hidden], .quiz-tick[hidden] { display: none; }
#progress-status { margin-bottom: 0; }
#progress-status:empty { margin: 0; }
.quiz-tick { display: inline-flex; gap: .25rem; align-items: center; color: var(--wc-green-ink); font-weight: 600; }
.quiz-tick svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.model-answer { margin: .75rem 0 1.5rem; border: 1px solid var(--wc-card-line); border-radius: var(--wc-r-card); background: #fff; }
.model-answer summary { cursor: pointer; padding: .6rem 1rem; min-height: 44px; font-weight: 700; color: var(--wc-green-ink); }
.model-answer > :not(summary) { margin-left: 1rem; margin-right: 1rem; }

.quiz { margin: 1rem 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-family: var(--wc-serif); font-size: 1.25rem; font-weight: 600; color: var(--wc-charcoal); margin-bottom: 1rem; padding: 0; }
.choices { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.choices li { position: relative; }
.choices input { position: absolute; left: 1rem; top: 1.05rem; width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--wc-green); }
.choices label { display: block; min-height: 44px; padding: .75rem 1rem .75rem 3rem; background: #fff; border: 1px solid var(--wc-card-line); border-radius: var(--wc-r-card); color: var(--wc-charcoal); cursor: pointer; }
.choices input:checked + label { border-color: var(--wc-green-ink); box-shadow: inset 0 0 0 2px var(--wc-green-ink); }
.choices input:disabled + label { cursor: default; }
.choices label.keyed { border-color: var(--wc-green-ink); background: #E7F2EA; }
.tag { font-weight: 700; color: var(--wc-green-ink); }
.feedback { margin: 1rem 0 0; padding: .75rem 1rem; border-radius: var(--wc-r-card); border-left: 4px solid var(--wc-green); background: var(--wc-deep-cream); color: var(--wc-charcoal); }
.feedback.wrong { border-left-color: var(--wc-orange-ink); }
.feedback p { margin: .25rem 0; }
.verdict { font-weight: 700; }
.feedback:focus { outline-offset: 2px; }
.error { color: #8A1C1C; font-weight: 600; margin: .5rem 0; }
.error:empty { margin: 0; }
.score { font-family: var(--wc-serif); font-size: 1.4rem; color: var(--wc-charcoal); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.next { margin-top: 2rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .6rem 1.4rem; border: 2px solid var(--wc-green); border-radius: var(--wc-r-pill); background: var(--wc-green); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; max-width: 100%; text-align: center; white-space: normal; }
.btn:hover { background: var(--wc-green-deep); border-color: var(--wc-green-deep); color: #fff; }
.btn-quiet { background: transparent; color: var(--wc-green-ink); }
.btn-quiet:hover { background: var(--wc-deep-cream); color: var(--wc-green-deep); }

/* One focus ring for every control: the café's gold, edged in charcoal so it holds 3:1 on cream. */
:focus-visible { outline: 3px solid var(--wc-charcoal); outline-offset: 2px; box-shadow: 0 0 0 2px var(--wc-gold); }
.choices input:focus-visible { outline: none; box-shadow: none; }
.choices input:focus-visible + label { outline: 3px solid var(--wc-charcoal); outline-offset: 2px; box-shadow: 0 0 0 2px var(--wc-gold); }
h1:focus, h2:focus { outline: none; }

/* On a screen tall enough, the gear switch stays in view so switching never means scrolling back. */
@media (min-height: 40em) and (min-width: 40em) {
  .gears { position: sticky; top: 0; z-index: 2; margin: 0 -.5rem; padding: .5rem; background: var(--wc-cream); border-bottom: 1px solid var(--wc-card-line); }
  .gears ul { flex-wrap: nowrap; }
  .gears-label, .gear-what { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html { scroll-padding-top: 5rem; }
  .objective, .notes li { scroll-margin-top: 5rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) {
  .choices input:checked + label, .gears a[aria-current="page"] { outline: 3px solid CanvasText; }
  .draft-banner { border-color: CanvasText; }
}
.quiz .from { font-size: .95rem; margin-top: .5rem; }
.quiz .draft-item { display: block; margin-top: .35rem; }
.modules .when { display: block; font-size: .9rem; }
.reread ul { margin: .25rem 0 1rem; }
