/* Maths Rocket — public site, drawn in the app's own style so the two feel
   like one product (frontend/src/theme.js LIGHT, components/ui.js,
   components/parent/ParentUi.js, screens/Landing.js):
   - colours: the LIGHT palette, the same names as in theme.js;
   - type: Nunito, body 600, headings and buttons 800 (fonts.js);
   - buttons: radius 18 (R.lg), 800 weight, ghost = 1.5px line border;
   - cards: white, radius 24 (R.xl), no border, soft blue shadow (S.card);
   - banners: the blue-to-indigo gradient of Landing / Parent Area pages;
   - pills: knowledgeSoft fill, knowledgeDark text, fully round. */
:root {
  --blue: #2563eb;          /* knowledge */
  --blue-dark: #1e3a8a;     /* knowledgeDark */
  --blue-soft: #e8f0fe;     /* knowledgeSoft */
  --green: #006c49;         /* success */
  --green-soft: #d9f2e5;    /* successSoft */
  --amber-text: #784b00;    /* action */
  --amber-soft: #fdecc8;    /* actionLight */
  --canvas: #f7f9fb;        /* canvas */
  --page: #f1f4f9;          /* Landing page background */
  --card: #ffffff;
  --text: #0f172a;
  --body: #334155;          /* slate700 */
  --muted: #5e6b80;         /* slatey */
  --line: #e2e8f0;
  --soft: #f1f5f9;
  --grad: linear-gradient(135deg, #3b82f6, #6366f1); /* Landing / ParentPage banner */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --shadow: 0 4px 12px rgba(37, 99, 235, 0.1);       /* S.card */
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.08);
  --max: 1080px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: "Nunito", -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  font-weight: 600;
}

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

h1, h2, h3 { color: var(--text); line-height: 1.2; font-weight: 800; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 6vw, 3rem); }
h2 { font-size: clamp(1.45rem, 4vw, 2rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

a { color: var(--blue); text-underline-offset: 3px; font-weight: 700; }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 16px; top: -100px;
  background: var(--card); color: var(--blue-dark); padding: 10px 16px; border-radius: var(--r-md);
  font-weight: 800; z-index: 100; box-shadow: var(--shadow);
}
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }

/* Header: the app's top bar (Landing): the icon tile, the name, a pill. */
.site-header { background: rgba(255, 255, 255, 0.94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
@supports (backdrop-filter: blur(8px)) { .site-header { backdrop-filter: blur(8px); } }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.brand:hover { color: var(--text); }
.brand img { width: 40px; height: 40px; border-radius: var(--r-md); border: 2px solid #fff; box-shadow: var(--shadow-sm); }
.nav { display: flex; gap: 4px 14px; flex-wrap: wrap; align-items: center; }
.nav a { color: var(--body); text-decoration: none; font-weight: 800; font-size: 0.95rem; padding: 8px 4px; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { color: var(--blue); }
.nav .btn { padding: 9px 14px; min-height: 44px; font-size: 0.85rem; color: #fff; }
.nav .btn:hover { color: #fff; }
/* Sign in: the app's ghost button (outline in the line colour), beside "Create account". */
.nav .nav-signin { padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 18px; background: var(--card); color: var(--blue); font-size: 0.85rem; }
.nav .nav-signin:hover { border-color: var(--blue); }
/* Phones: the logo alone, and the two buttons a little smaller, so the header
   stays on one line down to 320 px without running off the screen. */
@media (max-width: 440px) {
  .brand-name { display: none; }
  .nav { gap: 8px; }
  .nav .btn, .nav .nav-signin { padding: 8px 12px; font-size: 0.82rem; }
}
/* Phones: the big decorative logo in the hero is left out (it pushed the
   buttons and prices a screen further down). */
@media (max-width: 640px) { .hero-art { display: none; } }
/* Wide tables scroll inside their box on a phone, never the page. */
@media (max-width: 640px) {
  .prose table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
.hero-signin { margin: 10px 0 0; font-weight: 700; }
.hero-signin a { color: #fff; font-weight: 800; }
@media (max-width: 640px) {
  .nav .hide-sm { display: none; }
  .site-header .wrap { flex-wrap: nowrap; gap: 12px; }
  .nav .btn { padding: 9px 12px; }
  .brand { gap: 10px; font-size: 1.05rem; white-space: nowrap; }
  .brand img { width: 36px; height: 36px; border-radius: 12px; }
  .nav { flex-wrap: nowrap; gap: 10px; }
  .nav a { white-space: nowrap; }
}
/* Below 361 px "Sign in" no longer fits beside the logo, "Create account"
   and ☰: it lives in the menu only. */
@media (max-width: 360px) { .nav > .nav-signin { display: none; } }

/* ☰ menu (phones only): a <details>, so it opens and closes without
   JavaScript. The toggle is the ghost button of "Sign in"; the panel is a
   card dropped under the header (positioned against the sticky header). */
.menu { display: none; }
.menu > summary {
  list-style: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1.5px solid var(--line); border-radius: var(--r-lg);
  background: var(--card); color: var(--text); font-size: 1.25rem; line-height: 1; cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::marker { content: ""; }
.menu > summary:hover, .menu[open] > summary { border-color: var(--blue); color: var(--blue-dark); background: var(--blue-soft); }
.menu-panel {
  position: absolute; left: 16px; right: 16px; top: calc(100% + 8px);
  display: grid; gap: 2px; padding: 8px; background: var(--card); border-radius: var(--r-lg);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16), var(--shadow);
}
.nav .menu-panel a {
  display: flex; align-items: center; min-height: 44px; padding: 10px 14px; border-radius: 12px;
  color: var(--text); font-size: 1rem; white-space: normal;
}
.nav .menu-panel a:hover, .nav .menu-panel a[aria-current="page"] { background: var(--soft); color: var(--blue-dark); }
.nav .menu-panel .menu-signin { color: var(--blue); }
.nav .menu-panel .menu-cta { justify-content: center; background: var(--blue); color: #fff; margin: 2px 0 6px; border-radius: var(--r-lg); }
.nav .menu-panel .menu-cta:hover { background: var(--blue-dark); color: #fff; }
@media (max-width: 640px) { .menu { display: block; } }

/* Buttons: ui.js Btn / GhostBtn */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 13px 20px; border-radius: var(--r-lg);
  background: var(--blue); color: #fff; font-weight: 800; text-decoration: none; border: 0;
  font-size: 0.95rem; line-height: 1.2; text-align: center;
}
.btn:hover { background: var(--blue-dark); color: #fff; }
.btn-ghost { background: var(--card); color: var(--muted); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: var(--blue-soft); color: var(--blue-dark); }
/* White on a gradient banner: the app's hero call to action (heroCtaBg / heroCtaText). */
.btn-light { background: #fff; color: var(--blue); box-shadow: var(--shadow-sm); }
.btn-light:hover { background: var(--blue-soft); color: var(--blue-dark); }

.store-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 20px; }
.store {
  display: inline-flex; flex-direction: column; justify-content: center; min-height: 46px; padding: 6px 18px;
  border-radius: var(--r-lg); background: #0f172a; color: #fff; text-decoration: none; line-height: 1.2;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
}
.store small { font-size: 0.72rem; font-weight: 700; opacity: 0.85; }
.store strong { font-size: 1.02rem; font-weight: 800; }
a.store:hover { background: #1e293b; color: #fff; }
.store.soon { background: rgba(255, 255, 255, 0.14); color: #fff; border-style: dashed; cursor: default; }

/* Gradient banner: Landing's "Who are you?" and every Parent Area page head. */
.banner { background: var(--grad); color: #fff; border-radius: var(--r-xl); padding: 24px 20px; }
.banner h1, .banner h2 { color: #fff; }
.banner p { color: rgba(255, 255, 255, 0.9); }

/* Hero */
.hero { padding: 20px 0 8px; }
.hero .banner { padding: 32px 22px; }
.hero h1 { font-weight: 900; }
.hero .lead { color: rgba(255, 255, 255, 0.92); font-size: 1.1rem; max-width: 40em; }
.hero .eyebrow { background: rgba(255, 255, 255, 0.22); color: #fff; }
.hero-grid { display: grid; gap: 28px; align-items: center; }
.hero-art { justify-self: center; }
.hero-art img { width: 140px; height: 140px; border-radius: 32px; border: 4px solid #fff; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.25); }
.hero .fine { color: rgba(255, 255, 255, 0.85); font-size: 0.9rem; margin: 14px 0 0; }
@media (min-width: 820px) {
  .hero { padding-top: 28px; }
  .hero .banner { padding: 48px 44px; }
  .hero-grid { grid-template-columns: 1.5fr 1fr; }
  .hero-art img { width: 240px; height: 240px; border-radius: 52px; }
}

/* Eyebrow = the app's Pill */
.eyebrow {
  display: inline-flex; align-items: center; font-size: 0.8rem; font-weight: 800; line-height: 1.3;
  padding: 6px 12px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); margin-bottom: 12px;
}

/* Sections */
section { padding: 48px 0; }
section.alt { background: var(--page); }
.section-head { max-width: 46em; margin-bottom: 24px; }
.muted { color: var(--muted); }

.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* Cards: S.card */
.card { background: var(--card); border-radius: var(--r-xl); padding: 20px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: 6px; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
/* The picture square of a NavCard / HomeTile */
.icon { font-size: 1.7rem; line-height: 1; display: inline-flex; width: 52px; height: 52px; align-items: center; justify-content: center; background: var(--blue-soft); border-radius: var(--r-lg); margin-bottom: 12px; }

/* What you get: compact rows (icon + title + one line), 1 / 2 / 3 columns. */
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (min-width: 960px) { .features { grid-template-columns: repeat(3, 1fr); } }
.features li { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow); }
.features .icon { width: 44px; height: 44px; font-size: 1.4rem; margin: 0; flex-shrink: 0; border-radius: var(--r-md); }
.features h3 { font-size: 1rem; margin: 0 0 2px; }
.features p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.45; }

/* Pricing: the Paywall's compact plan cards, in two groups. */
.plan-groups { display: grid; gap: 28px; }
@media (min-width: 900px) {
  .plan-groups { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  /* Side by side, the cards of both groups start on the same line. */
  .plan-group { display: flex; flex-direction: column; }
  .plan-group .group-sub { flex-grow: 1; }
}
.group-title { font-size: 1.1rem; margin: 0 0 2px; }
.group-sub { color: var(--muted); font-size: 0.92rem; margin: 0 0 18px; }
.plans { display: grid; gap: 18px 12px; grid-template-columns: 1fr; }
@media (min-width: 340px) { .plans { grid-template-columns: repeat(2, 1fr); } }
.plan {
  position: relative; background: var(--card); border: 2px solid transparent; border-radius: var(--r-xl); padding: 16px 14px 14px;
  display: flex; flex-direction: column; box-shadow: 0 3px 10px rgba(37, 99, 235, 0.08); min-width: 0;
}
.plan.best { border-color: var(--blue); background: var(--blue-soft); }
.plan .tag { position: absolute; top: -13px; right: 12px; background: var(--amber-soft); color: var(--amber-text); font-size: 0.78rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.plan h4 { font-size: 1rem; font-weight: 800; color: var(--text); margin: 0; line-height: 1.25; }
.price { font-size: 1.6rem; font-weight: 900; color: var(--text); margin: 4px 0 0; line-height: 1.2; }
.price span { font-size: 0.92rem; color: var(--muted); font-weight: 700; }
.plan .desc { color: var(--body); font-size: 0.88rem; line-height: 1.4; margin: 6px 0 0; }
.plan-terms { color: var(--muted); font-size: 0.88rem; margin: 22px 0 0; }

/* FAQ: cards */
.faq details { background: var(--card); border-radius: var(--r-lg); margin-bottom: 10px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 800; color: var(--text); min-height: 48px; list-style: none; border-radius: var(--r-lg); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
/* The app's chevron (C.chevron), turning down when open */
.faq summary::after { content: "›"; color: var(--muted); font-size: 1.5rem; line-height: 1; transition: transform 0.15s; flex-shrink: 0; }
.faq details[open] summary::after { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .faq summary::after { transition: none; } }
.faq details[open] summary { border-bottom: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.faq .answer { padding: 14px 18px 4px; }

/* CTA band */
.cta-band { background: var(--grad); color: #fff; border-radius: var(--r-xl); padding: 32px 22px; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255, 255, 255, 0.92); }
.cta-band .store-row { justify-content: center; }

/* Prose pages (privacy, terms, delete, support): a Parent Area page head */
.page-head { padding: 20px 0 0; }
.page-head .banner { padding: 24px 22px; }
.page-head h1 { font-size: clamp(1.6rem, 5vw, 2.3rem); margin-bottom: 4px; }
.page-head p { margin: 0; }
.prose { padding: 28px 16px 56px; }
.prose h2 { font-size: 1.4rem; margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.45em; }
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 0 0 1.2em; background: var(--card); font-size: 0.95rem; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th + th, .prose td + td { border-left: 1px solid var(--line); }
.prose tr:last-child td { border-bottom: 0; }
.prose th { background: var(--soft); color: var(--text); font-weight: 800; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.note { background: var(--blue-soft); color: var(--blue-dark); border-radius: var(--r-lg); padding: 14px 18px; margin: 0 0 1.2em; }
.note.ok { background: var(--green-soft); color: var(--green); }
.note.warn { background: var(--amber-soft); color: var(--amber-text); }
.note p:last-child { margin-bottom: 0; }
.path { font-weight: 800; color: var(--text); }
.toc { background: var(--card); border-radius: var(--r-lg); padding: 14px 20px; margin-bottom: 8px; box-shadow: var(--shadow); }
.toc ol { margin: 0; }

/* Footer: light, like the app's pages */
.site-footer { background: var(--page); border-top: 1px solid var(--line); color: var(--muted); padding: 32px 0; font-size: 0.93rem; }
.site-footer a { color: var(--blue); }
.site-footer .wrap { display: grid; gap: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer nav a { min-height: 44px; display: inline-flex; align-items: center; color: var(--body); font-weight: 800; text-decoration: none; }
.site-footer nav a:hover { color: var(--blue); }
.site-footer p { margin: 0; }

/* 404 */
.not-found { text-align: center; padding: 80px 0; }
.not-found .big { font-size: 4rem; line-height: 1; margin-bottom: 12px; }
