:root {
  --blue: #1e3a8a;
  --blue-deep: #1e3a8a;
  --sky: #dbeafe;
  --sky-soft: #eff6ff;
  --yellow: #facc15;
  --yellow-hot: #eab308;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --ok: #15803d;
  --bad: #b91c1c;
  --card: #ffffff;
  --radius: 16px;
  --font: system-ui, "Segoe UI", Arial, sans-serif;
  --display: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.55;
  background: linear-gradient(180deg, var(--sky) 0%, #fff 28%, var(--sky-soft) 100%);
  min-height: 100vh;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--yellow);
  color: var(--blue);
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  font-weight: 800;
  color: var(--blue);
  text-decoration: none;
  font-size: 1.1rem;
  font-family: var(--display);
}
.pill {
  background: var(--yellow);
  color: var(--blue);
  font-weight: 700;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
.pill:hover { background: var(--yellow-hot); }
.pill.ghost {
  background: transparent;
  border: 2px solid var(--blue);
}
.pill:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.app {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
}

.hero {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
}
.hero .eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 0.5rem;
}
.hero h1 {
  font-family: var(--display);
  color: var(--blue);
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
}
.hero .lead {
  color: #334155;
  font-size: 1.05rem;
  margin: 0 auto 1.25rem;
  max-width: 32rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin: 1rem 0;
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.06);
}
.card h2 {
  font-family: var(--display);
  color: var(--blue);
  font-size: 1.2rem;
  margin: 0 0 0.65rem;
}
.card ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.card li { margin-bottom: 0.35rem; }

.privacy {
  font-size: 0.9rem;
  color: var(--muted);
  background: var(--sky-soft);
  border-left: 4px solid var(--blue);
  padding: 0.85rem 1rem;
  margin: 1rem 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.pace {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
}
.pace button {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--blue);
}
.pace button[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--sky);
}

.day-hub {
  margin: 1.25rem 0;
}
.day-hub header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.day-hub h2 {
  font-family: var(--display);
  color: var(--blue);
  font-size: 1.15rem;
  margin: 0;
}
.progress-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.stamps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-top: 0.85rem;
}
@media (min-width: 480px) {
  .stamps { grid-template-columns: repeat(6, 1fr); }
}

.stamp-btn {
  appearance: none;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0.65rem 0.35rem;
  cursor: pointer;
  font-weight: 800;
  color: var(--blue);
  font-family: var(--display);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.stamp-btn:hover:not(:disabled) { border-color: var(--blue); }
.stamp-btn.done {
  background: var(--blue);
  color: var(--yellow);
  border-color: var(--blue);
}
.stamp-btn.current {
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.55);
  border-color: var(--yellow-hot);
}
.stamp-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.stamp-btn .mini {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  font-family: var(--font);
  opacity: 0.85;
  margin-top: 0.15rem;
  line-height: 1.2;
}

.lesson-shell .meta {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}
.lesson-shell h1 {
  font-family: var(--display);
  color: var(--blue);
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  margin: 0 0 0.75rem;
}
.bite-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.bite-tabs span {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
}
.bite-tabs span.on {
  background: var(--blue);
  color: #fff;
}
.bite-tabs span.done {
  background: #bbf7d0;
  color: var(--ok);
}

.spark-text {
  font-size: 1.05rem;
  margin: 0 0 1rem;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.opt {
  text-align: left;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  color: var(--ink);
}
.opt:hover:not(:disabled) { border-color: var(--blue); }
.opt.correct {
  border-color: var(--ok);
  background: #f0fdf4;
}
.opt.wrong {
  border-color: var(--bad);
  background: #fef2f2;
}
.opt:disabled { cursor: default; }

.coach {
  margin-top: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-weight: 600;
}
.coach.ok { background: #f0fdf4; color: var(--ok); }
.coach.bad { background: #fef2f2; color: var(--bad); }

.stamp-pop {
  text-align: center;
  padding: 1.5rem 0.5rem;
}
.stamp-pop .seal {
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--blue);
  color: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.4rem;
  box-shadow: 0 10px 30px rgba(30, 58, 138, 0.25);
}
@media (prefers-reduced-motion: no-preference) {
  .stamp-pop .seal {
    animation: pop 0.45s ease;
  }
}
@keyframes pop {
  0% { transform: scale(0.6); opacity: 0.4; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.stamp-line {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 1rem;
}

.badge-card {
  text-align: center;
  border: 4px solid var(--blue);
  border-radius: 20px;
  padding: 1.5rem 1rem;
  background: linear-gradient(180deg, var(--sky), #fff);
  margin: 1rem 0;
}
.badge-card h2 {
  font-family: var(--display);
  color: var(--blue);
  margin: 0.35rem 0;
  font-size: 1.6rem;
}
.badge-card .nick {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 1rem 0;
  text-align: left;
}
.field label { font-weight: 700; color: var(--blue); font-size: 0.9rem; }
.field input {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 2px solid var(--line);
  font-size: 1rem;
}
.field input:focus {
  outline: 2px solid var(--yellow);
  border-color: var(--blue);
}
.hint { font-size: 0.8rem; color: var(--muted); }

.parent-end .cta-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}
.parent-end a.big {
  display: block;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  padding: 0.95rem 1rem;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--blue);
}
.parent-end a.big.secondary {
  background: var(--blue);
  color: #fff;
}
.parent-end a.big.ghost {
  background: #fff;
  border: 2px solid var(--blue);
  color: var(--blue);
}

.site-foot {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.site-foot a { color: var(--blue); }

@media print {
  .topnav, .site-foot, .actions, .pace { display: none !important; }
  .badge-card { break-inside: avoid; }
}
