/* Ninna website — calm, reliable, parent-first.
   Single shared stylesheet for the landing + legal + support pages.

   Aligned to the in-app "Parent Comfort" design system:
   - Light (Family Room): warm off-white bg, cream cards, muted sage primary,
     soft peach accent, warm near-black text.
   - Dark (Quiet Nursery): warm near-black bg, charcoal cards, dim sage, soft
     peach accent, cream text. Same structure — only color tokens change.
   Theme follows the OS (System), matching the app's default. */

:root {
  /* Light — Family Room */
  --bg: #faf4ec;          /* warm off-white, not pure white */
  --bg-soft: #f4ece0;     /* quiet warm panel */
  --card: #fdf8f1;        /* cream / milk-white card */
  --border: #ece0d0;      /* subtle warm border */
  --text: #2c2a27;        /* warm near-black */
  --muted: #6f7268;       /* gray-sage secondary */
  --primary: #7d9a80;     /* muted sage — chips, links, accents */
  --primary-dim: #6c8a70; /* sage hover/pressed */
  --cta: #5f7d63;         /* deeper sage for buttons (AA-legible text) */
  --cta-dim: #54724f;     /* sage button hover/pressed */
  --on-primary: #fbf7f0;  /* cream text on sage */
  --accent: #e7a482;      /* soft peach — baby/camera, Pro, emphasis */
  --accent-soft: #f6e3d7; /* peach tint for tiles */
  --warn: #d8924e;        /* softened amber */
  --warn-soft: rgba(216,146,78,0.10);
  --max: 760px;
  --radius: 18px;
  --radius-sm: 12px;
  font-synthesis: none;
  color-scheme: light;
}

/* Dark — Quiet Nursery. Applied only when the visitor explicitly chooses Dark
   via the header toggle. Default is always Light; the OS setting is ignored. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1e201d;
  --bg-soft: #232521;
  --card: #282b27;
  --border: #353833;
  --text: #ece5d8;
  --muted: #9a9d91;
  --primary: #84a187;
  --primary-dim: #93ad95;
  --cta: #84a187;
  --cta-dim: #738f76;
  --on-primary: #1b1d1a;
  --accent: #e3a585;
  --accent-soft: #38312c;
  --warn: #d79c5f;
  --warn-soft: rgba(215,156,95,0.12);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(1200px 620px at 50% -240px, var(--bg-soft) 0%, var(--bg) 62%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

/* Horizontal gutter on every screen. Sections below set only vertical padding
   (longhand) so they never clobber these side gutters. max() keeps clear of
   notch/safe-area insets on phones. */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

/* Header / nav */
.site-head {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(120%) blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 650; font-size: 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.nav a { color: var(--muted); margin-left: 18px; font-size: 15px; }
.nav a:hover { color: var(--text); text-decoration: none; }

/* Theme toggle — cycles System → Light → Dark (mirrors the app's theme picker) */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-left: 18px; padding: 0;
  color: var(--muted); background: transparent;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  vertical-align: middle; line-height: 0;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--primary); background: var(--bg-soft); }
.theme-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; display: block; }

/* Hero */
.hero { text-align: center; padding-top: 84px; padding-bottom: 60px; }
.hero h1 { font-size: clamp(34px, 6vw, 52px); line-height: 1.1; margin: 0 0 18px; letter-spacing: -0.5px; }
.hero p.lead { font-size: clamp(17px, 2.6vw, 21px); color: var(--muted); max-width: 560px; margin: 0 auto 30px; }

/* Trust pill — soft sage chip */
.pill {
  display: inline-block; font-size: 13px; color: var(--primary-dim);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 38%, transparent);
  border-radius: 999px; padding: 6px 15px; margin-bottom: 22px; letter-spacing: 0.2px;
}

/* Primary CTA — sage (peach is an accent, not the main CTA color) */
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--cta); color: var(--on-primary);
  font-weight: 650; padding: 14px 26px; border-radius: var(--radius-sm); font-size: 16px;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--cta) 28%, transparent);
  transition: background .15s ease, transform .05s ease;
}
.cta:hover { background: var(--cta-dim); text-decoration: none; }
.cta:active { transform: translateY(1px); }
.cta-note { display: block; color: var(--muted); font-size: 13px; margin-top: 14px; }

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding-top: 24px; padding-bottom: 70px; }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }
.feature {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 5%, transparent);
}
.feature h3 { margin: 0 0 8px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

/* Soft peach icon tile (BabyIconTile feel) wrapping the emoji glyph */
.feature .ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; margin-bottom: 14px;
  font-size: 22px; line-height: 1;
  background: var(--accent-soft);
  border-radius: 13px;
}

/* Document pages (legal / support) */
.doc { padding-top: 48px; padding-bottom: 90px; }
.doc h1 { font-size: clamp(28px, 5vw, 38px); margin: 0 0 6px; letter-spacing: -0.5px; }
.doc .updated { color: var(--muted); font-size: 14px; margin: 0 0 32px; }
.doc h2 { font-size: 21px; margin: 38px 0 10px; }
.doc h3 { font-size: 17px; margin: 26px 0 8px; }
.doc p, .doc li { color: var(--text); }
.doc table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
.doc th, .doc td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; vertical-align: top; }
.doc th { background: var(--bg-soft); color: var(--text); }
.doc .notice { background: var(--warn-soft); border: 1px solid var(--warn); border-radius: var(--radius-sm);
  padding: 16px 18px; margin: 24px 0; }
.doc .notice strong { color: var(--warn); }
.doc code { background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; font-size: 0.92em; }

/* Article / guide pages (built on .doc base) */
.article { padding-top: 40px; padding-bottom: 80px; }
.article .eyebrow { color: var(--primary-dim); font-size: 13px; font-weight: 650; letter-spacing: 0.4px; text-transform: uppercase; margin: 0 0 10px; }
.article h1 { font-size: clamp(28px, 5vw, 40px); margin: 0 0 14px; letter-spacing: -0.5px; line-height: 1.12; }
.article .lede { font-size: clamp(17px, 2.4vw, 20px); color: var(--muted); margin: 0 0 8px; max-width: 62ch; }
.article .updated { color: var(--muted); font-size: 13px; margin: 18px 0 0; }

/* In-page table of contents */
.toc { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin: 30px 0; }
.toc strong { display: block; font-size: 13px; letter-spacing: 0.3px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; }
@media (max-width: 560px) { .toc ol { columns: 1; } }
.toc li { margin: 4px 0; }

/* Soft callouts */
.callout { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin: 22px 0; background: var(--card); }
.callout--tip { background: color-mix(in srgb, var(--primary) 12%, var(--card)); border-color: color-mix(in srgb, var(--primary) 36%, var(--border)); }
.callout--care { background: var(--warn-soft); border-color: var(--warn); }
.callout h3 { margin: 0 0 6px; font-size: 16px; }
.callout p { margin: 0; }
.callout--care h3 { color: var(--warn); }

/* Guide cards (pillar → future cluster articles) */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 22px 0; }
.guide-card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; color: var(--text); }
.guide-card:hover { border-color: var(--primary); text-decoration: none; }
.guide-card .ic { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: var(--accent-soft); border-radius: 11px; font-size: 20px; margin-bottom: 10px; }
.guide-card h3 { margin: 0 0 4px; font-size: 16px; }
.guide-card p { margin: 0; color: var(--muted); font-size: 14px; }
.guide-card .soon { display: inline-block; margin-top: 12px; font-size: 12px; color: var(--muted); border: 1px dashed var(--border); border-radius: 999px; padding: 4px 12px; }
.guide-card .read { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 13px; font-weight: 650; color: var(--cta);
  background: color-mix(in srgb, var(--primary) 14%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 38%, transparent);
  border-radius: 999px; padding: 7px 15px; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.guide-card:hover .read, .guide-card:focus-visible .read { background: var(--cta); color: var(--on-primary); border-color: var(--cta); }

/* Sources + disclaimer */
.sources { font-size: 14px; }
.sources li { margin: 6px 0; color: var(--muted); }
.disclaimer { font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); margin-top: 40px; padding-top: 18px; }

/* Homepage guide teaser */
.teaser { padding-top: 6px; padding-bottom: 64px; }
.teaser .panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; justify-content: space-between; }
.teaser h2 { margin: 0 0 6px; font-size: 22px; }
.teaser p { margin: 0; color: var(--muted); max-width: 52ch; }

/* Footer */
.site-foot { border-top: 1px solid var(--border); padding: 30px 0 50px; color: var(--muted); font-size: 14px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; justify-content: space-between; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--text); }
.site-foot .links a { margin-left: 18px; }
@media (max-width: 520px) { .site-foot .links a { margin: 0 16px 0 0; } }
