/* ==========================================================================
   Pictoria Kids — marketing site
   Design system mirrors the real app exactly (lib/core/theme/app_colors.dart):
   deep violet primary, warm gold accent, coral support, warm-neutral ground,
   Fredoka for display type, Nunito for body/UI.
   ========================================================================== */

:root {
  /* ---- Brand palette (light) ---- */
  --primary: #4b2e9e;
  --primary-dark: #34206e;
  --primary-light: #7a5ae0;
  --secondary: #3a8dff;
  --accent: #ffc93c;
  --accent-ink: #5c4300;
  --coral: #ff7a6b;
  --success: #34c77b;

  --bg: #fbf7f1;
  --bg-deep: #f3ebfa;
  --surface: #ffffff;
  --surface-tint: #fdf9ff;
  --border: rgba(75, 46, 158, 0.12);

  --text: #241b3e;
  --text-muted: #6e6484;
  --text-on-primary: #ffffff;

  --shadow-color: 75, 46, 158;

  /* World accents, verbatim from lib/data/content/worlds/*.dart */
  --w-animals: #ff9152;      --w-animals-soft: #ffe7d3;
  --w-dinosaurs: #3fae6b;    --w-dinosaurs-soft: #dcf3e4;
  --w-space: #3a5ae0;        --w-space-soft: #e3e8fb;
  --w-vehicles: #00b4c6;     --w-vehicles-soft: #d8f6f8;
  --w-food: #e8574a;         --w-food-soft: #ffe3de;
  --w-ocean: #0096c7;        --w-ocean-soft: #d2f1fb;
  --w-countries: #e0a100;    --w-countries-soft: #fff3d6;
  --w-nature: #0f9b8e;       --w-nature-soft: #d7f3ef;
  --w-body: #ff6f91;         --w-body-soft: #ffe1ea;
  --w-objects: #a9744f;      --w-objects-soft: #f3e3d3;

  --radius-sm: 16px;
  --radius-md: 24px;
  --radius-lg: 32px;
  --radius-pill: 999px;

  --font-display: "Fredoka", ui-rounded, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #b39dff;
    --primary-dark: #8f78ea;
    --primary-light: #d6c8ff;
    --secondary: #7fb2ff;
    --accent: #ffc93c;
    --accent-ink: #3a2900;
    --coral: #ff9587;
    --success: #6be0a4;

    --bg: #150f28;
    --bg-deep: #1d1638;
    --surface: #221a3d;
    --surface-tint: #271f45;
    --border: rgba(255, 255, 255, 0.1);

    --text: #f2eefb;
    --text-muted: #b6abd6;
    --text-on-primary: #1c1333;

    --shadow-color: 0, 0, 0;

    --w-animals-soft: #3a2a20;   --w-dinosaurs-soft: #1e3327;
    --w-space-soft: #232a4a;     --w-vehicles-soft: #163538;
    --w-food-soft: #3a2320;      --w-ocean-soft: #1a3542;
    --w-countries-soft: #3a2f10; --w-nature-soft: #163530;
    --w-body-soft: #3a2230;      --w-objects-soft: #33261a;
  }
}

:root[data-theme="dark"] {
  --primary: #b39dff;
  --primary-dark: #8f78ea;
  --primary-light: #d6c8ff;
  --secondary: #7fb2ff;
  --accent: #ffc93c;
  --accent-ink: #3a2900;
  --coral: #ff9587;
  --success: #6be0a4;

  --bg: #150f28;
  --bg-deep: #1d1638;
  --surface: #221a3d;
  --surface-tint: #271f45;
  --border: rgba(255, 255, 255, 0.1);

  --text: #f2eefb;
  --text-muted: #b6abd6;
  --text-on-primary: #1c1333;

  --shadow-color: 0, 0, 0;

  --w-animals-soft: #3a2a20;   --w-dinosaurs-soft: #1e3327;
  --w-space-soft: #232a4a;     --w-vehicles-soft: #163538;
  --w-food-soft: #3a2320;      --w-ocean-soft: #1a3542;
  --w-countries-soft: #3a2f10; --w-nature-soft: #163530;
  --w-body-soft: #3a2230;      --w-objects-soft: #33261a;
}

/* ---- Reset ---- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  text-wrap: balance;
  line-height: 1.12;
}

p { max-width: 62ch; }
.center p { margin-inline: auto; }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--primary);
}

/* ---- Nav ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-nav .wrap {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
}
.brand img { height: 32px; width: auto; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  font-weight: 700;
  font-size: 0.94rem;
}
.nav-links a { color: var(--text-muted); transition: color 0.15s; }
.nav-links a:hover { color: var(--primary); }
.nav-cta {
  background: var(--primary);
  color: var(--text-on-primary);
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 0.92rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(var(--shadow-color), 0.5); }
.nav-toggle { display: none; }

/* ---- Hero ---- */
.hero {
  position: relative;
  padding: 84px 0 60px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 620px;
  background: radial-gradient(60% 60% at 30% 20%, color-mix(in srgb, var(--primary-light) 30%, transparent), transparent 70%),
              radial-gradient(50% 50% at 80% 10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero-copy .eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.hero-copy .eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 20%, transparent); }
.hero h1 {
  font-size: clamp(2.4rem, 4.4vw, 3.6rem);
  margin-bottom: 20px;
}
.hero h1 .accent-word { color: var(--primary); }
.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 34px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 30px; }
.store-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--text);
  color: var(--bg);
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-weight: 800;
  transition: transform 0.15s;
}
.store-badge svg { width: 22px; height: 22px; flex: none; }
.store-badge .lines { line-height: 1.2; text-align: left; }
.store-badge .lines small { display: block; font-weight: 600; font-size: 0.68rem; opacity: 0.75; }
.store-badge .lines strong { font-size: 0.95rem; font-family: var(--font-display); }
.store-badge:hover { transform: translateY(-2px); }
.store-badge.soon { opacity: 0.55; cursor: default; }
.store-badge.soon:hover { transform: none; }

.hero-trust { display: flex; flex-wrap: wrap; gap: 20px; font-size: 0.86rem; font-weight: 700; color: var(--text-muted); }
.hero-trust span { display: flex; align-items: center; gap: 7px; }
.hero-trust svg { width: 16px; height: 16px; color: var(--success); flex: none; }

/* ---- Interactive reveal demo ---- */
.reveal-demo {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: 0 30px 60px -24px rgba(var(--shadow-color), 0.35);
  border: 1px solid var(--border);
}
.reveal-demo .demo-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.reveal-demo .demo-label .prompt { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.reveal-demo .demo-label .timer-ring { width: 30px; height: 30px; }
.reveal-stage {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--w-animals-soft);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reveal-stage svg#elephant {
  width: 62%;
  transition: filter 0.15s linear, transform 0.15s linear;
}
.reveal-progress {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-deep);
  margin-top: 16px;
  overflow: hidden;
}
.reveal-progress .fill {
  height: 100%;
  width: 38%;
  background: var(--w-animals);
  border-radius: var(--radius-pill);
  transition: width 0.15s linear, background 0.3s;
}
.reveal-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.reveal-options button {
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  border: 2px solid color-mix(in srgb, var(--w-animals) 45%, transparent);
  background: var(--surface);
  font-weight: 800;
  font-size: 0.88rem;
  transition: all 0.15s;
}
.reveal-options button:hover { border-color: var(--w-animals); transform: translateY(-1px); }
.reveal-options button.correct { background: var(--success); border-color: var(--success); color: #fff; }
.reveal-points {
  position: absolute;
  top: 26px;
  right: 26px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  opacity: 0;
  transform: translateY(6px) scale(0.9);
  transition: opacity 0.35s, transform 0.35s;
}
.reveal-points.show { opacity: 1; transform: translateY(0) scale(1); }

/* ---- Section shell ---- */
section { padding: 96px 0; }
.section-head { max-width: 640px; margin-bottom: 52px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .eyebrow { margin-bottom: 12px; display: block; }
.section-head h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 14px; }
.section-head p { color: var(--text-muted); font-size: 1.06rem; }

/* ---- How it works ---- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  position: relative;
}
.step .step-mark {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--bg-deep);
  color: var(--primary);
  font-family: var(--font-display);
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  font-size: 1.1rem;
}
.step h3 { font-size: 1.08rem; margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: 0.95rem; }

/* ---- Worlds ---- */
.worlds-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.world-chip {
  background: var(--chip-soft);
  border-radius: var(--radius-md);
  padding: 22px 16px;
  text-align: center;
  transition: transform 0.2s;
}
.world-chip:hover { transform: translateY(-4px); }
.world-chip .badge {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--chip-color);
  box-shadow: 0 6px 16px -6px rgba(var(--shadow-color), 0.3);
}
.world-chip .name { font-weight: 800; font-size: 0.92rem; }
.world-chip .tag { font-size: 0.72rem; color: var(--text-muted); font-weight: 700; margin-top: 2px; }

/* ---- Features ---- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px 26px;
}
.feature-card .icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--bg-deep);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.feature-card .icon svg { width: 24px; height: 24px; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: 0.94rem; }

/* ---- Screenshot gallery ---- */
.gallery-shell { position: relative; }
.gallery {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  padding: 10px 4px 26px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.gallery .frame {
  flex: none;
  width: 230px;
  scroll-snap-align: start;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px -18px rgba(var(--shadow-color), 0.4);
  background: var(--surface);
}
.gallery .frame img { width: 100%; }

/* ---- For parents ---- */
.parents-panel {
  background: var(--bg-deep);
  border-radius: var(--radius-lg);
  padding: 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: center;
}
.parents-list { display: grid; gap: 18px; }
.parents-list li { list-style: none; display: flex; gap: 14px; align-items: flex-start; }
.parents-list .tick {
  width: 26px; height: 26px; flex: none;
  border-radius: 50%;
  background: var(--success);
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}
.parents-list .tick svg { width: 14px; height: 14px; color: var(--surface); }
.parents-list strong { display: block; font-size: 0.98rem; }
.parents-list span { color: var(--text-muted); font-size: 0.92rem; }

/* ---- Final CTA ---- */
.final-cta {
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-lg);
  padding: 72px 32px;
  color: var(--text-on-primary);
}
.final-cta h2 { color: inherit; margin-bottom: 14px; }
.final-cta p { color: inherit; opacity: 0.88; margin: 0 auto 32px; }
.final-cta .hero-actions { justify-content: center; }
.final-cta .store-badge { background: rgba(255,255,255,0.16); color: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .final-cta { color: #1c1333; }
}
:root[data-theme="dark"] .final-cta { color: #1c1333; }

/* ---- Footer ---- */
footer {
  border-top: 1px solid var(--border);
  padding: 44px 0;
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
footer .foot-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; white-space: nowrap; }
footer .foot-brand img { height: 24px; }
footer nav { display: flex; flex-wrap: wrap; gap: 12px 26px; font-weight: 700; font-size: 0.9rem; color: var(--text-muted); }
footer nav a { white-space: nowrap; }
footer nav a:hover { color: var(--primary); }
footer .copyright { color: var(--text-muted); font-size: 0.85rem; width: 100%; margin-top: 10px; }

/* ---- Theme toggle ---- */
.theme-toggle {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
}
.theme-toggle svg { width: 19px; height: 19px; color: var(--text); }

/* ---- Reveal-on-scroll ---- */
.reveal-up {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-up.in-view { opacity: 1; transform: translateY(0); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .worlds-grid { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: 1fr; }
  .parents-panel { grid-template-columns: 1fr; padding: 36px 26px; }
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .worlds-grid { grid-template-columns: repeat(2, 1fr); }
  section { padding: 64px 0; }
  .hero { padding: 56px 0 40px; }

  /* Nav bar was wrapping "Pictoria Kids" and "Get the app" onto two lines
     each at narrow widths, ballooning the sticky bar's height. Shrink
     everything down and keep it on one line instead. */
  .site-nav .wrap { height: auto; min-height: 64px; padding: 10px 20px; gap: 10px; }
  .brand { font-size: 0.98rem; white-space: nowrap; gap: 8px; }
  .brand img { height: 26px; }
  .theme-toggle { width: 36px; height: 36px; flex: none; }
  .nav-cta { padding: 9px 14px; font-size: 0.78rem; white-space: nowrap; flex: none; }
}

/* ---- Legal page ---- */
/* Scoped to the <main> element specifically — `.legal .wrap` alone also
   matches the site-nav's and footer's .wrap divs (both are descendants of
   <body class="legal"> too), which blew up the sticky nav's height and made
   it overlap the content below it. */
.legal main.wrap { max-width: 760px; padding-top: 56px; padding-bottom: 90px; }
.legal h1 { font-size: 2.1rem; margin-bottom: 6px; }
.legal .updated { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }
.legal .lede { color: var(--text); font-size: 1.05rem; margin-bottom: 34px; }
.legal .glance {
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  margin-bottom: 44px;
}
.legal .glance h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--primary); margin-bottom: 16px; font-family: var(--font-body); font-weight: 800; }
.legal .glance ul { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.legal .glance li { display: flex; gap: 10px; font-size: 0.94rem; align-items: flex-start; }
.legal .glance .tick { width: 18px; height: 18px; border-radius: 50%; background: var(--success); flex: none; margin-top: 2px; display:flex; align-items:center; justify-content:center; }
.legal .glance .tick svg { width: 10px; height: 10px; color: var(--surface); }
.legal section.doc { margin-bottom: 36px; padding-top: 30px; border-top: 1px solid var(--border); }
.legal section.doc:first-of-type { border-top: none; padding-top: 0; }
.legal h2.doc-title { font-size: 1.25rem; margin-bottom: 12px; }
.legal p, .legal li { color: var(--text); max-width: 66ch; }
.legal ul.plain { padding-left: 20px; margin-top: 8px; }
.legal ul.plain li { margin-bottom: 8px; color: var(--text-muted); }
@media (max-width: 560px) {
  .legal .glance ul { grid-template-columns: 1fr; }
}
