/* GoodMinutes — one stylesheet for every page. Palette from KidsLearn/UI/Theme.swift. */
:root {
  --purple: #615ea8;        /* Theme.purple */
  --purple-deep: #4a4787;   /* Theme.purpleDeep */
  --orange: #e39463;        /* Theme.orange (decoration / fills, never small text on white) */
  --green: #6ba67a;         /* Theme.green */
  --green-text: #3c7049;    /* darker sage for text, AA on cream */
  --ink: #2e2152;           /* Theme.ink */
  --ink-soft: #564d6e;      /* AA-safe version of Theme.inkSoft */
  --bg-top: #ededfa;
  --bg-bottom: #fcf5e6;
  --surface: #ffffff;
  --surface-tint: #f4f3fc;
  --line: rgba(46, 33, 82, 0.12);
  --link: #4f4c99;
  --shadow: 0 6px 20px rgba(46, 33, 82, 0.08);
  --radius: 22px;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --purple: #6d6ab8;
    --ink: #efeaf9;
    --ink-soft: #c5bedb;
    --green-text: #9fd3ab;
    --bg-top: #19142e;
    --bg-bottom: #1f1830;
    --surface: #272043;
    --surface-tint: #2e2650;
    --line: rgba(239, 234, 249, 0.14);
    --link: #b7b4f2;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg-bottom) linear-gradient(180deg, var(--bg-top), var(--bg-bottom) 900px) no-repeat;
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }

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

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 12px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }

/* Header */
.site-header { padding: 14px 0; }
.site-header .wrap { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; color: var(--ink); text-decoration: none; }
.brand svg { width: 44px; height: 44px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.site-nav a { display: inline-block; padding: 8px 12px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 650; }
.site-nav a:hover { background: var(--surface-tint); }
.site-nav a.cta { background: var(--purple); color: #fff; }
.site-nav a.cta:hover { background: var(--purple-deep); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 24px; border-radius: 20px; font-weight: 750; font-size: 1.05rem; text-decoration: none; border: 0; cursor: pointer; }
.btn-primary { background: linear-gradient(180deg, var(--purple), var(--purple-deep)); color: #fff; box-shadow: 0 6px 16px rgba(74, 71, 135, 0.35); }
.btn-secondary { background: var(--surface); color: var(--link); border: 2px solid var(--line); }
.app-store { display: inline-flex; align-items: center; gap: 10px; background: #000; color: #fff; text-decoration: none; padding: 10px 20px 10px 16px; border-radius: 14px; line-height: 1.1; border: 1px solid #555; }
.app-store small { display: block; font-size: 0.72rem; font-weight: 500; }
.app-store strong { display: block; font-size: 1.3rem; font-weight: 650; }


/* Sections */
section { padding: 56px 0; }
.eyebrow { display: inline-block; font-weight: 800; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--green-text); margin-bottom: 8px; }
.lead { font-size: 1.2rem; color: var(--ink-soft); }
.center { text-align: center; }
.section-head { max-width: 680px; margin: 0 auto 32px; text-align: center; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }
.grid { display: grid; gap: 20px; }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 560px) and (max-width: 899px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }

/* Hero */
.hero { padding: 28px 0 56px; }
.hero .wrap { display: grid; gap: 32px; align-items: center; }
@media (min-width: 880px) { .hero .wrap { grid-template-columns: 1.1fr 0.9fr; } }
.hero h1 span { color: var(--purple); }
@media (prefers-color-scheme: dark) { .hero h1 span { color: var(--link); } }
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 24px 0 14px; }
.ticks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-soft); font-weight: 650; }
.ticks li::before { content: "✓ "; color: var(--green-text); font-weight: 900; }
.hero-art { position: relative; display: grid; place-items: center; min-height: 320px; }
.hero-art .blob { position: absolute; inset: 6% 4%; border-radius: 46% 54% 50% 50% / 52% 46% 54% 48%; background: radial-gradient(circle at 30% 30%, rgba(227, 148, 99, 0.35), transparent 60%), radial-gradient(circle at 70% 70%, rgba(107, 166, 122, 0.35), transparent 60%), var(--surface-tint); }
.hero-art .owl { position: relative; width: min(240px, 60%); }
.bubble { position: absolute; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 10px 14px; font-weight: 750; font-size: 0.95rem; }
.bubble.b1 { top: 6%; left: 2%; }
.bubble.b2 { bottom: 10%; right: 0; }
.bubble.b3 { bottom: 18%; left: 0; }
.battery { display: inline-flex; align-items: center; gap: 8px; }
.battery i { display: inline-block; width: 42px; height: 18px; border: 2.5px solid var(--ink); border-radius: 5px; position: relative; background: linear-gradient(90deg, var(--green) 70%, transparent 70%); }
.battery i::after { content: ""; position: absolute; right: -6px; top: 4px; width: 3px; height: 6px; background: var(--ink); border-radius: 0 2px 2px 0; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; }

/* Steps */
.steps { counter-reset: step; }
.step { position: relative; padding-top: 54px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: 20px; left: 26px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 1.25rem; color: #fff; background: var(--purple); }
.step:nth-child(2)::before { background: #a35628; }
.step:nth-child(3)::before { background: var(--green-text); }
@media (prefers-color-scheme: dark) { .step:nth-child(3)::before { background: #3c7049; } }
.step h3 { margin-top: 16px; }

/* Subjects */
.subject { border-top: 8px solid var(--purple); }
.subject.reading { border-top-color: var(--orange); }
.subject.logic { border-top-color: var(--green); }
.subject .emoji { font-size: 2.2rem; line-height: 1; }
.subject ul { padding-left: 1.1em; margin: 0 0 1em; }
.example { background: var(--surface-tint); border-radius: 16px; padding: 12px 14px; font-size: 0.97rem; }
.example strong { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }

/* Feature list */
.feature h3 { display: flex; gap: 10px; align-items: center; }
.feature .ico { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; background: var(--surface-tint); }

.band { background: var(--surface-tint); }
.peace { background: linear-gradient(180deg, var(--purple), var(--purple-deep)); color: #fff; border-radius: 32px; padding: 40px 26px; }
.peace h2, .peace h3 { color: #fff; }
.peace p { color: #f0eefb; }
.peace .card { background: rgba(255, 255, 255, 0.1); box-shadow: none; }
.peace a { color: #fff; }
.peace .eyebrow { color: #ffd9c0; }

/* Pricing */
.plans { align-items: stretch; }
.plan { display: flex; flex-direction: column; text-align: center; border: 2px solid transparent; }
.plan.featured { border-color: var(--purple); position: relative; }
.plan .tag { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--purple); color: #fff; font-weight: 800; font-size: 0.8rem; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.plan .price { font-size: 2.3rem; font-weight: 900; margin: 6px 0 0; }
.plan .per { color: var(--ink-soft); font-weight: 650; }
.plan .trial { margin-top: auto; padding-top: 14px; font-weight: 750; color: var(--green-text); }
.fine { font-size: 0.92rem; color: var(--ink-soft); }

/* FAQ */
.faq details { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 12px; }
.faq summary { cursor: pointer; padding: 18px 52px 18px 22px; font-weight: 750; font-size: 1.08rem; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 1.6rem; font-weight: 700; color: var(--purple); }
@media (prefers-color-scheme: dark) { .faq summary::after { color: var(--link); } }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 22px 18px; color: var(--ink-soft); }
.faq details > div p:last-child { margin-bottom: 0; }

/* Legal / document pages */
.doc { padding: 24px 0 64px; }
.doc .card { padding: clamp(22px, 4vw, 44px); }
.doc h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.doc h2 { font-size: 1.45rem; margin-top: 1.8em; }
.doc h3 { font-size: 1.12rem; margin-top: 1.4em; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin-bottom: 0.35em; }
.meta { color: var(--ink-soft); font-weight: 650; }
.callout { background: var(--surface-tint); border-left: 6px solid var(--green); border-radius: 14px; padding: 16px 18px; margin: 1.2em 0; }
.toc { background: var(--surface-tint); border-radius: 16px; padding: 14px 18px; }
.toc ol { margin: 0; columns: 2 220px; }
table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 0.97rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { font-weight: 800; }
.table-scroll { overflow-x: auto; }

/* Footer */
.site-footer { padding: 40px 0 48px; border-top: 1px solid var(--line); margin-top: 24px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: var(--ink); font-weight: 650; }
.site-footer .copy { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }

.not-found { text-align: center; padding: 40px 0 80px; }
.not-found svg { width: 160px; }

/* ---------- Home page (Adventure Map design) ---------- */
:root {
  --cream: #f7f1df;          /* Treehouse cream */
  --cream-deep: #efe6cc;
  --sage-band: #3e5e3f;
  --on-sage: #f7f1df;
  --device: #2e2152;
}
@media (prefers-color-scheme: dark) {
  :root {
    --cream: #1f1830;
    --cream-deep: #272043;
    --sage-band: #2c4a33;
    --on-sage: #eef3e8;
    --device: #0f0b1d;
  }
}
.home section { padding: 72px 0; }
.home .section-head { margin-bottom: 40px; }
.h-hero { background: var(--cream); }
.h-hero .wrap { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.h-hero-copy { flex: 1 1 440px; min-width: 0; }
.h-hero-copy h1 { text-wrap: balance; }
.h-hero-media { flex: 1 1 360px; min-width: 0; display: flex; justify-content: center; }
.home .actions { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin: 28px 0 0; }
.btn-text { font-weight: 800; color: var(--ink); text-decoration: none; padding: 14px 4px; }
.btn-text:hover { text-decoration: underline; }
.h-ticks { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px 24px; font-weight: 800; }
.h-ticks li::before { content: "✓"; margin-right: 8px; color: var(--green-text); }

.device { background: var(--device); border-radius: 28px; padding: 10px; box-shadow: var(--shadow); }
.device video { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; border-radius: 19px; background: var(--cream); object-fit: cover; }
.device-lg { width: 100%; max-width: 420px; border-radius: 36px; padding: 14px; }
.device-lg video { border-radius: 24px; }

.h-programs { background: var(--cream-deep); }
.program { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.program + .program { margin-top: 72px; }
.program-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: center; text-align: center; }
.program-head h3 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin: 0; }
.program-head p { margin: 0; color: var(--ink-soft); font-size: 1.15rem; }
.stop { width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.4rem; color: #fff; }
.math .stop { background: var(--purple); }
.reading .stop { background: var(--orange); color: #2e2152; }
.logic .stop { background: var(--green); }
.program-media { display: flex; flex-wrap: wrap; gap: 32px; justify-content: center; width: 100%; }
.program-media figure { margin: 0; flex: 1 1 280px; max-width: 400px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.program-media figcaption { text-align: center; font-weight: 800; }

.h-steps { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.h-steps li { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; display: flex; flex-direction: column; gap: 8px; }
.h-steps .num { font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--purple); }
.h-steps li:nth-child(2) .num { color: var(--orange); }
.h-steps li:nth-child(3) .num { color: var(--green-text); }
.h-steps strong { font-size: 1.2rem; }
.h-steps li > span:last-child { color: var(--ink-soft); }

.h-promise { background: var(--sage-band); color: var(--on-sage); text-align: center; }
.h-promise h2 { margin-bottom: 32px; }
.h-promise-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; max-width: 900px; margin: 0 auto 24px; }
.h-promise-grid > div { background: rgba(255, 255, 255, 0.1); border-radius: var(--radius); padding: 26px; }
.h-promise-grid p { margin: 0; }
.h-promise .big { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.h-promise a { color: var(--on-sage); font-weight: 700; }

.h-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin-bottom: 24px; }
.h-plan { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.h-plan h3 { margin: 0; }
.h-plan p { margin: 0; color: var(--ink-soft); }
.h-plan .price { font-size: 2.8rem; font-weight: 800; color: var(--ink); margin-top: 8px; font-variant-numeric: tabular-nums; }
.h-plan.featured { background: var(--device); color: #f7f1df; }
.h-plan.featured p, .h-plan.featured .price { color: #f7f1df; }
.h-plan .tag { display: inline-block; background: var(--orange); color: #2e2152; font-weight: 800; font-size: 0.85rem; padding: 3px 12px; border-radius: 999px; margin-bottom: 8px; }
.home .faq { background: var(--cream-deep); }
