/* Math Drills website. Colours, type and shapes mirror the app's design system
   (core/designsystem: ColorSchemes.kt, Color.kt, Type.kt, Tokens.kt). */

@font-face {
  font-family: "Google Sans Flex";
  src: url("/assets/fonts/GoogleSansFlex.ttf") format("truetype");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* BlueLight */
  --primary: #0055d4;
  --on-primary: #ffffff;
  --primary-container: #e1e0ff;
  --on-primary-container: #001849;
  --secondary-container: #e1e0ff;
  --on-secondary-container: #10193d;
  --background: #f9f9ff;
  --on-surface: #1b1b1f;
  --on-surface-variant: #464652;
  --outline: #767683;
  --outline-variant: #c6c5d4;
  --surface-container-low: #f3f3f9;
  --surface-container: #eeedf3;
  --surface-container-high: #e8e8ed;
  --surface-container-lowest: #ffffff;

  /* Hero card: the app's blue drill card */
  --hero: #0055d4;
  --on-hero: #ffffff;
  --on-hero-variant: #dfe2ff;
  --hero-button: #c0c1ff;
  --on-hero-button: #002b74;
  --hero-blob: rgba(255, 255, 255, 0.10);

  /* LightAccents */
  --blue: #0059de;
  --green: #007330;
  --orange: #a64600;
  --purple: #693ded;
  --teal: #007060;
  --pink: #bf0973;
  --amber: #8c5800;
  --rose: #c7003f;
  --accent-alpha: 12%;

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --max: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* BlueDark */
    --primary: #c0c1ff;
    --on-primary: #002b74;
    --primary-container: #003fa3;
    --on-primary-container: #e1e0ff;
    --secondary-container: #40436d;
    --on-secondary-container: #e1e0ff;
    --background: #131317;
    --on-surface: #e2e2e8;
    --on-surface-variant: #c6c5d4;
    --outline: #908f9d;
    --outline-variant: #464652;
    --surface-container-low: #1b1b1f;
    --surface-container: #1f1f23;
    --surface-container-high: #2a292e;
    --surface-container-lowest: #0e0e13;

    --hero: #0047b3;
    --hero-blob: rgba(255, 255, 255, 0.07);

    /* DarkAccents */
    --blue: #c0c1ff;
    --green: #63de80;
    --orange: #ffb68d;
    --purple: #d5baff;
    --teal: #00dfc1;
    --pink: #ffafcf;
    --amber: #ffb860;
    --rose: #ffb2b4;
    --accent-alpha: 22%;
  }
}

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

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

body {
  margin: 0;
  background: var(--background);
  color: var(--on-surface);
  font-family: "Google Sans Flex", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variation-settings: "opsz" 18, "ROND" 0;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

/* Headlines use the rounded display cut, as in the app's MathsTypography. */
h1, h2, h3, .display, .brand-name, .stat-number, .price {
  font-variation-settings: "opsz" 40, "ROND" 100;
  letter-spacing: -0.01em;
}

h1, h2, h3 { margin: 0; line-height: 1.15; }

a { color: var(--primary); text-underline-offset: 3px; }

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

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

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--surface-container-high); padding: 8px 16px; border-radius: 999px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--outline-variant) 50%, transparent);
}

.header-row { display: flex; align-items: center; gap: 16px; height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--on-surface); text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 12px; }
.brand-name { font-size: 20px; font-weight: 700; }

.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a {
  color: var(--on-surface-variant);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 999px;
}
.nav a:hover, .nav a[aria-current="page"] { background: var(--secondary-container); color: var(--on-secondary-container); }

@media (max-width: 640px) {
  .nav .hide-sm { display: none; }
  .nav a { padding: 8px 10px; }
}

/* ---------- Buttons & pills ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 28px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: border-radius 160ms ease, transform 160ms ease;
}
.btn:active { border-radius: 16px; transform: scale(0.98); }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-hero { background: var(--hero-button); color: var(--on-hero-button); }
.btn-ghost { color: var(--on-hero); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-hero) 45%, transparent); }
.btn-primary { background: var(--primary); color: var(--on-primary); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ---------- Hero ---------- */

.hero { padding-top: 24px; padding-bottom: 8px; }

.hero-card {
  position: relative;
  overflow: hidden;
  background: var(--hero);
  color: var(--on-hero);
  border-radius: 36px;
  padding: 56px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}

/* Soft blobs, like the shapes on the app's hero card. */
.hero-card::before, .hero-card::after {
  content: "";
  position: absolute;
  background: var(--hero-blob);
  border-radius: 46% 54% 42% 58% / 55% 41% 59% 45%;
  pointer-events: none;
}
.hero-card::before { width: 420px; height: 380px; right: -120px; top: -140px; }
.hero-card::after { width: 300px; height: 260px; left: 32%; bottom: -170px; }

.hero-copy { position: relative; z-index: 1; }
.hero .pill { background: rgba(255, 255, 255, 0.16); color: var(--on-hero); }
.hero h1 { font-size: clamp(38px, 5.4vw, 64px); font-weight: 800; margin: 20px 0 16px; }
.hero p.lede { font-size: 19px; color: var(--on-hero-variant); max-width: 34ch; margin: 0 0 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { margin: 16px 0 0; font-size: 14px; color: var(--on-hero-variant); }

.hero-phone { position: relative; z-index: 1; justify-self: center; }

.phone {
  width: 100%;
  max-width: 300px;
  border-radius: 40px;
  padding: 10px;
  background: #0b0b0f;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.phone img { border-radius: 30px; width: 100%; height: auto; aspect-ratio: 405 / 832; }

@media (max-width: 860px) {
  .hero-card { grid-template-columns: 1fr; padding: 36px 24px 0; border-radius: 28px; }
  .hero-phone { margin-bottom: -60px; }
  .hero-phone .phone { max-width: 250px; }
  .hero { padding-bottom: 60px; }
}

/* ---------- Stats strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 32px 0 0;
}
.stat {
  background: var(--surface-container);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}
.stat-number { font-size: 36px; font-weight: 800; line-height: 1.1; font-feature-settings: "tnum", "lnum"; }
.stat-label { color: var(--on-surface-variant); font-size: 15px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); margin-top: 88px; } }

/* ---------- Sections ---------- */

section { padding: 72px 0 0; }
.section-head { max-width: 640px; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 700; }
.section-head p { color: var(--on-surface-variant); font-size: 18px; margin: 12px 0 0; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface-container);
  border-radius: var(--radius-xl);
  padding: 24px;
}
.card h3 { font-size: 20px; font-weight: 600; margin: 16px 0 6px; }
.card p { margin: 0; color: var(--on-surface-variant); }

.icon {
  --tint: var(--blue);
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--tint);
  background: color-mix(in srgb, var(--tint) var(--accent-alpha), transparent);
}
.icon svg { width: 26px; height: 26px; }

.t-blue { --tint: var(--blue); }
.t-green { --tint: var(--green); }
.t-orange { --tint: var(--orange); }
.t-purple { --tint: var(--purple); }
.t-teal { --tint: var(--teal); }
.t-pink { --tint: var(--pink); }
.t-amber { --tint: var(--amber); }
.t-rose { --tint: var(--rose); }

/* ---------- Screenshots ---------- */

.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 20px;
  margin: 0 -4px;
}
.shots figure { margin: 0; scroll-snap-align: start; }
.shots .phone { max-width: none; border-radius: 34px; padding: 8px; }
.shots .phone img { border-radius: 26px; }
.shots figcaption { text-align: center; color: var(--on-surface-variant); font-size: 15px; margin-top: 12px; }

/* ---------- Pricing ---------- */

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: stretch; }
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; } }

.plan { background: var(--surface-container); border-radius: var(--radius-xl); padding: 28px; display: flex; flex-direction: column; }
.plan.featured { background: var(--primary-container); color: var(--on-primary-container); }
.plan h3 { font-size: 22px; font-weight: 600; }
.plan .price { font-size: 44px; font-weight: 800; margin: 14px 0 2px; font-feature-settings: "tnum", "lnum"; }
.plan .per { color: var(--on-surface-variant); font-size: 15px; }
.plan.featured .per { color: inherit; opacity: 0.8; }
.plan ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.plan li svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--green); }
.plan.featured li svg { color: currentColor; }
.plan .pill { align-self: flex-start; background: color-mix(in srgb, var(--purple) var(--accent-alpha), transparent); color: var(--purple); }
.plan.featured .pill { background: var(--on-primary-container); color: var(--primary-container); }
.fine { color: var(--on-surface-variant); font-size: 14px; margin-top: 16px; }

/* ---------- Privacy summary ---------- */

.privacy-band {
  background: var(--surface-container-low);
  border-radius: 36px;
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}
@media (max-width: 860px) { .privacy-band { grid-template-columns: 1fr; padding: 28px 20px; border-radius: 28px; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chip { background: var(--surface-container-high); border-radius: 999px; padding: 8px 16px; font-weight: 500; }
.flow { display: grid; gap: 10px; }
.flow .row { display: flex; gap: 14px; align-items: center; background: var(--surface-container); border-radius: var(--radius-md); padding: 14px 16px; }
.flow .row strong { display: block; }
.flow .row span { color: var(--on-surface-variant); font-size: 14px; }

/* ---------- Legal pages ---------- */

.legal { max-width: 760px; margin: 0 auto; padding: 40px 16px 24px; }
.legal-hero { background: var(--surface-container); border-radius: var(--radius-xl); padding: 32px; margin-bottom: 28px; }
.legal-hero h1 { font-size: clamp(34px, 5vw, 48px); font-weight: 800; }
.legal-hero p { color: var(--on-surface-variant); margin: 10px 0 0; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.legal-meta .pill { background: var(--secondary-container); color: var(--on-secondary-container); }

.toc { background: var(--surface-container-low); border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 28px; }
.toc h2 { font-size: 16px; font-weight: 600; margin-bottom: 10px; font-variation-settings: "opsz" 18, "ROND" 0; letter-spacing: 0.01em; }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.toc li { margin: 4px 0; break-inside: avoid; }
@media (max-width: 560px) { .toc ol { columns: 1; } }

.legal section { padding: 0; margin: 0 0 28px; scroll-margin-top: 84px; }
.legal section h2 { font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.legal section p { margin: 0 0 10px; }
.legal section ul { margin: 0 0 10px; padding-left: 22px; }
.legal section li { margin: 6px 0; }

/* ---------- Footer ---------- */

.site-footer { margin-top: 80px; border-top: 1px solid var(--outline-variant); padding: 32px 0 48px; color: var(--on-surface-variant); }
.footer-row { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { color: var(--on-surface); text-decoration: none; font-weight: 500; }
.footer-links a:hover { text-decoration: underline; }
.site-footer small { font-size: 14px; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
