/* Layout: storybook editorial — wide hero with framed illustration, then alternating ivory / sage bands.
   Single warm-light theme by design (brand palette from the brief). */
:root {
  --forest: #174B3A;
  --forest-deep: #17372E;
  --forest-ink: #0f2c23;
  --ivory: #FAF5EA;
  --terracotta: #B95332;
  --terracotta-deep: #9b4227;
  --sage: #DDE8D8;
  --sage-deep: #c5d6bf;
  --champagne: #E9C879;
  --card: #FFFEFA;
  --line: #e6dccb;
  --muted: #55665e;
  --good: #2f7a4f;
  --good-bg: #e3f1e5;
  --try-bg: #fdf0ea;

  --f-display: "Fraunces", "Georgia", "Times New Roman", serif;
  --f-body: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;

  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;
  --shadow: 0 1px 2px rgba(23, 55, 46, .06), 0 8px 24px -12px rgba(23, 55, 46, .22);
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--forest-deep);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--f-display); color: var(--forest-deep); line-height: 1.12; margin: 0; text-wrap: balance; font-weight: 600; }
h2 { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0; }
a { color: var(--forest); }
:focus-visible { outline: 3px solid var(--terracotta); outline-offset: 3px; border-radius: 6px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--forest); color: var(--card); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.eyebrow {
  font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--terracotta); margin-bottom: 10px;
}
.section { padding-block: clamp(56px, 8vw, 96px); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 32px; }
.section-sub { color: var(--muted); max-width: 60ch; margin-top: 12px; }
.small { font-size: .92rem; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 700 1rem/1 var(--f-body); text-decoration: none; cursor: pointer;
  padding: 15px 26px; border-radius: 999px; border: 2px solid transparent;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
  min-height: 48px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--forest); color: var(--card); box-shadow: 0 6px 16px -8px rgba(23,75,58,.7); }
.btn-primary:hover { background: var(--forest-ink); }
.btn-accent { background: var(--terracotta); color: var(--card); }
.btn-accent:hover { background: var(--terracotta-deep); }
.btn-outline { background: var(--card); color: var(--forest-deep); border-color: var(--line); }
.btn-outline:hover { border-color: var(--forest); }
.btn-ghost { background: transparent; color: var(--forest-deep); border-color: var(--forest-deep); }
.btn-sm { padding: 10px 18px; min-height: 42px; font-size: .92rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.play { width: 26px; height: 26px; border-radius: 50%; background: var(--forest-deep); position: relative; flex: none; }
.play::after { content: ""; position: absolute; left: 10px; top: 7px; border-left: 9px solid var(--card); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Header */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--ivory); }
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: rgba(250, 245, 234, .94);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--forest-deep); flex: none; }
.brand-mark { width: 46px; height: 40px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--f-display); font-size: 1.32rem; font-weight: 600; }
.brand-text small { font-size: .74rem; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav ul a {
  display: block; padding: 8px 12px; border-radius: 999px; text-decoration: none;
  color: var(--forest-deep); font-weight: 600; font-size: .95rem;
}
.site-nav ul a:hover { background: var(--sage); }
.site-nav ul a.is-active { background: #f1e3cd; color: var(--terracotta-deep); }
.nav-actions { display: flex; gap: 10px; }
.menu-toggle { display: none; }

@media (max-width: 1020px) {
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
    width: 48px; height: 48px; border-radius: 14px; border: 1.5px solid var(--line);
    background: var(--card); cursor: pointer;
  }
  .menu-bars, .menu-bars::before, .menu-bars::after {
    display: block; width: 20px; height: 2px; background: var(--forest-deep); border-radius: 2px; position: relative; transition: transform .2s, opacity .2s;
  }
  .menu-bars::before, .menu-bars::after { content: ""; position: absolute; left: 0; }
  .menu-bars::before { top: -6px; } .menu-bars::after { top: 6px; }
  .menu-toggle[aria-expanded="true"] .menu-bars { background: transparent; }
  .menu-toggle[aria-expanded="true"] .menu-bars::before { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-bars::after { transform: translateY(-6px) rotate(-45deg); }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 14px;
    background: var(--ivory); border-bottom: 1px solid var(--line);
    padding: 12px max(20px, env(safe-area-inset-right, 0px)) 20px max(20px, env(safe-area-inset-left, 0px));
    box-shadow: 0 16px 24px -16px rgba(23,55,46,.3);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; }
  .site-nav ul a { padding: 12px 14px; font-size: 1.05rem; }
  .nav-actions .btn { flex: 1; }
}

/* Hero */
.hero { position: relative; padding-block: 28px 8px; overflow: hidden; }
.hero::before, .hero::after {
  content: ""; position: absolute; width: 140px; height: 140px; pointer-events: none; opacity: .9;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 95C50 60 45 30 20 8' stroke='%235f8a5d' stroke-width='2.5' fill='none'/%3E%3Cpath d='M44 60c-14 0-26-8-30-20 14-2 26 6 30 20zM40 40C28 36 22 26 22 14c12 3 18 13 18 26zM47 78c-12 4-26 0-33-10 12-5 26-1 33 10z' fill='%2378a66f'/%3E%3Cpath d='M48 50c12-4 24 0 32 10-12 6-25 2-32-10zM46 30c8-9 20-11 30-6-7 10-19 12-30 6z' fill='%235f8a5d'/%3E%3C/svg%3E");
}
.hero::before { left: -40px; top: 40px; transform: rotate(-10deg); }
.hero::after { right: -30px; bottom: 40px; transform: scaleX(-1) rotate(-20deg); }
.hero-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero-copy { min-width: 0; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.7rem, 1.6rem + 4.6vw, 5.1rem); font-weight: 700; letter-spacing: -.025em; line-height: 1; }
.hero h1 span { display: block; }
.hero h1 .accent { color: var(--terracotta); }
.lede { font-size: 1.12rem; margin-top: 22px; max-width: 46ch; color: #2c4a40; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-art { margin: 0; position: relative; }
.hero-art img {
  width: 100%; border-radius: 46% 54% 40% 60% / 38% 42% 58% 62%;
  box-shadow: 0 30px 50px -30px rgba(23,55,46,.45);
  aspect-ratio: 556 / 323; object-fit: cover;
}
.hero-art::after {
  content: ""; position: absolute; inset: -14px -10px auto auto; width: 90px; height: 90px; border-radius: 50%;
  background: var(--champagne); z-index: -1;
}
.feature-row {
  list-style: none; padding: 0; margin: 34px 0 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.feature-row li { display: flex; align-items: center; gap: 12px; font-size: .9rem; font-weight: 700; line-height: 1.3; }
.fi { flex: none; width: 46px; height: 46px; border-radius: 50%; background: #f3e5c6; display: grid; place-items: center; }
.fi svg, .bi svg { width: 22px; height: 22px; fill: none; stroke: var(--terracotta); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .feature-row { grid-template-columns: repeat(2, 1fr); }
}

/* Learning path */
.path { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; counter-reset: lvl; }
.lvl {
  --tint: #fbe7df; --tag: var(--terracotta);
  height: 100%; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; text-decoration: none;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--tint); border: 1.5px solid transparent; border-radius: var(--r-md);
  padding: 14px 14px 18px; position: relative;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.lvl:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(23,55,46,.12); }
.lvl[data-n="2"] { --tint: #fbf0d6; --tag: #c98a14; }
.lvl[data-n="3"] { --tint: #e1efe0; --tag: #3f8a5c; }
.lvl[data-n="4"] { --tint: #e0edf3; --tag: #3e7fa6; }
.lvl[data-n="5"] { --tint: #ece6f4; --tag: #7a5aa8; }
.lvl-img { border-radius: 12px; overflow: hidden; background: var(--card); }
.lvl-img img { width: 100%; aspect-ratio: 150 / 97; object-fit: cover; }
.lvl-num {
  position: absolute; top: 8px; left: 8px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--tag); color: #fff; font: 800 .85rem/34px var(--f-body); text-align: center;
}
.lvl-title { font-family: var(--f-display); font-weight: 600; font-size: 1.15rem; line-height: 1.15; }
.lvl-desc { font-size: .9rem; color: #3a5249; flex: 1; }
.lvl-go { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; font-weight: 800; color: var(--tag); }
.lvl-go .arrow { width: 30px; height: 30px; border-radius: 50%; background: var(--tag); color: #fff; display: grid; place-items: center; font-size: 1rem; }
@media (max-width: 1020px) { .path { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) {
  .path { grid-template-columns: 1fr; }
  .lvl { flex-direction: row; align-items: center; gap: 14px; }
  .lvl-img { width: 112px; flex: none; }
  .lvl-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
  .lvl-go { display: none; }
}
@media (min-width: 701px) { .lvl-text { display: contents; } }

/* Sample activity section */
.try { background: var(--try-bg); position: relative; }
.try-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.try-intro p:not(.eyebrow) { margin-top: 14px; color: #3a5249; max-width: 44ch; }
.try-kid { margin-top: 24px; width: min(300px, 100%); border-radius: var(--r-lg); }
@media (max-width: 860px) { .try-grid { grid-template-columns: 1fr; } .try-kid { display: none; } }

/* Activity player (engine) */
.activity {
  min-width: 0; background: var(--card); border-radius: var(--r-lg);
  border: 10px solid #8a5a35; box-shadow: inset 0 0 0 2px #6e4526, 0 24px 40px -26px rgba(60,35,15,.55);
  padding: clamp(16px, 3vw, 30px); position: relative;
}
.act-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.act-instr { font-weight: 700; font-size: 1rem; flex: 1 1 220px; }
.act-meter { display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); font-size: .9rem; }
.dots { display: flex; gap: 5px; flex-wrap: wrap; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dots i.done { background: var(--terracotta); }
.dots i.now { background: var(--champagne); box-shadow: 0 0 0 2px var(--terracotta); }
.act-prompt { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 20px 0 18px; text-align: center; }
.listen-row { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.btn-listen {
  display: inline-flex; align-items: center; gap: 12px; cursor: pointer;
  background: var(--forest); color: var(--card); border: 0; border-radius: 999px;
  padding: 10px 22px 10px 12px; font: 800 1.05rem var(--f-body); min-height: 56px;
}
.btn-listen svg { width: 36px; height: 36px; padding: 7px; border-radius: 50%; background: var(--champagne); fill: var(--forest-deep); stroke: var(--forest-deep); stroke-width: 1.6; stroke-linecap: round; }
.btn-listen svg .w { fill: none; }
.btn-listen.is-speaking svg { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(233,200,121,.45); } }
.link-btn { font-size: .88rem; color: var(--muted); }
.act-word { font-family: var(--f-display); font-size: 2.2rem; font-weight: 700; letter-spacing: .04em; }
.act-show { font-family: var(--f-display); font-size: clamp(2.4rem, 2rem + 2vw, 3.4rem); font-weight: 700; letter-spacing: .06em; line-height: 1; color: var(--forest-deep); }
.act-question { font-size: 1.25rem; font-weight: 800; max-width: 40ch; }
.passage { background: #fbf6ea; border: 1px dashed var(--champagne); border-radius: var(--r-md); padding: 14px 18px; font-size: 1.2rem; line-height: 1.7; max-width: 46ch; text-align: left; }
.pic { font-size: 3.6rem; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.pic-big { font-size: clamp(4.2rem, 3.4rem + 3vw, 5.6rem); }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 2vw, 16px); }
.choices.two { grid-template-columns: repeat(2, 1fr); max-width: 440px; margin-inline: auto; }
.choices.long { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
.choice {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--r-md);
  padding: 14px 8px 12px; font: 800 1.15rem var(--f-body); color: var(--forest-deep); min-height: 72px;
  transition: transform .15s, border-color .15s, background-color .15s;
}
.kind-pic .choice { min-height: 140px; }
.kind-letter .choice .opt-text { font-family: var(--f-display); font-size: 2.3rem; font-weight: 700; line-height: 1; }
.kind-text .choice .opt-text { font-size: 1.2rem; }
.long .choice { align-items: flex-start; text-align: left; padding: 14px 18px; min-height: 58px; }
.choice:hover:not([disabled]) { transform: translateY(-3px); border-color: var(--champagne); }
.choice .lbl { min-height: 1.4em; }
.choice .lbl.hidden-lbl { visibility: hidden; }
.choice.is-right { border-color: var(--good); background: var(--good-bg); }
.choice.is-wrong { border-color: var(--terracotta); background: #fbe9e2; animation: nudge .35s; }
.choice[disabled] { cursor: default; }
.choice[disabled]:not(.is-right):not(.is-wrong) { opacity: .7; }
@keyframes nudge { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.slots { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.slot { width: 56px; height: 64px; border-radius: 12px; border: 2px dashed var(--sage-deep); display: grid; place-items: center; font: 700 2rem var(--f-display); color: var(--forest-deep); background: #fbf6ea; }
.slot.filled { border-style: solid; border-color: var(--forest); background: var(--card); }
.slots.is-right .slot { border-color: var(--good); background: var(--good-bg); }
.slots.is-wrong { animation: nudge .35s; }
.slots.is-wrong .slot { border-color: var(--terracotta); background: #fbe9e2; }
.tiles { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.tile { width: 58px; height: 58px; border-radius: 14px; border: 0; background: var(--champagne); color: var(--forest-deep); font: 700 1.9rem var(--f-display); cursor: pointer; box-shadow: 0 4px 0 #c9a552; transition: transform .1s; }
.tile:hover:not([disabled]) { transform: translateY(-2px); }
.tile[disabled] { opacity: .25; cursor: default; box-shadow: none; }
.build-tools { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.feedback { min-height: 3.2em; margin-top: 16px; text-align: center; font-weight: 700; }
.feedback.good { color: var(--good); }
.feedback.try-again { color: var(--terracotta-deep); }
.act-foot { display: flex; justify-content: center; }
.act-done { text-align: center; padding: 18px 0 6px; }
.act-done h3 { font-size: 1.7rem; margin: 6px 0 8px; }
.act-done p { color: #3a5249; margin-bottom: 18px; }
.done-stars { font-size: 2.4rem; letter-spacing: 6px; color: #d9a93a; }
.done-stars .off, .stars .off { color: var(--line); }
.done-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.act-error { text-align: center; padding: 20px; }
@media (max-width: 420px) {
  .kind-pic .choice { min-height: 110px; padding: 12px 4px 8px; font-size: 1rem; }
  .pic { font-size: 2.8rem; }
  .activity { border-width: 7px; }
  .slot { width: 46px; height: 54px; font-size: 1.6rem; }
  .tile { width: 50px; height: 50px; }
}

/* Progress band */
.progress-band { background: var(--sage); padding-block: 48px; }
.progress-inner { display: grid; grid-template-columns: 1fr 1.3fr; gap: 28px; align-items: start; }
.progress-inner h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.progress-inner .small { margin-top: 8px; max-width: 42ch; }
.progress-card { background: var(--card); border-radius: var(--r-md); padding: 14px 20px 18px; box-shadow: var(--shadow); min-width: 0; }
.prog-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; padding-block: 10px; color: inherit; text-decoration: none; }
.prog-row + .prog-row { border-top: 1px solid var(--line); }
.prog-link:hover strong { text-decoration: underline; }
.prog-row strong { font-size: .98rem; }
.prog-row small { color: var(--muted); font-size: .82rem; grid-column: 1 / -1; margin-top: -2px; }
.prog-row .bar { grid-column: 1 / -1; }
.prog-state { font-size: .82rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: #efe8da; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.prog-state.ok { background: var(--good-bg); color: var(--good); }
.bar { display: block; height: 8px; border-radius: 99px; background: #ece4d4; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--forest); transition: width .4s ease; }
.prog-reset { margin-top: 10px; font-size: .85rem; }
.reset-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; font-weight: 700; font-size: .92rem; }
.notice { background: #fbe9e2; color: var(--terracotta-deep); border-radius: var(--r-sm); padding: 10px 14px; font-size: .9rem; font-weight: 700; margin-bottom: 8px; }
.empty { color: var(--muted); font-size: .92rem; padding: 6px 0 8px; }
.badges { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; font-size: .84rem; font-weight: 800; background: rgba(255,254,250,.55); color: #6b7a72; border: 1px dashed #a9bba3; }
.badge.earned { background: var(--card); color: var(--forest-deep); border: 1px solid var(--champagne); }
.badge-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; background: #e8eee5; }
.badge.earned .badge-dot { background: var(--champagne); color: var(--forest-deep); }
@media (max-width: 760px) { .progress-inner { grid-template-columns: 1fr; } }

/* Parents */
.parents-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.benefits { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.benefits li { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; }
.benefits li:last-child { grid-column: 1 / -1; }
.bi { flex: none; width: 42px; height: 42px; border-radius: 12px; background: #f6e3da; display: grid; place-items: center; }
.benefits h3 { font-family: var(--f-body); font-size: 1rem; font-weight: 800; margin-bottom: 4px; }
.benefits p { font-size: .9rem; color: var(--muted); }
.parents-art { margin: 0; }
.parents-art img { width: 100%; border-radius: 50% 50% var(--r-lg) var(--r-lg); box-shadow: var(--shadow); }
@media (max-width: 860px) {
  .parents-grid { grid-template-columns: 1fr; }
  .parents-art { max-width: 320px; }
}
@media (max-width: 560px) { .benefits { grid-template-columns: 1fr; } }

/* Pricing */
.pricing { background: linear-gradient(var(--ivory), #f5eedf); }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 34px; align-items: stretch; max-width: 820px; }
.plan {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-lg);
  padding: 28px 24px 24px; display: flex; flex-direction: column; gap: 16px; position: relative;
}
.plan.featured { border: 2px solid var(--terracotta); box-shadow: 0 20px 40px -26px rgba(185,83,50,.55); }
.plan-badge { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--terracotta); color: #fff; font-size: .78rem; font-weight: 800; padding: 5px 14px; border-radius: 999px; white-space: nowrap; }
.plan h3 { font-size: 1.3rem; }
.plan-price { font-family: var(--f-display); font-size: 2.4rem; font-weight: 700; color: var(--terracotta); font-variant-numeric: tabular-nums; line-height: 1; }
.plan-price small { font-family: var(--f-body); font-size: .9rem; font-weight: 700; color: var(--muted); margin-left: 4px; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; flex: 1; align-content: start; }
.plan li { display: flex; gap: 10px; font-size: .95rem; }
.plan li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: var(--forest) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.5l2.6 2.5L13 6.5' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.plan .btn { width: 100%; }
.plan-note { font-size: .82rem; color: var(--muted); text-align: center; margin-top: -6px; }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; max-width: 460px; } }

/* About */
.about { background: var(--sage); }
.about-grid { display: grid; grid-template-columns: 220px 1fr; gap: clamp(24px, 5vw, 60px); align-items: center; max-width: 900px; }
.about-art { width: 100%; border-radius: var(--r-lg); box-shadow: var(--shadow); }
.about p:not(.eyebrow) { margin-top: 14px; max-width: 58ch; }
.ticks { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.ticks li { background: var(--card); border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: .9rem; color: var(--terracotta-deep); }
@media (max-width: 600px) { .about-grid { grid-template-columns: 1fr; } .about-art { max-width: 180px; } }

/* FAQ */
.faq-wrap { max-width: 820px; }
.faq h2 { margin-bottom: 22px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 18px; margin-top: 10px; }
.faq summary { cursor: pointer; font-weight: 800; padding: 16px 0; list-style-position: outside; }
.faq details p { padding-bottom: 16px; color: #3a5249; }

/* Footer */
.site-footer { background: var(--forest); color: #e7efe6; padding-block: 40px calc(28px + env(safe-area-inset-bottom, 0px)); }
.footer-inner { display: grid; grid-template-columns: auto 1fr; gap: 18px 40px; align-items: center; }
.foot-brand strong { display: block; font-family: var(--f-display); font-size: 1.4rem; font-weight: 600; color: var(--champagne); }
.foot-brand small { color: #c9d8cc; }
.foot-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: flex-end; }
.foot-links a, .foot-links .link-btn { color: #e7efe6; font-size: .92rem; text-decoration: none; }
.foot-links a:hover, .foot-links .link-btn:hover { text-decoration: underline; }
.copy { grid-column: 1 / -1; font-size: .82rem; color: #b8cbbd; border-top: 1px solid rgba(255,255,255,.14); padding-top: 16px; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; } .foot-links { justify-content: flex-start; } }

/* App views: level and activity pages */
.app-view { padding-block: 24px 80px; min-height: 60vh; }
.view { display: flex; flex-direction: column; gap: 22px; }
.view-title { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); font-weight: 700; letter-spacing: -.015em; }
.view-title:focus { outline: none; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .9rem; color: var(--muted); }
.crumbs a { color: var(--forest); font-weight: 700; }
.lv-head { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: clamp(20px, 4vw, 44px); align-items: center; background: var(--tint, #fbe7df); border-radius: var(--r-lg); padding: clamp(18px, 3vw, 32px); }
.lv-1 { --tint: #fbe7df; } .lv-2 { --tint: #fbf0d6; } .lv-3 { --tint: #e1efe0; } .lv-4 { --tint: #e0edf3; } .lv-5 { --tint: #ece6f4; }
.lv-img { width: 100%; border-radius: var(--r-md); background: var(--card); aspect-ratio: 150 / 97; object-fit: cover; }
.lv-intro { min-width: 0; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.lv-intro .eyebrow { margin: 0; }
.lv-objective { font-size: 1.05rem; }
.lv-explain { color: #3a5249; max-width: 62ch; }
.lv-progress { display: grid; gap: 6px; width: 100%; max-width: 440px; font-size: .88rem; font-weight: 700; color: var(--muted); }
.list-h { font-size: 1.5rem; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.list-h span { font-family: var(--f-body); font-size: .85rem; font-weight: 700; color: var(--muted); }
.act-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.act-card { display: grid; grid-template-columns: auto 1fr auto auto; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 18px; }
.act-card.locked { background: #f6f1e6; }
.act-card.locked .act-info { opacity: .75; }
.step { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--sage); color: var(--forest-deep); font-weight: 800; }
.act-info { min-width: 0; }
.act-info h3 { font-family: var(--f-body); font-size: 1.08rem; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.act-info p { font-size: .88rem; color: var(--muted); }
.chip { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.chip-free { background: var(--good-bg); color: var(--good); }
.act-status { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.act-status small { color: var(--muted); font-size: .82rem; font-weight: 700; }
.stars { color: #d9a93a; font-size: 1.15rem; letter-spacing: 2px; }
.lv-pager { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); }
.lv-pager a { font-weight: 800; color: var(--forest); }
.play-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.play-head img { width: 130px; border-radius: var(--r-md); flex: none; }
.play-skill { color: var(--muted); font-weight: 700; margin-top: 4px; }
.play-view .activity, .play-view .play-head { max-width: 820px; width: 100%; }
.state-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(22px, 4vw, 40px); max-width: 640px; display: grid; gap: 14px; }
.state-card p { color: #3a5249; }
.state-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
@media (max-width: 700px) {
  .lv-head { grid-template-columns: 1fr; }
  .lv-img { max-width: 240px; }
  .act-card { grid-template-columns: auto 1fr; padding: 14px; }
  .act-status { grid-column: 2; align-items: flex-start; flex-direction: row; gap: 8px; align-items: center; }
  .act-card .btn { grid-column: 1 / -1; }
  .play-head img { width: 84px; }
}

/* Game packs and library */
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.pack { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pack-head { display: flex; gap: 12px; align-items: center; }
.pack-icon { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; background: var(--sage); }
.pack-memory .pack-icon { background: #fbe7df; } .pack-sort .pack-icon { background: #fbf0d6; } .pack-bubbles .pack-icon { background: #e0edf3; } .pack-build .pack-icon { background: #ece6f4; }
.pack h3 { font-family: var(--f-body); font-size: 1.05rem; font-weight: 800; }
.pack-head p { font-size: .84rem; color: var(--muted); }
.sets { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.set { width: 100%; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--ivory); color: var(--forest-deep); text-decoration: none; font: 800 .86rem var(--f-body); cursor: pointer; padding: 6px; transition: border-color .15s, transform .15s; }
.set:hover { border-color: var(--forest); transform: translateY(-2px); }
.set.done { background: var(--good-bg); border-color: #b9dcc1; }
.set.locked { background: #f1ece1; color: #7d8a83; }
.set-tag { font-size: .72rem; font-weight: 800; color: var(--terracotta-deep); }
.set-stars { color: #d9a93a; font-size: .8rem; letter-spacing: 1px; }
.pack-progress { font-size: .8rem; color: var(--muted); font-weight: 700; }
.games-head { display: grid; gap: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .88rem; font-weight: 700; color: var(--muted); }
.games-level { display: grid; gap: 14px; padding-top: 12px; }
.games-level-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.games-level-head h2 { font-size: 1.5rem; }
.games-level-head a { font-weight: 800; color: var(--forest); }

/* New game types */
.choices.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 600px) { .choices.four { grid-template-columns: repeat(2, 1fr); } }
.face-text { font: 700 1.6rem var(--f-display); line-height: 1.1; color: var(--forest-deep); }
.face-word { font-weight: 800; font-size: .95rem; }
.mem-count { text-align: center; font-weight: 800; color: var(--muted); margin: 14px 0 10px; font-variant-numeric: tabular-nums; }
.memory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 560px; margin-inline: auto; }
.card { position: relative; aspect-ratio: 1; border-radius: 14px; border: 0; cursor: pointer; padding: 6px; background: var(--forest); color: var(--champagne); box-shadow: 0 4px 0 var(--forest-ink); display: grid; place-items: center; transition: transform .2s, background-color .2s; }
.card .card-back { font-size: 1.6rem; }
.card .card-face { display: none; flex-direction: column; align-items: center; gap: 2px; }
.card .card-face .pic { font-size: 2.4rem; }
.card.up { background: var(--card); box-shadow: inset 0 0 0 2px var(--champagne); transform: rotateY(0) scale(1.02); }
.card.up .card-back { display: none; }
.card.up .card-face { display: flex; }
.card.matched { background: var(--good-bg); box-shadow: inset 0 0 0 2px var(--good); cursor: default; }
@media (max-width: 480px) { .memory { grid-template-columns: repeat(3, 1fr); } .card .card-face .pic { font-size: 2rem; } .face-text { font-size: 1.25rem; } }
.bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin-top: 16px; }
.bin { min-height: 120px; border-radius: var(--r-md); border: 2px dashed var(--sage-deep); background: #f4f8f1; cursor: pointer; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; font: inherit; color: var(--forest-deep); transition: border-color .15s, background-color .15s; }
.bin:hover { border-color: var(--forest); }
.bin.is-wrong { border-color: var(--terracotta); background: #fbe9e2; animation: nudge .35s; }
.bin-head { display: flex; align-items: center; gap: 8px; }
.bin-label { font: 700 1.3rem var(--f-display); }
.bin-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.bin-chip { background: var(--card); border-radius: 10px; padding: 2px 6px; font-weight: 800; font-size: .9rem; }
.bin-chip .pic { font-size: 1.5rem; }
.sort-hint { text-align: center; font-size: .88rem; color: var(--muted); font-weight: 700; margin: 12px 0 8px; }
.sort-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.sort-card { min-width: 92px; min-height: 92px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px; font: inherit; color: var(--forest-deep); transition: transform .15s, border-color .15s; }
.sort-card .pic { font-size: 2.4rem; }
.sort-card[aria-pressed="true"] { border-color: var(--terracotta); transform: translateY(-4px); box-shadow: 0 8px 16px -10px rgba(185,83,50,.6); }
.bubbles { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding: 8px 0; }
.bubble { width: 96px; height: 96px; border-radius: 50%; border: 2px solid rgba(62,127,166,.35); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px; color: var(--forest-deep); font: inherit;
  background: radial-gradient(circle at 32% 28%, #ffffff 0 14%, #e3f0f7 15% 60%, #cfe3ee 100%); animation: float 4s ease-in-out infinite; transition: transform .2s, opacity .3s; }
.bubble .pic { font-size: 2rem; }
.bubble .face-word { font-size: .78rem; }
.bubble .face-text { font-size: 1.35rem; }
.bubble.popped { transform: scale(.2); opacity: 0; animation: none; }
.bubble.faded { opacity: .35; animation: none; cursor: default; }
.bubble.is-wrong { border-color: var(--terracotta); background: #fbe9e2; animation: nudge .35s; }
@keyframes float { 50% { transform: translateY(-6px); } }
@media (max-width: 420px) { .bubble { width: 80px; height: 80px; } }
.slots.words, .tiles.words { flex-wrap: wrap; }
.slots.words .slot { width: auto; min-width: 64px; height: 50px; padding: 0 10px; font: 700 1.2rem var(--f-body); }
.tiles.words .tile { width: auto; height: 50px; padding: 0 14px; font: 800 1.15rem var(--f-body); }

/* Toast and preview banner */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 40; background: var(--forest-deep); color: var(--card); padding: 12px 20px; border-radius: 999px; font-weight: 800; box-shadow: 0 12px 30px -10px rgba(15,44,35,.6); max-width: calc(100% - 32px); }
.toast span { color: var(--champagne); }
.preview-banner { margin: 0; background: var(--champagne); color: var(--forest-deep); text-align: center; font-size: .85rem; font-weight: 800; padding: 6px max(16px, env(safe-area-inset-right, 0px)) 6px max(16px, env(safe-area-inset-left, 0px)); }

/* Access code */
.plan-note-top { font-size: .85rem; font-weight: 700; color: var(--muted); margin-top: -10px; }
.plan-code { font-size: .9rem; align-self: center; }
.plan-owned { text-align: center; font-weight: 800; color: var(--good); background: var(--good-bg); border-radius: 999px; padding: 12px; }
.btn.is-unlocked { border-color: var(--good); color: var(--good); }
.code-form { display: grid; gap: 8px; margin-top: 16px; }
.code-form label { font-weight: 800; }
.code-form input { font: 700 1.3rem/1.2 var(--f-body); letter-spacing: .12em; text-transform: uppercase; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--ivory); color: var(--forest-deep); width: 100%; }
.code-form input:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px var(--sage); }
.code-form input::placeholder { color: #a5aea8; letter-spacing: .08em; }
.code-msg { min-height: 1.4em; color: var(--terracotta-deep); font-weight: 700; font-size: .92rem; margin: 0 !important; }
.code-form .btn { margin-top: 4px !important; justify-self: start; }
.modal-body .small { margin-top: 16px; font-size: .9rem; }
.modal-body .state-actions .btn, .modal-body .state-actions { margin-top: 12px; }
.selectable { user-select: all; }

/* Modal */
.modal {
  border: 0; border-radius: var(--r-lg); padding: 0; width: min(560px, calc(100% - 32px));
  background: var(--card); color: var(--forest-deep); box-shadow: 0 30px 60px -20px rgba(15,44,35,.5);
}
.modal::backdrop { background: rgba(15, 44, 35, .45); }
.modal-body { padding: 30px 28px 26px; }
.modal-body h2 { font-size: 1.6rem; margin-bottom: 10px; padding-right: 30px; }
.modal-body p { color: #3a5249; margin-top: 10px; }
.modal-body ul, .modal-body ol { margin: 14px 0 0; padding-left: 1.2em; display: grid; gap: 6px; }
.modal-body .btn { margin-top: 20px; }
.modal-img { border-radius: var(--r-md); margin-bottom: 16px; width: 100%; max-width: 240px; aspect-ratio: 150/97; object-fit: cover; }
.modal-tag { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--terracotta); margin-bottom: 6px; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--ivory); font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--forest-deep); }

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