:root {
  color-scheme: light;
  --ink: #172635;
  --ink-soft: #42515d;
  --paper: #fbf7ec;
  --paper-deep: #f1ead9;
  --white: #ffffff;
  --line: #d9d5c9;
  --teal: #147f78;
  --teal-dark: #0c625d;
  --mint: #dff2e9;
  --coral: #e6684a;
  --coral-soft: #ffe4d9;
  --yellow: #f5c451;
  --violet: #6c58a9;
  --violet-soft: #ebe4ff;
  --blue: #3f75b5;
  --blue-soft: #dfebfa;
  --green: #287c56;
  --red: #b94230;
  --shadow: 0 18px 54px rgba(23, 38, 53, 0.11);
  --shadow-small: 0 8px 24px rgba(23, 38, 53, 0.09);
  --radius: 22px;
  --radius-small: 13px;
  --content: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "PingFang HK", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.55;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(23, 38, 53, 0.027) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 38, 53, 0.027) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 4px solid rgba(63, 117, 181, 0.38);
  outline-offset: 3px;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3,
strong {
  letter-spacing: -0.025em;
}

.container {
  width: min(var(--content), calc(100% - 40px));
  margin-inline: auto;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(150px, 1fr);
  gap: 24px;
  align-items: center;
  min-height: 74px;
  padding: 10px 34px;
  border-bottom: 1px solid rgba(23, 38, 53, 0.1);
  background: rgba(251, 247, 236, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  width: fit-content;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--ink);
  color: white;
  font-size: 23px;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--yellow);
}

.brand-copy {
  display: grid;
  line-height: 1.12;
}

.brand-copy strong {
  font-size: 17px;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-links a {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}

.nav-links a:hover {
  background: white;
  color: var(--teal-dark);
}

.nav-links a[aria-current="page"] {
  background: var(--mint);
  color: var(--teal-dark);
}

.term-toggle {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-self: end;
  min-height: 38px;
  padding: 7px 10px 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

[data-toggle-dot] {
  position: relative;
  width: 31px;
  height: 18px;
  border-radius: 999px;
  background: #b8bdbd;
  transition: background 180ms ease;
}

[data-toggle-dot]::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  content: "";
  transition: transform 180ms ease;
}

[aria-pressed="true"] > [data-toggle-dot] {
  background: var(--teal);
}

[aria-pressed="true"] > [data-toggle-dot]::after {
  transform: translateX(13px);
}

.hide-english .term-en {
  display: none !important;
}

.home-hero {
  padding: 74px 0 64px;
  overflow: hidden;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(430px, 0.78fr);
  gap: 68px;
  align-items: center;
}

.hero-copy {
  display: grid;
  gap: 24px;
}

.eyebrow {
  color: #a4462f;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow-light {
  color: #f6cb70;
}

.hero-copy h1 {
  max-width: 760px;
  font-size: clamp(50px, 6vw, 82px);
  line-height: 1.04;
}

.hero-copy h1 span {
  position: relative;
  color: var(--teal-dark);
}

.hero-copy h1 span::after {
  position: absolute;
  right: 0;
  bottom: -7px;
  left: 0;
  height: 10px;
  border-radius: 50%;
  background: var(--yellow);
  content: "";
  opacity: 0.62;
  transform: rotate(-1.2deg);
}

.hero-lead {
  max-width: 680px;
  color: var(--ink-soft);
  font-size: 20px;
  font-weight: 650;
}

.hero-actions,
.workbench-actions,
.sprint-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button {
  display: inline-flex;
  min-height: 49px;
  padding: 0 19px;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
}

.button-primary {
  background: var(--ink);
  color: white;
  box-shadow: 4px 4px 0 rgba(20, 127, 120, 0.5);
}

.button-primary:hover {
  background: var(--teal-dark);
}

.button-quiet {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.66);
}

.button-quiet:hover {
  border-color: var(--teal);
  background: white;
}

.button-small {
  min-height: 42px;
  padding-inline: 15px;
  font-size: 14px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.text-button {
  border: 0;
  background: none;
  color: var(--teal-dark);
  cursor: pointer;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-facts div {
  display: grid;
  min-width: 138px;
  padding: 12px 16px;
  border-left: 3px solid var(--coral);
  background: rgba(255, 255, 255, 0.55);
}

.hero-facts dt {
  font-size: 22px;
  font-weight: 950;
}

.hero-facts dd {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.hero-lab-card {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 12px 12px 0 var(--coral-soft), var(--shadow);
  transform: rotate(1deg);
}

.hero-lab-card::before {
  position: absolute;
  top: -19px;
  left: 42%;
  width: 82px;
  height: 30px;
  background: rgba(245, 196, 81, 0.72);
  content: "";
  transform: rotate(-5deg);
}

.lab-card-topline,
.chart-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 850;
}

.live-dot {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green);
}

.live-dot::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.hero-lab-card h2 {
  font-size: 31px;
}

.hero-lab-card > p {
  color: var(--ink-soft);
  font-weight: 650;
}

.mini-number-line {
  padding: 32px 8px 20px;
}

.mini-track {
  position: relative;
  height: 5px;
  border-radius: 99px;
  background: var(--ink);
}

.mini-track > span {
  position: absolute;
  top: 12px;
  left: var(--x);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  transform: translateX(-50%);
}

.mini-track > span::before {
  position: absolute;
  top: -15px;
  left: 50%;
  width: 2px;
  height: 9px;
  background: var(--ink);
  content: "";
}

.mini-pin {
  position: absolute;
  bottom: 13px;
  left: var(--x);
  display: grid;
  min-width: 42px;
  min-height: 32px;
  padding-inline: 7px;
  place-items: center;
  border-radius: 9px;
  color: white;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  transform: translateX(-50%);
}

.mini-pin::after {
  position: absolute;
  bottom: -8px;
  border: 5px solid transparent;
  border-top-color: inherit;
  content: "";
}

.pin-a {
  background: var(--blue);
  border-top-color: var(--blue);
}

.pin-b {
  background: var(--coral);
  border-top-color: var(--coral);
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-row button,
.sign-choice-grid button,
.quiz-options button,
.amc-options button,
.sort-bank button,
.repeat-tabs button {
  min-height: 44px;
  padding: 9px 13px;
  border: 2px solid var(--line);
  border-radius: 11px;
  background: white;
  cursor: pointer;
  font-weight: 850;
}

.choice-row button:hover,
.sign-choice-grid button:hover,
.quiz-options button:hover,
.amc-options button:hover,
.sort-bank button:hover,
.repeat-tabs button:hover {
  border-color: var(--teal);
}

button.is-correct {
  border-color: var(--green) !important;
  background: #e0f4e9 !important;
  color: #175d3c !important;
}

button.is-wrong {
  border-color: var(--red) !important;
  background: #ffe5df !important;
  color: #8f281c !important;
}

.inline-feedback {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 11px;
  background: #f3efe3;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 750;
}

.section {
  padding: 70px 0;
}

.section-heading {
  display: grid;
  gap: 9px;
  max-width: 820px;
  margin-bottom: 28px;
}

.section-heading h2 {
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1.12;
}

.section-heading > p:last-child,
.split-heading > p {
  color: var(--ink-soft);
  font-weight: 650;
}

.split-heading {
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.55fr);
  gap: 40px;
  align-items: end;
  max-width: none;
}

.split-heading > div {
  display: grid;
  gap: 9px;
}

.track-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.track-card {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 300px;
  padding: 25px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-small);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.track-card::after {
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  content: "";
  opacity: 0.7;
}

.track-card:hover {
  box-shadow: 8px 8px 0 var(--ink);
  transform: translate(-3px, -3px);
}

.track-mint {
  background: linear-gradient(145deg, white 40%, var(--mint));
}

.track-mint::after {
  background: repeating-linear-gradient(45deg, var(--teal), var(--teal) 3px, transparent 3px, transparent 8px);
}

.track-coral {
  background: linear-gradient(145deg, white 40%, var(--coral-soft));
}

.track-coral::after {
  background: var(--coral);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.track-violet {
  background: linear-gradient(145deg, white 40%, var(--violet-soft));
}

.track-violet::after {
  border: 8px solid var(--violet);
  background: transparent;
}

.track-status {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 900;
}

.track-card h3 {
  max-width: 250px;
  font-size: 30px;
  line-height: 1.1;
}

.track-card > p:not(.eyebrow) {
  max-width: 300px;
  color: var(--ink-soft);
  font-weight: 650;
}

.card-action {
  margin-top: auto;
  font-size: 14px;
  font-weight: 900;
}

.progress-band {
  padding: 60px 0;
  background: var(--ink);
  color: white;
}

.progress-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}

.progress-layout h2 {
  max-width: 620px;
  margin-top: 10px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.13;
}

.progress-card {
  display: grid;
  gap: 13px;
  padding: 23px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.progress-number {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.progress-number strong {
  color: var(--yellow);
  font-size: 48px;
  line-height: 1;
}

.progress-number span,
.progress-card p {
  color: #cdd6dc;
  font-weight: 700;
}

.progress-meter {
  height: 11px;
  border-radius: 99px;
  background: rgba(23, 38, 53, 0.12);
  overflow: hidden;
}

.progress-band .progress-meter {
  background: rgba(255, 255, 255, 0.14);
}

.progress-meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), var(--coral));
  transition: width 350ms ease;
}

.roadmap-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: start;
}

.roadmap-panel {
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}

.roadmap-title {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-bottom: 18px;
}

.roadmap-title h3 {
  font-size: 22px;
}

.roadmap-title p {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

.roadmap-icon {
  display: grid;
  width: 47px;
  height: 47px;
  place-items: center;
  border-radius: 14px;
  background: var(--ink);
  color: white;
  font-size: 15px;
  font-weight: 950;
}

.roadmap-list {
  display: grid;
  gap: 7px;
}

.roadmap-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 60px;
  padding: 9px 10px;
  border-radius: 12px;
}

.roadmap-item:hover {
  background: white;
}

.roadmap-dot {
  width: 10px;
  height: 10px;
  border: 2px solid #aeb6b7;
  border-radius: 50%;
}

.roadmap-item.is-open .roadmap-dot {
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(20, 127, 120, 0.12);
}

.roadmap-item strong,
.roadmap-item small {
  display: block;
}

.roadmap-item strong {
  font-size: 14px;
}

.roadmap-item small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.roadmap-item em {
  color: var(--ink-soft);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.roadmap-item.is-open em {
  color: var(--teal-dark);
}

.roadmap-item.is-planned {
  opacity: 0.72;
}

.philosophy-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
}

.method-card,
.method-steps {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: white;
}

.method-intro {
  display: grid;
  gap: 12px;
  align-content: end;
  min-height: 280px;
  padding: 28px;
  background: var(--coral-soft);
}

.method-intro h2 {
  font-size: 38px;
  line-height: 1.1;
}

.method-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0;
  padding: 18px;
  list-style: none;
}

.method-steps li {
  display: grid;
  gap: 7px;
  min-height: 220px;
  padding: 16px;
  align-content: end;
  border-right: 1px solid var(--line);
}

.method-steps li:last-child {
  border-right: 0;
}

.method-steps span {
  margin-bottom: auto;
  color: var(--coral);
  font-size: 13px;
  font-weight: 900;
}

.method-steps strong {
  font-size: 19px;
}

.method-steps small {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.site-footer {
  display: flex;
  gap: 30px;
  align-items: end;
  justify-content: space-between;
  padding: 35px max(30px, calc((100% - var(--content)) / 2));
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
}

.site-footer strong {
  font-size: 18px;
}

.site-footer p {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.footer-links {
  display: flex;
  gap: 16px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
}

/* Topic pages */
.topic-hero {
  padding: 34px 0 52px;
  border-bottom: 1px solid rgba(23, 38, 53, 0.1);
}

.topic-hero-coral {
  background: linear-gradient(135deg, var(--paper) 50%, var(--coral-soft));
}

.topic-hero-mint {
  background: linear-gradient(135deg, var(--paper) 50%, var(--mint));
}

.topic-hero-violet {
  background: linear-gradient(135deg, var(--paper) 50%, var(--violet-soft));
}

.topic-hero-blue {
  background: linear-gradient(135deg, var(--paper) 50%, var(--blue-soft));
}

.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 36px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.breadcrumb a:hover {
  color: var(--teal-dark);
}

.topic-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.78fr);
  gap: 58px;
  align-items: center;
}

.topic-hero-grid > div:first-child {
  display: grid;
  gap: 18px;
}

.topic-hero h1 {
  font-size: clamp(48px, 6vw, 72px);
  line-height: 1.03;
}

.topic-hero h1 .term-en {
  display: block;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.3em;
  font-weight: 800;
  letter-spacing: 0;
}

.topic-lead {
  max-width: 700px;
  color: var(--ink-soft);
  font-size: 19px;
  font-weight: 700;
}

.topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-meta span {
  padding: 7px 10px;
  border: 1px solid rgba(23, 38, 53, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  font-size: 11px;
  font-weight: 850;
}

.topic-hero-visual,
.amc-format-card,
.formula-cloud,
.set-visual {
  min-height: 270px;
  padding: 25px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: white;
  box-shadow: 10px 10px 0 rgba(23, 38, 53, 0.1);
}

.topic-hero-visual {
  display: grid;
  gap: 20px;
  align-content: center;
}

.hero-axis {
  position: relative;
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  padding-top: 55px;
}

.hero-axis::before {
  position: absolute;
  top: 66px;
  right: 0;
  left: 0;
  height: 4px;
  border-radius: 99px;
  background: var(--ink);
  content: "";
}

.hero-axis span {
  position: relative;
  padding-top: 27px;
  text-align: center;
  font-size: 11px;
  font-weight: 850;
}

.hero-axis span::before {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 2px;
  height: 13px;
  background: var(--ink);
  content: "";
}

.hero-axis .axis-zero {
  color: var(--coral);
  font-size: 14px;
}

.hero-axis i {
  position: absolute;
  top: 0;
  left: var(--axis-position);
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--coral);
  color: white;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  transform: translateX(-50%);
}

.topic-hero-visual > p {
  color: var(--ink-soft);
  text-align: center;
  font-size: 13px;
  font-weight: 750;
}

.experiment-nav {
  position: sticky;
  top: 74px;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.experiment-nav .container {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  overflow-x: auto;
  scrollbar-width: thin;
}

.experiment-nav .four-items {
  grid-template-columns: repeat(4, 1fr);
}

.experiment-nav a {
  display: flex;
  gap: 7px;
  min-width: 118px;
  min-height: 57px;
  padding: 9px;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.experiment-nav a:first-child {
  border-left: 1px solid var(--line);
}

.experiment-nav a:hover {
  background: var(--paper);
  color: var(--teal-dark);
}

.experiment-nav a span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 10px;
}

.lesson-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding-top: 52px;
  padding-bottom: 78px;
}

.lesson-progress {
  position: sticky;
  top: 148px;
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
}

.lesson-progress h2 {
  font-size: 24px;
}

.lesson-progress ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lesson-progress li {
  position: relative;
  padding: 7px 8px 7px 26px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
}

.lesson-progress li::before {
  position: absolute;
  top: 11px;
  left: 8px;
  width: 9px;
  height: 9px;
  border: 2px solid #aeb6b7;
  border-radius: 50%;
  content: "";
}

.lesson-progress li.is-complete {
  background: var(--mint);
  color: var(--green);
}

.lesson-progress li.is-complete::before {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 2px var(--mint);
}

.experiment-stack {
  display: grid;
  gap: 28px;
}

.experiment-card {
  scroll-margin-top: 155px;
  padding: 28px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-small);
}

.experiment-header {
  display: grid;
  grid-template-columns: 55px 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.experiment-header > div {
  display: grid;
  gap: 7px;
}

.experiment-header h2 {
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.12;
}

.experiment-header > div > p:last-child {
  color: var(--ink-soft);
  font-weight: 650;
}

.experiment-number {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  background: var(--ink);
  color: white;
  font-size: 15px;
  font-weight: 950;
}

.challenge-board {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(270px, 0.65fr);
  gap: 14px;
}

.question-panel,
.feedback-panel,
.number-line-workbench,
.sort-workbench,
.mirror-layout,
.quiz-board,
.mission-board {
  padding: 20px;
  border-radius: 16px;
  background: #f5f1e6;
}

.question-panel {
  display: grid;
  gap: 17px;
}

.question-panel h3 {
  min-height: 80px;
  font-size: 24px;
  line-height: 1.3;
}

.question-tag,
.feedback-label {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--yellow);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.05em;
}

.sign-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.sign-choice-grid button {
  display: grid;
  gap: 2px;
  min-height: 88px;
  place-items: center;
}

.sign-choice-grid strong {
  font-size: 30px;
}

.sign-choice-grid span {
  color: var(--ink-soft);
  font-size: 11px;
}

.feedback-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  background: var(--mint);
}

.feedback-label {
  background: white;
  color: var(--green);
}

.feedback-message {
  min-height: 130px;
  color: #284f3d;
  font-weight: 750;
}

.number-line-workbench,
.mirror-layout,
.sort-workbench {
  display: grid;
  gap: 19px;
}

.target-readout {
  font-size: 18px;
  font-weight: 750;
}

.target-readout strong {
  display: inline-block;
  margin-left: 5px;
  padding: 5px 12px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  font-size: 28px;
}

.interactive-axis {
  position: relative;
  height: 85px;
  margin: 0 10px;
  border-bottom: 5px solid var(--ink);
}

.interactive-axis span {
  position: absolute;
  bottom: -33px;
  left: var(--tick);
  font-size: 12px;
  font-weight: 850;
  transform: translateX(-50%);
}

.interactive-axis span::before {
  position: absolute;
  bottom: 25px;
  left: 50%;
  width: 2px;
  height: 15px;
  background: var(--ink);
  content: "";
}

.interactive-axis::after {
  position: absolute;
  right: 0;
  bottom: -9px;
  border: 7px solid transparent;
  border-left-color: var(--ink);
  content: "";
  transform: translateX(100%);
}

.interactive-axis i {
  position: absolute;
  bottom: 11px;
  left: 50%;
  width: 22px;
  height: 22px;
  border: 4px solid white;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 3px var(--ink);
  transform: translateX(-50%);
  transition: left 120ms ease;
}

.range-label {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 850;
}

.range-label output {
  color: var(--ink);
  font-size: 17px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
  cursor: grab;
}

input[type="number"] {
  min-height: 43px;
  padding: 7px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: white;
}

.mirror-layout {
  background: var(--blue-soft);
}

.mirror-axis {
  position: relative;
  height: 120px;
  margin: 0 18px;
  border-bottom: 5px solid var(--ink);
}

.mirror-axis::before {
  position: absolute;
  bottom: -17px;
  left: 50%;
  width: 4px;
  height: 28px;
  background: var(--ink);
  content: "";
}

.mirror-zero {
  position: absolute;
  bottom: -43px;
  left: 50%;
  font-size: 13px;
  transform: translateX(-50%);
}

.mirror-point {
  position: absolute;
  bottom: 12px;
  width: 25px;
  height: 25px;
  border: 4px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--ink);
  transform: translateX(-50%);
  transition: left 130ms ease;
}

.point-main {
  background: var(--coral);
}

.point-opposite {
  background: var(--blue);
}

.mirror-distance {
  position: absolute;
  bottom: 20px;
  height: 7px;
  background: repeating-linear-gradient(90deg, var(--violet), var(--violet) 6px, transparent 6px, transparent 10px);
  opacity: 0.55;
}

.result-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.result-trio div {
  padding: 13px;
  border-radius: 12px;
  background: white;
}

.result-trio dt {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

.result-trio dt small {
  display: block;
}

.result-trio dd {
  margin-top: 3px;
  font-size: 25px;
  font-weight: 950;
}

.sort-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  min-height: 65px;
  padding: 12px;
  border: 2px dashed #c6bfae;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.6);
}

.sort-bank button {
  min-width: 65px;
  font-size: 19px;
}

.sort-answer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.sort-answer > span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 850;
}

.sort-answer > div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 62px;
  border-bottom: 4px solid var(--ink);
}

.sort-answer > div span {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  font-size: 19px;
  font-weight: 900;
}

.sort-hint {
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--violet-soft);
  color: #4e3b86;
  font-size: 13px;
  font-weight: 750;
}

.motion-grid,
.equation-layout,
.percentage-layout,
.speed-layout,
.data-layout,
.rule-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.motion-question,
.motion-stage,
.rule-challenge,
.control-panel,
.receipt-card,
.balance-stage,
.equation-steps,
.route-stage,
.speed-controls,
.speed-result,
.chart-card,
.detective-note {
  display: grid;
  gap: 15px;
  padding: 20px;
  align-content: center;
  border-radius: 16px;
  background: #f5f1e6;
}

.motion-question > span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.motion-question > strong {
  font-size: 48px;
  line-height: 1;
}

.motion-question label {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
}

.motion-question input {
  width: 90px;
}

.motion-stage {
  background: var(--coral-soft);
}

.motion-axis {
  position: relative;
  height: 65px;
  border-bottom: 5px solid var(--ink);
}

.motion-axis::before {
  position: absolute;
  right: 50%;
  bottom: -15px;
  width: 3px;
  height: 24px;
  background: var(--ink);
  content: "";
}

.motion-axis i {
  position: absolute;
  bottom: 10px;
  left: 40%;
  width: 24px;
  height: 24px;
  border: 4px solid white;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 3px var(--ink);
  transform: translateX(-50%);
  transition: left 700ms cubic-bezier(0.2, 0.7, 0.25, 1);
}

.motion-stage p {
  color: var(--ink-soft);
  font-weight: 750;
}

.pattern-table {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding: 13px;
  border-radius: 16px;
  background: var(--ink);
}

.pattern-table div {
  display: grid;
  gap: 3px;
  min-height: 72px;
  padding: 10px;
  place-items: center;
  border-radius: 10px;
  background: white;
}

.pattern-table span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.pattern-table strong {
  font-size: 24px;
}

.pattern-table div:nth-last-child(-n+2) {
  background: var(--yellow);
}

.rule-challenge h3 {
  min-height: 70px;
  font-size: 23px;
}

.quiz-board {
  display: grid;
  gap: 16px;
}

.quiz-prompt {
  display: grid;
  gap: 5px;
  padding: 18px;
  place-items: center;
  border-radius: 13px;
  background: var(--ink);
  color: white;
}

.quiz-prompt span {
  color: #bfc9cf;
  font-size: 11px;
  font-weight: 800;
}

.quiz-prompt strong {
  font-size: 36px;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.quiz-options button {
  font-size: 19px;
}

.mission-board {
  position: relative;
  display: grid;
  gap: 17px;
  background: var(--violet-soft);
}

.mission-stamp {
  width: fit-content;
  padding: 6px 10px;
  border: 2px solid currentColor;
  border-radius: 9px;
  color: var(--violet);
  font-size: 11px;
  font-weight: 950;
  transform: rotate(-2deg);
}

.mission-board h3 {
  max-width: 700px;
  font-size: 25px;
  line-height: 1.3;
}

.mission-answer {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 850;
}

.mission-answer input {
  width: 120px;
}

.completion-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 25px;
  align-items: center;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
}

.completion-card > div {
  display: grid;
  gap: 8px;
}

.completion-card h2 {
  font-size: 30px;
}

.completion-card p:not(.eyebrow) {
  color: #cad4da;
}

/* P6 */
.formula-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  align-content: center;
  justify-content: center;
  background: var(--mint);
}

.formula-cloud span {
  padding: 11px 14px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: white;
  font-weight: 900;
  box-shadow: 4px 4px 0 rgba(23, 38, 53, 0.12);
  transform: rotate(var(--r));
}

.control-panel {
  background: var(--mint);
}

.receipt-card {
  border: 1px dashed #a39b87;
  background: #fffdf7;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.receipt-card > div {
  display: flex;
  gap: 15px;
  justify-content: space-between;
}

.receipt-card span {
  color: var(--ink-soft);
}

.receipt-card hr {
  width: 100%;
  border: 0;
  border-top: 2px dashed var(--line);
}

.receipt-total strong {
  font-size: 26px;
}

.receipt-card p {
  padding: 9px;
  border-radius: 8px;
  background: var(--yellow);
  text-align: center;
  font-size: 13px;
  font-weight: 900;
}

.balance-stage {
  min-height: 280px;
  background: var(--blue-soft);
  transition: transform 240ms ease;
}

.balance-stage.is-unbalanced {
  transform: rotate(-2deg);
}

.balance-stage.is-balanced {
  box-shadow: inset 0 0 0 4px rgba(40, 124, 86, 0.45);
}

.balance-beam {
  display: grid;
  grid-template-columns: 1fr 4px 1fr;
  gap: 10px;
  align-items: end;
}

.balance-beam > i {
  width: 4px;
  height: 115px;
  background: var(--ink);
  clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%);
}

.balance-pan {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 90px;
  padding: 10px;
  align-items: end;
  justify-content: center;
  border-bottom: 5px solid var(--ink);
}

.x-block,
.unit-block,
.weight-block {
  display: grid;
  min-width: 36px;
  height: 42px;
  padding: 5px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--coral);
  color: white;
  font-weight: 900;
}

.unit-block {
  background: var(--yellow);
  color: var(--ink);
}

.weight-block {
  min-width: 70px;
  background: var(--violet);
}

.balance-stage > strong {
  text-align: center;
  font-size: 26px;
}

.equation-steps label {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 850;
}

.equation-steps input {
  width: 90px;
}

.equation-proof {
  padding: 13px;
  border-radius: 11px;
  background: white;
  color: var(--ink-soft);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 13px;
  font-weight: 800;
}

.speed-layout {
  grid-template-columns: 1.25fr 0.9fr 0.6fr;
}

.route-stage {
  min-height: 210px;
  background: var(--mint);
}

.route-track {
  position: relative;
  height: 55px;
  border-bottom: 6px solid var(--ink);
}

.route-track::before,
.route-track::after {
  position: absolute;
  bottom: -8px;
  width: 15px;
  height: 15px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: white;
  content: "";
}

.route-track::before {
  left: 0;
}

.route-track::after {
  right: 0;
}

.route-track i {
  position: absolute;
  bottom: 7px;
  left: 50%;
  color: var(--coral);
  font-size: 26px;
  font-style: normal;
  transition: left 300ms ease;
}

.route-labels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
}

.route-labels span:last-child {
  text-align: right;
}

.route-labels strong {
  padding: 6px 10px;
  border-radius: 8px;
  background: white;
  font-size: 15px;
}

.speed-controls {
  background: #f5f1e6;
}

.speed-result {
  place-items: center;
  background: var(--coral-soft);
  text-align: center;
}

.speed-result > span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 850;
}

.speed-result strong {
  font-size: 26px;
}

.speed-result p {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  font-weight: 800;
}

.chart-card {
  min-height: 330px;
  background: white;
}

.chart-toggle {
  justify-self: end;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  min-height: 250px;
  padding: 15px 20px 0;
  align-items: end;
  border-bottom: 4px solid var(--ink);
  background:
    repeating-linear-gradient(to top, transparent 0, transparent 48px, rgba(23, 38, 53, 0.08) 49px, transparent 50px);
}

.bar-chart div {
  position: relative;
  display: grid;
  height: calc(var(--value) * 2px);
  max-height: 220px;
  align-items: end;
  text-align: center;
  transition: height 300ms ease;
}

.bar-chart.is-cropped div {
  height: calc((var(--value) - 88) * 13px);
}

.bar-chart i {
  position: absolute;
  inset: 0 8px 0;
  border-radius: 8px 8px 0 0;
  background: var(--blue);
}

.bar-chart div:nth-child(2) i {
  background: var(--teal);
}

.bar-chart div:nth-child(3) i {
  background: var(--coral);
}

.bar-chart strong {
  position: absolute;
  top: -23px;
  right: 0;
  left: 0;
  font-size: 13px;
}

.bar-chart span {
  position: relative;
  bottom: -23px;
  z-index: 1;
  font-size: 12px;
  font-weight: 900;
}

.detective-note {
  align-content: start;
  background: var(--yellow);
}

.detective-note h3 {
  font-size: 27px;
}

.detective-note p {
  color: #4d4532;
  font-weight: 700;
}

/* AMC 8 */
.amc-format-card {
  display: grid;
  gap: 14px;
  align-content: center;
  background: var(--violet-soft);
}

.amc-badge {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 50%;
  background: var(--violet);
  color: white;
  font-size: 18px;
  font-weight: 950;
  box-shadow: 5px 5px 0 var(--yellow);
}

.amc-format-card h2 {
  font-size: 36px;
}

.amc-format-card > p {
  color: var(--ink-soft);
  font-weight: 700;
}

.amc-format-card > div {
  display: grid;
  padding: 12px;
  border-radius: 12px;
  background: white;
}

.amc-format-card > div strong {
  font-size: 20px;
}

.amc-format-card > div span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.skill-grid article {
  position: relative;
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
}

.skill-grid article > span {
  position: absolute;
  top: 16px;
  right: 16px;
  color: #c8c1b1;
  font-size: 25px;
  font-weight: 950;
}

.skill-grid h3 {
  margin-top: 55px;
  font-size: 22px;
}

.skill-grid .term-en {
  color: var(--violet);
  font-size: 11px;
  font-weight: 850;
}

.skill-grid article > p:last-child {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.strategy-band {
  padding: 65px 0;
  background: var(--ink);
  color: white;
}

.strategy-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.strategy-steps li {
  min-height: 190px;
  padding: 19px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.07);
}

.strategy-steps span {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 40px;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 950;
}

.strategy-steps strong {
  display: block;
  font-size: 17px;
}

.strategy-steps p {
  margin-top: 7px;
  color: #cbd5dc;
  font-size: 13px;
  font-weight: 650;
}

.sprint-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-self: end;
}

.sprint-controls > strong {
  min-width: 70px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 20px;
}

.sprint-shell {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
}

.sprint-rail {
  display: grid;
  gap: 14px;
  padding: 18px;
  align-content: start;
  border-radius: 17px;
  background: var(--ink);
  color: white;
}

.sprint-rail > span {
  color: #bfc9cf;
  font-size: 11px;
  font-weight: 850;
}

.sprint-rail ol {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sprint-rail li {
  display: grid;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  color: #bac4ca;
  font-size: 12px;
  font-weight: 900;
}

.sprint-rail li.is-current {
  border-color: var(--yellow);
  color: var(--yellow);
}

.sprint-rail li.is-answered {
  background: rgba(20, 127, 120, 0.45);
  color: white;
}

.sprint-score {
  display: flex;
  gap: 4px;
  align-items: baseline;
  margin-top: 15px;
}

.sprint-score strong {
  color: var(--yellow);
  font-size: 38px;
}

.sprint-score span {
  color: #bac4ca;
  font-size: 13px;
}

.sprint-card {
  display: grid;
  gap: 20px;
  min-height: 490px;
  padding: 28px;
  align-content: start;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: white;
}

.sprint-card h3 {
  max-width: 850px;
  font-size: 28px;
  line-height: 1.4;
}

.amc-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.amc-options button {
  display: grid;
  gap: 5px;
  min-height: 80px;
  place-items: center;
}

.amc-options button span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--paper-deep);
  font-size: 10px;
}

.amc-options button strong {
  font-size: 18px;
}

.amc-feedback {
  min-height: 85px;
  padding: 15px;
  border-left: 5px solid var(--violet);
  border-radius: 0 12px 12px 0;
  background: var(--violet-soft);
  color: #43366f;
  font-weight: 750;
}

.sprint-actions {
  margin-top: auto;
  justify-content: space-between;
}

.sprint-summary {
  display: grid;
  gap: 18px;
  padding: 35px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--violet-soft);
  text-align: center;
}

.sprint-summary h3 {
  max-width: 760px;
  font-size: 29px;
}

.sprint-summary p {
  color: var(--ink-soft);
  font-weight: 700;
}

.source-note {
  display: grid;
  grid-template-columns: 0.65fr 1.35fr;
  gap: 45px;
  align-items: start;
  border-top: 1px solid var(--line);
}

.source-note > div {
  display: grid;
  gap: 8px;
}

.source-note h2 {
  font-size: 30px;
}

.source-note > p {
  color: var(--ink-soft);
  font-weight: 650;
}

.source-note a {
  color: var(--teal-dark);
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Rational and irrational */
.set-visual {
  display: grid;
  place-items: center;
  background: var(--blue-soft);
}

.real-set {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  width: 100%;
  padding: 17px;
  border: 3px solid var(--ink);
  border-radius: 50px;
  text-align: center;
}

.real-set > strong {
  grid-column: 1 / -1;
  font-size: 20px;
}

.rational-set,
.irrational-set {
  display: grid;
  min-height: 100px;
  padding: 10px;
  place-items: center;
  border-radius: 40px;
  font-size: 18px;
  font-weight: 900;
}

.rational-set {
  background: var(--mint);
}

.irrational-set {
  background: var(--violet-soft);
}

.real-set small {
  color: var(--ink-soft);
  font-size: 11px;
}

.rational-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.compact-card {
  min-height: 520px;
}

.wide-card {
  grid-column: 1 / -1;
  min-height: auto;
}

.classify-stage {
  display: grid;
  gap: 18px;
  place-items: center;
  padding: 26px;
  border-radius: 17px;
  background: var(--mint);
}

.classify-stage > strong {
  display: grid;
  min-width: 180px;
  min-height: 110px;
  padding: 15px;
  place-items: center;
  border-radius: 18px;
  background: var(--ink);
  color: white;
  font-size: 44px;
}

.sqrt-experiment {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border-radius: 17px;
  background: var(--blue-soft);
}

.unit-square {
  position: relative;
  aspect-ratio: 1;
  max-width: 220px;
  margin: 18px;
  border: 5px solid var(--teal);
  background: rgba(255, 255, 255, 0.6);
}

.unit-square i {
  position: absolute;
  top: 50%;
  left: -11%;
  width: 122%;
  height: 6px;
  border-radius: 99px;
  background: var(--coral);
  transform: rotate(-45deg);
}

.unit-square > strong {
  position: absolute;
  top: 20%;
  right: -7%;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--coral);
  color: white;
}

.square-side {
  position: absolute;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 900;
}

.side-bottom {
  bottom: -25px;
  left: 50%;
}

.side-left {
  top: 50%;
  left: -20px;
}

.sqrt-readout {
  display: grid;
  gap: 8px;
  padding: 17px;
  border-radius: 13px;
  background: white;
}

.sqrt-readout strong {
  font-size: clamp(34px, 5vw, 60px);
}

.sqrt-readout span {
  color: var(--ink-soft);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  font-weight: 800;
}

.sqrt-experiment .range-label {
  grid-column: 1 / -1;
}

.repeat-layout {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1.2fr;
  gap: 16px;
  align-items: stretch;
}

.repeat-tabs {
  display: grid;
  gap: 8px;
}

.repeat-tabs button[aria-pressed="true"] {
  border-color: var(--teal);
  background: var(--mint);
  color: var(--teal-dark);
}

.repeat-equation {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: 16px;
  background: var(--ink);
  color: white;
}

.repeat-equation strong {
  font-size: clamp(25px, 4vw, 40px);
}

.repeat-equation span {
  color: var(--yellow);
  font-size: 27px;
}

.repeat-layout ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 18px 18px 18px 38px;
  border-radius: 16px;
  background: var(--violet-soft);
  color: #463b6c;
  font-weight: 750;
}

.error-page {
  display: grid;
  min-height: calc(100vh - 180px);
  padding: 40px 20px;
  place-items: center;
  text-align: center;
}

.error-page > div {
  width: min(620px, 100%);
  padding: clamp(34px, 7vw, 72px);
  border: 2px solid var(--ink);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-offset);
}

.error-page h1 {
  margin: 10px 0 14px;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1;
}

.error-page p:not(.eyebrow) {
  margin: 0 auto 24px;
  color: var(--ink-soft);
}

@media (max-width: 1040px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 8px 16px;
  }

  .nav-links {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    width: 100%;
    border-top: 1px solid rgba(23, 38, 53, 0.1);
  }

  .nav-links a {
    padding: 10px 6px;
    border-radius: 0;
    text-align: center;
    white-space: nowrap;
  }

  .nav-links a + a {
    border-left: 1px solid rgba(23, 38, 53, 0.1);
  }

  .site-header > .term-toggle {
    grid-row: 1;
    grid-column: 2;
  }

  .experiment-nav {
    top: 114px;
  }

  .experiment-card {
    scroll-margin-top: 190px;
  }

  .hero-layout,
  .topic-hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-lab-card {
    transform: none;
  }

  .track-grid,
  .roadmap-columns {
    grid-template-columns: 1fr;
  }

  .roadmap-panel {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 20px;
  }

  .roadmap-title {
    align-self: start;
  }

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

  .lesson-progress {
    position: static;
  }

  .lesson-progress ol {
    grid-template-columns: repeat(4, 1fr);
  }

  .speed-layout {
    grid-template-columns: 1fr 1fr;
  }

  .speed-result {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 26px, var(--content));
  }

  .site-header {
    min-height: 66px;
    padding: 8px 14px;
  }

  .brand-copy small,
  .term-toggle > span:first-child {
    display: none;
  }

  .term-toggle {
    padding: 7px;
  }

  .home-hero {
    padding: 46px 0 40px;
  }

  .hero-copy h1,
  .topic-hero h1 {
    font-size: 46px;
  }

  .hero-lead,
  .topic-lead {
    font-size: 17px;
  }

  .hero-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-facts div {
    min-width: 0;
    padding: 10px;
  }

  .hero-facts dt {
    font-size: 17px;
  }

  .hero-facts dd {
    font-size: 10px;
  }

  .hero-lab-card,
  .experiment-card {
    padding: 20px;
  }

  .section {
    padding: 52px 0;
  }

  .section-heading h2 {
    font-size: 34px;
  }

  .split-heading,
  .progress-layout,
  .philosophy-section,
  .source-note,
  .rational-grid {
    grid-template-columns: 1fr;
  }

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

  .track-card {
    min-height: 250px;
  }

  .roadmap-panel {
    display: block;
  }

  .method-steps {
    grid-template-columns: 1fr;
  }

  .method-steps li {
    grid-template-columns: 45px 1fr;
    gap: 3px 10px;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .method-steps li:last-child {
    border-bottom: 0;
  }

  .method-steps span {
    grid-row: 1 / 3;
    margin: 0;
  }

  .topic-hero {
    padding-top: 24px;
  }

  .breadcrumb {
    margin-bottom: 24px;
  }

  .topic-hero-visual,
  .amc-format-card,
  .formula-cloud,
  .set-visual {
    min-height: 220px;
  }

  .experiment-nav {
    top: 110px;
  }

  .experiment-nav .container,
  .experiment-nav .four-items {
    width: 100%;
    grid-template-columns: repeat(8, 125px);
  }

  .experiment-nav .four-items {
    grid-template-columns: repeat(4, 135px);
  }

  .lesson-shell {
    padding-top: 28px;
  }

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

  .experiment-card {
    scroll-margin-top: 180px;
  }

  .experiment-header {
    grid-template-columns: 43px 1fr;
  }

  .experiment-number {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 12px;
  }

  .experiment-header h2 {
    font-size: 28px;
  }

  .challenge-board,
  .motion-grid,
  .equation-layout,
  .percentage-layout,
  .data-layout,
  .rule-layout,
  .speed-layout,
  .sqrt-experiment,
  .repeat-layout {
    grid-template-columns: 1fr;
  }

  .sign-choice-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .result-trio {
    grid-template-columns: 1fr;
  }

  .sort-answer {
    grid-template-columns: 1fr;
  }

  .sort-answer > span:last-child {
    text-align: right;
  }

  .quiz-options,
  .pattern-table {
    grid-template-columns: repeat(2, 1fr);
  }

  .completion-card {
    grid-template-columns: 1fr;
  }

  .speed-result {
    grid-column: auto;
  }

  .skill-grid,
  .strategy-steps {
    grid-template-columns: 1fr 1fr;
  }

  .sprint-shell {
    grid-template-columns: 1fr;
  }

  .sprint-rail {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }

  .sprint-rail ol {
    grid-template-columns: repeat(6, 1fr);
  }

  .sprint-score {
    margin: 0;
  }

  .amc-options {
    grid-template-columns: 1fr 1fr;
  }

  .wide-card {
    grid-column: auto;
  }

  .sqrt-experiment .range-label {
    grid-column: auto;
  }

  .site-footer {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .hero-copy h1,
  .topic-hero h1 {
    font-size: 39px;
  }

  .hero-actions .button {
    width: 100%;
  }

  .hero-facts {
    grid-template-columns: 1fr;
  }

  .hero-facts div {
    grid-template-columns: 55px 1fr;
    align-items: center;
  }

  .choice-row,
  .sign-choice-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .lesson-progress ol,
  .skill-grid,
  .strategy-steps,
  .amc-options {
    grid-template-columns: 1fr;
  }

  .quiz-options {
    grid-template-columns: 1fr 1fr;
  }

  .sprint-rail {
    grid-template-columns: 1fr;
  }

  .sprint-rail ol {
    grid-template-columns: repeat(6, 1fr);
  }

  .sprint-card {
    padding: 20px;
  }

  .sprint-card h3 {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
