:root {
  --bg: #F1F5F8;
  --surface: #FFFFFF;
  --surface-2: #E6EDF3;
  --ink: #172335;
  --muted: #53627A;
  --line: #D3DDE7;
  --accent: #E4572E;
  --accent-ink: #FFFFFF;
  --sun: #F3B61F;
  --leaf: #3FA34D;
  --sky: #2E86AB;
  --plank: #C98B4F;
  --plank-edge: #A36A36;
  --shadow: 0 1px 0 rgba(23, 35, 53, .06), 0 10px 24px -14px rgba(23, 35, 53, .28);
  --radius: 22px;
  --display: "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --body: "Lexend", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1724; --surface: #172233; --surface-2: #1F2C40; --ink: #EEF2F7; --muted: #A2B0C3;
    --line: #2A3A50; --accent: #FF7A52; --accent-ink: #1A0E08; --plank: #8C5E33; --plank-edge: #6B4524;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 26px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1724; --surface: #172233; --surface-2: #1F2C40; --ink: #EEF2F7; --muted: #A2B0C3;
  --line: #2A3A50; --accent: #FF7A52; --accent-ink: #1A0E08; --plank: #8C5E33; --plank-edge: #6B4524;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 26px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.05; text-wrap: balance; margin: 0; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 8px; }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 20px; }

/* Header */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.5rem/1 var(--display); }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.top-nav { display: flex; gap: 4px; }
.top-nav a { text-decoration: none; font-weight: 500; font-size: .95rem; padding: 8px 12px; border-radius: 999px; color: var(--muted); }
.top-nav a:hover { color: var(--ink); background: var(--surface-2); }
@media (max-width: 520px) { .top-nav a:not(:first-child) { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 1rem/1 var(--body); text-decoration: none; cursor: pointer;
  padding: 14px 22px; border-radius: 999px; border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 60%, #000); }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 60%, #000); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-small { padding: 8px 14px; font-size: .85rem; border-color: var(--line); background: var(--surface); color: var(--ink); }

/* Hero */
.hero { display: flex; flex-direction: column; gap: 28px; padding-block: 28px 48px; }
.banner { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 28px; box-shadow: var(--shadow); background: #5B4BC4; }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; }
.hero-row .lede { margin: 0; }
.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; }
@media (max-width: 600px) { .banner { border-radius: 18px; } .hero { padding-block: 16px 36px; } }
.eyebrow { margin: 0 0 14px; font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); font-weight: 800; letter-spacing: -.01em; }
.hl { color: var(--accent); position: relative; white-space: nowrap; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 34em; margin: 20px 0 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }


/* App tile (icon) */
.tile {
  --c: var(--accent);
  display: grid; place-items: center; overflow: hidden; position: relative;
  border-radius: 22%;
  background:
    radial-gradient(circle at 78% 18%, rgba(255,255,255,.35) 0 16%, transparent 17%),
    radial-gradient(circle at 12% 110%, rgba(0,0,0,.14) 0 34%, transparent 35%),
    var(--c);
  color: #fff; font: 800 1.6rem/1 var(--display);
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.14);
}
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile span { transform: translateY(2px); }

/* Section heads */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; }
.section-head p { margin: 0; color: var(--muted); }

.filter-label { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Apps */
.apps { padding-block: 32px 72px; }

/* App cards */
/* auto-fit: a few apps stretch to fill the row; more apps wrap onto new rows (3 across on desktop) */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
@media (max-width: 380px) { .grid { grid-template-columns: 1fr; } }
.card {
  --c: var(--accent);
  display: flex; flex-direction: column; gap: 16px;
  background: var(--surface); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); border-top: 6px solid var(--c);
  transition: opacity .2s ease, transform .2s ease;
}
.card-head { display: flex; gap: 16px; align-items: center; }
.card-head .tile { width: 72px; height: 72px; flex: none; }
.card-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card-title h3 { font-size: 1.7rem; font-weight: 800; }
.card-tagline { margin: 0; color: var(--muted); }
.pill {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  font-size: .75rem; font-weight: 600; letter-spacing: .04em;
  padding: 4px 10px 4px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink);
}

/* Age ruler: the app's age range on a growth-chart scale */
.ruler { display: flex; flex-direction: column; gap: 6px; }
.ruler-top { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }
.ruler-top b { color: var(--ink); font-weight: 600; }
.ruler-track { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; }
.ruler-track span {
  height: 26px; border-radius: 6px; background: var(--surface-2);
  display: grid; place-items: end center; padding-bottom: 3px;
  font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums;
}
.ruler-track span.on { background: color-mix(in srgb, var(--c) 22%, var(--surface)); color: var(--ink); font-weight: 600; }

.skills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.skills li { font-size: .8rem; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.card-actions .btn { padding: 12px 18px; font-size: .92rem; }
.card-actions .btn-primary { background: var(--ink); color: var(--bg); box-shadow: none; }
.card-actions .soon-note { align-self: center; font-size: .88rem; color: var(--muted); }

/* Parents */
.parents { background: var(--surface); border-block: 1px solid var(--line); padding-block: 64px; }
.promises { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.promises li { display: flex; flex-direction: column; gap: 6px; padding-left: 18px; position: relative; }
.promises li::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 5px; border-radius: 3px; background: var(--c, var(--accent)); }
.promises li:nth-child(1) { --c: var(--leaf); }
.promises li:nth-child(2) { --c: var(--sky); }
.promises li:nth-child(3) { --c: var(--sun); }
.promises li:nth-child(4) { --c: var(--accent); }
.promises b { font: 800 1.35rem/1.1 var(--display); }
.promises span { color: var(--muted); }

/* Footer */
.foot { padding-block: 48px 32px; }
.foot-inner { display: flex; flex-wrap: wrap; gap: 28px 48px; justify-content: space-between; align-items: flex-start; }
.foot-brand { margin: 0; font: 800 1.6rem/1 var(--display); }
.foot-sub { margin: 6px 0 0; color: var(--muted); }
.foot-contact { display: flex; flex-direction: column; gap: 8px; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.email { font-weight: 600; font-size: 1.05rem; word-break: break-all; user-select: all; }
.foot-links a { color: var(--muted); display: inline-block; padding: 12px 0; margin: -12px 0; }
a.email { display: inline-block; padding: 8px 0; margin: -8px 0; }
.foot-legal { margin-top: 36px; font-size: .78rem; color: var(--muted); }

/* App page (app.html): one page per app, filled in from apps.js */
.app-page { --c: var(--accent); display: flex; flex-direction: column; gap: 40px; padding-block: 20px 56px; }
.back-link { align-self: flex-start; text-decoration: none; font-weight: 500; color: var(--muted); padding: 8px 0; margin-bottom: -28px; }
.back-link:hover { color: var(--ink); }
.app-hero {
  display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 32px 48px; align-items: center;
  padding: clamp(22px, 4vw, 40px); border-radius: 28px; border-top: 8px solid var(--c);
  background: color-mix(in srgb, var(--c) 8%, var(--surface)); box-shadow: var(--shadow);
}
.app-hero .showcase { width: 100%; max-width: 440px; justify-self: center; }
@media (max-width: 820px) { .app-hero { grid-template-columns: 1fr; } }
.app-intro { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.app-title { display: flex; gap: 18px; align-items: center; }
.app-title .tile { width: 88px; height: 88px; flex: none; font-size: 2rem; }
.app-title h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 800; }
.app-title p { margin: 4px 0 0; color: var(--muted); }
.app-tagline { margin: 0; font-size: 1.2rem; font-weight: 500; line-height: 1.45; }
.app-desc { margin: 0; color: var(--muted); }
.app-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pill-big { font-size: .9rem; padding: 10px 16px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 0; }
.facts div { background: var(--surface); border-radius: 14px; padding: 12px 14px; }
.facts dt { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; word-break: break-word; }
.features { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 20px; }
.features li { display: flex; gap: 10px; align-items: baseline; }
.features li::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--c); transform: translateY(1px) rotate(45deg); }
.card-title h3 a { text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.app-pkg { margin: 0; font-size: .8rem; color: var(--muted); word-break: break-all; }

/* Hero showcase: fanned screenshots of the featured app */
.showcase { position: relative; display: block; aspect-ratio: 1.15; max-width: 100%; text-decoration: none; }
.fan {
  position: absolute; width: 58%; aspect-ratio: 1; object-fit: cover; border-radius: 22px;
  box-shadow: var(--shadow), 0 24px 40px -24px rgba(23, 35, 53, .45);
  transition: transform .3s ease;
}
.fan-0 { left: 0; top: 14%; transform: rotate(-7deg); z-index: 1; }
.fan-1 { left: 21%; top: 0; transform: rotate(1deg); z-index: 3; }
.fan-2 { right: 0; top: 16%; transform: rotate(8deg); z-index: 2; }
.showcase:hover .fan-0 { transform: rotate(-10deg) translateX(-8px); }
.showcase:hover .fan-2 { transform: rotate(11deg) translateX(8px); }
.showcase:hover .fan-1 { transform: rotate(0deg) translateY(-6px); }
.showcase-tag {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 4;
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 6px 16px 6px 6px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow);
  font-weight: 600; font-size: .95rem;
}
.showcase-tag .tile { width: 34px; height: 34px; font-size: .85rem; border-radius: 50%; }

/* Screenshot thumbnails on cards */
.thumbs { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-decoration: none; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--surface-2); transition: transform .2s ease; }
.thumbs:hover img { transform: translateY(-3px); }
.thumbs-more {
  position: absolute; right: 6px; bottom: 6px; padding: 3px 9px; border-radius: 999px;
  background: rgba(15, 23, 36, .78); color: #fff; font-size: .78rem; font-weight: 600;
}
.pill::before { background: var(--sun); }

/* App page sections */
.app-sec { display: flex; flex-direction: column; gap: 20px; padding-top: 36px; border-top: 1px solid var(--line); scroll-margin-top: 72px; }
.app-sec > h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800; }

/* Benefits */
.benefits { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 14px; }
.benefits li {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 16px;
  background: color-mix(in srgb, var(--c) 10%, var(--surface)); border-left: 5px solid var(--c);
}
.benefits b { font: 800 1.12rem/1.2 var(--display); }
.benefits span { color: var(--muted); font-size: .93rem; }

/* App tour: screenshot and story side by side, alternating; stacked on phones */
.tour { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 36px; width: 100%; max-width: 900px; align-self: center; }
.stop { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; }
.stop:nth-child(even) { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.stop img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 20px; background: var(--surface-2);
  box-shadow: var(--shadow), 0 18px 30px -22px rgba(23, 35, 53, .5);
}
.stop:nth-child(even) img { order: 2; }
.stop-text { display: flex; flex-direction: column; gap: 8px; }
.stop-n { align-self: flex-start; font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c) 18%, var(--surface)); }
.stop h3 { margin: 0; font: 800 clamp(1.35rem, 3.4vw, 1.7rem)/1.1 var(--display); text-wrap: balance; }
.stop p { margin: 0; color: var(--muted); }
@media (max-width: 600px) {
  .stop, .stop:nth-child(even) { grid-template-columns: 1fr; gap: 14px; }
  .stop:nth-child(even) img { order: 0; }
}

/* How to play: numbered steps */
.how { list-style: none; margin: 0; padding: 0; counter-reset: how; display: flex; flex-direction: column; gap: 14px; }
.how li { counter-increment: how; display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; }
.how li::before {
  content: counter(how); grid-row: span 2; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--c); color: #fff; font: 800 1.2rem/1 var(--display);
}
.how b { font-weight: 600; align-self: end; }
.how span { color: var(--muted); font-size: .95rem; }

/* Ending: the download pitch */
.finale {
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  padding: 28px 20px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--c) 12%, var(--surface));
}
.finale .tile { width: 72px; height: 72px; }
.finale h2 { font-size: clamp(1.6rem, 4vw, 2rem); font-weight: 800; }
.finale p { margin: 0; max-width: 34em; color: var(--muted); }
.finale .app-cta { justify-content: center; margin-top: 4px; }

/* Download bar, floating at the bottom of the screen */
.app-bar {
  position: sticky; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 5;
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; margin-top: -16px;
  border-radius: 999px; border: 1px solid var(--line); box-shadow: var(--shadow), 0 16px 30px -18px rgba(23, 35, 53, .5);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
}
.app-bar .tile { width: 44px; height: 44px; flex: none; font-size: .9rem; border-radius: 50%; }
.bar-text { display: flex; flex-direction: column; min-width: 0; margin-right: auto; line-height: 1.25; }
.bar-text b { font-weight: 600; }
.bar-text span { font-size: .8rem; color: var(--muted); }
.app-bar .btn { padding: 12px 26px; }

/* More apps */
.more-apps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.more-apps a {
  display: flex; align-items: center; gap: 14px; height: 100%; padding: 14px; border-radius: 18px; text-decoration: none;
  background: var(--surface); box-shadow: var(--shadow); transition: transform .15s ease;
}
.more-apps a:hover { transform: translateY(-2px); }
.more-apps .tile { width: 56px; height: 56px; flex: none; font-size: 1.1rem; }
.more-apps a > span { display: flex; flex-direction: column; min-width: 0; }
.more-apps b { font: 800 1.2rem/1.2 var(--display); }
.more-apps a > span > span { font-size: .88rem; color: var(--muted); }
.tile:has(img) { box-shadow: 0 0 0 1px var(--line); }
.foot-id { display: flex; align-items: center; gap: 14px; }
.foot-logo { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 0 0 1px var(--line); }

/* Privacy policy page */
.policy { max-width: 760px; padding-block: 48px 72px; display: flex; flex-direction: column; gap: 28px; }
.policy h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 800; }
.policy .eyebrow { margin: 0 0 -20px; }
.policy-date { margin: -18px 0 0; color: var(--muted); }
.policy section { display: flex; flex-direction: column; gap: 10px; }
.policy h2 { font-size: 1.6rem; font-weight: 800; }
.policy p { margin: 0; max-width: 65ch; }
.policy a { color: var(--sky); font-weight: 500; }
.policy-summary { background: var(--surface); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); border-top: 6px solid var(--leaf); }
.policy-summary ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.table-wrap { overflow-x: auto; }
.policy table { width: 100%; min-width: 440px; border-collapse: collapse; background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.policy th, .policy td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.policy thead th { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.policy tbody tr:last-child > * { border-bottom: 0; }
.policy tbody th { font-weight: 600; }
