/* Malilu World — website
   The roles come from docs/40-malilu-world-design-system.md and
   Malilu/Design/Tokens.swift, so the site and the app stay one thing.
   One light scheme, deliberately: the violet world is not inverted. */

:root {
  /* The logo's seven hues */
  --purple: #A577FA;
  --sunshine: #FDC745;
  --bubblegum: #F888B9;
  --mint: #3CDBBC;
  --sky: #62A4FB;
  --lilac: #E588F2;
  --hot-pink: #FC2B80;
  --tangerine: #FF9F5A;

  /* Grounds */
  --ground: #5B3FD0;
  --ground-deep: #3E2BAA;
  --card: #4A31BE;
  --card-selected: #6E55E0;
  --night: #1E1B7A;
  --band-on-night: #2A1F96;
  --pill-on-night: #3628BA;

  /* Actions */
  --cta: #3CDBBC;
  --cta-down: #24B99D;
  --accent: #FC2B80;
  --accent-deep: #E0136B;

  /* Grown-up surfaces */
  --mist: #F1EAFE;
  --mist-deep: #DCCDFB;
  --ink: #23324A;
  --ink-soft: #4A5670;
  --paper: #FFFFFF;

  --on-ground: #FFFFFF;
  --on-ground-soft: rgba(255, 255, 255, 0.82);

  /* Layout: three radii only, as in the app */
  --r-sm: 12px;
  --r-md: 22px;
  --r-lg: 32px;
  --gutter: 20px;
  --max: 1120px;
  --lip: 4px; /* the solid lip under a button */

  --font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------------------------------------------------------------- base */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  margin: 0 0 12px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 900;
}

h1 { font-size: clamp(30px, 5.4vw, 52px); }
h2 { font-size: clamp(25px, 3.6vw, 38px); }
h3 { font-size: clamp(19px, 2.2vw, 23px); }

p { margin: 0 0 14px; }

a { color: inherit; }

ul { margin: 0 0 14px; padding-left: 1.15em; }
li { margin: 6px 0; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 0 0 var(--r-sm) 0;
  z-index: 100;
  font-weight: 800;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--sunshine);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 13px 26px;
  border: 0;
  border-radius: var(--r-md);
  font: inherit;
  font-weight: 900;
  font-size: 17px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.btn--cta {
  background: var(--cta);
  color: var(--ink);
  box-shadow: 0 var(--lip) 0 var(--cta-down);
}
.btn--cta:hover { background: #4ee3c6; }
.btn--cta:active { transform: translateY(var(--lip)); box-shadow: 0 0 0 var(--cta-down); }

.btn--ghost {
  background: transparent;
  color: var(--on-ground);
  box-shadow: inset 0 0 0 2.5px rgba(255, 255, 255, 0.55);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.12); }

.btn--ink {
  background: var(--ground);
  color: #fff;
  box-shadow: 0 var(--lip) 0 var(--ground-deep);
}
.btn--ink:hover { background: #6748dd; }
.btn--ink:active { transform: translateY(var(--lip)); box-shadow: 0 0 0 var(--ground-deep); }

.btn--block { width: 100%; }

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ---------------------------------------------------------------- chrome */

.announce {
  background: var(--cta);
  color: var(--ink);
  font-weight: 800;
  text-align: center;
  padding: 11px var(--gutter);
  font-size: 15.5px;
}
.announce a {
  color: var(--ink);
  text-underline-offset: 3px;
  font-weight: 900;
  white-space: nowrap;
}
.announce span { margin-right: 10px; }

.topbar { padding: 10px var(--gutter) 0; }

.nav {
  max-width: var(--max);
  margin: 0 auto;
  background: var(--ground);
  border-radius: var(--r-lg);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--on-ground);
}

.nav__logo { display: flex; align-items: center; flex: 0 0 auto; }
.nav__logo img { width: 122px; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.nav__links a {
  display: block;
  padding: 9px 13px;
  border-radius: var(--r-sm);
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  white-space: nowrap;
  color: var(--on-ground);
}
.nav__links a:hover { background: rgba(255, 255, 255, 0.14); }
.nav__links a[aria-current="page"] { background: var(--ground-deep); }

.nav__end { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.nav__lang {
  display: inline-flex;
  align-items: center;
  padding: 9px 13px;
  border-radius: var(--r-sm);
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  background: var(--pill-on-night);
  color: #fff;
}
.nav__lang:hover { background: var(--ground-deep); }

.nav .btn { min-height: 46px; padding: 10px 22px; font-size: 16px; }

.nav__toggle {
  display: none;
  background: var(--pill-on-night);
  border: 0;
  color: #fff;
  border-radius: var(--r-sm);
  min-height: 46px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 960px) {
  .nav { flex-wrap: wrap; }
  .nav__toggle { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
  .nav__links {
    order: 3;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-top: 10px;
  }
  .nav__links[hidden] { display: none; }
  .nav__links a { padding: 12px 14px; }
  .nav__end { order: 2; }
  .nav .btn { padding: 10px 16px; }
  .nav__logo img { width: 104px; }
}

/* ----------------------------------------------------------------- hero */

.hero {
  background: var(--ground);
  color: var(--on-ground);
  margin: 10px var(--gutter) 0;
  border-radius: var(--r-lg);
  padding: clamp(32px, 5vw, 64px) 0 0;
  overflow: hidden;
}
.hero > .wrap { max-width: calc(var(--max) - 2 * var(--gutter)); }

.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: end;
}

.hero__kicker {
  display: inline-block;
  background: var(--sunshine);
  color: var(--ink);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.hero h1 { color: #fff; margin-bottom: 16px; }
.hero__body { color: var(--on-ground-soft); font-size: 18.5px; max-width: 46ch; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 10px;
}
.hero__note { color: var(--on-ground-soft); font-size: 14.5px; margin-bottom: 36px; }

.hero__art { position: relative; text-align: center; padding-bottom: 0; }
.hero__art img { width: min(300px, 78%); margin: 0 auto; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.28)); }

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; gap: 8px; }
  .hero__art img { width: min(230px, 62%); }
  .hero__note { margin-bottom: 20px; }
}

/* -------------------------------------------------------------- sections */

.section { padding: clamp(40px, 5.5vw, 76px) 0; }
.section--tight { padding: clamp(28px, 3.5vw, 48px) 0; }

.section__head { max-width: 62ch; margin-bottom: 30px; }
.section__head p { color: var(--ink-soft); font-size: 18px; }

.section--night {
  background: var(--night);
  color: #fff;
  margin: 0 var(--gutter);
  border-radius: var(--r-lg);
}
.section--night .section__head p { color: rgba(255, 255, 255, 0.8); }

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 22px 22px 24px;
  box-shadow: 0 2px 0 var(--mist-deep);
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-soft); margin: 0; font-size: 16px; }

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* Numbered steps */
.step { position: relative; padding-top: 10px; }
.step__n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--sunshine);
  color: var(--ink);
  font-weight: 900;
  margin-bottom: 12px;
}

/* Stat tiles */
.stat {
  background: var(--band-on-night);
  border-radius: var(--r-md);
  padding: 20px;
  text-align: center;
}
.stat__v { display: block; font-size: 34px; font-weight: 900; color: var(--sunshine); line-height: 1.1; }
.stat__l { display: block; font-size: 15px; color: rgba(255, 255, 255, 0.82); margin-top: 6px; }

/* Buddy cards */
.buddy {
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 16px 14px 20px;
  text-align: center;
  box-shadow: 0 2px 0 var(--mist-deep);
}
.buddy img { width: 118px; margin: 0 auto 10px; }
.buddy__n { font-weight: 900; font-size: 19px; }
.buddy__r { color: var(--ink-soft); font-size: 15px; margin: 2px 0 8px; }
.buddy__v { font-size: 13.5px; color: var(--ink-soft); }

/* Category + age tiles */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.tile {
  display: block;
  border-radius: var(--r-md);
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 var(--lip) 0 rgba(0, 0, 0, 0.14);
  transition: transform 0.12s ease;
}
.tile:hover { transform: translateY(-2px); }
.tile:active { transform: translateY(var(--lip)); box-shadow: 0 0 0 rgba(0, 0, 0, 0.14); }
.tile__t { font-weight: 900; font-size: 19px; display: block; }
.tile__c { font-size: 14.5px; opacity: 0.78; font-weight: 700; }
.tile__b { font-size: 15px; margin-top: 8px; display: block; opacity: 0.86; }

.tile--firstYear { background: var(--hot-pink); color: #fff; }
.tile--letters { background: var(--sky); }
.tile--numbers { background: var(--sunshine); }
.tile--shapes { background: var(--lilac); }
.tile--words { background: var(--purple); }
.tile--memory { background: var(--mint); }
.tile--feelings { background: var(--bubblegum); }
.tile--making { background: var(--tangerine); }

.ages { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.age {
  display: block;
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 18px 16px;
  text-decoration: none;
  color: var(--ink);
  text-align: center;
  box-shadow: 0 2px 0 var(--mist-deep);
  transition: transform 0.12s ease;
}
.age:hover { transform: translateY(-2px); }
.age__n { display: block; font-size: 34px; font-weight: 900; color: var(--ground); line-height: 1.05; }
.age__l { display: block; font-size: 14.5px; color: var(--ink-soft); }
.section--night .age { background: var(--band-on-night); color: #fff; box-shadow: none; }
.section--night .age__n { color: var(--sunshine); }
.section--night .age__l { color: rgba(255, 255, 255, 0.8); }

/* Game list */
.games { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); list-style: none; padding: 0; margin: 0; }
.game {
  background: var(--paper);
  border-radius: var(--r-sm);
  padding: 13px 16px;
  box-shadow: 0 2px 0 var(--mist-deep);
  margin: 0;
}
.game__t { font-weight: 800; display: block; }
.game__i { color: var(--ink-soft); font-size: 14.5px; }
.more { color: var(--ink-soft); font-size: 15px; margin-top: 14px; }

/* Pricing */
.plans { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.plan {
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 26px 24px;
  box-shadow: 0 2px 0 var(--mist-deep);
}
.plan--featured { box-shadow: 0 0 0 3px var(--cta), 0 var(--lip) 0 var(--cta-down); }
.plan__n { font-weight: 900; font-size: 20px; }
.plan__p { font-size: 40px; font-weight: 900; line-height: 1.1; margin: 8px 0 0; }
.plan__per { font-size: 16px; color: var(--ink-soft); font-weight: 700; }
.plan__note { color: var(--ink-soft); font-size: 15px; margin: 10px 0 16px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 20px; }
.plan li { padding-left: 26px; position: relative; font-size: 16px; }
.plan li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.62em;
  width: 15px; height: 8px;
  border-left: 3px solid var(--cta-down);
  border-bottom: 3px solid var(--cta-down);
  transform: rotate(-45deg);
}

.promises { list-style: none; padding: 0; }
.promises li { padding-left: 30px; position: relative; font-size: 17px; }
.promises li::before {
  content: "";
  position: absolute;
  left: 2px; top: 0.55em;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--hot-pink);
  box-shadow: inset 0 0 0 4px var(--mist);
}
.section--night .promises li::before { box-shadow: inset 0 0 0 4px var(--night); }

/* Callout + FAQ */
.callout {
  background: var(--paper);
  border-radius: var(--r-lg);
  padding: clamp(26px, 4vw, 44px);
  text-align: center;
}
.callout p { color: var(--ink-soft); max-width: 58ch; margin-left: auto; margin-right: auto; }

details.faq {
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin-bottom: 10px;
  box-shadow: 0 2px 0 var(--mist-deep);
}
details.faq summary {
  font-weight: 900;
  cursor: pointer;
  list-style: none;
  padding-right: 28px;
  position: relative;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  position: absolute;
  right: 0; top: -2px;
  font-size: 24px;
  color: var(--ground);
  line-height: 1;
}
details.faq[open] summary::after { content: "−"; }
details.faq p { margin: 10px 0 0; color: var(--ink-soft); }

.prose { max-width: 70ch; }
.prose h2 { margin-top: 34px; }
.prose a { color: var(--ground); }
.prose table { border-collapse: collapse; width: 100%; font-size: 16px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1.5px solid var(--mist-deep); vertical-align: top; }
.prose .box {
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 18px 22px;
  box-shadow: 0 2px 0 var(--mist-deep);
  margin: 18px 0;
}
.prose .updated { color: var(--ink-soft); font-size: 15px; }

.breadcrumb { font-size: 15px; color: var(--ink-soft); margin-bottom: 14px; }
.breadcrumb a { color: var(--ground); }

.pagehead {
  background: var(--ground);
  color: #fff;
  margin: 10px var(--gutter) 0;
  border-radius: var(--r-lg);
  padding: clamp(28px, 4vw, 52px) 0;
}
.pagehead h1 { color: #fff; }
.pagehead p { color: var(--on-ground-soft); font-size: 18px; max-width: 58ch; }
.pagehead .breadcrumb { color: var(--on-ground-soft); }
.pagehead .breadcrumb a { color: #fff; }
.pagehead__meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chip {
  background: var(--pill-on-night);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 15px;
  font-weight: 800;
}
.chip--sun { background: var(--sunshine); color: var(--ink); }

/* --------------------------------------------------------------- footer */

.footer {
  background: var(--night);
  color: #fff;
  margin-top: 40px;
  padding: 48px 0 32px;
}
.footer__grid { display: grid; gap: 28px; grid-template-columns: 1.4fr 1fr 1fr; }
.footer img { width: 132px; margin-bottom: 12px; }
.footer p { color: rgba(255, 255, 255, 0.76); font-size: 15.5px; max-width: 34ch; }
.footer h4 { font-size: 16px; margin-bottom: 10px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer a { color: rgba(255, 255, 255, 0.86); text-decoration: none; font-size: 15.5px; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer__legal {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: space-between;
}
@media (max-width: 720px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
