/* SHSAT Placement styles: the SHSAT Simulation's look (../SHSAT Simulation/sim.css), trimmed to what the
   placement test uses, plus the step ladder and results. Tokens, fonts and the graph-paper grid are copied from
   ackacademy-next/app/globals.css; keep them in step with it. */

@font-face { font-family: "CMU Serif"; src: url("fonts/cmu-serif-roman.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "CMU Serif"; src: url("fonts/cmu-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "CMU Serif"; src: url("fonts/cmu-serif-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ---------- design tokens (from the website) ---------- */
:root {
  --paper: #fbf8f1;
  --paper-raised: #f4efe3;
  --paper-sunk: #efe8d8;
  --ink: #24211d;
  --ink-soft: #4a453d;
  --muted: #6f695f;
  --rule: #e2dac8;
  /* Apricot is the highlight (fills, underlines, never text); sienna is the colored text. */
  --accent: #f2b400;
  --accent-soft: #fcecb8;
  --accent-ink: #b54a1a;
  --sienna: #c9541e;
  --blue: #2b2f8c;
  --green: #138a78;
  --on-ink: #fbf8f1;
  --art-filter: none;
  --grid-line: rgb(36 33 29 / 0.032);
  --shadow: 0 1px 0 var(--rule), 0 18px 40px -24px rgb(36 33 29 / 0.35);
  --serif: "Newsreader", ui-serif, Georgia, serif;
  --display: "CMU Serif", "Latin Modern Roman", ui-serif, Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 1.0625rem; line-height: 1.5;
  font-optical-sizing: auto; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: var(--sans); color: inherit; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
a { color: inherit; }
.graph-paper {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(to right, var(--grid-line) 1px, transparent 1px), linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px; background-position: -1px -1px;
}
.eyebrow { font-family: var(--sans); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 12px; }
.display { font-family: var(--display); font-weight: 400; letter-spacing: -0.01em; line-height: 1.08; margin: 0; }
.display em { font-style: italic; }
.lead { font-size: 1.25rem; line-height: 1.55; color: var(--ink-soft); max-width: 40rem; margin: 18px 0 0; }
.small { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); margin: 0; }
.center { text-align: center; }

/* ---------- buttons (the website's Button.tsx) ---------- */
.btn-primary, .btn-ghost, .btn-accent {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 3px; padding: 12px 20px; font-family: var(--sans); font-size: 0.875rem; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; transition: background 0.2s, filter 0.2s, transform 0.1s; text-decoration: none;
}
.btn-primary { background: var(--ink); color: var(--on-ink); border: 1px solid var(--ink); }
.btn-primary:hover { background: var(--ink-soft); }
.btn-ghost { background: var(--paper); color: var(--ink); border: 1px solid color-mix(in srgb, var(--ink) 80%, transparent); }
.btn-ghost:hover { background: var(--paper-raised); }
.btn-primary:active, .btn-ghost:active { transform: scale(0.98); }
.big { padding: 16px 28px; font-size: 1rem; }

/* ---------- toolbar ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper); border-bottom: 1px solid var(--rule);
  background-image: linear-gradient(to right, var(--grid-line) 1px, transparent 1px), linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px; background-position: -1px -1px; background-attachment: fixed;
}
.header-in { max-width: 76rem; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 16px; min-height: 64px; }
.header .spacer { flex: 1; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .mark { width: 40px; height: 40px; filter: var(--art-filter); }
.brand .wordmark { font-family: var(--display); font-size: 1.35rem; line-height: 1; white-space: nowrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; position: relative;
  height: 40px; min-width: 42px; padding: 0 12px; border-radius: 3px;
  border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.btn:hover:not(:disabled) { background: var(--paper-raised); }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.navgroup, .toolgroup { display: flex; }
.navgroup .btn { width: 48px; border-radius: 0; height: 42px; }
.navgroup .btn:first-child { border-radius: 3px 0 0 3px; }
.navgroup .btn:last-child { border-radius: 0 3px 3px 0; margin-left: -1px; }
.btn.next:not(:disabled) { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn.next:hover:not(:disabled) { background: var(--ink-soft); }
.toolgroup .btn { border-radius: 0; width: 42px; padding: 0; margin-left: -1px; }
.toolgroup .btn:first-child { border-radius: 3px 0 0 3px; margin-left: 0; }
.toolgroup .btn:last-child { border-radius: 0 3px 3px 0; }
.btn.pressed, .btn.pressed:hover { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.timerbox { display: flex; align-items: center; }
.timertext {
  height: 40px; display: flex; align-items: center; padding: 0 12px;
  font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; font-variant-numeric: tabular-nums;
  border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); border-right: 0; border-radius: 3px 0 0 3px; background: var(--paper-raised);
}
.timertext + .btn { border-radius: 0 3px 3px 0; }
.timertext.low { color: var(--sienna); }
.username { font-family: var(--sans); font-size: 0.875rem; font-weight: 600; color: var(--ink-soft); }
@media (hover: hover) {
  [data-tip]:hover::after {
    content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    background: var(--ink); color: var(--on-ink); font-family: var(--sans); font-size: 0.75rem; font-weight: 600;
    padding: 5px 8px; border-radius: 3px; white-space: nowrap; z-index: 200; pointer-events: none;
  }
}

/* ---------- breadcrumb bar ---------- */
.crumbs { background: var(--paper-raised); border-bottom: 1px solid var(--rule); }
.crumbs-in {
  max-width: 76rem; margin: 0 auto; min-height: 38px; padding: 0 16px; display: flex; align-items: center; flex-wrap: wrap;
  font-family: var(--sans); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-ink);
}
.crumbs .sep { margin: 0 12px; color: var(--muted); }
.crumbs .spacer { flex: 1; }
.battery { width: 26px; height: 13px; border: 1.5px solid var(--ink-soft); border-radius: 3px; position: relative; padding: 1px; }
.battery::after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; background: var(--ink-soft); border-radius: 0 2px 2px 0; }
.battery i { display: block; height: 100%; background: var(--ink-soft); border-radius: 1px; }

/* ---------- pages ---------- */
.stage { position: relative; max-width: 76rem; margin: 0 auto; padding: 36px 16px 96px; }
.card {
  position: relative; max-width: 760px; margin: 0 auto;
  background: var(--card-bg, var(--paper)); color: var(--card-fg, var(--ink));
  border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--shadow); padding: 28px 32px 30px;
}
.card.wide { max-width: 960px; }
.qnum { font-family: var(--sans); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 14px; }
.item-body { font-size: 1.1875rem; line-height: 1.55; }
.item-body p { margin: 0 0 14px; }
.item-body img.fig, .modal img.fig { display: block; margin: 8px auto 16px; max-width: 100%; height: auto; filter: var(--art-filter); }
.katex { font-size: 1.08em; }
.choices { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.choice {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 16px 8px 10px;
  width: fit-content; min-width: min(100%, 300px); max-width: 100%;
  border: 1px solid var(--rule); border-radius: 4px; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.choice:hover { background: var(--paper-raised); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .letter {
  flex: none; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid color-mix(in srgb, currentColor 70%, transparent); border-radius: 50%;
  font-family: var(--sans); font-size: 0.8125rem; font-weight: 600;
}
.choice.picked { border-color: var(--accent); background: var(--accent-soft); }
.choice.picked .letter { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.choice input:focus-visible + .letter { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice .content p { margin: 0; }
.choice .content img.fig { margin: 4px 0; }
.choice.eliminated { cursor: default; }
.choice.eliminated .content, .choice.eliminated .letter { opacity: 0.4; }
.choice .xmark { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.answer-prompt { font-family: var(--sans); font-size: 0.875rem; font-weight: 600; color: var(--ink-soft); margin: 18px 0 8px; }
.text-answer {
  width: 150px; height: 46px; padding: 4px 12px; font-size: 1.125rem; font-weight: 500;
  background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 3px;
}
.text-answer:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
mark.hl-blue, .hl-pop i.hl-blue { background: color-mix(in srgb, var(--blue) 24%, transparent); color: inherit; }
mark.hl-pink, .hl-pop i.hl-pink { background: color-mix(in srgb, var(--accent) 45%, transparent); color: inherit; }

/* ---------- welcome ---------- */
.facts { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts div { padding: 22px 16px 22px 0; }
.facts div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.facts dt { font-family: var(--display); font-size: 2rem; line-height: 1.1; }
.facts dd { margin: 6px 0 0; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }
.signin { display: flex; flex-direction: column; gap: 12px; padding: 24px; background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 6px; }
.field-label { font-family: var(--sans); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-ink); }
.signin input { height: 48px; padding: 0 14px; font-size: 1rem; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 3px; }
.signin input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.rules { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.rules li { border-top: 2px solid var(--accent); padding-top: 14px; color: var(--ink-soft); }
.rules b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.35rem; color: var(--ink); margin-bottom: 4px; }
.site-foot { max-width: 76rem; margin: 0 auto; padding: 22px 16px 34px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }
.site-foot a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- section start, loading ---------- */
.section-start { max-width: 420px; margin: 40px auto; text-align: center; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--shadow); padding: 34px 28px 30px; }
.section-start h2 { font-size: 2.75rem; }
.section-start .count { font-family: var(--sans); font-size: 0.875rem; color: var(--muted); margin: 14px 0 26px; }
.section-start .count b { color: var(--ink); }
.loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--paper) 55%, transparent); z-index: 400; }
.loading .box { width: 280px; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--shadow); text-align: center; padding: 18px 18px 16px; font-family: var(--sans); font-size: 0.875rem; font-weight: 600; }
.loading .bar { height: 3px; background: var(--rule); margin-top: 16px; position: relative; overflow: hidden; border-radius: 2px; }
.loading .bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); animation: load 1.2s ease-out forwards; }
@keyframes load { to { width: 100%; } }

/* ---------- results ---------- */
.results h1, .prep-done h1 { font-size: clamp(2.5rem, 6vw, 4rem); }
.strands { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 30px 0 26px; }
.strand { position: relative; padding: 14px 14px 18px; background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 6px; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); overflow: hidden; }
.strand b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.6rem; color: var(--ink); margin-top: 4px; }
.strand i { position: absolute; left: 0; bottom: 0; height: 4px; width: var(--p); background: var(--accent); }
.table-wrap { overflow-x: auto; }
.results table, .prep-done table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.875rem; }
.results th, .prep-done th { text-align: left; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 0 10px 10px; border-bottom: 1px solid var(--rule); }
.results td, .prep-done td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.results tr:last-child td, .prep-done tr:last-child td { border-bottom: 0; }
.results .ok:not(.rv-item), .prep-done .ok { color: var(--green); font-weight: 600; }
.results .no, .prep-done .no { color: var(--sienna); font-weight: 600; }
.results .why { font-family: var(--serif); font-style: italic; color: var(--ink-soft); font-size: 0.9375rem; min-width: 200px; }
.linkbtn { border: 0; background: none; color: var(--ink); cursor: pointer; font-weight: 600; padding: 0; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* ---------- modals ---------- */
.backdrop { position: fixed; inset: 0; background: rgb(36 33 29 / 0.28); z-index: 300; }
.modal { position: fixed; z-index: 310; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 24px 60px -20px rgb(0 0 0 / 0.45); overflow: hidden; }
.modal .mhead { display: flex; align-items: center; padding: 14px 18px 12px; border-bottom: 1px solid var(--rule); cursor: move; }
.modal .mhead h3 { margin: 0; flex: 1; font-family: var(--display); font-weight: 400; font-size: 1.4rem; }
.modal .mclose { border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 4px; color: var(--muted); }
.modal .mclose:hover { color: var(--ink); }
.modal .mbody { padding: 16px 18px; font-size: 1.0625rem; }
.modal .mfoot { padding: 0 18px 18px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------- placement ---------- */
.draft-note { font-family: var(--sans); font-size: 0.8125rem; color: var(--ink-soft); background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 3px; margin: 22px 0 0; max-width: 40rem; }
.progress { max-width: 760px; margin: 0 auto 14px; display: flex; align-items: center; gap: 12px; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }
.progress .track { flex: 1; height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.progress .track i { display: block; height: 100%; width: var(--p); background: var(--accent); transition: width 0.4s; }
.strand-tag { font-family: var(--sans); font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); }
.place-foot { max-width: 760px; margin: 16px auto 0; display: flex; justify-content: flex-end; gap: 10px; }
.place-error { font-family: var(--sans); font-size: 0.875rem; font-weight: 600; color: var(--sienna); min-height: 1.2em; margin: 10px 0 0; }
.text-answer { width: 190px; }

.overall { margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.overall div { padding: 20px 16px 20px 0; }
.overall div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.overall dt { font-family: var(--display); font-size: 2rem; line-height: 1.1; }
.overall dd { margin: 6px 0 0; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }

.ladders { display: grid; gap: 12px; margin: 30px 0 0; }
.ladder { display: grid; grid-template-columns: minmax(180px, 1.1fr) 2fr; gap: 10px 20px; align-items: center; padding: 16px 18px; background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 6px; }
.ladder h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.35rem; line-height: 1.2; }
.ladder .lvl { font-family: var(--sans); font-size: 0.8125rem; color: var(--ink-soft); margin-top: 4px; }
.ladder .lvl b { color: var(--ink); }
.rungs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.rungs span { height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 3px; font-family: var(--sans); font-size: 0.75rem; font-weight: 600; color: var(--muted); background: var(--paper); border: 1px solid var(--rule); }
.rungs span.on { background: var(--accent); border-color: var(--accent); color: #24211d; }
.rungs span.na { background: transparent; border-style: dashed; }
.ladder .note { grid-column: 1 / -1; font-size: 0.9375rem; color: var(--ink-soft); margin: 0; }

.worklist { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.worklist li { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: baseline; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); }
.worklist .n { font-family: var(--display); font-size: 1.4rem; color: var(--accent-ink); }
.worklist b { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; display: block; }
.worklist .sub { font-size: 0.9375rem; color: var(--ink-soft); }
.tag { font-family: var(--sans); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; padding: 4px 8px; border-radius: 3px; white-space: nowrap; }
.tag.broken { color: var(--sienna); border: 1px solid color-mix(in srgb, var(--sienna) 50%, transparent); }
.tag.shaky { color: var(--ink-soft); border: 1px solid var(--accent); background: var(--accent-soft); }
.section-title { font-family: var(--display); font-weight: 400; font-size: 1.9rem; margin: 44px 0 0; }
.section-sub { color: var(--ink-soft); margin: 6px 0 0; }

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .header-in { gap: 8px; padding: 8px 12px; }
  .username { display: none; }
  .stage { padding: 24px 16px 88px; }
  .card { padding: 20px 18px 22px; }
  .rules { grid-template-columns: 1fr; }
  .signin { order: -1; }
  .facts dt, .overall dt { font-size: 1.5rem; }
  .ladder { grid-template-columns: 1fr; }
  .rungs span { font-size: 0.6875rem; }
  .worklist li { grid-template-columns: auto 1fr; }
  .worklist .tag { grid-column: 2; justify-self: start; }
  .site-foot { flex-direction: column; gap: 6px; }
}

/* ------------------------------------------------------------------ home page (renderWelcome in place.js; the same block as ../Grade Placement/place.css) */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.home .stage { padding-top: 0; padding-bottom: 0; }
.home [id] { scroll-margin-top: 84px; }
/* The hero is two rows: the headline with the drawing centered beside it, then the text with the steps (or the
   start box) centered beside it. On a phone: headline, drawing, text, then the steps or start box. */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); grid-template-areas: "title art" "body side"; gap: 28px 56px; align-items: center; padding-top: 56px !important; }
.hh-title { grid-area: title; } .hh-art { grid-area: art; } .hh-body { grid-area: body; } .hh-side { grid-area: side; }
.hh-body .draft-note { margin-top: 28px; }
.home-hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.1rem); max-width: 15ch; }
.home-hero h1 em { color: var(--accent-ink); }
.home-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 0; }
.home-steps { list-style: none; margin: 0; padding: 26px; background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 6px; display: grid; gap: 20px; box-shadow: var(--shadow); }
.home-steps li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; font-family: var(--sans); font-size: 0.9375rem; color: var(--ink-soft); line-height: 1.45; }
.home-steps b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.3rem; color: var(--ink); margin-bottom: 2px; }
.home-steps .n { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--ink); display: grid; place-items: center; font-family: var(--display); font-size: 1.15rem; }

.home-sec { padding-top: 88px !important; }
.home-sec-head { max-width: 44rem; margin-bottom: 30px; }
.home-sec-head h2 { font-size: clamp(2rem, 4.2vw, 2.9rem); }
.home-sec-head p { font-size: 1.125rem; line-height: 1.55; color: var(--ink-soft); margin: 12px 0 0; }


.home-hero .signin { box-shadow: var(--shadow); order: 0; }
.illustration { isolation: isolate; }
.illustration .tint { mix-blend-mode: multiply; }
.hero-art { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto; }
@media (max-width: 960px) { .hero-art { max-width: 240px; } }
.start-title { font-family: var(--display); font-size: 1.6rem; line-height: 1.1; margin: 0 0 4px; }
.home-hero .facts { margin-top: 28px; max-width: 40rem; }
.topics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.topic { padding: 24px; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--shadow); }
.topic-n { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); font-family: var(--display); font-size: 1.05rem; }
.topic h3 { font-family: var(--display); font-weight: 400; font-size: 1.45rem; line-height: 1.15; margin: 14px 0 0; color: var(--accent-ink); }
.topic p { font-size: 1.02rem; line-height: 1.5; color: var(--ink-soft); margin: 10px 0 0; }
.topic-ladder { background: var(--paper-raised); }
.topic-ladder h3 { margin-top: 0; }
.topic-ladder .rungs { margin-top: 16px; }
.topic-ladder .small { margin-top: 10px; }
.mode h3 { margin-bottom: 4px; }
.home .rules { margin-top: 36px; }

/* The animated example under "How it works" (DEMO and playDemo in place.js). The step card it is on lights up. */
.demo { margin-top: 28px; padding: 28px; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--shadow); }
.demo-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.demo-head h3 { font-size: 1.7rem; }
.demo-ctrl { display: flex; align-items: center; gap: 12px; }
.demo-play { padding: 8px 16px; min-width: 76px; }
.demo-body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; margin-top: 24px; align-items: center; }
.demo-card { min-height: 236px; padding: 22px; background: #fffdf8; border: 1px solid var(--rule); box-shadow: 0 1px 2px rgb(36 33 29 / 0.08); border-radius: 6px; }
.demo-step { font-family: var(--sans); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink); margin: 0; }
.demo-step span { color: var(--muted); }
.demo-q { font-family: var(--display); font-size: 1.35rem; line-height: 1.3; margin: 10px 0 0; }
.demo-a { font-family: var(--sans); font-size: 0.9375rem; color: var(--ink-soft); margin: 14px 0 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.demo-a b { font-size: 1.05rem; color: var(--ink); padding: 2px 10px; border: 1.5px solid var(--ink); border-radius: 3px; background: var(--paper); }
.demo-v { font-weight: 600; font-size: 0.8125rem; padding: 4px 10px; border-radius: 999px; }
.demo-v.ok { background: color-mix(in srgb, var(--green) 15%, var(--paper)); color: var(--green); }
.demo-v.miss { background: color-mix(in srgb, var(--sienna) 14%, var(--paper)); color: var(--sienna); }
.demo-say { font-size: 1.02rem; line-height: 1.5; color: var(--ink-soft); margin: 14px 0 0; }
.demo-result { margin: 14px 0 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; color: var(--ink); border-radius: 3px; }
.demo-card.go > * { animation: demo-in 0.45s ease-out both; }
.demo-card.go .demo-a { animation-delay: 0.6s; }
.demo-card.go .demo-v { animation: demo-pop 0.4s ease-out 1.2s both; }
.demo-card.go .demo-say { animation-delay: 1.6s; }
.demo-card.go .demo-result { animation-delay: 3s; }
@keyframes demo-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes demo-pop { 0% { opacity: 0; transform: scale(0.6); } 70% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: none; } }
.demo-topic { font-family: var(--display); font-size: 1.2rem; margin: 0 0 30px; }
.demo-rungs { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; --at: 4; }
.demo-rungs span { height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 3px; font-family: var(--sans); font-size: 0.75rem; font-weight: 600; color: var(--muted); background: var(--paper-raised); border: 1px solid var(--rule); transition: background 0.4s, border-color 0.4s, color 0.4s; }
.demo-rungs span.ok { background: color-mix(in srgb, var(--green) 16%, var(--paper)); border-color: var(--green); color: var(--green); }
.demo-rungs span.miss { background: color-mix(in srgb, var(--sienna) 14%, var(--paper)); border-color: var(--sienna); color: var(--sienna); }
.demo-rungs span.on { background: var(--accent); border-color: var(--accent); color: #24211d; }
.demo-pin { position: absolute; top: -18px; left: calc((100% - 36px) / 7 * (var(--at) + 0.5) + 6px * var(--at)); width: 0; height: 0; margin-left: -7px; border: 7px solid transparent; border-top: 10px solid var(--ink); border-bottom: 0; transition: left 0.7s cubic-bezier(0.3, 0.7, 0.3, 1); }
.demo-legend { display: flex; gap: 14px; margin: 16px 0 0; font-family: var(--sans); font-size: 0.75rem; color: var(--muted); }
.demo-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.demo-legend .ok::before { background: var(--green); }
.demo-legend .miss::before { background: var(--sienna); }
.demo-legend .on::before { background: var(--accent); }
.demo-note { margin-top: 18px; }
@media (prefers-reduced-motion: reduce) {
  .demo-card.go > *, .demo-card.go .demo-v { animation: none; }
  .demo-pin, .demo-rungs span { transition: none; }
}
@media (max-width: 760px) {
  .demo { padding: 20px; }
  .demo-body { grid-template-columns: 1fr; gap: 24px; }
  .demo-ladder { order: -1; }
  .demo-topic { margin-bottom: 24px; }
  .demo-card { min-height: 0; }
  .demo-rungs span { font-size: 0.6875rem; height: 36px; }
}

.more { margin-top: 18px; border: 1px solid color-mix(in srgb, var(--ink) 10%, #fff3c2); border-radius: 6px; background: #fff3c2; }
.more summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; font-family: var(--display); font-size: 1.2rem; color: var(--ink); }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: "+"; font-family: var(--sans); font-size: 1.4rem; color: var(--accent-ink); transition: transform 0.2s; }
.more[open] summary::after { transform: rotate(45deg); }
.more summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.more-list { list-style: none; margin: 0; padding: 0 20px 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.more-list li { border-top: 2px solid var(--accent); padding-top: 12px; font-size: 1rem; line-height: 1.55; color: var(--ink-soft); }
.more-list b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.2rem; color: var(--ink); margin-bottom: 4px; }
@media (max-width: 760px) { .more-list { grid-template-columns: 1fr; } .more summary { font-size: 1.1rem; } }
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.mode { padding: 30px; background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 6px; }
.mode-tag { font-family: var(--sans); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 8px; }
.mode h3 { font-size: 2rem; }
.mode-lead { font-size: 1.08rem; color: var(--ink-soft); margin: 8px 0 0; }
.ticks { list-style: none; margin: 20px 0 0; padding: 18px 0 0; border-top: 1px solid var(--rule); display: grid; gap: 12px; }
.ticks li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-family: var(--sans); font-size: 0.9375rem; line-height: 1.5; color: var(--ink-soft); }
.ticks svg { color: var(--green); margin-top: 2px; }

.ready { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.ready li { border-top: 2px solid var(--accent); padding-top: 16px; font-family: var(--sans); font-size: 0.9375rem; line-height: 1.5; color: var(--ink-soft); }
.ready b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.3rem; color: var(--ink); margin: 10px 0 4px; }
.ricon2 { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--ink); }
.ricon2 svg { width: 22px; height: 22px; }

.parents { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 48px; padding: 40px; background: var(--ink); color: var(--on-ink); border-radius: 6px; }
.parents .eyebrow { color: var(--accent); }
.parents h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); color: var(--on-ink); }
.parents-body p { font-size: 1.08rem; line-height: 1.6; margin: 0 0 14px; color: color-mix(in srgb, var(--on-ink) 86%, transparent); }
.parents-body .small { color: color-mix(in srgb, var(--on-ink) 65%, transparent); margin: 6px 0 0; }

.faq { max-width: 52rem; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 2px; font-family: var(--display); font-size: 1.3rem; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--sans); font-size: 1.4rem; color: var(--accent-ink); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.faq details p { margin: 0 0 20px; padding: 0 2px; font-size: 1.05rem; line-height: 1.6; color: var(--ink-soft); max-width: 44rem; }
.home-end { margin: 44px 0 0; padding-bottom: 0; }

@media (max-width: 960px) {
  .home-hero { grid-template-columns: 1fr; grid-template-areas: "title" "art" "body" "side"; gap: 28px; padding-top: 40px !important; }
  .topics, .ready { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parents { grid-template-columns: 1fr; gap: 20px; padding: 30px; }
}
@media (max-width: 640px) {
  .home-sec { padding-top: 64px !important; }
  .topics, .modes, .ready { grid-template-columns: 1fr; }
  .mode, .parents { padding: 22px; }
  .home-cta .big { flex: 1; padding: 15px 16px; white-space: nowrap; }
  .faq summary { font-size: 1.15rem; }
}

/* The website's pill buttons (ackacademy-next components/Button.tsx, pillClass), as on the grades page: filled in
   blue for the main action, outlined in the same blue beside it. */
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border: 1.5px solid var(--blue); border-radius: 999px; font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; color: var(--blue); text-decoration: none; white-space: nowrap; transition: background 0.2s, filter 0.2s, transform 0.1s; }
.pill:hover { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.pill.on { background: var(--blue); color: var(--on-ink); }
.pill.on:hover { background: var(--blue); filter: brightness(1.1); }
.pill:active { transform: scale(0.98); }
.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pill.big { padding: 15px 28px; font-size: 1rem; }
button.pill { background: transparent; cursor: pointer; }

/* ---------- the website's header pencil and free-week button (PENCIL, FREE_WEEK) ---------- */
/* As on the website (SiteHeader.tsx): the pencil fills the gap between the name and the buttons, and steps aside
   when the gap is too narrow for a whole pencil, instead of sliding under the buttons. */
.h-pencil { flex: 1; min-width: 0; display: flex; align-items: center; padding: 0 24px; container-type: inline-size; }
.h-pencil .pencil { display: none; }
@container (min-width: 72px) { .h-pencil .pencil { display: flex; } }
.pencil { display: flex; align-items: stretch; width: 100%; height: 16px; }
.pencil svg { height: 100%; overflow: visible; }
.pencil .pc-end { width: auto; flex: none; }
.pencil .pc-barrel { flex: 1; min-width: 0; margin: 0 -1px; }
.pencil .np-end { width: auto; flex: none; }
.pencil .np-barrel { flex: 1; min-width: 0; margin: 0 -1px; }
.free-week { display: inline-flex; align-items: center; padding: 10px 20px; border-radius: 3px; background: #F3A09A; color: #3d1f1c; font-family: var(--sans); font-size: 0.875rem; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; transition: filter 0.2s, transform 0.1s; }
.free-week:hover { filter: brightness(1.05); }
.free-week:active { transform: scale(0.98); }
/* Phones: no pencil in the header, just the name and the buttons. */
@media (max-width: 640px) { .h-pencil { padding: 0 10px; } .h-pencil .pencil { display: none; } .pencil { height: 12px; } .free-week { padding: 9px 14px; font-size: 0.8rem; } }
@media (max-width: 380px) { .free-week { display: none; } }

/* ---------- the website's menu (sitemenu.js; ackacademy-next components/MobileMenu.tsx) ---------- */
.sm-open { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; transition: border-color 0.2s; }
.sm-open:hover { border-color: var(--ink); }
.sm-open span { display: flex; flex-direction: column; gap: 5px; width: 1.15rem; }
.sm-open i { display: block; height: 1.5px; border-radius: 999px; background: currentColor; }
.sm-panel { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; padding: 0 16px max(2rem, env(safe-area-inset-bottom)); background: var(--paper); opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
.sm-panel.open { opacity: 1; visibility: visible; }
.sm-bar { position: relative; display: flex; align-items: center; justify-content: space-between; margin: 0 -16px 24px; padding: 16px; border-bottom: 1px solid color-mix(in srgb, var(--rule) 70%, transparent); }
.sm-bar img { display: block; width: 48px; height: 48px; }
.sm-word { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding-top: 6px; font-family: var(--display); font-size: 1.3rem; white-space: nowrap; pointer-events: none; }
.sm-close { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--rule); background: transparent; color: var(--ink); cursor: pointer; }
.sm-close:hover { border-color: var(--ink); }
.sm-nav { flex: 1; overflow-x: hidden; overflow-y: auto; width: 100%; max-width: calc(44rem + 24px); margin: 0 auto; padding: 0 12px; }
.sm-nav ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.sm-nav > ol > li { border-bottom: 1px solid var(--rule); opacity: 0; transform: translateY(-10px); transition: opacity 0.5s ease-out, transform 0.5s ease-out; }
.sm-panel.open .sm-nav > ol > li { opacity: 1; transform: none; transition-delay: var(--d); }
.sm-row { display: flex; align-items: baseline; gap: 16px; margin: 0 -12px; padding: 16px 12px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.sm-row:hover .sm-art { transform: rotate(-3deg); }
.sm-n { width: 24px; flex: none; font-family: var(--sans); font-size: 0.75rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.sm-label { font-family: var(--display); font-size: 1.85rem; line-height: 1; white-space: nowrap; }
.sm-art { width: 60px; height: auto; margin-left: auto; align-self: center; flex: none; transition: transform 0.3s; }
.sm-kids { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 20px; margin: -4px 0 0; padding: 0 0 16px 40px; }
.sm-kids a { font-family: var(--sans); font-size: 0.95rem; color: var(--ink-soft); text-underline-offset: 4px; }
.sm-kids a:hover { color: var(--ink); }
.sm-foot { width: 100%; max-width: 44rem; margin: 0 auto; padding-top: 32px; display: grid; gap: 16px; }
.sm-cta { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px 28px; border-radius: 3px; background: var(--ink); color: var(--on-ink); font-family: var(--sans); font-size: 1rem; font-weight: 600; text-decoration: none; }
.sm-cta:hover { background: var(--ink-soft); }
.sm-foot p { margin: 0; text-align: center; font-family: var(--sans); font-size: 0.875rem; }
.sm-foot p a { color: var(--muted); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
@media (min-width: 640px) { .sm-panel { padding-left: 32px; padding-right: 32px; } .sm-bar { margin: 0 -32px 24px; padding: 16px 32px; } .sm-label { font-size: 2.1rem; } .sm-art { width: 64px; } }
@media (max-width: 359px) { .sm-label { font-size: 1.5rem; } .sm-art { width: 48px; } }
@media (prefers-reduced-motion: reduce) { .sm-panel, .sm-nav > ol > li, .sm-art { transition: none; } }

/* The website's desktop nav (SiteMenu.nav()), from 1024px; below that, the pencil and the menu button. */
.site-nav { display: none; flex: 1; justify-content: center; min-width: 0; }
.site-nav > ul { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 8px 14px; border-radius: 999px; font-family: var(--sans); font-size: 0.92rem; color: var(--ink-soft); text-decoration: none; white-space: nowrap; transition: color 0.2s; }
.site-nav a:hover { color: var(--ink); }
.sn-menu { position: relative; display: flex; align-items: center; }
.sn-menu > a { padding-right: 6px; }
.sn-arrow { display: grid; place-items: center; width: 24px; height: 32px; margin-left: -4px; border: 0; border-radius: 999px; background: none; color: var(--ink-soft); cursor: pointer; }
.sn-arrow:hover { color: var(--ink); }
.sn-arrow svg { transition: transform 0.2s; }
.sn-menu:hover .sn-arrow svg, .sn-menu.open .sn-arrow svg { transform: rotate(180deg); }
.sn-panel { position: absolute; left: 0; top: 100%; z-index: 60; padding-top: 8px; opacity: 0; visibility: hidden; transition: opacity 0.15s, visibility 0.15s; }
.sn-menu:hover .sn-panel, .sn-menu.open .sn-panel { opacity: 1; visibility: visible; }
.sn-panel ul { list-style: none; min-width: 15rem; margin: 0; padding: 6px; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); box-shadow: 0 12px 32px -16px rgb(36 33 29 / 0.35); }
.sn-panel a { border-radius: 8px; padding: 8px 12px; }
.sn-panel a:hover { background: color-mix(in srgb, var(--accent-soft) 50%, transparent); }
@media (min-width: 1024px) {
  .site-nav { display: flex; }
  .header .h-pencil, .header .sm-open { display: none; }
}

/* The pencil under the current section (NAV_PENCIL), the width of its name and arrow. */
.sn-l { position: relative; display: inline-block; }
.sn-pencil { position: absolute; left: 12px; right: 2px; bottom: -2px; width: auto; height: 7px; pointer-events: none; }

/* The current section and page: the pencil under Math, the page shaded in the dropdown and the phone menu. */
.site-nav .sn-menu.on > a { font-weight: 600; color: var(--ink); }
.sn-panel a[aria-current="page"] { background: var(--accent-soft); font-weight: 600; color: var(--ink); }
.sm-row.on { background: var(--accent-soft); padding-top: 8px; padding-bottom: 8px; margin-top: 8px; margin-bottom: 10px; }
.sm-row.on + .sm-kids { margin-top: 0; }
.sm-row.on .sm-n { color: var(--accent-ink); }
.sm-row.on .sm-label { font-style: italic; }
.sm-kids a[aria-current="page"] { font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

/* The results and practice cards as index cards, like the grades page's "Two ways to use it": pale blue and mint
   stock, the label and title above the header rule, every tick line on a rule, the ticks in the margin left of the
   red line. */
.modes .mode {
  --rg: 28px; --head: 84px; --margin: 58px; --card: #e3eef8;
  padding: 14px 24px 14px 72px; border: 0; border-radius: 3px;
  background:
    linear-gradient(90deg, transparent var(--margin), rgb(201 84 30 / 0.5) var(--margin), rgb(201 84 30 / 0.5) calc(var(--margin) + 1.5px), transparent calc(var(--margin) + 1.5px)),
    linear-gradient(180deg, transparent calc(var(--head) - 2px), rgb(43 47 140 / 0.45) calc(var(--head) - 2px), rgb(43 47 140 / 0.45) var(--head), transparent var(--head)),
    repeating-linear-gradient(180deg, transparent 0 calc(var(--rg) - 1px), rgb(43 47 140 / 0.16) calc(var(--rg) - 1px) var(--rg)) 0 calc(var(--head) - 5px) / 100% 100% no-repeat,
    var(--card);
  box-shadow: 0 1px 2px rgb(36 33 29 / 0.12), 0 14px 30px -18px rgb(36 33 29 / 0.4);
}
.modes .mode + .mode { --card: #e2f2ea; }
.modes .mode-tag { line-height: var(--rg); margin: 0; }
.modes .mode h3 { line-height: calc(var(--head) - 14px - var(--rg)); margin: 0; }
.modes .ticks { margin: 0; padding: 0; border: 0; gap: 0; }
.modes .ticks li { grid-template-columns: 22px 1fr; gap: 24px; margin-left: -46px; line-height: var(--rg); }
.modes .ticks svg { margin-top: 5px; }
@media (max-width: 640px) {
  .modes .mode { --margin: 44px; padding: 14px 16px 14px 56px; }
  .modes .ticks li { grid-template-columns: 18px 1fr; gap: 20px; margin-left: -38px; }
}
/* "Before you start": the heading on the left, the sneaker being laced on the right (READY_ART in place.js). */
.ready-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px; margin-bottom: 30px; }
.ready-top .home-sec-head { margin-bottom: 0; }
.ready-art { display: block; width: 280px; max-width: 100%; height: auto; }
@media (max-width: 640px) { .ready-top { grid-template-columns: 1fr; gap: 16px; } .ready-art { width: 220px; justify-self: end; } }

/* The animated header logo (SiteMenu.brand(); the website's HeaderLogo). Both the name and the mark sit in one grid
   cell. On the way down the name folds (0-300ms), stacks (230-530ms), fades (540ms) and the mark scales in (560ms);
   the un-scrolled delays run it back in reverse. */
.bw-brand { display: grid; align-items: center; justify-items: start; gap: 0; }
.bw-brand > * { grid-area: 1 / 1; }
.bw { font-family: var(--display); font-weight: 400; font-size: 1.4rem; line-height: 1; white-space: nowrap; color: var(--ink); transition: opacity 0.2s 0.15s, filter 0.2s 0.15s; }
.bw-l { display: inline-block; transition: transform 0.3s ease-in-out 0.23s; }
.bw-f { display: inline-block; overflow: hidden; vertical-align: bottom; transition: max-width 0.3s 0.52s, opacity 0.3s 0.52s; }
.bw-dot { max-width: 0.5em; }
.bw-tail { max-width: 6em; }
.bw-mark { width: 48px; height: 48px; opacity: 0; transform: scale(0.9); transition: opacity 0.3s ease-out 0s, transform 0.3s ease-out 0s; filter: var(--art-filter); }
html[data-scrolled] .bw { opacity: 0; filter: blur(1px); transition-delay: 0.54s; }
html[data-scrolled] .bw-l { transform: translate(var(--tx, 0), var(--ty, 0)) scale(0.8); transition-delay: 0s; }
html[data-scrolled] .bw-f { max-width: 0; opacity: 0; transition-delay: 0s; }
html[data-scrolled] .bw-mark { opacity: 1; transform: none; transition-delay: 0.56s; }
@media (min-width: 640px) { .bw { font-size: 1.6rem; } .bw-mark { width: 56px; height: 56px; } }
@media (prefers-reduced-motion: reduce) { .bw, .bw-l, .bw-f, .bw-mark { transition: none; } }

/* The bookcase (SHELF in sitemenu.js) fills what the links leave of the menu's height, running down it between the
   links and Start a Free Week, as tall as that space allows; where the space is too short for it, it hides. */
.sm-nav { flex: 0 1 auto; }
.sm-shelf { flex: 1 1 0; min-height: 0; width: 100%; max-width: 44rem; margin: 0 auto; padding: 20px 0 4px; display: flex; align-items: stretch; justify-content: center; container-type: size; }
.sm-case-art { display: block; height: 100%; width: auto; max-width: 100%; }
@container (max-height: 150px) { .sm-case-art { display: none; } }
/* It comes in like the menu's rows (.sm-nav li: fade and drop 10px), just after the last of them. */
.sm-shelf { opacity: 0; transform: translateY(-10px); transition: opacity 0.5s ease-out, transform 0.5s ease-out; }
.sm-panel.open .sm-shelf { opacity: 1; transform: none; transition-delay: 330ms; }
@media (prefers-reduced-motion: reduce) { .sm-shelf { transition: none; } }
/* The headline's answer sits to the right, on its own two lines, "minutes." right under the number. */
.home-hero h1 .hh-find { display: block; width: fit-content; margin-left: auto; text-align: right; }
/* The four steps live in the example: tabs under its title, and each step's rule at the top of its card. */
.demo-dots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.demo-dots button { width: auto; height: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--rule); background: #fffdf8; font-family: var(--display); font-size: 1.05rem; color: var(--ink); text-align: left; cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.demo-dots button .n { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-size: 0.9rem; }
.demo-dots button:hover { border-color: var(--blue); }
.demo-dots button[aria-current="step"] { background: var(--blue); border-color: var(--blue); color: var(--on-ink); }
.demo-dots button[aria-current="step"] .n { background: var(--accent); color: var(--ink); }
.demo-rule { margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px dashed var(--rule); font-size: 1.05rem; line-height: 1.5; color: var(--ink-soft); }
.demo-rule b { font-family: var(--display); font-weight: 400; font-size: 1.2rem; color: var(--ink); }
@media (max-width: 760px) { .demo-dots { grid-template-columns: repeat(2, minmax(0, 1fr)); } .demo-dots button { font-size: 0.95rem; padding: 8px 10px; } }
/* The last call to action: centered on a phone, on the right on a computer. */
.home-end.edge { text-align: center; }
@media (min-width: 761px) { .home-end.edge { text-align: right; } }

/* The website's footer (SiteMenu.footer()): on the page's grid paper under an ink rule, the logo, line and email on
   the left, the link columns on the right, and the sign-off with the curled-up cat at the bottom right. */
.sf { max-width: 76rem; margin: 96px auto 0; padding: 0 16px 40px; }
.sf-grid { display: grid; gap: 48px; padding-top: 40px; border-top: 1px solid color-mix(in srgb, var(--ink) 80%, transparent); }
.sf-about { max-width: 24rem; display: grid; gap: 16px; justify-items: start; }
.sf-logo { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 8px; color: var(--ink); text-decoration: none; }
.sf-logo img { width: 56px; height: 56px; filter: var(--art-filter); }
.sf-logo span { font-family: var(--display); font-size: 1.4rem; line-height: 1; }
.sf-about p { margin: 0; font-size: 0.95rem; line-height: 1.6; color: var(--ink-soft); }
.sf-mail { font-size: 0.95rem; font-weight: 500; color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.sf-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.sf-head { margin: 0 0 16px; font-family: var(--sans); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-ink); }
.sf-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sf-cols a { font-size: 0.95rem; color: var(--ink-soft); text-decoration: none; transition: color 0.2s; }
.sf-cols a:hover, .sf-cols a[aria-current="page"] { color: var(--ink); }
.sf-cols a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.sf-sign { margin: 48px 0 0; display: flex; align-items: flex-end; justify-content: flex-end; gap: 8px; font-family: var(--sans); font-size: 0.75rem; color: var(--muted); }
.sf-sign span { padding-bottom: 4px; }
.sf-cat { height: 36px; width: auto; overflow: visible; color: var(--ink); }
@media (min-width: 900px) { .sf-grid { grid-template-columns: 1.1fr 2.2fr; } .sf-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Each topic card's drawing (TOPIC_ART in place.js) sits in its top-right corner. */
.topic { position: relative; }
.topic-art { position: absolute; top: 14px; right: 14px; width: 76px; height: auto; pointer-events: none; }
.topic:has(.topic-art) h3 { margin-top: 26px; }

/* ------------------------------------------------------------------ the review at the end (review.js) */
.review { margin-top: 56px; padding-top: 36px; border-top: 1px solid var(--rule); text-align: left; }
.rv-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.rv-head h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.rv-score { margin: 10px 0 0; font-size: 1.1rem; color: var(--ink-soft); }
.rv-score b { color: var(--ink); }
.rv-filter { display: flex; gap: 6px; }
.rv-filter button { font-family: var(--sans); font-size: 0.875rem; font-weight: 600; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--blue); background: transparent; color: var(--blue); cursor: pointer; }
.rv-filter button[aria-pressed="true"] { background: var(--blue); color: var(--on-ink); }
.rv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.review.only-missed .rv-item.ok { display: none; }
.rv-item { padding: 20px 22px; background: #fffdf8; border: 1px solid var(--rule); border-left: 4px solid var(--green); border-radius: 6px; box-shadow: 0 1px 2px rgb(36 33 29 / 0.06); }
.rv-item.miss { border-left-color: var(--sienna); }
.rv-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-family: var(--sans); font-size: 0.8125rem; }
.rv-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-family: var(--display); font-size: 0.95rem; }
.rv-tag { font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.6875rem; color: var(--accent-ink); }
.rv-mark { margin-left: auto; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.rv-mark.ok { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.rv-mark.miss { color: var(--sienna); background: color-mix(in srgb, var(--sienna) 12%, transparent); }
.rv-q { font-size: 1.05rem; }
.rv-q img.fig, .rv-q figure { max-width: 100%; }
.rv-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; }
.rv-answers > div { padding: 12px 14px; border-radius: 4px; background: var(--paper-raised); }
.rv-answers dt { font-family: var(--sans); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.rv-answers dd { margin: 0; font-size: 1.05rem; }
.rv-item.miss .rv-answers > div:first-child { background: color-mix(in srgb, var(--sienna) 8%, var(--paper)); }
.rv-right { color: var(--green); font-weight: 600; }
.rv-touch { pointer-events: none; max-width: 420px; }
.rv-solution { margin-top: 16px; padding: 16px 18px; border: 1px dashed color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 6px; background: var(--paper); }
.rv-sh { margin: 0 0 10px; font-family: var(--sans); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-ink); }
.rv-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rv-steps li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: baseline; }
.rv-step { font-family: var(--sans); font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); }
.rv-math { overflow-x: auto; }
.rv-final { margin-top: 12px; overflow-x: auto; }
.rv-final .katex-display { margin: 0; text-align: left; }
.rv-final .katex-display > .katex { text-align: left; }
.rv-box { display: inline-block; padding: 6px 14px; border: 1.5px solid var(--ink); font-size: 1.1rem; }
.rv-soon { margin: 0; color: var(--muted); font-style: italic; }
@media (max-width: 640px) { .rv-answers { grid-template-columns: 1fr; } .rv-item { padding: 16px; } .rv-steps li { grid-template-columns: 1fr; gap: 2px; } }

/* Half credit in the review, and the answer-format hint under a typed question. */
.rv-item.half { border-left-color: var(--accent); }
.rv-mark.half { color: var(--accent-ink); background: var(--accent-soft); }
.rv-item.half .rv-answers > div:first-child { background: color-mix(in srgb, var(--accent) 12%, var(--paper)); }
.rv-note { margin: 12px 0 0; font-family: var(--sans); font-size: 0.875rem; color: var(--accent-ink); }
.fmt-hint { margin: 10px 0 6px; font-family: var(--sans); font-size: 0.875rem; color: var(--ink-soft); }
.fmt-hint::before { content: "Format: "; font-weight: 600; color: var(--accent-ink); }

/* The parents panel on light card stock, like the page's index cards (blush), instead of dark ink. */
.parents { background: #fbe4df; color: var(--ink); border: 1px solid color-mix(in srgb, var(--sienna) 18%, #fbe4df); box-shadow: 0 1px 2px rgb(36 33 29 / 0.08), 0 14px 30px -20px rgb(36 33 29 / 0.3); }
.parents .eyebrow { color: var(--accent-ink); }
.parents h2 { color: var(--ink); }
.parents-body p { color: var(--ink-soft); }
.parents-body .small { color: var(--muted); }
/* Under the start box, a way to the full test: one line, quieter than the start button above it. */
.sim-link { margin: 18px 0 0; font-family: var(--sans); font-size: 0.95rem; color: var(--ink-soft); }
.sim-link a { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.sim-link a:hover { text-decoration-color: var(--blue); }
