:root {
  color-scheme: light;
  --white: #fff;
  --ink: #282e2a;
  --muted: #5a665f;
  --line: #dfe4de;
  --sage: #435c50;
  --sage-dark: #334a3e;
  --sage-soft: #edf2ed;
  --stage: #f7f8f5;
  --clay: #c6a092;
  --blue: #9bafc3;
  --display: "Instrument Serif", Georgia, serif;
  --body: "DM Sans", system-ui, -apple-system, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-block-start: 24px; }
body { margin: 0; background: var(--white); color: var(--ink); font: 1rem/1.55 var(--body); }
p, h1, h2, h3, dl, dd, figure { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid #587867; outline-offset: 4px; }
.frame { width: min(1184px, calc(100% - 88px)); margin-inline: auto; }
.page { min-height: calc(100vh - 144px); padding: 40px 0 70px; }
.page:focus { outline: none; }
.skip-link { position: fixed; z-index: 2; top: 8px; left: 8px; transform: translateY(-160%); border-radius: 6px; padding: 10px 16px; background: var(--sage); color: white; }
.skip-link:focus { transform: none; }

.site-header { border-bottom: 1px solid var(--line); }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -.025em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 36px; border-radius: 8px; color: #f8faf8; background: var(--sage); font: 700 1rem/1 var(--body); letter-spacing: -.06em; }
.site-nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 34px); }
.site-nav a { padding: 8px 0; color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 600; white-space: nowrap; }
.site-nav a[aria-current] { color: var(--ink); box-shadow: inset 0 -1.5px var(--sage); }
.site-nav a:hover, .breadcrumbs a:hover { color: var(--sage-dark); text-decoration: underline; text-underline-offset: 4px; }

.eyebrow, .subject { color: var(--sage); font-size: .875rem; font-weight: 700; letter-spacing: .09em; line-height: 1.45; text-transform: uppercase; }
.intro-copy { color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.16rem); line-height: 1.6; max-width: 58ch; }
.home-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.home-showcase { margin-bottom: clamp(26px, 4vw, 44px); }
.home-showcase-heading { margin-bottom: 19px; }
.home-showcase-heading h1 {
  margin-top: 5px;
  color: var(--sage);
  font: 400 clamp(3.2rem, 6.1vw, 5.15rem)/.98 var(--display);
  letter-spacing: -.025em;
}
.home-showcase .home-demo-shell {
  --demo-column-gap: clamp(17px, 3vw, 35px);
  padding: clamp(14px, 2.3vw, 26px);
  background: #fbfcfa;
}
.home-demo-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  width: min(28rem, calc((100% - var(--demo-column-gap)) * .45));
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--sage-soft);
}
.home-demo-picker button {
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--sage-dark);
  font-size: .9rem;
  font-weight: 700;
}
.home-demo-picker button:hover { border-color: #c8d6c8; }
.home-demo-picker button[aria-selected="true"] { background: var(--sage); color: var(--white); }
.home-demo-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.home-demo-grid .home-demo {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  grid-template-rows: min-content 1fr;
  grid-template-areas: "story visual" "inputs visual";
  gap: 12px var(--demo-column-gap);
  align-items: start;
  min-width: 0;
}
/* Share one grid cell to keep the surrounding layout stable during switching. */
.home-demo-grid .home-demo[hidden] { display: grid; visibility: hidden; pointer-events: none; }
.home-demo-story { grid-area: story; }
.home-demo-inputs { grid-area: inputs; }
.home-demo .home-demo-visual {
  grid-area: visual;
  min-width: 0;
  height: clamp(265px, 29vw, 385px);
  margin: 0;
}
.home-demo .home-demo-heading h2 {
  margin-bottom: 5px;
  color: var(--sage-dark);
  font: 400 clamp(2rem, 3.15vw, 2.9rem)/1.04 var(--display);
}
.home-demo-heading p { color: var(--muted); }
.home-demo-heading strong { color: var(--ink); }
.home-demo-controls {
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f7f3;
}
.home-demo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px; }
.home-demo-controls .demo-unfold { margin-top: 9px; min-height: 38px; }
.home-demo label, .home-demo output { font-weight: 700; }
.home-demo output { color: var(--sage-dark); font-variant-numeric: tabular-nums; }
.home-demo .demo-reading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  color: var(--sage-dark);
  font-weight: 650;
}
.teaching-overview { margin-bottom: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.teaching-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 0 9px; padding: 0; list-style: none; }
.teaching-flow li { padding: 12px 15px; border: 1px solid var(--line); border-radius: 8px; background: #f7f8f5; }
.teaching-flow h3 { margin-bottom: 3px; color: var(--sage-dark); font-size: 1.06rem; }
.teaching-flow p { color: var(--muted); }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.section-heading h2 { font: 400 clamp(2.05rem, 3vw, 2.55rem)/1.05 var(--display); }
.section-heading > span { color: var(--muted); font-size: .875rem; }
.year-section { border-top: 1px solid var(--line); padding-top: 24px; }
.year-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.tone-sage { --tone: #e9eee6; --tone-line: #cbd7c8; --tone-ink: #425849; }
.tone-clay { --tone: #f1e8e4; --tone-line: #e0ccc3; --tone-ink: #735047; }
.tone-blue { --tone: #eaf0f4; --tone-line: #cdd9e3; --tone-ink: #465d70; }
.tone-lilac { --tone: #eeebf2; --tone-line: #d9d1e1; --tone-ink: #625472; }
.tone-sand { --tone: #f1eee7; --tone-line: #e0d7c6; --tone-ink: #675b46; }
.card-crossed { position: relative; isolation: isolate; }
.card-crossed::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(to top right, transparent calc(50% - .75px), #53615477 calc(50% - .75px) calc(50% + .75px), transparent calc(50% + .75px)),
    linear-gradient(to bottom right, transparent calc(50% - .75px), #53615477 calc(50% - .75px) calc(50% + .75px), transparent calc(50% + .75px));
}
.year-card {
  display: flex;
  flex-direction: column;
  min-height: 157px;
  padding: 15px 17px 14px;
  border: 1px solid var(--tone-line);
  border-radius: 11px;
  background: var(--tone);
  color: var(--tone-ink);
  text-decoration: none;
  transition: box-shadow .18s ease, transform .18s ease;
}
.year-card-ready { box-shadow: inset 0 0 0 1px var(--tone-line); }
.year-prefix { font-weight: 700; font-size: .875rem; }
.year-number { margin-block: 3px 8px; font: 400 clamp(2.85rem, 4.9vw, 4.3rem)/.95 var(--display); }
.year-availability { margin-top: auto; font-size: .875rem; line-height: 1.35; }
.year-card:hover, a.unit-card:hover, .shape-card:hover { transform: translateY(-2px); box-shadow: 0 5px 16px #223a2630; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; font-size: .875rem; }
.footer-inner a { color: var(--ink); font-weight: 700; text-decoration: none; }

.breadcrumbs { margin-block: 0 24px; color: var(--muted); font-size: .875rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 10px; }
.breadcrumbs li + li::before { content: "/"; color: #758076; }
.breadcrumbs li[aria-current] { color: var(--ink); font-weight: 700; }
.breadcrumbs a { text-decoration: none; }
.page-intro, .intro { margin-bottom: 29px; }
.page-intro h1, .intro h1 { margin-block: 4px 9px; font: 400 clamp(3.3rem, 7vw, 5.1rem)/.99 var(--display); letter-spacing: -.018em; }
.term-list { display: grid; gap: 25px; }
.term-section { border-top: 1px solid var(--line); padding-top: 20px; }
.term-section .section-heading { margin-bottom: 14px; }
.unit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.unit-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 93px;
  padding: 17px;
  border: 1px solid var(--tone-line);
  border-radius: 11px;
  background: var(--tone);
  text-decoration: none;
  transition: box-shadow .18s ease, transform .18s ease;
}
.unit-card h3, .shape-copy h3 { font: 400 2.05rem/1 var(--display); }
.shape-copy p { margin-top: 7px; color: var(--tone-ink); font-size: .875rem; line-height: 1.4; }

.shape-library { border-top: 1px solid var(--line); padding-top: 24px; }
.shape-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.shape-card { display: block; overflow: hidden; min-width: 0; border: 1px solid var(--tone-line); border-radius: 11px; background: white; text-decoration: none; transition: box-shadow .18s ease, transform .18s ease; }
.shape-preview { background: radial-gradient(circle at 1px 1px, #68746731 .7px, transparent 1px) 0 0 / 17px 17px, var(--tone); }
.shape-preview canvas { display: block; width: 100%; height: 144px; }
.shape-copy { padding: 13px 14px 16px; }
.shape-copy h3 { font-size: 1.75rem; }
.outline-panel, .empty-state { margin-top: 22px; border: 1px solid var(--line); border-radius: 11px; padding: 21px; }
.outline-panel .section-heading { margin-bottom: 10px; }
.outline-panel .section-heading h2, .empty-state h2 { font: 400 2.15rem/1.15 var(--display); }
.topic-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 22px; margin: 0; padding-inline-start: 21px; }
.topic-list li::marker { color: #718579; }
.outline-note, .empty-state p { margin-top: 10px; color: var(--muted); }
.empty-state-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 15px; }
.lesson-nav { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 21px; }
.lesson-nav a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); text-decoration: none; font-size: .875rem; font-weight: 600; white-space: nowrap; }
.lesson-nav a:hover, .lesson-nav a[aria-current] { border-color: #bfcdc1; background: var(--sage-soft); color: var(--sage-dark); }

.lab-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(322px, 1fr); align-items: start; gap: 18px; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: white; }
.card h2 { font-size: 1.16rem; font-weight: 700; line-height: 1.25; letter-spacing: -.023em; }
.model-card { padding: 14px; }
.model-header, .card-heading, .dimension-heading, .model-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.model-header { margin-bottom: 12px; padding-inline: 3px; }
.view-switch { display: inline-flex; flex-shrink: 0; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #f3f5f1; }
.view-switch button { min-height: 33px; padding: 4px 10px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: .875rem; font-weight: 650; white-space: nowrap; }
.view-switch button[aria-pressed="true"] { background: #dce7dc; color: #334d3e; }
.view-switch button:hover { color: var(--sage-dark); }
.stage { position: relative; isolation: isolate; height: clamp(350px, 36vw, 431px); overflow: hidden; border: 1px solid #e0e6de; border-radius: 8px; background: radial-gradient(circle at 1px 1px, #788c7d39 1px, transparent 1.2px) 0 0 / 20px 20px, var(--stage); }
.model-target, .model-target canvas { display: block; width: 100%; height: 100%; }
.model-target { position: absolute; inset: 0; padding: 0; border: 0; border-radius: 8px; background: transparent; -webkit-tap-highlight-color: transparent; }
.model-target:focus-visible { outline-offset: -4px; }
.stage-state { position: absolute; top: 11px; left: 11px; padding: 4px 8px; border: 1px solid #d3ddd4; border-radius: 5px; background: #fdfffdf2; color: #4c6354; font-size: .875rem; font-weight: 650; line-height: 1.25; pointer-events: none; }
.unfold-cue {
  --unfold-cue-fill: rgba(229, 241, 232, .8);
  --unfold-cue-border: #8da996;
  position: absolute;
  inset-inline: 0;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 20px);
  margin-inline: auto;
  padding: 7px 14px;
  border: 1px solid var(--unfold-cue-border);
  border-radius: 999px;
  background-color: var(--unfold-cue-fill);
  box-shadow: 0 6px 15px #2b423544;
  color: var(--sage-dark);
  font-size: .9375rem;
  font-weight: 700;
  line-height: 1.25;
  pointer-events: none;
  animation: unfold-cue-float 1.4s ease-in-out 3;
  transition: transform .22s ease, background-color .22s ease;
}
.unfold-cue::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--unfold-cue-border);
  border-left: 1px solid var(--unfold-cue-border);
  background-color: var(--unfold-cue-fill);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  transform: translateX(-50%) rotate(45deg);
}
.unfold-cue[hidden] { display: none; }
.model-target:is(:hover, :focus-visible) .unfold-cue {
  --unfold-cue-fill: rgba(218, 236, 222, .87);
  transform: translateY(-7px);
}
@keyframes unfold-cue-float {
  50% { transform: translateY(-14px) scale(1.035); }
}
.model-footer { flex-wrap: wrap; padding-top: 12px; }
.model-actions, .legend { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: 8px 13px; border: 1px solid transparent; border-radius: 7px; font-size: .9rem; font-weight: 700; line-height: 1.3; text-decoration: none; }
.primary-button { background: var(--sage); color: white; }
.primary-button:hover { background: var(--sage-dark); }
.secondary-button { border-color: #d0d9d1; background: #f7f9f6; color: var(--sage-dark); }
.secondary-button:hover { border-color: #a1b4a5; background: #eef3ee; }
.secondary-button[aria-pressed="false"] { color: var(--muted); }
.unfold-icon { display: inline-grid; grid-template-columns: 3px 7px 3px; align-items: center; gap: 1px; height: 15px; }
.unfold-icon::before, .unfold-icon::after, .unfold-icon i { content: ""; height: 10px; border: 1.45px solid currentColor; border-radius: 1px; }
.unfold-icon::before, .unfold-icon::after { height: 8px; }
.ruler-icon { width: 15px; height: 8px; border: 1px solid currentColor; border-radius: 2px; background: repeating-linear-gradient(90deg, transparent 0 2px, currentColor 2px 3px) 1px 0 / 11px 3px no-repeat; }
.legend { gap: 9px; margin: 0; padding: 0; color: var(--muted); font-size: .875rem; list-style: none; }
.legend li { display: flex; align-items: center; gap: 5px; }
.swatch { width: 9px; height: 9px; flex-shrink: 0; border-radius: 50%; }
.swatch.side { background: #879e89; }
.swatch.top { background: var(--clay); }
.swatch.bottom { background: var(--blue); }

.parameters, .area { padding: 16px 18px; }
.parameters, .area:not(:last-child) { border-bottom: 1px solid var(--line); }
.card-heading { margin-bottom: 13px; }
.reset-button { min-height: 33px; padding: 3px 9px; border: 1px solid #d7ded7; border-radius: 6px; background: white; color: var(--sage); font-size: .875rem; font-weight: 650; }
.reset-button:hover { border-color: #a6b8a9; background: var(--sage-soft); }
.dimension + .dimension { margin-top: 7px; }
.dimension-heading label { font-size: .95rem; font-weight: 650; }
.variable { margin-left: 3px; color: #58685d; font-style: italic; }
.dimension-heading output { min-width: 3.1rem; padding: 3px 7px; border: 1px solid #d4ded4; border-radius: 5px; background: #edf3ed; color: #355342; font-size: .875rem; font-weight: 700; line-height: 1.35; text-align: center; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; display: block; width: 100%; height: 26px; margin: 2px 0 0; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 12px; background: linear-gradient(90deg, #7a9582 0 var(--range-progress), #dce4dc var(--range-progress) 100%); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 17px; height: 17px; margin-top: -6px; border: 2px solid white; border-radius: 50%; background: #50715c; box-shadow: 0 0 0 1px #50715c; }
input[type="range"]::-moz-range-track { height: 5px; border-radius: 12px; background: linear-gradient(90deg, #7a9582 0 var(--range-progress), #dce4dc var(--range-progress) 100%); }
input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border: 2px solid white; border-radius: 50%; background: #50715c; box-shadow: 0 0 0 1px #50715c; }
.measurement-derived { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 10px; margin-top: 6px; color: var(--muted); font-size: .875rem; }
.measurement-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 3px 10px; margin-bottom: 8px; }
.measurement-formula { color: #53685a; font-size: .91rem; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
.area-parts { margin-bottom: 12px; }
.area-part { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding-block: 5px; border-bottom: 1px solid #e6eae5; }
.area-part dt { display: flex; align-items: center; gap: 7px; font-size: .875rem; font-weight: 650; line-height: 1.25; }
.part-formula { display: block; margin-top: 2px; color: var(--muted); font-size: .875rem; font-weight: 500; }
.area-part dd { flex-shrink: 0; font-size: .875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.shape-icon { width: 14px; height: 10px; flex: 0 0 14px; border-radius: 2px; background: #a5b7a6; }
.shape-icon.top { background: var(--clay); }
.shape-icon.bottom { background: var(--blue); }
.shape-icon.circle, .shape-icon.circles { border-radius: 50%; }
.shape-icon.circles { background: linear-gradient(90deg, var(--clay) 50%, var(--blue) 50%); }
.shape-icon.triangle { clip-path: polygon(0 100%, 0 0, 100% 100%); }
.shape-icon.sector { border-radius: 0 0 12px 12px; }
.total { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; min-height: 54px; padding: 7px 11px; border: 1px solid #d2dfd1; border-radius: 6px; background: #ecf3eb; }
.total p { font-weight: 700; line-height: 1.25; }
.total-description span { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.total strong { color: #364f40; font-size: clamp(1.1rem, 2.05vw, 1.52rem); letter-spacing: -.035em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.measurement-volume .total { border-color: #d6dfe6; background: #eef3f6; }
.measurement-volume .total strong { color: #435b6d; }

.practice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 20px; }
.takeaway-card, .quiz-card { padding: 21px; }
.takeaway-card { background: #f2f5f0; }
.takeaway-card h2 { margin-block: 7px 8px; font: 400 2.15rem/1.1 var(--display); }
.takeaway-card > p:not(.subject) { color: var(--muted); }
.measurement-volume-copy, .measurement-units { margin-top: 9px; }
.takeaway-equation { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-block: 12px; font-weight: 700; }
.takeaway-equation span:not(.math-plus) { padding: 5px 8px; border: 1px solid #d2ded4; border-radius: 5px; color: var(--sage-dark); background: #f9fbf8; }
.quiz-card fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.quiz-card legend { padding: 0; }
.quiz-question { margin: 8px 0 12px; font-weight: 650; }
.quiz-choices { display: flex; flex-wrap: wrap; gap: 7px; }
.quiz-choices label { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; color: #45534a; font-size: .875rem; cursor: pointer; }
.quiz-choices label:hover, .quiz-choices label:has(:checked) { border-color: #a3b7a7; background: var(--sage-soft); }
.quiz-choices input { margin: 0; accent-color: var(--sage); }
.quiz-card button { margin-top: 12px; }
#quizFeedback { margin-top: 9px; color: #7d5445; font-size: .9375rem; }
#quizFeedback:empty { margin-top: 0; }
#quizFeedback[data-state="correct"] { color: #3d664b; }
.noscript { padding-bottom: 24px; color: var(--muted); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.calculus-year-actions { margin: -9px 0 23px; }
.math-radical { letter-spacing: normal; }
.checkpoint-library { display: grid; gap: 24px; }
.checkpoint-group { border-top: 1px solid var(--line); padding-top: 20px; }
.checkpoint-group header { margin-bottom: 12px; }
.checkpoint-group h2 { font: 400 clamp(2.05rem, 3.2vw, 2.65rem)/1.05 var(--display); }
.checkpoint-group header p { max-width: 66ch; margin-top: 5px; color: var(--muted); }
.checkpoint-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.core-checkpoint-grid { grid-auto-rows: 1fr; }
.checkpoint-grid.model-checkpoint-grid { grid-template-columns: minmax(0, 32rem); }
.model-checkpoint-grid .checkpoint-card { justify-content: center; }
.checkpoint-card { height: 100%; min-height: 157px; justify-content: flex-start; }
.checkpoint-card .checkpoint-index {
  margin-bottom: 8px;
  color: var(--tone-ink);
  font-size: .875rem;
  font-weight: 700;
}
.checkpoint-card h3 { font: 650 clamp(1.2rem, 2vw, 1.55rem)/1.2 var(--body); }
.checkpoint-card p { margin-top: 8px; color: var(--tone-ink); line-height: 1.45; }
.calculus-preparation .unit-card { justify-content: center; }

.calculus-lesson .page-intro { margin-bottom: 22px; }
.calculus-lesson .page-intro h1 { font-size: clamp(2.9rem, 6.4vw, 4.8rem); }
.calculus-goals { max-width: 65ch; margin-top: 11px; }
.calculus-goals summary { color: var(--sage-dark); font-weight: 650; cursor: pointer; }
.calculus-goals dl { margin-top: 7px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 6px; background: #f7f8f5; }
.calculus-goals dl > div + div { margin-top: 6px; }
.calculus-goals dt { font-weight: 700; }
.calculus-goals dd { color: var(--muted); }
.calculus-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(169px, 100%), 1fr));
  gap: 8px;
  margin: 0 0 23px;
  padding: 0;
  list-style: none;
}
.calculus-steps button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  height: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-size: .94rem;
  font-weight: 650;
  line-height: 1.25;
  text-align: left;
}
.calculus-steps button:hover,
.calculus-steps button[aria-current="step"] {
  border-color: #abbead;
  background: var(--sage-soft);
}
.calculus-step-number {
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  height: 25px;
  border-radius: 50%;
  background: #e5eae4;
  color: var(--sage-dark);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
.calculus-steps button[aria-current="step"] .calculus-step-number { background: var(--sage); color: white; }
.calculus-stage-intro { border-top: 1px solid var(--line); padding-top: 17px; }
.calculus-step-count { color: var(--sage); font-size: .875rem; font-weight: 700; }
.calculus-stage-intro h2 { margin-block: 3px 5px; font: 400 clamp(2.05rem, 4.5vw, 2.9rem)/1.02 var(--display); }
.calculus-stage-intro h2:focus { outline: none; }
.calculus-stage-intro > p:last-child { max-width: 70ch; color: var(--muted); }
.calculus-action, .calculus-look-for {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-block: 12px;
  padding: 9px 13px;
  border-left: 3px solid #849c88;
  border-radius: 0 6px 6px 0;
  background: var(--sage-soft);
  color: var(--sage-dark);
}
.calculus-look-for { border-color: #8197aa; background: #edf2f6; color: #38566b; }
.calculus-action > strong, .calculus-look-for > strong { white-space: nowrap; }
.calculus-words { max-width: 70ch; margin-top: 9px; }
.calculus-words summary, .calculus-quiz-hint summary { color: var(--sage-dark); font-weight: 650; cursor: pointer; }
.calculus-words dl { margin-top: 6px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 6px; background: #f7f8f5; }
.calculus-words dl > div + div { margin-top: 7px; }
.calculus-words dt { font-weight: 650; }
.calculus-words dd { color: var(--muted); }
.calculus-grid, .calculus-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(270px, 1fr);
  align-items: start;
  gap: 14px;
  margin-top: 13px;
}
.calculus-grid-single, .calculus-detail-single { grid-template-columns: minmax(0, 1fr); }
.calculus-graph-card { padding: 11px; }
.calculus-graph-card h3 { margin: 0 0 7px 4px; font-size: .95rem; }
.calculus-graph {
  height: clamp(290px, 31vw, 402px);
  overflow: hidden;
  border: 1px solid #e0e6df;
  border-radius: 8px;
  background: var(--stage);
}
.calculus-graph canvas { display: block; width: 100%; height: 100%; }
.calculus-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  margin: 9px 3px 2px;
  padding: 0;
  color: var(--muted);
  font-size: .875rem;
  list-style: none;
}
.calculus-legend[hidden] { display: none; }
.calculus-legend li { display: inline-flex; align-items: center; gap: 6px; }
.calculus-legend-swatch { width: 18px; border-top: 2px solid var(--legend-colour, #33463c); }
.calculus-legend-swatch[data-colour="sage"] { --legend-colour: #4f715e; }
.calculus-legend-swatch[data-colour="clay"] { --legend-colour: #a15949; }
.calculus-legend-swatch[data-colour="blue"] { --legend-colour: #4d6f92; }
.calculus-legend-swatch[data-colour="lilac"] { --legend-colour: #78618e; }
.calculus-legend-swatch[data-dashed] { border-top-style: dashed; }
.calculus-controls { padding: 13px 15px; }
.calculus-controls h3, .calculus-quiz h3 { margin-bottom: 10px; font-size: 1.02rem; }
.calculus-dimension + .calculus-dimension { margin-top: 10px; }
.calculus-dimension .dimension-heading label { line-height: 1.3; }
.calculus-dimension .dimension-heading output { white-space: nowrap; }
.calculus-cases, .calculus-quiz fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.calculus-cases { margin-bottom: 12px; }
.calculus-cases legend, .calculus-quiz legend { padding: 0; font-weight: 650; line-height: 1.4; }
.calculus-case-buttons, .calculus-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.calculus-case-buttons button { min-height: 38px; padding: 6px 9px; }
.calculus-case-buttons button[aria-pressed="true"] { border-color: #99b09c; background: #e5eee5; color: #304c3c; }
.calculus-values { margin-top: 12px; border-top: 1px solid var(--line); }
.calculus-values > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 9px;
  padding-block: 7px;
  border-bottom: 1px solid #e8ece7;
  line-height: 1.35;
}
.calculus-values > div:last-child { border: 0; padding-bottom: 1px; }
.calculus-values dt { min-width: 0; color: var(--muted); }
.calculus-values dd {
  min-width: 0;
  color: var(--sage-dark);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
}
.calculus-table-wrap { margin-top: 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.calculus-table { width: 100%; border-collapse: collapse; text-align: left; }
.calculus-table caption { padding: 9px 11px; font-weight: 700; text-align: left; }
.calculus-table th, .calculus-table td { padding: 7px 11px; border-top: 1px solid var(--line); }
.calculus-table th { background: #f2f5f1; }
.calculus-table td { font-variant-numeric: tabular-nums; }
.calculus-explanation, .calculus-quiz { padding: 14px 16px; }
.calculus-explanation { background: #f7f8f4; }
.calculus-explanation summary { color: var(--sage-dark); font-weight: 700; cursor: pointer; }
.calculus-explanation details + details { margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.calculus-explanation p { margin-top: 9px; }
.calculus-equation {
  padding: 8px 10px;
  border: 1px solid #d6dfd4;
  border-radius: 6px;
  background: white;
  color: var(--sage-dark);
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.calculus-choices { flex-direction: column; }
.calculus-choices label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  line-height: 1.35;
  cursor: pointer;
}
.calculus-choices label:hover, .calculus-choices label:has(:checked) { border-color: #a6b8a8; background: var(--sage-soft); }
.calculus-choices input { flex-shrink: 0; margin: 3px 0 0; accent-color: var(--sage); }
.calculus-quiz button { margin-top: 10px; }
.calculus-quiz-hint { margin-top: 9px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: #f7f8f5; }
.calculus-quiz-hint p { margin-top: 5px; }
.calculus-feedback:not(:empty) {
  margin-top: 10px;
  padding: 8px 9px;
  border-radius: 6px;
  background: #f5eee9;
  color: #6d483d;
}
.calculus-feedback[data-state="correct"] { background: #edf3eb; color: #39553e; }
.calculus-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-top: 19px;
}
.calculus-actions > div { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.calculus-back { padding: 6px 4px; color: var(--sage-dark); font-weight: 650; text-underline-offset: 3px; }

@media (max-width: 1040px) {
  .shape-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .year-card { padding-inline: 12px; }
}
@media (max-width: 820px) {
  .frame { width: calc(100% - 40px); }
  .unit-grid, .topic-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-grid { grid-template-columns: minmax(0, 1fr); }
  .checkpoint-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage { height: clamp(340px, 55vw, 410px); }
}
@media (max-width: 740px) {
  .home-demo-picker { width: min(100%, 28rem); }
  .home-demo-grid .home-demo {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "story" "visual" "inputs";
  }
  .home-demo .home-demo-visual { height: clamp(215px, 62vw, 325px); }
}
@media (max-width: 610px) {
  .teaching-flow { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .year-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .year-card { min-height: 131px; }
  .shape-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .practice-grid { grid-template-columns: 1fr; }
  .calculus-grid, .calculus-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .calculus-graph { height: clamp(255px, 73vw, 345px); }
}
@media (max-width: 500px) {
  .masthead { flex-wrap: wrap; gap: 3px 10px; padding-block: 8px; }
  .site-nav { flex-wrap: wrap; gap: 0 9px; }
}
@media (max-width: 430px) {
  .frame { width: calc(100% - 28px); }
  .page { padding-top: 28px; }
  .masthead { min-height: 61px; }
  .brand { gap: 7px; font-size: .93rem; }
  .brand-mark { width: 37px; height: 32px; }
  .site-nav a { font-size: .875rem; }
  .unit-grid { grid-template-columns: 1fr; }
  .checkpoint-grid { grid-template-columns: minmax(0, 1fr); }
  .core-checkpoint-grid { grid-auto-rows: auto; }
  .checkpoint-card { min-height: 0; }
  .topic-list { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; }
  .shape-grid { gap: 10px; }
  .shape-copy { padding-inline: 9px; }
  .shape-preview canvas { height: 126px; }
  .stage { height: 335px; }
  .model-card { padding: 9px; }
  .model-header h2 { font-size: 1rem; }
  .view-switch button { padding-inline: 6px; }
}
@media (max-width: 350px) {
  .year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
  .unfold-cue { animation: none; }
  .model-target:is(:hover, :focus-visible) .unfold-cue { transform: none; }
}
