/*
 * One stylesheet for the whole site.
 *
 * Two constraints drive every decision here:
 *
 *   1. Parents, not students. Anything that needs explaining is a mistake.
 *      One accent, one button style, few borders, lots of air.
 *   2. Mid-range Android on mobile data. No web fonts, no framework, no icon
 *      set, no JS for layout. System fonts render instantly and cost nothing.
 */

/*
 * Plus Jakarta Sans, self-hosted. One 27KB variable file covers weights
 * 400-800 and the latin range, so there is a single font request and no
 * third-party connection to Google.
 *
 * `swap` means text is readable in the system font immediately and reflows
 * when the font lands — on a slow connection that is the difference between
 * reading and staring at nothing.
 */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-latin.7660bd9909fb.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

:root {
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Army green, deep enough to read as almost-black at small sizes. */
  --green-900: #1B2413;
  --green-800: #26331A;
  --green-700: #354627;   /* the thick green: headers, primary surfaces */
  --green-600: #465A31;
  --green-300: #A8B694;
  --green-100: #EDF0E6;   /* soft page bands */

  --yellow: #E9B824;      /* calls to action, and nothing else */
  --yellow-dark: #C79A12;

  --ink: #1B2413;
  --muted: #5E6B52;
  --line: #DDE2D3;
  --bg: #FFFFFF;

  --warn: #A8481B;
  --radius: 8px;
  --wrap: 60rem;
  --narrow: 34rem;

  /* Side gutter. Widened on phones — 20px reads as flush against the edge
     once the text is 17px, and cramped text looks amateurish before anyone
     has read a word of it. */
  --gutter: 1.25rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  /* Set separately rather than via the `font` shorthand: the shorthand with a
     custom property is easy to break, and the font is the first thing anyone
     judges. */
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);

  /* Guard against a single wide child (a canvas, a long URL) making the whole
     page scroll sideways — which is what makes gutters look like they have
     vanished. `clip` rather than `hidden` so sticky positioning still works. */
  overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-700); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--green-900); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .7rem; letter-spacing: -0.01em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.35rem; margin-top: 2.5rem; }
h3 { font-size: 1.1rem; margin-top: 1.5rem; }
p { margin: 0 0 1.1rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: var(--narrow); }
.lede { font-size: 1.12rem; color: var(--muted); }
.meta { color: var(--muted); font-size: .92rem; }
.section { padding-block: 3rem; }
.center { text-align: center; }

/* Spacing utilities.
   A small fixed set, so templates never need a one-off `style=` attribute for
   a margin. Inline styles are how a design system quietly stops being one:
   they are invisible to a global change and drift apart page by page. */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.pt-3 { padding-top: 2rem; }
.pt-4 { padding-top: 3rem; }
.mb-3 { margin-bottom: 1.5rem; }
.ml-1 { margin-left: .5rem; }
.tight { margin: 0 0 .5rem; }
.tight-2 { margin: 0 0 1rem; }

/* A price line above a call to action. */
.price { margin: 0 0 .3rem; font-size: 1.15rem; }
/* "(optional)" beside a field label, which is itself bold. */
.label-optional { font-weight: 400; }

/* Third-party embed (the Cal.com calendar). Fixed height because the iframe
   cannot report its own, and it must not collapse to nothing. */
.embed-frame {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-top: 1rem;
}
.embed-frame iframe { width: 100%; height: 44rem; border: 0; display: block; }

/* A row of buttons or links. */
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1.5rem; }

/* Label on the left, value on the right — timetables, score rows. */
.split { display: flex; justify-content: space-between; gap: 1rem; }

/* A link that should not look like one. */
.plain { text-decoration: none; color: inherit; }

/* ---------------------------------------------------------------- header */

.site-header { background: var(--green-700); color: #fff; }
.site-header a { color: #fff; text-decoration: none; }
.site-header__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; min-height: 3.5rem; gap: 1rem;
}
.brand { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand em { font-style: normal; color: var(--yellow); }

.nav { margin-left: auto; display: flex; align-items: center; gap: .2rem; }
.nav a {
  padding: .5rem .7rem; border-radius: var(--radius);
  font-size: .95rem; opacity: .92;
}
.nav a:hover { background: rgba(255,255,255,.12); opacity: 1; }
.nav a[aria-current="page"] { opacity: 1; box-shadow: inset 0 -2px 0 var(--yellow); }
.nav .btn { margin-left: .5rem; }

/* Hamburger: a checkbox, so the menu works with JavaScript switched off. */
.nav-toggle { display: none; }
.nav-toggle-label { display: none; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.9rem; padding: .55rem 1.35rem;
  font: inherit; font-weight: 650; line-height: 1.2;
  background: var(--yellow); color: var(--green-900);
  border: 0; border-radius: var(--radius);
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--yellow-dark); color: var(--green-900); }
.site-header .btn { color: var(--green-900); }
.btn--quiet {
  background: transparent; color: var(--green-700);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn--quiet:hover { background: var(--green-100); color: var(--green-900); }
.site-header .btn--quiet { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); }
.btn--block { width: 100%; }
/* Submit buttons get the primary treatment without needing a class on every
   form in the codebase. */
form button[type=submit] {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-height: 2.9rem; padding: .55rem 1.35rem;
  font: inherit; font-weight: 650;
  background: var(--yellow); color: var(--green-900);
  border: 0; border-radius: var(--radius); cursor: pointer;
}
form button[type=submit]:hover { background: var(--yellow-dark); }

/* ---------------------------------------------------------------- hero */

.hero { padding-block: 3.5rem 2.5rem; }
.hero h1 { font-size: 2.5rem; max-width: 16ch; }
.hero .lede { max-width: 44ch; }
.hero__actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.75rem; }

.band { background: var(--green-100); padding-block: 3rem; margin: 3.5rem 0 0; }
.band--dark { background: var(--green-700); color: #fff; }
.band--dark h2 { color: #fff; }
.band--dark .lede { color: var(--green-300); }

/* ---------------------------------------------------------------- lists */

/* `min(16rem, 100%)` rather than a bare 16rem: on a narrow phone a fixed
   minimum forces the track wider than its container and the page scrolls
   sideways. */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); }

/* Minimal cards: a hairline and space, not a box with shadows. */
.card { border-top: 2px solid var(--green-700); padding: 1rem 0 0; }
.card h3 { margin-top: 0; }
.card a { text-decoration: none; color: var(--ink); }
.card a:hover { color: var(--green-700); }
.card--boxed {
  border: 1px solid var(--line); border-top: 2px solid var(--green-700);
  border-radius: var(--radius); padding: 1.15rem;
}
.card--soft { background: var(--green-100); border: 0; border-radius: var(--radius); padding: 1.15rem; }

.steps { list-style: none; padding: 0; counter-reset: step; margin: 1.5rem 0 0; }
.steps li { position: relative; padding-left: 2.75rem; margin-bottom: 1.5rem; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--yellow); color: var(--green-900);
  font-size: .9rem; font-weight: 700;
}

.pill {
  display: inline-block; padding: .12rem .55rem; margin-right: .3rem;
  border-radius: 999px; background: var(--green-100); color: var(--green-800);
  font-size: .8rem; font-weight: 600;
}
.pill--yellow { background: var(--yellow); color: var(--green-900); }

.rows { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.rows li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.rows li:first-child { border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- prose */

.prose { max-width: 38rem; }
.prose h2 { margin-top: 2.25rem; }
.prose ul, .prose ol { margin: 0 0 1.1rem; padding-left: 1.25rem; }
.prose li { margin-bottom: .4rem; }
.prose figure { margin: 2rem 0; }
.prose figcaption { font-size: .9rem; color: var(--muted); margin-top: .6rem; }
.prose iframe { max-width: 100%; border: 0; aspect-ratio: 16/9; height: auto; }

.callout {
  border-left: 3px solid var(--yellow); background: var(--green-100);
  padding: 1rem 1.15rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.75rem 0;
}
.callout__heading { margin: 0 0 .35rem; font-size: 1rem; }
.callout--mistake { border-left-color: var(--warn); }

.download {
  display: block; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1rem; margin: 1rem 0;
}
.download:hover { border-color: var(--green-700); }
.download__title { display: block; font-weight: 650; }
.download__desc, .download__meta { display: block; font-size: .9rem; color: var(--muted); }

/* ---------------------------------------------------------------- video */

.video { margin: 2rem 0; }
.video__frame {
  position: relative; aspect-ratio: 16/9; overflow: hidden;
  background: var(--green-900); border-radius: var(--radius);
}
.video__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video__play {
  width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer;
  background: var(--green-800); display: grid; place-items: center; position: relative;
}
.video__play img { width: 100%; height: 100%; object-fit: cover; }
.video__play-icon {
  position: absolute; display: grid; place-items: center;
  width: 4rem; height: 4rem; border-radius: 50%;
  background: var(--yellow); color: var(--green-900);
  font-size: 1.4rem; padding-left: .2rem;
}
.video__duration {
  position: absolute; right: .6rem; bottom: .6rem;
  background: rgba(0,0,0,.7); color: #fff;
  font-size: .8rem; padding: .1rem .45rem; border-radius: 4px;
}

/* Expandable explanations and transcripts share one look. */
.nutshell, .transcript {
  border-left: 3px solid var(--green-300);
  padding-left: 1rem; margin: 1.25rem 0;
}
.nutshell > summary, .transcript > summary {
  cursor: pointer; font-weight: 650; color: var(--green-700);
  list-style: none; padding: .2rem 0;
}
.nutshell > summary::-webkit-details-marker,
.transcript > summary::-webkit-details-marker { display: none; }
.nutshell > summary::before, .transcript > summary::before {
  content: "+ "; font-weight: 700; color: var(--yellow-dark);
}
.nutshell[open] > summary::before, .transcript[open] > summary::before { content: "− "; }
.nutshell__body, .transcript__body { padding-top: .4rem; }
.nutshell__body > *:last-child, .transcript__body > *:last-child { margin-bottom: 0; }
.transcript__body { max-height: 22rem; overflow-y: auto; font-size: .95rem; color: var(--muted); }

/* ---------------------------------------------------------------- sketches */

.sketch { margin: 2rem 0; }
.sketch__prompt { font-weight: 650; }
.sketch__stage {
  display: grid; place-items: center; overflow: hidden;
  background: var(--green-100); border-radius: var(--radius);
}
.sketch__start {
  width: 100%; min-height: inherit; background: none; border: 0; padding: 2rem 0;
  cursor: pointer; position: relative; display: grid; place-items: center;
}
.sketch__start-label {
  display: inline-block; padding: .7rem 1.4rem; border-radius: 999px;
  background: var(--yellow); color: var(--green-900); font-weight: 650;
}
.sketch__start img + .sketch__start-label { position: absolute; }
.sketch__credit { display: block; margin-top: .3rem; }
.sketch canvas { display: block; max-width: 100%; }
.sketch__error, .sketch__loading, .sketch__missing { padding: 2rem 1rem; color: var(--muted); }

.sketch-ui { width: 100%; padding: .9rem 1rem 1rem; background: #fff; border-top: 1px solid var(--line); }
.sketch-ui__row { display: flex; align-items: center; gap: .8rem; margin-bottom: .7rem; }
.sketch-ui__row:last-child { margin-bottom: 0; }
.sketch-ui__label { flex: none; min-width: 6.5rem; font-size: .92rem; font-weight: 650; }
.sketch-ui input[type=range] { flex: 1; min-width: 0; height: 2rem; accent-color: var(--green-700); }
.sketch-ui button {
  min-height: 2.6rem; padding: .4rem 1.1rem; width: auto; font: inherit; font-weight: 650;
  background: var(--green-700); color: #fff; border: 0; border-radius: var(--radius); cursor: pointer;
}
.sketch-ui button:hover { background: var(--green-800); }

/* ---------------------------------------------------------------- forms */

label { display: block; font-weight: 650; margin: 1.1rem 0 .35rem; font-size: .95rem; }
input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=password], select, textarea {
  width: 100%; padding: .75rem .8rem; font: inherit;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink);
}
input:focus-visible, select:focus-visible, textarea:focus-visible,
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--yellow); outline-offset: 2px;
}
.errors { color: var(--warn); font-size: .9rem; margin: .35rem 0 0; }
.checkline { display: flex; gap: .6rem; align-items: flex-start; margin: 1rem 0 0; }
.checkline input { width: 1.15rem; height: 1.15rem; margin-top: .25rem; flex: none; accent-color: var(--green-700); }
.checkline label { margin: 0; font-weight: 400; font-size: .95rem; }

.gate { background: var(--green-100); border-radius: var(--radius); padding: 1.5rem; margin: 2rem 0; }
.gate h2 { margin-top: 0; }

/* ---------------------------------------------------------------- quiz */

.quiz { max-width: var(--narrow); margin: 0 auto; padding: 1.75rem var(--gutter) 4rem; }
.progress { height: 5px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 1.5rem; }
.progress > span { display: block; height: 100%; background: var(--green-700); transition: width .2s ease; }
.question { font-size: 1.25rem; font-weight: 650; margin: .4rem 0 0; }

ul.options { list-style: none; margin: 1.25rem 0 0; padding: 0; }
ul.options li { margin: 0 0 .6rem; }
ul.options label {
  display: flex; align-items: center; gap: .75rem; margin: 0;
  padding: .9rem 1rem; font-weight: 500; min-height: 3rem;
  border: 1.5px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
ul.options input[type=radio] { width: 1.2rem; height: 1.2rem; flex: none; accent-color: var(--green-700); }
ul.options label:has(input:checked) { border-color: var(--green-700); background: var(--green-100); }

.bar { margin: 0 0 1rem; }
.bar__label { display: flex; justify-content: space-between; font-size: .95rem; margin-bottom: .3rem; font-weight: 600; }
.bar__track { height: 9px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar__fill { display: block; height: 100%; background: var(--green-700); }
.bar--low .bar__fill { background: var(--yellow); }
.blur { filter: blur(5px); user-select: none; pointer-events: none; opacity: .55; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  background: var(--green-900); color: var(--green-300);
  margin-top: 4rem; padding: 2.5rem 0 3rem; font-size: .93rem;
}
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer strong { color: #fff; display: block; margin-bottom: .6rem; }
.site-footer__cols { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .4rem; }
.site-footer__legal { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.15); }

/* ---------------------------------------------------------------- small screens */

@media (max-width: 46rem) {
  :root { --gutter: 1.5rem; }

  h1 { font-size: 1.8rem; }
  .hero { padding-block: 2.25rem 1.5rem; }
  .hero h1 { font-size: 2rem; max-width: none; }
  .section, .band { padding-block: 2.25rem; }

  /* --- Hamburger drawer -------------------------------------------------
     Slides in from the right, over the page. A panel from the right is what
     a phone user expects and keeps their thumb near the control; the old
     top-slide pushed the page down and felt like a broken layout.

     Driven by a checkbox, so it works with JavaScript switched off. */

  .nav-toggle-label {
    display: block; margin-left: auto; padding: .6rem .5rem;
    cursor: pointer; line-height: 0; z-index: 70; position: relative;
  }
  .nav-toggle-label span,
  .nav-toggle-label span::before,
  .nav-toggle-label span::after {
    display: block; width: 22px; height: 2px; background: #fff;
    border-radius: 2px; content: ""; position: relative;
  }
  .nav-toggle-label span::before { top: -7px; position: absolute; }
  .nav-toggle-label span::after { top: 7px; position: absolute; }

  .nav-overlay {
    display: block; position: fixed; inset: 0;
    background: rgba(11, 15, 8, .5);
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
    z-index: 60; cursor: pointer;
  }
  .nav-toggle:checked ~ .nav-overlay { opacity: 1; pointer-events: auto; }

  .nav {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(80vw, 19rem);
    margin: 0; padding: 4.5rem 1.5rem 2rem;
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--green-800);
    box-shadow: -14px 0 34px rgba(0, 0, 0, .3);
    overflow-y: auto;
    z-index: 65;
    /* Off-screen rather than display:none, so it slides rather than appears. */
    transform: translateX(100%);
    transition: transform .25s ease;
  }
  .nav-toggle:checked ~ .nav { transform: translateX(0); }

  .nav a {
    padding: .95rem .25rem; border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    font-size: 1.05rem; opacity: 1;
  }
  .nav a:hover { background: transparent; }
  .nav a[aria-current="page"] { box-shadow: none; color: var(--yellow); }
  .nav .btn { margin: 1.25rem 0 0; border-bottom: 0; }

  /* Stop the page behind the drawer scrolling under the finger. */
  body:has(.nav-toggle:checked) { overflow: hidden; }

  /* Respect a reduced-motion preference: appear rather than slide. */
  @media (prefers-reduced-motion: reduce) {
    .nav, .nav-overlay { transition: none; }
  }
}

/* Desktop: no drawer furniture at all. */
@media (min-width: 46.01rem) {
  .nav-overlay { display: none; }
}
