/* Chemistry4Kids website. Colours, fonts and the chunky "edge" cards come from the app
   (apps/mobile/src/constants/theme.ts) so the site and the app look like one product.
   Fonts are self-hosted (SIL Open Font License, see fonts/) so visitors' browsers never
   contact a font service. */

@font-face {
  font-family: "Baloo 2";
  src: url("/fonts/baloo-2-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/fonts/nunito-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/fonts/nunito-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/fonts/nunito-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --ink: #3c2e58;
  --ink-soft: #5f5379;
  --paper: #ffffff;
  --mist: #f6f3fc;
  --line: #e2daf2;
  --grape: #7c3aed;
  --grape-edge: #5b21b6;
  --grape-tint: #ede9fe;
  --on-grape: #ffffff;
  --sun: #ffc800;
  --sun-edge: #e5a800;
  --matter: #12876a;
  --matter-tint: #e3f4ee;
  --engineering: #2f6fed;
  --engineering-tint: #e6eefd;
  --display: "Baloo 2", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --edge: 4px;
  --radius-card: 20px;
  --radius-button: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1ebff;
    --ink-soft: #c2b6e0;
    --paper: #17102b;
    --mist: #221741;
    --line: #3b2f63;
    --grape: #9d6bff;
    --grape-edge: #6d3fd6;
    --grape-tint: #332460;
    --on-grape: #17102b;
    --matter: #3ccfa4;
    --matter-tint: #15342c;
    --engineering: #7aa5ff;
    --engineering-tint: #1b2647;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--body);
}
a { color: var(--grape); text-underline-offset: 0.15em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.14em; }
:focus-visible { outline: 3px solid var(--grape); outline-offset: 3px; border-radius: 6px; }
strong { font-weight: 800; }

h1, h2, h3, .wordmark {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.25rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.4rem); margin: 0 0 0.5rem; }
h3 { font-size: 1.4rem; margin: 2rem 0 0.75rem; }

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--grape); color: var(--on-grape);
  padding: 0.6rem 1rem; border-radius: 12px; font-weight: 800; z-index: 10;
}
.skip:focus { top: 1rem; }

/* Header: one flat band in the app's purple. */
.site-header { background: var(--grape); color: var(--on-grape); }
.bar {
  max-width: 72rem; margin: 0 auto; padding: 0.9rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.wordmark { color: inherit; text-decoration: none; font-size: 1.6rem; }
.wordmark .four {
  display: inline-block; background: var(--sun); color: #3c2e58;
  border-radius: 10px; padding: 0 0.3em; margin: 0 0.06em;
  box-shadow: 0 3px 0 var(--sun-edge); transform: rotate(-4deg);
}
.site-header nav { display: flex; gap: 0.25rem 1.25rem; flex-wrap: wrap; }
.site-header nav a { color: inherit; font-weight: 800; text-decoration: none; padding: 0.25rem 0; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.3em; }
.site-header :focus-visible { outline-color: var(--sun); }

main { display: block; }
.hero, .band, .prose { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }

/* Hero: the claim on one side, a real Prediction on the other. */
.hero {
  display: grid; gap: 2.5rem; align-items: center;
  padding-top: clamp(2.5rem, 7vw, 5rem); padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
@media (min-width: 60rem) { .hero { grid-template-columns: 1.05fr 1fr; gap: 4rem; } }
.eyebrow {
  display: inline-block; margin: 0 0 1rem; font-weight: 800; font-size: 0.95rem;
  background: var(--grape-tint); color: var(--ink); padding: 0.3rem 0.8rem; border-radius: 999px;
}
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 36rem; margin: 0 0 1rem; }
.availability { font-weight: 800; margin: 0; }

/* Hero card: the five steps of every Investigation, in the app's chunky style. */
.journey {
  background: var(--mist); border: 2px solid var(--line);
  border-radius: var(--radius-card); padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: 0 var(--edge) 0 var(--line);
}
.journey-title { font-size: clamp(1.5rem, 2.6vw, 1.9rem); margin: 0 0 1rem; }
.journey-steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.journey-steps li {
  counter-increment: step; display: grid; grid-template-columns: 2.5rem 1fr; column-gap: 0.75rem;
  align-items: start; background: var(--paper); border: 2px solid var(--line);
  border-radius: var(--radius-button); padding: 0.75rem 1rem; box-shadow: 0 var(--edge) 0 var(--line);
  font-size: 1rem;
}
.journey-steps li::before {
  content: counter(step); grid-row: span 2; display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--grape); color: var(--on-grape); font: 800 1.15rem/1 var(--display);
}
.journey-steps li:last-child::before { background: var(--sun); color: #3c2e58; }
.journey-steps strong { display: block; font-family: var(--display); font-size: 1.2rem; line-height: 1.25; }

/* Sections */
.band { padding-top: 3rem; padding-bottom: 1rem; }
.section-lead { color: var(--ink-soft); max-width: 40rem; margin: 0 0 1.5rem; }

.facts { padding: 0; margin: 0; list-style: none; display: grid; gap: 1rem; }
@media (min-width: 44rem) { .facts { grid-template-columns: 1fr 1fr; } }
.facts li { border: 2px solid var(--line); border-radius: var(--radius-card); padding: 1.1rem 1.25rem; }

.contact {
  background: var(--grape-tint); border-radius: var(--radius-card); padding: 1.1rem 1.25rem;
  font-weight: 700;
}
.contact a, .panel a { color: var(--ink); }
.faq { display: grid; gap: 0.75rem; }
.faq details { border: 2px solid var(--line); border-radius: var(--radius-button); padding: 0 1.1rem; }
.faq summary {
  cursor: pointer; font-weight: 800; padding: 0.9rem 0; list-style-position: outside;
}
.faq details[open] summary { border-bottom: 2px solid var(--line); margin-bottom: 0.5rem; }
.faq details p { margin: 0.5rem 0 1rem; }

/* Long-form pages: privacy policy and sponsorship. */
.page-head { background: var(--mist); }
.page-head .prose { padding-top: 2.5rem; padding-bottom: 2rem; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.prose { max-width: 46rem; }
.prose h2 { margin-top: 2.5rem; font-size: 1.75rem; }
.prose h3 { margin-top: 1.5rem; font-size: 1.3rem; }
.prose li { margin-bottom: 0.4rem; }
.panel {
  background: var(--grape-tint); border-radius: var(--radius-card); padding: 1.1rem 1.4rem; margin: 2rem 0;
}
.panel ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.effective { color: var(--ink-soft); font-weight: 700; margin: 0; }

.site-footer {
  margin-top: 4rem; background: var(--mist); color: var(--ink-soft); font-size: 0.95rem;
  padding: 2rem 1rem 3rem;
}
.site-footer > * { max-width: 70rem; margin-left: auto; margin-right: auto; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-bottom: 1rem; font-weight: 800; }
.site-footer p { margin-top: 0; margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
