/* Num Drill — landing site CSS. Brand-matched, no framework, ~3 KB gzipped. */

:root {
  --indigo: #6366f1;
  --indigo-dark: #4f46e5;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --bg: #fafaff;
  --card: #ffffff;
  --success: #10b981;
  --max-w: 64rem;
  --rad: 0.75rem;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d12;
    --card: #14141d;
    --slate-900: #f1f5f9;
    --slate-700: #cbd5e1;
    --slate-500: #94a3b8;
    --slate-300: #475569;
    --slate-200: #1e293b;
    --slate-100: #14141d;
  }
}

/* Manual theme overrides — applied via the in-page toggle. These come AFTER
   the @media rule so they win when the user has explicitly chosen a theme
   regardless of the OS-level preference. */
:root.theme-dark {
  --bg: #0d0d12;
  --card: #14141d;
  --slate-900: #f1f5f9;
  --slate-700: #cbd5e1;
  --slate-500: #94a3b8;
  --slate-300: #475569;
  --slate-200: #1e293b;
  --slate-100: #14141d;
}
:root.theme-light {
  --bg: #fafaff;
  --card: #ffffff;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--slate-700);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--slate-900); line-height: 1.2; margin: 0 0 0.5rem; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 2.5rem; line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem; margin-top: 2.5rem; }
h3 { font-size: 1.25rem; margin-top: 1.75rem; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.4rem; }
strong { color: var(--slate-900); font-weight: 600; }
hr { border: none; border-top: 1px solid var(--slate-200); margin: 2.5rem 0; }
small { color: var(--slate-500); font-size: 0.875rem; }
code { background: var(--slate-100); border-radius: 0.25rem; padding: 0.125rem 0.375rem; font-size: 0.875em; }

/* ---------- Layout ---------- */

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 0.5rem; top: 0.5rem; padding: 0.5rem 0.75rem; background: var(--indigo); color: #fff; border-radius: 0.5rem; z-index: 100; }

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

.site-header {
  border-bottom: 1px solid var(--slate-200);
  background: rgba(250, 250, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
@media (prefers-color-scheme: dark) {
  .site-header { background: rgba(13, 13, 18, 0.85); }
}
:root.theme-dark .site-header { background: rgba(13, 13, 18, 0.85); }
:root.theme-light .site-header { background: rgba(250, 250, 255, 0.85); }
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 3.5rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1.05rem; color: var(--slate-900);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand .num { color: var(--indigo); }
.brand .drill { color: var(--slate-700); }
.brand-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; color: var(--indigo);
}
.site-nav { display: flex; align-items: center; gap: 0.25rem; }
.site-nav a {
  display: inline-flex; align-items: center; padding: 0.5rem 0.75rem;
  border-radius: 0.5rem; color: var(--slate-700); font-size: 0.95rem; font-weight: 500;
}
.site-nav a:hover { background: var(--slate-100); text-decoration: none; }
.site-nav a.cta {
  background: var(--indigo); color: #fff; margin-left: 0.5rem;
}
.site-nav a.cta:hover { background: var(--indigo-dark); }

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

.hero {
  text-align: center;
  padding: 4rem 1.25rem 3rem;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.08), transparent 70%);
}
.hero .pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--slate-200); border-radius: 999px;
  background: var(--card); color: var(--slate-500);
  font-size: 0.78rem; font-weight: 500;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  max-width: 38rem; margin: 1rem auto 1rem;
}
.hero h1 .accent { color: var(--indigo); }
.hero .lead {
  max-width: 38rem; margin: 0 auto 1.5rem;
  font-size: 1.1rem; color: var(--slate-700);
}
.hero .cta-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-bottom: 0.5rem;
}
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--rad); font-weight: 600; font-size: 1rem;
  background: var(--indigo); color: #fff;
  border: 1px solid transparent;
  text-decoration: none; cursor: pointer; transition: background 0.15s;
  min-height: 44px;
}
.btn:hover { background: var(--indigo-dark); text-decoration: none; }
.btn-secondary {
  background: var(--card); color: var(--slate-700); border-color: var(--slate-200);
}
.btn-secondary:hover { background: var(--slate-100); }
.btn-outline {
  background: var(--card); color: var(--indigo); border-color: var(--indigo);
}
.btn-outline:hover { background: rgba(99, 102, 241, 0.08); text-decoration: none; }
.cta-row .small-note {
  width: 100%; margin: 0.6rem 0 0; color: var(--slate-500); font-size: 0.85rem;
}
.note { color: var(--slate-500); font-size: 0.85rem; margin: 0; }

/* ---------- Feature cards ---------- */

.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.75rem; margin: 2rem 0;
}
.feature {
  background: var(--card); border: 1px solid var(--slate-200);
  border-radius: var(--rad); padding: 1rem 1.1rem;
}
.feature h3 { font-size: 1rem; margin: 0 0 0.25rem; }
.feature p { margin: 0; font-size: 0.9rem; color: var(--slate-500); }

/* ---------- Article body ---------- */

.page {
  max-width: 44rem; margin: 0 auto; padding: 2rem 1.25rem 3rem;
}
.page > h1 { font-size: 2.25rem; margin-bottom: 1.25rem; }
.page > .meta {
  color: var(--slate-500); font-size: 0.9rem; margin-bottom: 2rem;
  border-bottom: 1px solid var(--slate-200); padding-bottom: 1rem;
}
.page p { font-size: 1rem; }

.callout {
  background: var(--slate-100); border-left: 3px solid var(--indigo);
  border-radius: 0.25rem;
  padding: 1rem 1.25rem; margin: 1.5rem 0;
}
.callout p:last-child { margin-bottom: 0; }

/* Anchor jump menu for hub-style pages: a row of pill links that scroll to
   in-page sections. Helps Google award sitelinks and helps parents skip to
   the "by grade" or "by skill" view they want. */
.jump-menu {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}
.jump-menu a {
  display: inline-flex; align-items: center;
  padding: 0.5rem 1rem;
  border: 1px solid var(--slate-200); border-radius: 999px;
  background: var(--card); color: var(--slate-700);
  font-size: 0.92rem; font-weight: 500;
}
.jump-menu a:hover { border-color: var(--indigo); color: var(--indigo); text-decoration: none; }
.jump-menu a::before {
  content: "↓"; margin-right: 0.4rem; color: var(--indigo); font-weight: 700;
}

.cta-card {
  background: var(--card); border: 1px solid var(--slate-200);
  border-radius: var(--rad); padding: 1.5rem; margin: 2rem 0;
  text-align: center;
}
.cta-card h3 { margin-top: 0; }
.cta-card .btn { margin-top: 0.5rem; }

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

.site-footer {
  margin-top: 4rem; padding: 2.5rem 1.25rem 1.5rem;
  border-top: 1px solid var(--slate-200);
  font-size: 0.92rem; color: var(--slate-500);
  background: var(--card);
}
.site-footer .container { display: block; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem; margin-bottom: 1.75rem;
}
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer-grid h4 {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--slate-700);
  margin: 0 0 0.6rem;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 0.35rem; }
.footer-grid a { color: var(--slate-500); }
.footer-grid a:hover { color: var(--indigo); text-decoration: none; }
.footer-grid .footer-blurb { color: var(--slate-500); font-size: 0.92rem; max-width: 22rem; margin: 0.5rem 0 0; }
.footer-grid .footer-brand {
  font-weight: 700; color: var(--slate-900); font-size: 1rem; letter-spacing: -0.01em;
}
.footer-grid .footer-brand .num { color: var(--indigo); }
.footer-bottom {
  border-top: 1px solid var(--slate-200);
  padding-top: 1rem; color: var(--slate-500); font-size: 0.85rem;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
}
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ---------- Citations / references ---------- */

.refs { font-size: 0.92rem; color: var(--slate-500); }
.refs li { margin-bottom: 0.85rem; }
.refs em { font-style: italic; color: var(--slate-700); }

/* ---------- Safety: never let a page horizontally scroll ---------- */
/* Long URLs (DOIs in the methodology page especially) need to wrap inside
   their list items on narrow screens. We don't want a single citation to
   widen the document past the viewport. */
html, body { overflow-x: hidden; max-width: 100%; }
.page a, .refs a, .refs li,
.page p, .page li { overflow-wrap: anywhere; word-break: break-word; }

/* ---------- Mobile menu (CSS-only hamburger) ---------- */
/* Hidden checkbox + label "hamburger" pattern: works without JavaScript
   (important for the static marketing site to stay JS-free). */
.menu-toggle { display: none; }
.menu-button {
  display: none; cursor: pointer; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; margin-left: 0.25rem;
  border: 1px solid var(--slate-200); border-radius: 0.5rem;
  background: var(--card); color: var(--slate-700);
}
.menu-button:hover { background: var(--slate-100); }
.menu-button svg { width: 1.25rem; height: 1.25rem; }
.menu-panel { display: none; }

/* ---------- Theme toggle (sun/moon icon button) ---------- */

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem;
  margin-left: 0.25rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--slate-700);
  cursor: pointer;
}
.theme-toggle:hover {
  background: var(--slate-100);
  border-color: var(--slate-200);
  color: var(--slate-900);
}
.theme-toggle svg { width: 1.1rem; height: 1.1rem; }

/* Default to "moon" icon (offering dark) when site is in light mode; show
   "sun" (offering light) when in dark mode. The OS default is light, so
   moon is the starting state. The @media query and the explicit theme
   classes override this in dark contexts. */
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: inline-block; }
@media (prefers-color-scheme: dark) {
  .theme-toggle .sun { display: inline-block; }
  .theme-toggle .moon { display: none; }
}
:root.theme-dark .theme-toggle .sun { display: inline-block; }
:root.theme-dark .theme-toggle .moon { display: none; }
:root.theme-light .theme-toggle .sun { display: none; }
:root.theme-light .theme-toggle .moon { display: inline-block; }

/* ---------- Mobile tweaks ---------- */

@media (max-width: 720px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.4rem; }
  .hero { padding: 2.5rem 1rem 2rem; }

  /* The header at <720px can't fit five nav items + brand + CTA in one row.
     Hide the inline text links and replace them with a hamburger button that
     toggles a drop-down panel of all nav links (so mobile users keep full
     access to Practice / Research / Parents / FAQ — fixes the prior bug
     where they were effectively trapped on the homepage). */
  .site-header .container { gap: 0.5rem; flex-wrap: wrap; }
  .site-nav { gap: 0.25rem; }
  .site-nav a { padding: 0.5rem 0.5rem; font-size: 0.875rem; }
  .site-nav a:not(.cta) { display: none; }
  .site-nav a.cta { padding: 0.5rem 0.85rem; }
  .menu-button { display: inline-flex; }

  /* When the toggle is checked, the panel below the header shows all nav
     links full-width as a tap-friendly list. The checkbox and panel are
     siblings (checkbox is BEFORE <header>, panel is right AFTER it) so
     `~ .menu-panel` matches. */
  .menu-toggle:checked ~ .menu-panel { display: block; }
  .menu-panel {
    display: none;
    width: 100%;
    border-bottom: 1px solid var(--slate-200);
    background: var(--card);
    padding: 0.25rem 0;
    position: sticky; top: 3.5rem; z-index: 9;
  }
  .menu-panel a {
    display: block; padding: 0.85rem 1.25rem;
    color: var(--slate-700); font-size: 1rem; font-weight: 500;
    border-bottom: 1px solid var(--slate-100);
  }
  .menu-panel a:last-child { border-bottom: none; }
  .menu-panel a:hover, .menu-panel a:focus { background: var(--slate-100); text-decoration: none; }
  .menu-panel a[aria-current="page"] { color: var(--indigo); font-weight: 600; }
}
