/* ============================================================================
   AUSSIE AUSSIE ENGLISH — chef.css
   The one design system. Student app (light), admin app (dark), print artefacts.

   The look: mustard-yellow page, huge condensed black uppercase display type,
   cream cards with thick ink borders and HARD offset shadows (no blur ever),
   tomato-red accents, one deep-purple feature card per screen.

   Rules for anyone editing:
     - No gradients. No blurred shadows. No soft "friendly" pastels.
     - Shadows are always `Npx Npx 0` in ink. Blur radius is not a thing here.
     - Exactly ONE purple card per screen. It is the status moment.
     - Hi-contrast or nothing: ink on yellow, ink on cream, cream on ink.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Archivo:wght@400;500;600;700&display=swap');

/* ---------------------------------------------------------------- tokens -- */
:root {
  color-scheme: light;

  /* palette — five colours, no sixth */
  --yellow:      #F1C42F;   /* the page. not an accent — the page. */
  --yellow-deep: #E0B424;   /* pressed states, subtle banding on yellow */
  --ink:         #1E1710;   /* warm near-black. every border, every heading. */
  --red:         #E8432E;   /* links, FAB, active, punctuation accents */
  --purple:      #3F2F6B;   /* the one feature card */
  --cream:       #FFF9EF;   /* card faces */
  --white:       #FFFFFF;   /* inputs, printable sheets */

  /* derived — opacity ramps only, never new hues */
  --ink-70: color-mix(in srgb, var(--ink) 70%, var(--cream));
  --ink-45: color-mix(in srgb, var(--ink) 45%, var(--cream));
  --ink-15: color-mix(in srgb, var(--ink) 15%, var(--cream));

  /* surfaces (flipped wholesale by .theme-dark) */
  --page:      var(--yellow);
  --surface:   var(--cream);
  --surface-2: var(--white);
  --on-page:   var(--ink);
  --on-surface:var(--ink);
  --line:      var(--ink);

  /* geometry */
  --bw:    2.5px;          /* standard border */
  --bw-lg: 3px;            /* hero cards */
  --r:     16px;
  --r-sm:  10px;
  --r-lg:  22px;
  --shadow:    4px 4px 0 var(--line);
  --shadow-lg: 6px 6px 0 var(--line);
  --shadow-sm: 3px 3px 0 var(--line);

  /* type */
  --display: "Anton", "Archivo Black", "Haettenschweiler", "Arial Narrow Bold", sans-serif;
  --body:    "Archivo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  /* spacing scale */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
}

/* Dark theme — admin only. Same palette, inverted surfaces. Yellow and red stay
   as accents so the two apps read as one family. */
.theme-dark {
  color-scheme: dark;
  --page:       #171208;
  --surface:    #241C10;
  --surface-2:  #2E2414;
  --on-page:    #FFF6E2;
  --on-surface: #FFF6E2;
  --line:       #F1C42F;          /* borders glow yellow on dark */
  --ink-70: color-mix(in srgb, #FFF6E2 70%, #241C10);
  --ink-45: color-mix(in srgb, #FFF6E2 45%, #241C10);
  --ink-15: color-mix(in srgb, #FFF6E2 15%, #241C10);
  --shadow:    4px 4px 0 #0C0904;
  --shadow-lg: 6px 6px 0 #0C0904;
  --shadow-sm: 3px 3px 0 #0C0904;
}

/* ------------------------------------------------------------------ base -- */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--page);
  color: var(--on-page);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: var(--red); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
  border-radius: 4px;
}

.chef-page { max-width: 780px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s8); }
.chef-page--wide { max-width: 1080px; }

/* ------------------------------------------------------------- typography -- */
.chef-eyebrow {
  font-family: var(--body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--red);
}
.chef-eyebrow .acc { color: var(--on-page); }

.chef-display {
  font-family: var(--display);
  font-weight: 400;               /* Anton ships a single weight */
  text-transform: uppercase;
  line-height: .92;
  letter-spacing: .005em;
  font-size: clamp(38px, 11vw, 68px);
  color: var(--on-page);
}
.chef-display .acc { color: var(--red); }     /* the red comma / full stop */
.chef-display--sm { font-size: clamp(26px, 6vw, 36px); }
.chef-display--xl { font-size: clamp(48px, 15vw, 92px); }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; text-transform: uppercase; line-height: .96; letter-spacing: .01em; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }
h4 { font-size: 16px; letter-spacing: .04em; }

.chef-sub { color: var(--ink-70); font-size: 15px; }
.chef-fine { color: var(--ink-45); font-size: 13px; }
.chef-label {
  font-family: var(--body); font-weight: 700; font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-45);
}

/* ----------------------------------------------------------------- cards -- */
.chef-card {
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: var(--s4);
}
.chef-card + .chef-card { margin-top: var(--s3); }
.chef-card--lg { border-width: var(--bw-lg); box-shadow: var(--shadow-lg); padding: var(--s5); border-radius: var(--r-lg); }
.chef-card--flat { box-shadow: none; }

/* the ONE purple card per screen */
.chef-card--purple {
  background: var(--purple);
  color: var(--cream);
  border-color: var(--line);
}
.chef-card--purple .chef-label,
.chef-card--purple .chef-eyebrow { color: var(--yellow); }
.chef-card--purple .chef-display,
.chef-card--purple h2, .chef-card--purple h3 { color: var(--cream); }
.chef-card--purple .chef-sub { color: color-mix(in srgb, var(--cream) 78%, var(--purple)); }

/* ---------------------------------------------------------------- buttons -- */
.chef-pill {
  display: inline-flex; align-items: center; gap: var(--s2);
  background: transparent;
  color: var(--red);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 700; font-size: 14px;
  transition: transform .08s ease, box-shadow .08s ease;
}
.chef-pill:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.chef-pill:active { transform: translate(2px, 2px); }

.chef-pill--solid { background: var(--ink); color: var(--cream); border-color: var(--ink); box-shadow: var(--shadow-sm); }
.theme-dark .chef-pill--solid { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.chef-pill--solid:active { box-shadow: none; transform: translate(3px, 3px); }
.chef-pill--red { background: var(--red); color: #fff; border-color: var(--line); box-shadow: var(--shadow-sm); }
.chef-pill--red:active { box-shadow: none; transform: translate(3px, 3px); }

.chef-fab {
  width: 56px; height: 56px; border-radius: 999px;
  background: var(--red); color: #fff;
  border: var(--bw) solid var(--line);
  box-shadow: var(--shadow);
  display: inline-grid; place-items: center;
  font-size: 30px; line-height: 1; font-weight: 400; font-family: var(--body);
}
.chef-fab:active { box-shadow: none; transform: translate(4px, 4px); }

/* small round icon button — settings / profile / back */
.chef-icon {
  width: 44px; height: 44px; border-radius: 999px;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  box-shadow: var(--shadow-sm);
  display: inline-grid; place-items: center;
  font-size: 19px;
}
.chef-icon:active { box-shadow: none; transform: translate(3px, 3px); }

/* ----------------------------------------------------------------- input -- */
.chef-search, .chef-input, .chef-select, .chef-textarea {
  width: 100%;
  background: var(--surface-2);
  color: var(--on-surface);
  border: var(--bw) solid var(--line);
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 16px;   /* 16px stops iOS zooming on focus */
}
.chef-input, .chef-select, .chef-textarea { border-radius: var(--r-sm); }
.chef-textarea { min-height: 76px; resize: vertical; }
.chef-search::placeholder, .chef-input::placeholder { color: var(--ink-45); }

/* ----------------------------------------------------------------- chips -- */
.chef-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  background: var(--surface);
  color: var(--on-surface);
  white-space: nowrap;
}
.chef-chip--level { background: var(--yellow); color: var(--ink); border-color: var(--ink); }
.chef-chip--ok    { background: var(--cream); color: #146B32; border-color: #146B32; }
.chef-chip--due   { background: var(--red); color: #fff; }
.chef-chip--todo  { background: transparent; color: var(--red); border-style: dashed; }
/* Vocabulary chips. In the student app these are read-only; in admin they are
   tapped to strike words that weren't covered. A dozen of them share one row, so
   the usual 44px tap target would force a layout that no longer reads as a word
   list. 34px is the accepted compromise: comfortably tappable for one adult on a
   laptop, still dense enough to scan twelve words at a glance. Deliberate
   exception — do not "fix" it by squaring them off. */
.chef-chip--word  { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 14px; padding: 8px 14px; min-height: 34px; }
.chef-chip--word.is-struck { opacity: .35; text-decoration: line-through; }

.chef-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ----------------------------------------------------------------- stats -- */
.chef-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: var(--s3); }
.chef-stat { background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: var(--s3) var(--s4); }
.chef-stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1; color: var(--on-surface); }
.chef-stat span { display: block; margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-45); }
.chef-stat--red b { color: var(--red); }

/* progress bar (break-even, level completion) */
.chef-bar { height: 14px; background: color-mix(in srgb, var(--line) 22%, transparent); border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }
.chef-bar i { display: block; height: 100%; background: var(--yellow); }
.chef-card--purple .chef-bar { border-color: var(--yellow); background: rgba(255,255,255,.14); }

/* -------------------------------------------------------------- checkbox -- */
.chef-check {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
  padding: 10px 14px;
  font-weight: 600; font-size: 14px;
  user-select: none;
}
.chef-check input { appearance: none; width: 20px; height: 20px; flex: none; border: 2px solid var(--line); border-radius: 5px; background: var(--surface-2); display: grid; place-items: center; }
.chef-check input:checked { background: var(--red); border-color: var(--red); }
.chef-check input:checked::after { content: "✓"; color: #fff; font-size: 14px; font-weight: 700; line-height: 1; }
.chef-check:has(input:checked) { background: color-mix(in srgb, var(--yellow) 45%, var(--surface)); }

/* ---------------------------------------------------------------- stamps -- */
.chef-stamp {
  aspect-ratio: 1;
  border: 2.5px dashed var(--ink-45);
  border-radius: 999px;
  display: grid; place-items: center;
  text-align: center;
  background: transparent;
}
.chef-stamp b { font-family: var(--display); font-size: 17px; color: var(--ink-45); line-height: 1; }
/* --ink-15 survives a backlit screen and disappears on a laser printer; these
   labels have to be legible on paper, which is where the passport lives. */
.chef-stamp small { display: block; font-size: 7.5px; letter-spacing: .1em; color: var(--ink-45); }
.chef-stamp.is-filled { border-style: solid; border-color: var(--red); background: var(--red); }
.chef-stamp.is-filled b, .chef-stamp.is-filled small { color: #fff; }
.chef-stamps { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s2); }

/* ------------------------------------------------- the circle map (student) */
.chef-circle {
  position: relative;
  display: grid; place-items: center; text-align: center;
  border-radius: 999px;
  border: var(--bw-lg) solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  aspect-ratio: 1;
  padding: 6px;
  transition: transform .12s ease;
}
.chef-circle:active { transform: scale(.96); }
.chef-circle b { font-family: var(--display); line-height: .95; color: var(--on-surface); }
.chef-circle small { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--ink-45); text-transform: uppercase; }

.chef-circle--level b { font-size: clamp(26px, 8vw, 42px); }
.chef-circle--unit  b { font-size: 14px; text-transform: uppercase; letter-spacing: .02em; }
.chef-circle--lesson b { font-size: 20px; }

/* states */
.chef-circle.is-done    { background: var(--red); border-color: var(--line); }
.chef-circle.is-done b, .chef-circle.is-done small { color: #fff; }
.chef-circle.is-open    { background: var(--surface); }
.chef-circle.is-locked  { background: color-mix(in srgb, var(--page) 70%, var(--ink-15)); opacity: .62; border-style: dashed; }
.chef-circle.is-locked b { color: var(--ink-45); }
.chef-circle.is-current { box-shadow: 0 0 0 5px var(--red), var(--shadow); }

/* progress ring drawn behind a level circle */
.chef-ring { position: absolute; inset: -9px; border-radius: 999px; pointer-events: none; }

/* ------------------------------------------------ sidebar / drawer (admin) --
   One component, two presentations. Wide screens get a persistent rail in a grid
   column; narrow screens get the same markup as an off-canvas drawer. No separate
   drawer class — a media query and one .is-open flag do the whole job. */
.chef-sidenav {
  background: var(--surface);
  border-right: var(--bw) solid var(--line);
  display: flex; flex-direction: column; gap: var(--s2);
  padding: calc(var(--s5) + env(safe-area-inset-top, 0px)) var(--s3) var(--s5);
}
.chef-sidenav__brand { margin-bottom: var(--s4); padding: 0 var(--s3); }

.chef-navitem {
  display: flex; align-items: center; gap: var(--s3);
  width: 100%; min-height: 44px; padding: 9px 16px;
  border: 2px solid transparent; border-radius: 999px;
  background: transparent; color: var(--on-surface);
  font-family: var(--body); font-weight: 700; font-size: 14px;
  letter-spacing: .06em; text-transform: uppercase; text-align: left;
  text-decoration: none;
}
.chef-navitem:hover { background: color-mix(in srgb, var(--surface-2) 80%, transparent); text-decoration: none; }
/* Active state reuses the established .chef-pill--solid pair so the two apps
   agree on what "selected" looks like, including the dark-theme inversion. */
.chef-navitem.is-active { background: var(--ink); color: var(--cream); border-color: var(--ink); box-shadow: var(--shadow-sm); }
.theme-dark .chef-navitem.is-active { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }

.chef-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 39; display: none; }
.chef-scrim.is-open { display: block; }

@media (min-width: 900px) {
  .chef-sidenav { position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
  .chef-scrim { display: none !important; }
}
@media (max-width: 899px) {
  .chef-sidenav {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    width: min(78vw, 300px);
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  .chef-sidenav.is-open { transform: none; }
}
body.drawer-open { overflow: hidden; }

/* ------------------------------------------------------ the family mind map --
   Day lanes, not a radial burst: a three-tier tree (day → family → student) has
   no fixed satellite count, and lanes stay readable at 360px where a ring would
   need collision handling. Edges are CSS borders — nothing to measure or redraw
   on resize. */
.chef-map { display: flex; flex-direction: column; gap: var(--s4); }
.chef-map__row { display: flex; align-items: flex-start; gap: var(--s3); }
.chef-map__hub { flex: none; width: 56px; }
.chef-map__hub b { font-size: 13px; text-transform: uppercase; letter-spacing: .02em; }
.chef-map__hub small { font-size: 9px; }

.chef-map__branch {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s2);
  padding: var(--s2) 0 var(--s2) var(--s4);
  border-left: 2px solid var(--ink-15);
}

.chef-map__node, .chef-map__leaf {
  position: relative;
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 44px; padding: 8px 14px;
  border: var(--bw) solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--on-surface);
  box-shadow: var(--shadow-sm);
  font-family: var(--body); font-weight: 700; font-size: 14px;
  text-align: left;
}
/* the twig joining a node to its spine */
.chef-map__node::before {
  content: ""; position: absolute; left: calc(var(--s4) * -1 - 2px); top: 50%;
  width: var(--s4); height: 2px; background: var(--ink-15);
}
.chef-map__node.is-expanded { background: var(--yellow); color: var(--ink); border-color: var(--ink); }
.theme-dark .chef-map__node.is-expanded { background: var(--yellow); color: var(--ink); }
.chef-map__node .hint { font-weight: 500; font-size: 12px; opacity: .7; }

/* unpaid dues — a dot, never a word; the node has no room for one */
.chef-map__badge {
  position: absolute; top: -6px; right: -6px;
  width: 14px; height: 14px; border-radius: 999px;
  background: var(--red); border: 2px solid var(--line);
}

.chef-map__leaves {
  flex: 1 0 100%;
  display: flex; flex-wrap: wrap; gap: var(--s2);
  padding-left: var(--s5);
}
.chef-map__leaf {
  min-height: 38px; padding: 6px 12px; font-size: 13px;
  border-width: 2px; box-shadow: none;
  background: var(--surface-2);
}
.chef-map__leaf::before {
  content: "└"; margin-right: 2px; color: var(--ink-45); font-weight: 400;
}
/* entry animation mirrors the student app's bloom so the two feel related */
.chef-map__leaf { opacity: 0; transform: scale(.9); transition: opacity .22s ease, transform .26s cubic-bezier(.34, 1.4, .64, 1); }
.chef-map__leaf.is-in { opacity: 1; transform: none; }

@media (max-width: 480px) {
  .chef-map__branch { padding-left: var(--s3); }
  .chef-map__node::before { left: calc(var(--s3) * -1 - 2px); width: var(--s3); }
  .chef-map__leaves { padding-left: var(--s3); }
}

/* ----------------------------------------------------------------- table -- */
.chef-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.chef-table th {
  text-align: left; font-family: var(--body); font-weight: 700;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-45); border-bottom: var(--bw) solid var(--line); padding: 8px 10px;
}
.chef-table td { border-bottom: 1.5px solid var(--ink-15); padding: 9px 10px; vertical-align: top; }
.chef-table tr:last-child td { border-bottom: 0; }
.chef-table .num { font-family: var(--display); font-size: 15px; color: var(--red); white-space: nowrap; }

/* ----------------------------------------------------------------- misc --- */
.chef-rule { height: var(--bw); background: var(--line); border: 0; border-radius: 2px; margin: var(--s5) 0 var(--s3); }
.chef-row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.chef-row--between { justify-content: space-between; }
.chef-spacer { flex: 1 1 auto; }
.chef-stack > * + * { margin-top: var(--s3); }

.chef-banner {
  border: var(--bw) solid var(--line);
  border-radius: var(--r-sm);
  background: var(--yellow);
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 700; font-size: 13px;
  letter-spacing: .04em; text-transform: uppercase;
}
.chef-banner--red { background: var(--red); color: #fff; }

/* screen-reader only */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ----------------------------------------------------------------- print -- */
@media print {
  .no-print { display: none !important; }
  .print-only { display: revert !important; }

  /* A 100dvh body is a 297mm box inside a ~277mm text area — on paper that is a
     guaranteed blank second page for any single-sheet artefact. Reset it. */
  html, body { min-height: 0; height: auto; }

  body { background: #fff !important; color: #000 !important; }
  .chef-page { max-width: none; padding: 0; }

  /* Adjacent-sibling spacing double-counts inside flex/grid parents that already
     use `gap`. On paper those few millimetres are the difference between one page
     and two, so drop it and let containers own their own spacing. */
  .chef-card + .chef-card { margin-top: 0; }
  .chef-card { box-shadow: none; break-inside: avoid; background: #fff; }
  .chef-pill, .chef-fab, .chef-icon { box-shadow: none; }
  a { color: inherit; text-decoration: none; }

  /* Colour is expensive and most pages print fine without it. Anything that
     MUST keep its fill (a cover band, a level chip) opts in with .keep-color. */
  .keep-color, .keep-color * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  h1, h2, h3, h4, .chef-display { break-after: avoid; }
  table, .chef-stamps, .chef-stats { break-inside: avoid; }
}

.print-only { display: none; }

/* -------------------------------------------------------------- a11y prefs */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
