:root {
  --ink: #16233f;
  --muted: #62708a;
  --line: #dce6f2;
  --paper: #ffffff;
  --canvas: #f4f8fc;
  --navy: #173d75;
  --teal: #17b8a6;
  --teal-dark: #087f75;
  --teal-soft: #ddf8f4;
  --yellow: #f8c84b;
  --yellow-soft: #fff5d6;
  --coral: #ff786b;
  --coral-soft: #ffe9e6;
  --purple: #7457d5;
  --purple-soft: #eee9ff;
  --success: #148466;
  --success-soft: #e2f7ef;
  --danger: #c84444;
  --danger-soft: #ffebeb;
  --shadow-sm: 0 8px 24px rgba(32, 59, 99, 0.08);
  --shadow-lg: 0 26px 70px rgba(25, 55, 93, 0.13);
  --radius: 24px;
  --radius-sm: 15px;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: clip;
  background:
    radial-gradient(circle at 8% 18%, rgba(23, 184, 166, 0.09) 0 7%, transparent 7.2%),
    radial-gradient(circle at 94% 8%, rgba(248, 200, 75, 0.14) 0 8%, transparent 8.2%),
    linear-gradient(180deg, #fbfdff 0%, #f3f8fc 48%, #edf4f9 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image: radial-gradient(#9bb4cb 0.7px, transparent 0.7px);
  background-size: 20px 20px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(116, 87, 213, 0.34);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
main,
footer {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 40px));
  margin-inline: auto;
}

main {
  overflow-x: clip;
}

.site-header {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--ink);
  color: white;
  font: 700 25px/1 Georgia, serif;
  transform: rotate(-4deg);
  box-shadow: 5px 5px 0 var(--yellow);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
  letter-spacing: 0.01em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  padding: 10px 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.text-button:hover {
  color: var(--purple);
}

.hero {
  position: relative;
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: center;
  gap: 80px;
  padding: 54px 68px;
  overflow: hidden;
  border: 1px solid rgba(213, 226, 240, 0.85);
  border-radius: 32px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.98), rgba(249, 253, 255, 0.87)),
    var(--paper);
  box-shadow: var(--shadow-lg);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero::before {
  width: 290px;
  height: 290px;
  right: -110px;
  top: -110px;
  border: 42px solid var(--teal-soft);
}

.hero::after {
  width: 120px;
  height: 120px;
  left: 46%;
  bottom: -78px;
  border: 26px solid var(--yellow-soft);
}

.hero-copy,
.hero-meter {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.eyebrow > span {
  width: 25px;
  height: 2px;
  background: currentColor;
}

.hero h1 {
  margin: 0;
  max-width: 670px;
  font-size: clamp(42px, 5vw, 69px);
  line-height: 1.1;
  letter-spacing: -0.055em;
}

.hero h1 em {
  position: relative;
  color: var(--purple);
  font-style: normal;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 8px;
  border-radius: 99px;
  background: var(--yellow);
  z-index: -1;
  transform: rotate(-1deg);
}

.hero-intro {
  max-width: 580px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 26px;
}

.hero-tags span {
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #fff;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
}

.hero-meter {
  text-align: center;
}

.progress-ring {
  --progress: 0;
  position: relative;
  width: 198px;
  height: 198px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--teal) calc(var(--progress) * 1%), #e7eef5 0);
  transition: background 300ms ease;
}

.progress-ring::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: inherit;
  background: white;
  box-shadow: inset 0 0 0 1px var(--line);
}

.progress-ring > div {
  position: relative;
  display: grid;
  gap: 3px;
}

.progress-ring strong {
  font-size: 38px;
  line-height: 1;
}

.progress-ring span {
  color: var(--muted);
  font-size: 12px;
}

.hero-meter > p {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.hero-meter > p strong {
  color: var(--ink);
}

.station-section {
  padding-block: 90px 70px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(29px, 3vw, 40px);
  letter-spacing: -0.035em;
}

.section-heading > p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 14px;
}

.station-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.station-tab {
  position: relative;
  min-height: 176px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  gap: 10px 14px;
  padding: 22px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: white;
  text-align: left;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  overflow: hidden;
  min-width: 0;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.station-tab::before {
  content: "";
  position: absolute;
  width: 84px;
  height: 84px;
  top: -34px;
  right: -26px;
  border-radius: 50%;
  background: var(--station-soft);
}

.station-tab:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(32, 59, 99, 0.13);
}

.station-tab.is-active {
  border-color: var(--station);
  box-shadow: 0 17px 38px color-mix(in srgb, var(--station) 18%, transparent);
}

.station-identify {
  --station: var(--teal);
  --station-soft: var(--teal-soft);
}

.station-round {
  --station: var(--purple);
  --station-soft: var(--purple-soft);
}

.station-estimate {
  --station: var(--coral);
  --station-soft: var(--coral-soft);
}

.station-number {
  align-self: start;
  color: var(--station);
  font: 800 12px/1.2 ui-monospace, monospace;
}

.station-icon {
  width: 53px;
  height: 53px;
  display: grid;
  place-items: center;
  align-self: end;
  border-radius: 16px;
  background: var(--station-soft);
  color: var(--station);
  font: 700 29px/1 Georgia, serif;
}

.station-name {
  align-self: end;
  min-width: 0;
}

.station-name small,
.station-name strong {
  display: block;
}

.station-name small {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.station-name strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.station-best {
  grid-column: 2;
  align-self: start;
  width: max-content;
  padding: 4px 8px;
  border-radius: 99px;
  background: var(--station-soft);
  color: color-mix(in srgb, var(--station) 68%, #223);
  font-size: 10px;
  font-weight: 800;
}

.station-best.is-complete::before {
  content: "✓ ";
}

.station-arrow {
  align-self: end;
  color: var(--station);
  font-size: 22px;
}

.activity-shell {
  --active: var(--teal);
  --active-soft: var(--teal-soft);
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 780px;
  margin-bottom: 84px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: white;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.activity-shell[data-station="round"] {
  --active: var(--purple);
  --active-soft: var(--purple-soft);
}

.activity-shell[data-station="estimate"] {
  --active: var(--coral);
  --active-soft: var(--coral-soft);
}

.activity-guide {
  position: relative;
  padding: 45px 34px;
  background:
    radial-gradient(circle at 105% 12%, var(--active-soft) 0 22%, transparent 22.5%),
    linear-gradient(180deg, #f8fbfe, #f1f6fb);
  border-right: 1px solid var(--line);
}

.activity-guide::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  background: var(--active);
}

.activity-kicker {
  margin: 0 0 18px;
  color: var(--active);
  font: 800 11px/1 ui-monospace, monospace;
  letter-spacing: 0.13em;
}

.activity-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin-bottom: 25px;
  border: 1px solid color-mix(in srgb, var(--active) 24%, white);
  border-radius: 23px;
  background: var(--active-soft);
  color: var(--active);
  font: 700 39px/1 Georgia, serif;
  transform: rotate(-2deg);
}

.activity-guide h2 {
  margin: 0;
  font-size: 29px;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.activity-guide > p:not(.activity-kicker) {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.rule-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  margin-top: 34px;
  padding: 17px;
  border: 1px solid color-mix(in srgb, var(--active) 17%, var(--line));
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
}

.rule-bulb {
  color: var(--active);
  font-size: 18px;
}

.rule-card strong {
  font-size: 13px;
}

.rule-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.session-score {
  margin-top: 36px;
}

.score-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.score-label strong {
  color: var(--ink);
}

.score-dots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.score-dot {
  height: 7px;
  border-radius: 99px;
  background: #dce6ee;
}

.score-dot.is-current {
  background: var(--yellow);
}

.score-dot.is-correct {
  background: var(--active);
}

.score-dot.is-practised {
  background: color-mix(in srgb, var(--active) 42%, white);
}

.lab-workspace {
  min-width: 0;
  padding: 38px 42px 46px;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.workspace-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 5px;
  color: var(--muted);
  font: 800 10px/1 ui-monospace, monospace;
  letter-spacing: 0.13em;
}

.live-dot {
  width: 8px;
  height: 8px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 2px var(--yellow);
}

.workspace-label.is-live .live-dot {
  background: var(--success);
  box-shadow: 0 0 0 2px var(--success);
}

.workspace-header h3 {
  margin: 0;
  font-size: 20px;
}

.status-badge {
  padding: 7px 11px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
}

.status-badge.is-loading {
  background: var(--yellow-soft);
  color: #886515;
}

.status-badge.is-ready {
  background: var(--success-soft);
  color: var(--success);
}

.status-badge.is-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.ggb-frame {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid #ccdceb;
  border-radius: 19px;
  background:
    linear-gradient(#edf3f8 1px, transparent 1px),
    linear-gradient(90deg, #edf3f8 1px, transparent 1px),
    white;
  background-size: 25px 25px;
  box-shadow: inset 0 0 0 6px #f8fbfd;
}

.ggb-element {
  width: 100%;
  min-height: 390px;
}

.ggb-element iframe {
  max-width: 100% !important;
}

/* GeoGebra may retain a scale transform from an earlier responsive size.
   Keep every applet wrapper aligned with the live card dimensions. */
.ggb-element > .applet_scaler.ggbTransform,
.ggb-element > .applet_scaler.ggbTransform > .appletParameters,
.ggb-element .GeoGebraFrame {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  transform: none !important;
  transform-origin: top left !important;
}

.ggb-loading,
.ggb-error {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 30px;
  background: rgba(251, 253, 255, 0.94);
  text-align: center;
}

.ggb-loading small,
.ggb-error p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.ggb-error > span {
  color: var(--danger);
  font-size: 38px;
}

.ggb-error[hidden],
.ggb-loading[hidden] {
  display: none;
}

.loading-orbit {
  width: 46px;
  height: 46px;
  margin-bottom: 7px;
  border: 4px solid var(--teal-soft);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.interaction-controls {
  min-height: 0;
  margin-top: 13px;
}

.mirror-panel {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px dashed color-mix(in srgb, var(--active) 35%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--active-soft) 42%, white);
}

.mirror-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.mirror-label strong {
  color: var(--ink);
}

.candidate-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.candidate-group {
  display: grid;
  gap: 7px;
}

.candidate-group > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.candidate-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.candidate-button {
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.candidate-button:hover,
.candidate-button.is-selected {
  border-color: var(--active);
  background: var(--active-soft);
  color: color-mix(in srgb, var(--active) 75%, #112);
}

.live-estimate {
  padding: 10px 13px;
  border-radius: 11px;
  background: white;
  color: var(--muted);
  font-size: 12px;
}

.live-estimate strong {
  color: var(--ink);
}

.question-card {
  margin-top: 22px;
  padding: 25px 26px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #fbfdff;
}

.question-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.question-number,
.question-type {
  font-size: 11px;
  font-weight: 800;
}

.question-number {
  color: var(--active);
}

.question-type {
  padding: 5px 9px;
  border-radius: 99px;
  background: var(--active-soft);
  color: color-mix(in srgb, var(--active) 74%, #223);
}

.question-card h3 {
  margin: 15px 0 0;
  font-size: clamp(19px, 2.2vw, 25px);
  line-height: 1.5;
}

.question-support {
  min-height: 0;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.answer-area {
  margin-top: 20px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.choice-option {
  position: relative;
}

.choice-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-option label {
  display: grid;
  min-height: 52px;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: white;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.choice-option label:hover {
  transform: translateY(-2px);
  border-color: var(--active);
}

.choice-option input:checked + label {
  border-color: var(--active);
  background: var(--active-soft);
  color: color-mix(in srgb, var(--active) 75%, #112);
  box-shadow: inset 0 0 0 1px var(--active);
}

.choice-option input:focus-visible + label {
  outline: 3px solid rgba(116, 87, 213, 0.3);
  outline-offset: 2px;
}

.numeric-answer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.numeric-answer label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.numeric-answer input {
  width: 100%;
  min-height: 55px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
}

.numeric-answer input::placeholder {
  color: #a6b2c1;
  font-weight: 500;
}

.input-note {
  color: var(--muted);
  font-size: 11px;
}

.answer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 19px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 17px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.primary-button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  box-shadow: 4px 4px 0 var(--active);
}

.primary-button:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--active);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.secondary-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--navy);
}

.secondary-button:hover {
  border-color: var(--active);
  color: var(--active);
}

.danger-button {
  border: 1px solid var(--danger);
  background: var(--danger);
  color: white;
}

.feedback {
  margin-top: 17px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.65;
}

.feedback[hidden] {
  display: none;
}

.feedback.is-correct {
  border: 1px solid #bfe8d8;
  background: var(--success-soft);
  color: #116a53;
}

.feedback.is-error {
  border: 1px solid #f2c8c8;
  background: var(--danger-soft);
  color: #9e3535;
}

.feedback.is-hint {
  border: 1px solid #f2db9f;
  background: var(--yellow-soft);
  color: #785c15;
}

.feedback strong {
  display: block;
  margin-bottom: 2px;
}

.station-complete {
  margin-top: 24px;
  padding: 34px;
  border: 1px solid color-mix(in srgb, var(--active) 25%, var(--line));
  border-radius: 19px;
  background:
    radial-gradient(circle at 88% 20%, var(--active-soft) 0 18%, transparent 18.5%),
    white;
}

.station-complete[hidden] {
  display: none;
}

.complete-spark {
  float: right;
  color: var(--active);
  font-size: 40px;
}

.station-complete h3 {
  margin: 5px 0 8px;
  font-size: 29px;
}

.station-complete > p:not(.eyebrow) {
  margin: 0 0 20px;
  color: var(--muted);
}

.reset-dialog {
  width: min(430px, calc(100% - 30px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(14, 29, 55, 0.3);
}

.reset-dialog::backdrop {
  background: rgba(17, 31, 53, 0.55);
  backdrop-filter: blur(4px);
}

.reset-dialog form {
  padding: 32px;
  text-align: center;
}

.dialog-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: var(--coral-soft);
  color: var(--danger);
  font-size: 27px;
}

.reset-dialog h2 {
  margin: 0;
  font-size: 24px;
}

.reset-dialog p {
  margin: 10px 0 22px;
  color: var(--muted);
  line-height: 1.6;
}

.reset-dialog form > div {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.home-link:hover {
  border-color: rgba(23, 61, 117, 0.25);
  background: white;
  transform: translateY(-1px);
}

.site-pill {
  padding: 9px 14px;
  border: 1px solid rgba(23, 184, 166, 0.25);
  border-radius: 999px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.home-hero {
  position: relative;
  min-height: 540px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: center;
  gap: 70px;
  overflow: hidden;
  padding: 72px 78px;
  border: 1px solid rgba(205, 220, 236, 0.9);
  border-radius: 36px;
  background:
    radial-gradient(circle at 86% 20%, rgba(248, 200, 75, 0.23), transparent 25%),
    radial-gradient(circle at 72% 86%, rgba(116, 87, 213, 0.14), transparent 27%),
    linear-gradient(130deg, #ffffff 0%, #f7fcff 58%, #edf8fa 100%);
  box-shadow: var(--shadow-lg);
}

.home-hero::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  left: -155px;
  bottom: -160px;
  border: 34px solid rgba(23, 184, 166, 0.09);
  border-radius: 50%;
}

.home-hero-copy {
  position: relative;
  z-index: 1;
}

.home-hero h1 {
  margin: 18px 0 22px;
  max-width: 780px;
  font-size: clamp(46px, 6vw, 76px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.home-hero h1 em {
  position: relative;
  color: var(--teal-dark);
  font-style: normal;
}

.home-hero h1 em::after {
  content: "";
  position: absolute;
  left: 2%;
  right: -1%;
  bottom: -8px;
  height: 10px;
  border-radius: 50%;
  background: var(--yellow);
  opacity: 0.72;
  transform: rotate(-1deg) scaleY(0.45);
}

.home-hero-copy > p:not(.eyebrow) {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
}

.home-cta {
  width: max-content;
  margin-top: 30px;
  text-decoration: none;
}

.home-orbit {
  position: relative;
  width: 340px;
  height: 340px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(23, 61, 117, 0.24);
  border-radius: 50%;
}

.home-orbit::before,
.home-orbit::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(23, 184, 166, 0.2);
  border-radius: 50%;
}

.home-orbit::before { inset: 44px; }
.home-orbit::after { inset: 88px; }

.home-orbit > div {
  position: relative;
  z-index: 2;
  width: 142px;
  height: 142px;
  display: grid;
  place-content: center;
  text-align: center;
  border: 10px solid white;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  box-shadow: 0 20px 44px rgba(23, 61, 117, 0.25);
}

.home-orbit strong {
  font-size: 50px;
  line-height: 1;
}

.home-orbit small {
  margin-top: 8px;
  color: #dfeaf7;
  font-size: 11px;
}

.orbit-symbol {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  min-width: 62px;
  height: 62px;
  padding: 0 12px;
  border: 7px solid white;
  border-radius: 999px;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
}

.orbit-symbol-a { top: 8px; left: 48px; background: var(--yellow-soft); color: #9b6810; }
.orbit-symbol-b { right: -6px; bottom: 62px; background: var(--purple-soft); color: var(--purple); }
.orbit-symbol-c { left: -2px; bottom: 48px; background: var(--coral-soft); color: var(--coral); font-size: 25px; }

.catalogue-section {
  padding-block: 88px 76px;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 30px;
}

.course-card {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border: 1px solid var(--line);
  border-top: 8px solid var(--course-accent);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.course-card::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  right: -60px;
  top: 76px;
  border: 22px solid var(--course-soft);
  border-radius: 50%;
}

.course-card-s2 { --course-accent: var(--teal); --course-soft: var(--teal-soft); }
.course-card-s4 { --course-accent: var(--purple); --course-soft: var(--purple-soft); }

.course-card-topline {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.course-level,
.course-status {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.course-level {
  padding: 8px 12px;
  color: var(--navy);
  background: #edf4fb;
}

.course-status {
  padding: 7px 10px;
  color: var(--success);
  background: var(--success-soft);
}

.course-status.is-new {
  color: var(--purple);
  background: var(--purple-soft);
  letter-spacing: 0.08em;
}

.course-icon {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  border-radius: 22px;
  color: var(--course-accent);
  background: var(--course-soft);
  font-family: Georgia, serif;
  font-size: 36px;
  font-weight: 800;
}

.course-card h3 {
  position: relative;
  z-index: 1;
  margin: 10px 0 12px;
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -0.04em;
}

.course-card > p:not(.eyebrow) {
  position: relative;
  z-index: 1;
  min-height: 58px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.topic-links {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  margin: 26px 0;
  padding: 0;
  list-style: none;
}

.topic-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fbfdff;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.topic-links a:hover {
  border-color: var(--course-accent);
  background: var(--course-soft);
  transform: translateX(3px);
}

.topic-links a span { color: var(--course-accent); }

.course-enter {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 13px 18px;
  border-radius: 14px;
  color: white;
  background: var(--course-accent);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.learning-route {
  display: grid;
  grid-template-columns: 0.8fr 1.7fr;
  align-items: center;
  gap: 50px;
  margin-bottom: 86px;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--navy);
  color: white;
  box-shadow: var(--shadow-sm);
}

.learning-route .eyebrow { color: #9ce0d7; }
.learning-route h2 { margin: 12px 0 0; font-size: 30px; }

.learning-route ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.learning-route li {
  display: grid;
  gap: 7px;
  min-height: 138px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.learning-route li span { color: var(--yellow); font-size: 11px; font-weight: 900; letter-spacing: 0.1em; }
.learning-route li strong { font-size: 18px; }
.learning-route li small { color: #c9d8e9; line-height: 1.55; }

.s4-page .station-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.s4-page .station-icon {
  font-size: 20px;
  white-space: nowrap;
}

.station-systems { --station-accent: var(--teal); --station-soft: var(--teal-soft); }
.station-components { --station-accent: var(--purple); --station-soft: var(--purple-soft); }
.station-operations { --station-accent: var(--coral); --station-soft: var(--coral-soft); }
.station-rationalize { --station-accent: var(--yellow); --station-soft: var(--yellow-soft); }

.activity-shell[data-station="components"] { --active-accent: var(--purple); --active-soft: var(--purple-soft); }
.activity-shell[data-station="operations"] { --active-accent: var(--coral); --active-soft: var(--coral-soft); }
.activity-shell[data-station="rationalize"] { --active-accent: var(--yellow); --active-soft: var(--yellow-soft); }

.s4-hero {
  background:
    radial-gradient(circle at 88% 14%, rgba(116, 87, 213, 0.16), transparent 24%),
    radial-gradient(circle at 13% 92%, rgba(23, 184, 166, 0.13), transparent 22%),
    linear-gradient(120deg, #ffffff 0%, #f8fbff 60%, #f5f1ff 100%);
}

.s4-hero h1 em { color: var(--purple); }
.s4-hero h1 em::after { background: var(--teal); }

.coordinate-panel {
  display: grid;
  gap: 14px;
}

.range-row {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.range-row input {
  width: 100%;
  accent-color: var(--purple);
}

.coordinate-answer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.coordinate-answer label {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.coordinate-answer label span {
  color: var(--purple);
  font-size: 10px;
}

.coordinate-answer input {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: white;
  font-size: 18px;
  font-weight: 800;
}

.coordinate-plus,
.coordinate-answer > strong {
  padding-bottom: 14px;
  color: var(--navy);
  font-size: 20px;
}

.real-choice-grid {
  grid-template-columns: repeat(3, 1fr);
}

.system-choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.system-range-buttons {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.system-range-button {
  min-height: 42px;
  padding: 8px 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--navy);
  background: white;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.system-range-button:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
}

.system-range-button.is-selected {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: var(--teal-soft);
  box-shadow: 0 5px 14px rgba(23, 184, 166, 0.12);
}

.system-range-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--teal) 30%, transparent);
  outline-offset: 2px;
}

.system-range-detail {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--teal) 22%, var(--line));
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.system-range-detail span {
  grid-row: 1 / span 2;
  align-self: stretch;
  display: grid;
  place-items: center;
  min-width: 88px;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.system-range-detail strong {
  color: var(--navy);
  font-size: 14px;
}

.system-range-detail p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.control-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.conjugate-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.conjugate-choices legend {
  grid-column: 1 / -1;
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.conjugate-choices .choice-option label {
  min-height: 54px;
  padding: 12px;
  font-size: 14px;
}

.rationalize-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--navy);
}

.rationalize-rule strong {
  color: var(--coral);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.rationalize-rule span {
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 800;
}

.operation-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.operation-legend span { display: inline-flex; align-items: center; gap: 7px; }
.operation-legend i { width: 10px; height: 10px; border-radius: 50%; }
.legend-teal { background: var(--teal); }
.legend-purple { background: var(--purple); }

footer a {
  color: inherit;
  font-weight: 800;
  text-decoration: none;
}

footer {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 980px) {
  .s4-page .station-tabs {
    grid-template-columns: 1fr;
  }
  .home-hero {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 36px;
    padding: 54px 46px;
  }

  .home-orbit {
    width: 270px;
    height: 270px;
  }

  .home-orbit > div {
    width: 118px;
    height: 118px;
  }

  .home-orbit strong { font-size: 42px; }

  .orbit-symbol {
    height: 52px;
    min-width: 52px;
    border-width: 5px;
    font-size: 13px;
  }

  .learning-route {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 38px;
    padding: 45px;
  }

  .progress-ring {
    width: 165px;
    height: 165px;
  }

  .station-tabs {
    grid-template-columns: 1fr;
  }

  .station-tab {
    min-height: 116px;
    grid-template-columns: auto auto 1fr auto;
    grid-template-rows: 1fr auto;
  }

  .station-number {
    grid-row: 1;
  }

  .station-icon {
    grid-row: 1 / span 2;
  }

  .station-name {
    grid-row: 1;
  }

  .station-best {
    grid-column: 3;
    grid-row: 2;
  }

  .station-arrow {
    grid-column: 4;
    grid-row: 1 / span 2;
  }

  .activity-shell {
    grid-template-columns: 255px minmax(0, 1fr);
  }

  .activity-guide {
    padding: 35px 25px;
  }

  .lab-workspace {
    padding: 32px 28px 40px;
  }
}

@media (max-width: 760px) {
  .site-header,
  main,
  footer {
    width: min(100% - 24px, 1240px);
  }

  .hero {
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 38px 26px;
  }

  .home-hero {
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 44px 28px;
  }

  .home-orbit {
    width: min(280px, 88vw);
    height: min(280px, 88vw);
    margin: 10px auto 0;
  }

  .course-grid {
    grid-template-columns: 1fr;
  }

  .learning-route ol {
    grid-template-columns: 1fr;
  }

  .learning-route li {
    min-height: 0;
  }

  .hero-meter {
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
  }

  .progress-ring {
    width: 118px;
    height: 118px;
    margin: 0;
    flex: 0 0 auto;
  }

  .progress-ring::before {
    inset: 10px;
  }

  .progress-ring strong {
    font-size: 27px;
  }

  .hero-meter > p {
    margin: 0;
  }

  .station-section {
    padding-block: 65px 50px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .activity-shell {
    grid-template-columns: 1fr;
  }

  .activity-guide {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .activity-guide::after {
    width: 8px;
    height: auto;
    top: 0;
    left: auto;
  }

  .activity-icon {
    width: 58px;
    height: 58px;
    margin-bottom: 17px;
    font-size: 30px;
  }

  .rule-card,
  .session-score {
    margin-top: 20px;
  }

  .ggb-frame,
  .ggb-element {
    min-height: 330px;
  }

  .system-range-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .site-header {
    min-height: 76px;
  }

  .brand small {
    display: none;
  }

  .text-button {
    font-size: 12px;
  }

  .header-actions {
    gap: 6px;
  }

  .home-link {
    width: 40px;
    justify-content: center;
    overflow: hidden;
    padding: 8px;
    white-space: nowrap;
    text-indent: -999px;
  }

  .home-link span {
    text-indent: 0;
  }

  .site-pill {
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .home-hero h1 {
    font-size: 42px;
  }

  .home-hero-copy > p:not(.eyebrow) {
    font-size: 15px;
  }

  .catalogue-section {
    padding-block: 62px 54px;
  }

  .course-card,
  .learning-route {
    padding: 25px 20px;
    border-radius: 22px;
  }

  .coordinate-answer {
    grid-template-columns: 1fr auto 1fr auto;
    gap: 7px;
  }

  .coordinate-answer input {
    padding-inline: 10px;
  }

  .real-choice-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    border-radius: 22px;
  }

  .hero h1 {
    font-size: 39px;
  }

  .hero-intro {
    font-size: 15px;
  }

  .station-tab {
    padding: 17px;
  }

  .station-name strong {
    font-size: 15px;
  }

  .station-name small,
  .station-number {
    display: none;
  }

  .activity-shell {
    border-radius: 22px;
  }

  .activity-guide,
  .lab-workspace {
    padding: 27px 18px 32px;
  }

  .workspace-header {
    align-items: start;
  }

  .workspace-header h3 {
    font-size: 17px;
  }

  .ggb-frame,
  .ggb-element {
    min-height: 285px;
  }

  .system-range-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-range-detail {
    grid-template-columns: 1fr;
  }

  .system-range-detail span {
    grid-row: auto;
    justify-self: start;
    min-width: 0;
  }

  .question-card {
    padding: 21px 17px;
  }

  .choice-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .choice-grid.real-choice-grid {
    grid-template-columns: 1fr;
  }

  .choice-grid.system-choice-grid {
    grid-template-columns: 1fr;
  }

  .conjugate-choices {
    grid-template-columns: 1fr;
  }

  .candidate-groups {
    grid-template-columns: 1fr;
  }

  .numeric-answer {
    grid-template-columns: 1fr;
  }

  .answer-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .answer-actions button {
    width: 100%;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
