:root {
  color-scheme: light;
  --ink: #20242c;
  --muted: #626b76;
  --paper: #fffefa;
  --desk: #f1eee5;
  --line: #d9d5ca;
  --blue: #1f69c9;
  --blue-soft: #e7f1ff;
  --red: #c8423d;
  --red-soft: #ffebe8;
  --green: #247a52;
  --green-soft: #e6f5ec;
  --yellow: #f4cf57;
  --yellow-soft: #fff6cb;
  --body: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --math: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(31, 105, 201, 0.045) 1px, transparent 1px),
    var(--desk);
  background-size: 100% 30px;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.58;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.page-width {
  width: min(1040px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.95);
}

.home-link {
  display: flex;
  width: min(1040px, calc(100% - 40px));
  min-height: 72px;
  align-items: center;
  gap: 12px;
  margin-inline: auto;
  text-decoration: none;
}

.home-link strong,
.home-link small {
  display: block;
  line-height: 1.2;
}

.home-link strong {
  font-size: 18px;
}

.home-link small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.pencil-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  transform: rotate(-3deg);
  border: 2px solid var(--ink);
  border-radius: 11px;
  background: var(--yellow-soft);
  font-size: 24px;
}

.intro {
  padding-block: 76px 64px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.intro h1,
.lesson-header h1,
.not-found h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.intro h1 em {
  position: relative;
  color: var(--blue);
  font-style: normal;
  white-space: nowrap;
}

.intro h1 em::after {
  position: absolute;
  right: 0;
  bottom: -5px;
  left: 0;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  content: "";
  opacity: 0.72;
  transform: rotate(-1deg);
}

.intro-copy {
  max-width: 730px;
  margin: 26px 0 28px;
  color: #454c55;
  font-size: 20px;
}

.simple-promise {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.simple-promise span {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 14px;
  font-weight: 700;
}

.simple-promise b {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-size: 12px;
}

.example-section {
  padding-bottom: 90px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 24px;
}

.section-heading h2,
.steps-heading h2,
.rule-card h2 {
  margin: 0;
  line-height: 1.15;
}

.section-heading h2,
.steps-heading h2 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  letter-spacing: -0.03em;
}

.section-heading > p {
  max-width: 330px;
  margin: 0;
  color: var(--muted);
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.example-card {
  display: grid;
  min-height: 142px;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 3px 0 rgba(32, 36, 44, 0.06);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.example-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue);
  box-shadow: 0 7px 0 rgba(31, 105, 201, 0.1);
}

.card-number {
  color: var(--blue);
  font-family: var(--math);
  font-size: 12px;
  font-weight: 800;
}

.card-copy,
.card-copy > span,
.card-copy > small {
  display: block;
}

.card-copy > strong {
  display: block;
  margin: -2px 0 8px;
  font-size: 18px;
  line-height: 1.25;
}

.card-problem {
  color: #343940;
  font-family: var(--math);
  font-size: 16px;
  font-weight: 750;
}

.card-copy > small {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.card-arrow {
  color: var(--blue);
  font-size: 24px;
  line-height: 1;
}

.lesson {
  padding-block: 42px 90px;
}

.back-link {
  display: inline-block;
  margin-bottom: 38px;
  color: var(--blue);
  font-weight: 750;
  text-underline-offset: 4px;
}

.lesson-header {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(290px, 0.75fr);
  gap: 48px;
  align-items: center;
}

.lesson-header h1 {
  font-size: clamp(2.45rem, 6vw, 4.6rem);
}

.lesson-header > div:first-child > p:last-child {
  max-width: 650px;
  margin: 22px 0 0;
  color: #49505a;
  font-size: 19px;
}

.source-example {
  position: relative;
  display: grid;
  min-height: 215px;
  place-content: center;
  padding: 30px;
  overflow: hidden;
  border: 1px solid #d6d0bd;
  border-radius: 4px 4px 18px 4px;
  background:
    linear-gradient(90deg, transparent 44px, rgba(200, 66, 61, 0.2) 45px, transparent 46px),
    repeating-linear-gradient(0deg, transparent, transparent 29px, rgba(31, 105, 201, 0.12) 30px),
    #fffdf5;
  box-shadow: 7px 8px 0 rgba(32, 36, 44, 0.1);
  text-align: center;
  transform: rotate(1deg);
}

.source-example small,
.source-example span {
  color: var(--muted);
  font-size: 12px;
}

.source-example strong {
  display: block;
  margin: 17px 0 12px;
  color: var(--ink);
  font-family: var(--math);
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.3;
}

.lesson-header--visual {
  display: block;
  max-width: 900px;
}

.lesson-header--visual > p:not(.eyebrow) {
  max-width: 690px;
  margin: 22px 0 0;
  color: #49505a;
  font-size: 19px;
}

.lesson-question {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 18px;
  margin-top: 27px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.lesson-question small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.lesson-question strong {
  font-family: var(--math);
  font-size: 17px;
}

.worksheet-demo {
  margin: 58px 0 68px;
}

.demo-heading {
  display: flex;
  max-width: 900px;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 17px;
}

.demo-heading h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3.5vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.demo-heading > p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.ink-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-radius: 50%;
}

.ink-dot--red {
  background: var(--red);
}

.ink-dot--blue {
  background: var(--blue);
}

.ink-dot--green {
  background: var(--green);
}

.teacher-paper {
  position: relative;
  width: min(900px, 100%);
  min-height: 390px;
  padding: 36px clamp(24px, 5vw, 55px);
  overflow: hidden;
  border: 3px solid var(--ink);
  background:
    linear-gradient(90deg, transparent 47px, rgba(200, 66, 61, 0.14) 48px, transparent 49px),
    repeating-linear-gradient(0deg, transparent, transparent 31px, rgba(31, 105, 201, 0.09) 32px),
    #fffef9;
  box-shadow: 7px 8px 0 rgba(32, 36, 44, 0.12);
  font-family: "Chalkboard SE", "Comic Sans MS", var(--body);
}

.teacher-paper::before {
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(32, 36, 44, 0.22);
  content: "";
  pointer-events: none;
}

.guided-paper [data-reveal] {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-7px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.guided-paper svg [data-reveal] {
  transform-box: fill-box;
  transform-origin: center;
}

.guided-paper [data-reveal].is-revealed {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.guided-paper [data-reveal].is-current-line {
  animation: pencil-reveal 520ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.guided-paper svg g.is-current-line > * {
  animation: pencil-mark 360ms ease-out both;
}

.guided-paper svg g.is-current-line > :nth-child(2) { animation-delay: 90ms; }
.guided-paper svg g.is-current-line > :nth-child(3) { animation-delay: 180ms; }
.guided-paper svg g.is-current-line > :nth-child(4) { animation-delay: 270ms; }
.guided-paper svg g.is-current-line > :nth-child(5) { animation-delay: 360ms; }
.guided-paper svg g.is-current-line > :nth-child(6) { animation-delay: 450ms; }

@keyframes pencil-reveal {
  from {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
    transform: translateY(-7px);
  }
  to {
    clip-path: inset(0 0 0 0);
    opacity: 1;
    transform: none;
  }
}

@keyframes pencil-mark {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.guide-panel {
  width: min(900px, 100%);
  margin-top: 18px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 5px 6px 0 rgba(32, 36, 44, 0.1);
}

.guide-progress {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 17px;
  border-bottom: 1px solid var(--line);
  background: #f7f5ee;
}

.guide-progress strong {
  font-size: 12px;
  letter-spacing: 0.04em;
}

.guide-dots {
  display: flex;
  gap: 6px;
}

.guide-dots span {
  width: 31px;
  height: 7px;
  border-radius: 999px;
  background: #d9d7cf;
  transition: background 180ms ease, transform 180ms ease;
}

.guide-dots span.is-complete {
  background: var(--blue);
}

.guide-dots span.is-current {
  transform: scaleY(1.45);
  background: var(--yellow);
}

.tutor-bubble {
  min-height: 205px;
  padding: 25px 27px 23px;
  border-left: 8px solid var(--blue);
}

.guide-panel[data-guide-phase="coach"] .tutor-bubble {
  border-left-color: #c39709;
  background: linear-gradient(90deg, rgba(255, 246, 203, 0.55), transparent 46%);
}

.guide-panel[data-guide-phase="coach"] .tutor-bubble small {
  color: #765b0c;
}

.tutor-bubble small {
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.tutor-bubble h3 {
  margin: 4px 0 12px;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.2;
}

.tutor-bubble .math-work {
  margin-bottom: 12px;
}

.tutor-bubble p {
  max-width: 720px;
  margin: 0;
  color: #4e5660;
}

.write-direction {
  max-width: 760px;
  margin: 14px 0;
  padding: 15px 17px;
  border: 2px solid var(--blue);
  border-radius: 11px;
  background: var(--blue-soft);
}

.write-direction small {
  color: var(--blue);
}

.write-direction p {
  margin: 3px 0 0;
  color: #26364a;
  font-weight: 700;
}

.write-steps {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding-left: 24px;
  color: #26364a;
  font-weight: 700;
}

.write-steps li::marker {
  color: var(--blue);
  font-weight: 900;
}

.why-line {
  font-size: 15px;
}

.coach-cue {
  display: grid;
  max-width: 760px;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  margin: 13px 0;
  padding: 15px 17px;
  border: 2px solid #d8b638;
  border-radius: 11px;
  background: var(--yellow-soft);
}

.coach-cue > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: #544006;
  font-family: var(--math);
  font-size: 21px;
  font-weight: 900;
}

.coach-cue p,
.coach-pause {
  margin: 0;
}

.coach-cue p {
  color: #343940;
  font-weight: 650;
}

.coach-pause {
  font-size: 14px;
}

.guide-controls {
  display: grid;
  grid-template-columns: auto minmax(230px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 14px 17px 17px;
  border-top: 1px solid var(--line);
}

.guide-button,
.guide-finish {
  min-height: 48px;
  border-radius: 9px;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}

.guide-button {
  padding: 10px 15px;
  border: 2px solid var(--ink);
}

.guide-button--back {
  background: var(--paper);
  color: var(--ink);
}

.guide-button--next {
  background: var(--blue);
  color: white;
}

.guide-button--next:hover {
  background: #1558ae;
}

.guide-button:disabled {
  border-color: #c9c8c2;
  background: #ecebe7;
  color: #8a8d91;
  cursor: not-allowed;
}

.guide-finish {
  padding: 8px 5px;
  border: 0;
  background: transparent;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.guide-finish:hover {
  color: #1558ae;
}

.written-layout,
.svg-diagram {
  position: relative;
  z-index: 1;
  min-height: 315px;
}

.teacher-red {
  color: var(--red) !important;
}

.teacher-blue {
  color: var(--blue) !important;
}

.teacher-green {
  color: var(--green) !important;
}

.big-math,
.math-text,
.number-row,
.fraction-line,
.equivalent-row,
.conversion-fact,
.volume-work {
  font-family: var(--math);
}

.big-math {
  font-size: clamp(1.45rem, 4vw, 2.25rem);
  font-weight: 800;
}

.boxed-answer {
  display: inline-block;
  padding: 4px 11px;
  border: 2px solid currentColor;
  border-radius: 2px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
}

.column-calculation {
  width: fit-content;
  min-width: 270px;
  font-family: var(--math);
  font-size: clamp(1.7rem, 5vw, 2.65rem);
  line-height: 1.28;
  text-align: right;
}

.carry-row {
  min-height: 25px;
  padding-right: 22px;
  font-size: 0.43em;
}

.calculation-note {
  max-width: 320px;
  margin: 8px 0;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  white-space: normal;
}

.number-row {
  position: relative;
  padding-inline: 22px 8px;
  white-space: pre;
}

.number-row .operator {
  position: absolute;
  left: 4px;
}

.rule-under {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--ink);
}

.rule-over {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 2px solid var(--ink);
}

.multiplication-layout,
.decimal-subtraction-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(42px, 9vw, 105px);
}

.diagram-notes {
  max-width: 310px;
  font-size: 17px;
}

.diagram-notes p {
  margin: 17px 0;
}

.diagram-notes b {
  color: inherit;
}

.svg-diagram {
  display: grid;
  place-items: center;
}

.svg-diagram svg {
  display: block;
  width: min(650px, 100%);
  height: auto;
  overflow: visible;
}

.svg-number,
.svg-answer,
.svg-remainder {
  fill: var(--ink);
  font-family: var(--math);
  font-weight: 750;
}

.svg-number {
  font-size: 46px;
}

.svg-answer {
  font-size: 45px;
}

.svg-remainder {
  font-size: 28px;
}

.svg-note {
  font-family: "Chalkboard SE", "Comic Sans MS", var(--body);
  font-size: 18px;
  font-weight: 700;
}

.svg-diagram .teacher-red {
  fill: var(--red) !important;
}

.svg-diagram .teacher-blue {
  fill: var(--blue) !important;
}

.svg-diagram .teacher-green {
  fill: var(--green) !important;
}

.division-bracket,
.work-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
}

.answer-box {
  fill: rgba(255, 255, 255, 0.55);
  stroke: var(--ink);
  stroke-width: 2;
}

.down-arrow {
  fill: none;
  stroke-width: 3;
}

.blue-stroke {
  stroke: var(--blue);
}

.green-stroke {
  stroke: var(--green);
}

.red-stroke {
  stroke: var(--red);
}

.fill-blue {
  fill: var(--blue);
}

.fill-green {
  fill: var(--green);
}

.fill-red {
  fill: var(--red);
}

.rounding-layout,
.compare-layout,
.form-layout,
.fraction-layout,
.customary-layout {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 19px;
  text-align: center;
}

.rounding-number {
  font-family: var(--math);
  font-size: clamp(2.2rem, 7vw, 4rem);
  line-height: 1.2;
}

.rounding-target {
  position: relative;
  border-bottom: 5px solid transparent;
  transition: border-color 180ms ease;
}

.rounding-decider {
  display: inline-grid;
  width: 1.05em;
  height: 1.05em;
  place-items: center;
  border: 3px solid transparent;
  border-radius: 50%;
  transition: border-color 180ms ease;
}

.rounding-target.is-marked {
  border-bottom-color: var(--blue);
}

.rounding-decider.is-marked {
  border-color: var(--red);
}

.is-current-mark {
  animation: mark-pop 420ms ease-out both;
}

@keyframes mark-pop {
  from { transform: scale(0.82); }
  to { transform: scale(1); }
}

.rounding-note {
  max-width: 520px;
  font-weight: 750;
}

.flow-arrow {
  color: var(--blue);
  font-family: var(--math);
  font-size: 25px;
  font-weight: 900;
  line-height: 0.8;
}

.small-note {
  font-size: 15px;
  font-weight: 750;
}

.form-layout {
  align-content: center;
}

.form-row {
  display: grid;
  width: min(700px, 100%);
  grid-template-columns: 150px 1fr;
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
  border: 2px solid var(--ink);
  background: rgba(255, 255, 255, 0.63);
  text-align: left;
}

.form-row b {
  color: var(--blue);
}

.form-row em {
  font-style: normal;
  font-weight: 800;
}

.compare-question {
  display: flex;
  align-items: center;
  gap: 14px;
}

.compare-blank {
  position: relative;
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--muted);
}

.compare-answer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fffef9;
}

.compare-checks {
  display: grid;
  gap: 5px;
  font-family: var(--math);
  text-align: left;
}

.aligned-decimals {
  display: grid;
  width: fit-content;
  justify-items: end;
  padding: 5px 12px;
  border-left: 2px solid currentColor;
}

.aligned-decimals small {
  margin-top: 3px;
  font-family: var(--body);
  font-size: 11px;
}

.decimal-column {
  min-width: 230px;
}

.decimal-multiply-layout {
  display: grid;
  place-items: center;
}

.decimal-multiply-layout .column-calculation {
  display: grid;
  place-items: end;
}

.count-places {
  width: 320px;
  margin: 15px 0;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 750;
  text-align: center;
}

.place-arches {
  border-bottom: 4px solid var(--green);
}

.fraction-layout {
  font-size: clamp(1.3rem, 3.5vw, 2rem);
}

.fraction-line,
.equivalent-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.equivalent-row {
  flex-wrap: wrap;
}

.equivalent-row small {
  flex-basis: 100%;
  font-family: var(--body);
  font-size: 14px;
}

.fraction {
  display: inline-grid;
  grid-template-rows: 1fr 1fr;
  min-width: 1.35em;
  align-items: center;
  line-height: 1.05;
  text-align: center;
  vertical-align: middle;
}

.fraction > span:first-child {
  padding: 0 0.12em 0.08em;
  border-bottom: 2px solid currentColor;
}

.fraction > span:last-child {
  padding-top: 0.08em;
}

.mixed-number {
  display: inline-flex;
  gap: 0.16em;
  align-items: center;
}

.cross-cancel {
  display: flex;
  gap: 25px;
  font-size: 15px;
  font-weight: 800;
}

.keep-change-flip {
  display: grid;
  width: min(740px, 100%);
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  font-size: 15px;
}

.keep-change-flip > span {
  display: flex;
  min-height: 90px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px;
  border: 2px solid currentColor;
  background: rgba(255, 255, 255, 0.58);
}

.keep-change-flip b {
  flex-basis: 100%;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.metric-layout {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 24px;
}

.metric-stairs {
  display: flex;
  align-items: end;
}

.metric-stairs span {
  display: grid;
  width: clamp(67px, 10vw, 94px);
  height: 58px;
  place-items: center;
  border: 2px solid var(--ink);
  border-right: 0;
  background: rgba(255, 255, 255, 0.66);
  font-size: 13px;
}

.metric-stairs span:last-child {
  border-right: 2px solid var(--ink);
}

.metric-stairs span:nth-child(1) { transform: translateY(-72px); }
.metric-stairs span:nth-child(2) { transform: translateY(-48px); }
.metric-stairs span:nth-child(3) { transform: translateY(-24px); }
.metric-stairs span:nth-child(5) { transform: translateY(24px); }
.metric-stairs span:nth-child(6) { transform: translateY(48px); }
.metric-stairs span:nth-child(7) { transform: translateY(72px); }

.metric-stairs .start-unit {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
}

.metric-stairs .end-unit {
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
}

.metric-move {
  margin-top: 62px;
  font-weight: 750;
}

.metric-move b {
  margin-left: 13px;
}

.conversion-fact {
  padding: 10px 18px;
  border: 2px solid var(--ink);
  background: white;
  font-size: 23px;
  font-weight: 800;
}

.unit-direction {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-weight: 750;
}

.unit-direction span:first-child,
.unit-direction span:last-child {
  padding: 5px 10px;
  border: 1px solid var(--ink);
  background: white;
}

.check-line {
  font-weight: 750;
}

.volume-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(290px, 1.2fr);
  gap: 55px;
  align-items: center;
}

.prism-wrap {
  display: grid;
  min-height: 230px;
  place-items: center;
}

.prism {
  position: relative;
  width: 210px;
  height: 120px;
  border: 3px solid var(--ink);
  background: rgba(31, 105, 201, 0.06);
}

.prism-top {
  position: absolute;
  right: -43px;
  bottom: 100%;
  width: 210px;
  height: 55px;
  border: 3px solid var(--ink);
  border-bottom: 0;
  background: rgba(31, 105, 201, 0.03);
  transform: skewX(-38deg);
  transform-origin: bottom left;
}

.prism-side {
  position: absolute;
  top: -53px;
  left: 100%;
  width: 43px;
  height: 122px;
  border: 3px solid var(--ink);
  border-left: 0;
  background: rgba(31, 105, 201, 0.1);
  transform: skewY(-51deg);
  transform-origin: bottom left;
}

.measure {
  position: absolute;
  font-family: var(--math);
  font-size: 14px;
  white-space: nowrap;
}

.measure-height {
  top: 45px;
  right: calc(100% + 10px);
}

.measure-length {
  top: calc(100% + 9px);
  left: 80px;
}

.measure-depth {
  top: 24px;
  left: calc(100% + 48px);
}

.volume-work {
  display: grid;
  gap: 18px;
  font-size: clamp(1.05rem, 2.5vw, 1.45rem);
  font-weight: 800;
}

.rule-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 17px;
  max-width: 870px;
  margin: 60px 0 70px;
  padding: 22px 25px;
  border: 2px solid #d8b638;
  border-radius: var(--radius);
  background: var(--yellow-soft);
}

.rule-card > span {
  font-size: 30px;
}

.rule-card h2 {
  font-size: 16px;
}

.rule-card p {
  margin: 6px 0 0;
}

.video-card {
  display: grid;
  max-width: 900px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: -34px 0 70px;
  padding: 20px 22px;
  border: 1px solid #cfd5dd;
  border-radius: 14px;
  background: rgba(255, 254, 250, 0.82);
}

.play-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  padding-left: 3px;
  border-radius: 50%;
  background: #e5483f;
  box-shadow: 0 3px 0 #a72d28;
  color: white;
  font-size: 17px;
}

.video-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.video-copy h2 {
  margin: 2px 0 3px;
  font-size: 18px;
  line-height: 1.25;
}

.video-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.video-copy strong {
  color: #424953;
}

.video-card > a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.video-card > a:hover {
  border-color: #e5483f;
  color: #b8312a;
}

.steps-heading {
  margin-bottom: 23px;
}

.step-list {
  display: grid;
  gap: 16px;
  max-width: 900px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 20px;
  padding: 27px;
  border: 1px solid var(--line);
  border-left: 7px solid var(--blue);
  border-radius: var(--radius);
  background: var(--paper);
}

.step-card[data-color="red"] {
  border-left-color: var(--red);
}

.step-card[data-color="green"] {
  border-left-color: var(--green);
}

.step-card[data-color="answer"] {
  border-left-color: #ad8512;
}

.step-number {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-family: var(--math);
  font-size: 18px;
  font-weight: 850;
}

.step-card[data-color="red"] .step-number {
  background: var(--red-soft);
  color: var(--red);
}

.step-card[data-color="green"] .step-number {
  background: var(--green-soft);
  color: var(--green);
}

.step-card[data-color="answer"] .step-number {
  background: var(--yellow-soft);
  color: #765b0c;
}

.step-content h3 {
  margin: 1px 0 13px;
  font-size: 21px;
  line-height: 1.25;
}

.math-work {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 13px;
}

.math-work span {
  display: inline-block;
  padding: 8px 11px;
  border-radius: 8px;
  background: #f0f2f4;
  font-family: var(--math);
  font-size: 17px;
  font-weight: 750;
}

.step-card[data-color="blue"] .math-work span {
  background: var(--blue-soft);
}

.step-card[data-color="red"] .math-work span {
  background: var(--red-soft);
}

.step-card[data-color="green"] .math-work span {
  background: var(--green-soft);
}

.step-card[data-color="answer"] .math-work span {
  background: var(--yellow-soft);
}

.step-content p {
  margin: 0;
  color: #4e5660;
}

.answer-card {
  display: flex;
  max-width: 900px;
  align-items: center;
  justify-content: space-between;
  gap: 35px;
  margin-top: 22px;
  padding: 28px;
  border: 3px solid var(--green);
  border-radius: var(--radius);
  background: var(--green-soft);
}

.answer-card small,
.answer-card strong {
  display: block;
}

.answer-card small {
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.answer-card strong {
  margin-top: 5px;
  font-family: var(--math);
  font-size: clamp(1.55rem, 4vw, 2.4rem);
}

.answer-card p {
  max-width: 480px;
  margin: 0;
}

.paper-note {
  display: flex;
  max-width: 900px;
  gap: 14px;
  align-items: start;
  margin: 36px 0 60px;
  padding: 20px 22px;
  border: 1px dashed #9d9582;
  border-radius: 12px;
  background: rgba(255, 254, 250, 0.65);
}

.paper-note > span {
  color: var(--blue);
  font-size: 26px;
}

.paper-note p {
  margin: 0;
}

.lesson-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.lesson-nav a {
  display: block;
  min-height: 90px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  text-decoration: none;
}

.lesson-nav a:hover {
  border-color: var(--blue);
}

.lesson-nav small,
.lesson-nav strong {
  display: block;
}

.lesson-nav small {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.lesson-nav strong {
  line-height: 1.3;
}

.next-link {
  text-align: right;
}

.site-footer {
  padding: 25px 20px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.site-footer p,
.noscript {
  margin: 0;
}

.noscript,
.not-found {
  padding-block: 70px;
}

.plain-button {
  display: inline-block;
  margin-top: 12px;
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--blue);
  color: white;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .page-width,
  .home-link {
    width: min(100% - 28px, 1040px);
  }

  .intro {
    padding-block: 52px 48px;
  }

  .intro h1 {
    font-size: clamp(2.45rem, 13vw, 4rem);
  }

  .intro-copy {
    font-size: 18px;
  }

  .section-heading,
  .lesson-header,
  .answer-card {
    display: block;
  }

  .section-heading > p {
    margin-top: 12px;
  }

  .example-grid {
    grid-template-columns: 1fr;
  }

  .lesson {
    padding-block: 25px 60px;
  }

  .back-link {
    margin-bottom: 27px;
  }

  .lesson-header h1 {
    font-size: clamp(2.3rem, 12vw, 3.7rem);
  }

  .lesson-header--visual > p:not(.eyebrow) {
    font-size: 17px;
  }

  .lesson-question {
    display: block;
  }

  .lesson-question small,
  .lesson-question strong {
    display: block;
  }

  .lesson-question strong {
    margin-top: 4px;
    font-size: 15px;
  }

  .worksheet-demo {
    margin-block: 44px 54px;
  }

  .demo-heading {
    display: block;
  }

  .demo-heading > p {
    margin-top: 10px;
    white-space: normal;
  }

  .teacher-paper {
    min-height: 0;
    padding: 30px 18px;
    border-width: 2px;
    box-shadow: 4px 5px 0 rgba(32, 36, 44, 0.12);
  }

  .teacher-paper::before {
    inset: 7px;
  }

  .guide-panel {
    margin-top: 14px;
    box-shadow: 3px 4px 0 rgba(32, 36, 44, 0.1);
  }

  .guide-progress {
    align-items: flex-start;
  }

  .guide-dots span {
    width: 24px;
  }

  .tutor-bubble {
    min-height: 255px;
    padding: 21px 18px;
    border-left-width: 6px;
  }

  .guide-controls {
    grid-template-columns: 1fr;
  }

  .guide-button--next {
    order: 1;
  }

  .guide-button--back {
    order: 2;
  }

  .guide-finish {
    order: 3;
  }

  .written-layout,
  .svg-diagram {
    min-height: 285px;
  }

  .multiplication-layout,
  .decimal-subtraction-layout {
    display: grid;
    gap: 24px;
  }

  .column-calculation {
    min-width: 230px;
    margin-inline: auto;
  }

  .diagram-notes {
    font-size: 14px;
  }

  .diagram-notes p {
    margin: 8px 0;
  }

  .svg-diagram svg {
    width: 100%;
  }

  .form-row {
    display: block;
    padding: 12px;
  }

  .form-row b,
  .form-row span {
    display: block;
  }

  .form-row span {
    margin-top: 6px;
  }

  .compare-question {
    gap: 7px;
    font-size: 1.25rem;
  }

  .compare-blank {
    width: 42px;
    height: 42px;
  }

  .count-places {
    width: min(280px, 100%);
  }

  .keep-change-flip {
    grid-template-columns: 1fr;
  }

  .keep-change-flip > span {
    min-height: 70px;
  }

  .metric-stairs span {
    width: 43px;
    height: 47px;
    font-size: 8px;
  }

  .metric-move {
    margin-top: 55px;
    font-size: 13px;
  }

  .metric-move b {
    display: block;
    margin: 4px 0 0;
  }

  .volume-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .prism {
    width: 170px;
    height: 100px;
  }

  .prism-top {
    width: 170px;
  }

  .prism-side {
    height: 102px;
  }

  .volume-work {
    place-items: center;
    text-align: center;
  }

  .source-example {
    min-height: 180px;
    margin-top: 35px;
  }

  .rule-card {
    margin-block: 42px 55px;
  }

  .video-card {
    grid-template-columns: auto minmax(0, 1fr);
    margin: -25px 0 55px;
    padding: 17px;
  }

  .play-mark {
    width: 42px;
    height: 42px;
  }

  .video-card > a {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  .step-card {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 13px;
    padding: 20px 17px;
  }

  .step-number {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .step-content h3 {
    font-size: 19px;
  }

  .math-work {
    display: grid;
  }

  .math-work span {
    width: fit-content;
    max-width: 100%;
    font-size: 15px;
  }

  .answer-card p {
    margin-top: 13px;
  }

  .lesson-nav {
    grid-template-columns: 1fr;
  }

  .next-link {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
