/* ══════════════════════════════════════════════════════════════
   public.css — shared styles for EigenOwl's public pages
   (login.html and for-parents.html)

   Colour tokens come from themes.css, which theme.js injects on every
   page. Only non-colour tokens and layout live here. Nothing in this
   file hardcodes an accent colour, so the public pages follow whichever
   theme is active — Observatory by default for a first-time visitor,
   or the student's own choice if they've set one.
   ══════════════════════════════════════════════════════════════ */

:root {
  /* Typography and shape — not provided by themes.css */
  --sans:    'Cabinet Grotesk', sans-serif;
  --mono:    'DM Mono', ui-monospace, monospace;
  --display: 'Fraunces', Georgia, serif;
  --title:   'Exo 2', system-ui, sans-serif;
  --radius:  14px;

  /* Fallbacks only — themes.css overrides these on body.theme-*.
     Set to Observatory so a failed stylesheet load degrades to the
     intended default rather than to something unrelated. */
  --bg:#02000e; --surface:#06051a; --surface2:#0a0822;
  --border:#14122e; --border2:#1e1c3a;
  --accent:#a8b8f5; --accent2:#c3cffa; --info:#63b2f2;
  --warn:#c89940; --danger:#c05050; --text:#ccd4ee;
}

/* ── Call-to-action colour ────────────────────────────────────
   Derived from the active theme's accent, lifted slightly toward white with a
   neutral near-black label. Using var(--bg) as the label put a theme-tinted
   dark on a same-hue button, which measured fine but read flat. */
:root {
  --cta:       color-mix(in srgb, var(--accent) 90%, #ffffff);
  --cta-hover: color-mix(in srgb, var(--accent) 74%, #ffffff);
  --cta-text:  #0a0a10;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  overflow-x: hidden;
}
section { position: relative; z-index: 1; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 32px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 32px; }

/* ── Navigation ───────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 64px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--text) 5%, transparent);
  transition: background .3s, border-color .3s;
}
nav.scrolled {
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  border-bottom-color: var(--border);
}
.nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; cursor: pointer; }
.nav-wordmark {
  font-family: var(--title); font-weight: 500; font-size: 22px;
  letter-spacing: .08em; color: var(--text);
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--text); opacity: .84; text-decoration: none; cursor: pointer;
  border: none; background: none; font-family: var(--sans);
  transition: opacity .2s, background .2s;
}
.nav-link:hover { opacity: 1; background: color-mix(in srgb, var(--text) 6%, transparent); }
.nav-link.current { opacity: 1; color: var(--accent); }
.nav-cta {
  padding: 9px 20px; border-radius: 9px; background: var(--cta);
  color: var(--cta-text); font-size: 13px; font-weight: 700;
  text-decoration: none; border: none; cursor: pointer;
  font-family: var(--sans); transition: background .2s, transform .2s;
  margin-left: 8px;
}
.nav-cta:hover { background: var(--cta-hover); transform: translateY(-1px); }

.nav-hamburger {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  width: 40px; height: 40px; gap: 5px; background: none; border: none;
  cursor: pointer; padding: 4px; border-radius: 8px; transition: background .2s;
}
.nav-hamburger:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.nav-hamburger span {
  display: block; width: 22px; height: 2px; background: var(--text);
  opacity: .8; border-radius: 2px; transition: all .25s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none; position: fixed; top: 64px; left: 0; right: 0; z-index: 99;
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  backdrop-filter: blur(20px); border-bottom: 1px solid var(--border);
  padding: 16px 20px 24px; flex-direction: column; gap: 4px;
  transform: translateY(-8px); opacity: 0;
  transition: transform .25s ease, opacity .25s ease; pointer-events: none;
}
.mobile-menu.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.mobile-menu-link {
  display: block; padding: 12px 16px; border-radius: 10px; font-size: 15px;
  font-weight: 500; color: var(--text); opacity: .9; text-decoration: none;
  cursor: pointer; border: none; background: none; font-family: var(--sans);
  text-align: left; width: 100%; transition: opacity .2s, background .2s;
}
.mobile-menu-link:hover { opacity: 1; background: color-mix(in srgb, var(--text) 6%, transparent); }
.mobile-menu-divider { height: 1px; background: var(--border); margin: 8px 0; }
.mobile-menu-cta {
  display: block; margin: 8px 0 0; padding: 13px 16px; background: var(--cta);
  color: var(--cta-text); border: none; border-radius: 10px;
  font-family: var(--sans); font-size: 15px; font-weight: 700; cursor: pointer;
  text-align: center; width: 100%; transition: background .2s;
}
.mobile-menu-cta:hover { background: var(--cta-hover); }

/* ── Section headings ─────────────────────────────────────── */
.section-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.section-title {
  font-family: var(--display); font-size: clamp(28px, 4vw, 44px);
  font-weight: 200; line-height: 1.15; margin-bottom: 16px;
}
.section-title em { font-style: italic; color: var(--accent); font-weight: 400; }
.section-sub {
  font-size: 16px; color: var(--text); opacity: .82; line-height: 1.7;
  max-width: 560px; margin-bottom: 52px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  padding: 14px 32px; background: var(--cta); color: var(--cta-text);
  border: none; border-radius: 12px; font-family: var(--sans);
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background .25s, transform .25s, box-shadow .25s;
  letter-spacing: .015em; text-decoration: none; display: inline-block;
}
.btn-primary:hover {
  background: var(--cta-hover); transform: translateY(-2px);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--accent) 25%, transparent);
}
.btn-primary:focus-visible,
.nav-cta:focus-visible,
.mobile-menu-cta:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}
.btn-secondary {
  padding: 14px 24px; background: none; color: var(--text); opacity: .75;
  border: 1px solid var(--border2); border-radius: 12px;
  font-family: var(--sans); font-size: 15px; cursor: pointer;
  transition: opacity .2s, border-color .2s; text-decoration: none;
  display: inline-block;
}
.btn-secondary:hover { opacity: 1; border-color: var(--accent); }

/* ── Long-form prose (for-parents.html) ───────────────────── */
.prose p {
  font-size: 15.5px; line-height: 1.8; color: var(--text); opacity: .85;
  margin-bottom: 18px; max-width: 68ch;
}
.prose p strong { opacity: 1; color: var(--text); font-weight: 700; }
.prose h3 {
  font-family: var(--display); font-size: clamp(22px, 3vw, 30px);
  font-weight: 200; line-height: 1.2; margin: 0 0 18px;
}
.prose h3 em { font-style: italic; color: var(--accent); font-weight: 400; }
.prose ol { margin: 0 0 18px 20px; max-width: 68ch; }
.prose ol li {
  font-size: 15.5px; line-height: 1.8; color: var(--text); opacity: .85;
  margin-bottom: 12px; padding-left: 6px;
}

/* Calm, not alarming — these boxes build trust rather than warn. */
.note-box {
  background: var(--surface); border: 1px solid var(--border2);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
  padding: 24px 28px; margin: 28px 0; max-width: 68ch;
}
.note-box-title {
  font-size: 13px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.note-box p { font-size: 15.5px; margin-bottom: 14px; }
.note-box p:last-child { margin-bottom: 0; }

/* ── Footer ───────────────────────────────────────────────── */
.footer { padding: 40px 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; }
.footer-brand {
  font-family: var(--title); font-size: 16px; letter-spacing: .06em;
  color: var(--text); opacity: .55;
}
.footer-copy { font-size: 12px; color: var(--text); opacity: .5; }
.footer-links { display: flex; gap: 20px; }
.footer-link {
  font-size: 12px; color: var(--text); opacity: .6; text-decoration: none;
  cursor: pointer; transition: opacity .2s, color .2s;
  border: none; background: none; font-family: var(--sans);
}
.footer-link:hover { opacity: 1; color: var(--accent); }

/* ── Scroll reveal ────────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

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

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  nav { padding: 0 20px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .mobile-menu { display: flex; }
  .container, .container-narrow { padding: 0 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
}
@media (max-width: 600px) {
  .prose p, .prose ol li { font-size: 15px; }
  .note-box { padding: 20px 22px; }
  .btn-primary, .btn-secondary { width: 100%; text-align: center; }
}
