:root {
  --navy: #123056;
  --navy-deep: #0c2240;
  --ink: #14283f;
  --sky: #7ec8e8;
  --sky-deep: #3aa3cc;
  --ice: #e5f6fc;
  --cream: #fff6ea;
  --paper: #fffdf9;
  --orange: #f08a24;
  --orange-deep: #d86d0d;
  --gold: #ffc83d;
  --gold-deep: #f0b000;
  --red: #e23b2b;
  --red-deep: #c4231b;
  --display: "Titan One", "Arial Black", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Fredoka", "Trebuchet MS", Verdana, sans-serif;
  --shadow: 6px 6px 0 var(--navy);
  --shadow-sm: 4px 4px 0 var(--navy);
  --line: 3px solid var(--navy);
  --radius: 22px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.06rem;
  line-height: 1.5;
  background-color: var(--cream);
  background-image:
    radial-gradient(circle at 8% -8%, #c5ecf8 0, transparent 36%),
    radial-gradient(circle at 110% 0%, #ffe1a8 0, transparent 32%),
    radial-gradient(rgba(18, 48, 86, 0.045) 1.15px, transparent 1.2px);
  background-size: auto, auto, 18px 18px;
  overflow-x: clip;
}

img { max-width: 100%; height: auto; }

button, input { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: var(--navy-deep); }

h1, h2, h3, p { margin-top: 0; }

h1, h2, .display {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.95;
}

h1 { font-size: clamp(3.1rem, 8vw, 6.4rem); margin-bottom: 0.3em; }
h2 { font-size: clamp(2rem, 4vw, 3.3rem); margin-bottom: 0.25em; }
h3 { font-size: 1.35rem; margin-bottom: 0.3em; }

p { margin-bottom: 0.8em; }

::selection { background: var(--gold); color: var(--navy); }

:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 80;
  background: var(--gold);
  color: var(--navy);
  border: var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.stripe {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 8px;
  background: linear-gradient(
    90deg,
    var(--sky) 0 16%,
    var(--gold) 16% 38%,
    var(--orange) 38% 58%,
    var(--red) 58% 78%,
    var(--navy) 78%
  );
}

.site-header {
  position: sticky;
  top: 8px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 18px;
  background: rgba(255, 246, 234, 0.92);
  border-bottom: var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  margin-right: auto;
  text-decoration: none;
}
.brand img {
  width: 118px;
  height: auto;
  display: block;
  filter: drop-shadow(3px 4px 0 rgba(18, 48, 86, 0.18));
}

.nav-toggle {
  display: none;
  border: var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--navy);
  padding: 8px 12px;
  border-radius: 999px;
}
.nav a:hover { background: white; }
.nav a[aria-current="page"] {
  background: var(--navy);
  color: white;
}

.sound {
  border: var(--line);
  background: white;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.sound[aria-pressed="true"] {
  background: var(--gold);
}

.wrap { width: min(1120px, calc(100% - 36px)); margin-inline: auto; }
.wrap-l { width: min(860px, calc(100% - 36px)); margin-inline: auto; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 28px;
  align-items: center;
  padding: 28px 0 10px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 5px 10px;
  border: 2px solid var(--navy);
  border-radius: 999px;
  background: white;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}
.kicker span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(226, 59, 43, 0.2);
}

.hero h1 .hot { color: var(--red-deep); display: block; }

.lede {
  font-size: 1.18rem;
  max-width: 46ch;
  margin-bottom: 18px;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border: var(--line);
  border-radius: 999px;
  background: white;
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--navy); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--navy); }
.btn-gold { background: var(--gold); }
.btn-orange { background: var(--orange); color: var(--navy-deep); }
.btn-navy { background: var(--navy); color: white; }
.btn-red { background: var(--red); color: white; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.hero-art {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-logo {
  width: min(480px, 100%);
  animation: bob 3s ease-in-out infinite;
  filter: drop-shadow(10px 16px 0 rgba(18, 48, 86, 0.16));
}

.gauge-card {
  width: 210px;
  margin-top: 4px;
  padding: 6px 10px 10px;
  background: var(--paper);
  border: var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.gauge-card p { margin: 0; font-weight: 600; font-size: 0.92rem; }
.gauge-card svg { width: 100%; height: auto; display: block; }
.needle {
  transform-origin: 150px 150px;
  animation: wobble 1.4s ease-in-out infinite;
}

.marquee {
  margin: 18px 0 8px;
  border-block: var(--line);
  background: white;
  overflow: hidden;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: ticker 32s linear infinite;
}
.marquee-track p {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 10px 14px 10px 0;
  font-weight: 600;
  white-space: nowrap;
}
.marquee b { color: var(--red-deep); }

.section { padding: 42px 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}
.section-head p { max-width: 46ch; margin: 0; }

.bento {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
}
.card.wide { grid-row: span 2; display: flex; flex-direction: column; }

.card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: inherit;
  text-decoration: none;
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 100%;
}
a.card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--navy); }

.preview {
  background: linear-gradient(#b9e8f8, #fff6ea 70%);
  border-bottom: var(--line);
  min-height: 148px;
}
.preview { overflow: hidden; }
.preview svg { width: 100%; height: 168px; display: block; }
.card.wide .preview { flex: 0 0 auto; }
.card.wide .preview svg { height: 230px; }
.card.wide .card-body { flex: 1; }

.card-body { padding: 16px 16px 18px; }
.card-body h3 { font-family: var(--display); font-size: 1.8rem; line-height: 1; }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.pill, .record {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--navy);
  border-radius: 999px;
  padding: 3px 10px;
  background: var(--ice);
  font-size: 0.92rem;
  font-weight: 600;
}
.record { background: var(--gold); }

.cap-band {
  background: var(--navy);
  color: white;
  border-block: var(--line);
}
.cap-band .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: center;
  padding: 36px 0;
}
.cap-band h2 { color: var(--gold); }
.cap-band .lede { color: white; max-width: 40ch; }
.cap-control label { font-weight: 700; display: block; margin-bottom: 8px; }
.cap-control input[type="range"] {
  width: min(100%, 420px);
  accent-color: var(--gold);
  height: 32px;
}
.speed-readout {
  font-family: var(--display);
  font-size: 3rem;
  line-height: 1;
  margin: 8px 0;
  color: var(--gold);
}
.speed-readout em { font-style: normal; color: white; font-size: 1.4rem; }
#speed-note { min-height: 3em; color: #d7eef8; }

.lessons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.lesson-card .preview { background: linear-gradient(#fff1c9, #fffdf9 72%); }

.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}
.panel {
  background: var(--paper);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.panel h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.excuse-out {
  min-height: 4.6em;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--ice);
  border: 2px dashed var(--navy);
  font-size: 1.12rem;
  font-weight: 600;
}
.board-list { list-style: none; margin: 0; padding: 0; }
.board-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 2px solid rgba(18, 48, 86, 0.12);
  font-weight: 600;
}
.board-list li:last-child { border-bottom: 0; }
.board-list span:last-child { color: var(--red-deep); text-align: right; }

.egg {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
}
.egg-shape {
  width: 74px;
  height: 92px;
  border-radius: 50% 50% 48% 48%;
  background: radial-gradient(circle at 35% 30%, white, #ffe7a8 42%, var(--gold) 70%);
  border: var(--line);
  box-shadow: var(--shadow-sm);
}

.site-footer {
  background: var(--navy-deep);
  color: white;
  border-top: var(--line);
  margin-top: 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 18px;
  padding: 28px 0 18px;
}
.site-footer a { color: var(--gold); font-weight: 600; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 6px 0; }
.legal {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding: 12px 0 22px;
  color: #d5e8f4;
  font-size: 0.95rem;
}

.page-intro { padding: 28px 0 8px; }
.page-intro h1 { font-size: clamp(2.8rem, 6vw, 5rem); }

.stack { display: grid; gap: 16px; }

.activity { padding: 22px 0 40px; }
.back a { font-weight: 700; text-decoration: none; }
.back a:hover { text-decoration: underline; }
.activity-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}
.activity-head h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
.keys { display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 0; margin: 12px 0; list-style: none; }
kbd {
  font-family: var(--body);
  font-weight: 700;
  border: 2px solid var(--navy);
  border-bottom-width: 4px;
  border-radius: 8px;
  padding: 1px 7px;
  background: white;
}

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 420px;
  border: var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #9adcf3;
  touch-action: none;
}
.stage canvas { width: 100%; height: 100%; display: block; }
.hud {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  color: var(--navy);
  font-weight: 700;
}
.hud b {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 0.9;
  text-shadow: 2px 2px 0 white;
}
.hud span {
  background: rgba(255, 253, 249, 0.88);
  border: 2px solid var(--navy);
  border-radius: 14px;
  padding: 6px 10px;
}

.veil {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  padding: 22px;
  background: rgba(255, 246, 234, 0.78);
}
.veil h2 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0; }
.veil p { margin: 0 0 8px; max-width: 36ch; }
.veil[hidden] { display: none; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.play {
  background: var(--paper);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.prompt {
  font-family: var(--body);
  font-weight: 600;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.25;
  margin-bottom: 14px;
}
.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
  margin-bottom: 8px;
}
.choices { display: grid; gap: 10px; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choice {
  text-align: left;
  background: white;
  border: var(--line);
  border-radius: 16px;
  min-height: 56px;
  padding: 12px 14px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.choice:hover:not(:disabled) { background: var(--ice); }
.choice.is-right { background: #d8f5c8; }
.choice.is-wrong { background: #ffd2cc; }
.choice:disabled { cursor: default; }
.why {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--ice);
  border: 2px dashed var(--navy);
}
.why strong { display: block; margin-bottom: 4px; }

.answer-row { display: flex; gap: 10px; flex-wrap: wrap; }
.answer-row input {
  flex: 1 1 180px;
  min-height: 56px;
  border: var(--line);
  border-radius: 16px;
  padding: 8px 14px;
  font-size: 1.4rem;
  font-weight: 700;
  background: white;
}
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.level {
  text-align: left;
  background: white;
  border: var(--line);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.level small { display: block; font-weight: 500; color: var(--navy); }
.level:hover { background: var(--gold); }

.review { display: grid; gap: 8px; margin-top: 14px; }
.review details {
  border: 2px solid var(--navy);
  border-radius: 12px;
  padding: 8px 12px;
  background: white;
}
.review details.is-miss { background: #fff0ee; }
.review details.is-right { background: #f3fbe9; }
.review summary { font-weight: 700; cursor: pointer; }

.mem-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 10px;
}
.mem-grid {
  width: min(560px, 100%);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.mem-card {
  aspect-ratio: 1;
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 16px;
}
.mem-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s ease;
}
.mem-card.is-up .mem-inner { transform: rotateY(180deg); }
.face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: var(--line);
  border-radius: 16px;
  backface-visibility: hidden;
  box-shadow: 3px 3px 0 var(--navy);
}
.face.front { background: var(--navy); color: var(--gold); font-family: var(--display); font-size: 1.8rem; }
.face.back { background: white; transform: rotateY(180deg); }
.mem-card.is-matched .face.back { background: #fff4cc; }
.face svg { width: 68%; height: 68%; }

.pad-wrap { display: grid; gap: 12px; justify-items: center; }
.pad {
  width: min(100%, 460px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: var(--line);
  background: var(--gold);
  box-shadow: var(--shadow);
  font-family: var(--display);
  font-size: clamp(2.4rem, 8vw, 4.5rem);
  color: var(--navy);
  letter-spacing: 0.02em;
}
.pad.wait { background: var(--sky); }
.pad.go { background: var(--orange); color: var(--navy-deep); }
.pad.foul { background: var(--red); color: white; animation: shake 0.35s linear; }
.pad.done { background: var(--navy); color: var(--gold); font-size: clamp(1.8rem, 5vw, 3rem); }
.dots { display: flex; gap: 8px; }
.dots i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--navy);
  background: white;
  display: block;
}
.dots i.good { background: var(--gold); }
.dots i.foul { background: var(--red); }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.speed-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr auto;
  gap: 10px;
  align-items: center;
  font-weight: 600;
}
.trackway {
  height: 18px;
  background: white;
  border: 2px solid var(--navy);
  border-radius: 999px;
  overflow: hidden;
}
.fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--sky-deep);
  animation: grow 0.9s cubic-bezier(.2,.8,.2,1) forwards;
}
.speed-row.is-us .fill { background: var(--orange); }
.speed-row.is-real .fill { background: var(--gold-deep); }
.speed-row.is-us { background: #fff1c9; border-radius: 12px; padding: 4px; }
.mph { min-width: 4.2ch; text-align: right; }

.schedule { width: 100%; border-collapse: collapse; background: white; }
.schedule th, .schedule td {
  border-bottom: 2px solid rgba(18, 48, 86, 0.12);
  text-align: left;
  padding: 8px 6px;
  vertical-align: top;
}
.schedule th { font-size: 0.92rem; }

.faq details {
  border-bottom: 2px solid rgba(18, 48, 86, 0.14);
  padding: 10px 0;
}
.faq summary { font-weight: 700; cursor: pointer; font-size: 1.08rem; }
.stamp {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 10px;
  border: 4px solid var(--red);
  color: var(--red-deep);
  font-family: var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 10px;
  transform: rotate(-6deg);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 70;
  width: min(92vw, 520px);
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  pointer-events: none;
  background: var(--navy);
  color: white;
  border: 3px solid var(--gold);
  border-radius: 999px;
  padding: 12px 16px;
  text-align: center;
  font-weight: 600;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i {
  position: absolute;
  top: -12px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  animation: fall 1.3s ease-in forwards;
}

.noscript {
  margin: 12px auto;
  width: min(1120px, calc(100% - 36px));
  background: white;
  border: var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}
@keyframes wobble {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}
@keyframes ticker { to { transform: translateX(-50%); } }
@keyframes grow { to { width: var(--p); } }
@keyframes fall {
  to { transform: translateY(100vh) rotate(240deg); opacity: 0.9; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@media (max-width: 900px) {
  .hero, .cap-band .wrap, .bento, .lessons, .split, .footer-grid, .levels {
    grid-template-columns: 1fr;
  }
  .card.wide { grid-row: auto; }
  .gauge-card { width: min(240px, 100%); }
  .section-head, .activity-head { flex-direction: column; align-items: start; }
  .hero-art { order: -1; }
  .choices.two { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    background: var(--cream);
    border-bottom: var(--line);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px; }
  .site-header { flex-wrap: wrap; }
  .brand img { width: 92px; }
  .stage { aspect-ratio: 4 / 5; max-height: 68vh; }
  .speed-row { grid-template-columns: 1fr auto; }
  .trackway { grid-column: 1 / -1; order: 3; }
  h1 { font-size: clamp(2.7rem, 12vw, 4.2rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .fill { width: var(--p); }
  .marquee-track { transform: none; }
}
