/* BabyMon site styles, using the app's Nightlight palette (maui/src/BabyMon.App/Theme/ThemePalettes.cs).
   Tokens first, then components (named after the "Website" page of the BabyMon design canvas), then pages. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface2: #F3EEE7;
  --footer-bg: #F3EEE7;
  --line: #E6DFD5;
  --ink: #1E2633;
  --ink2: #5B6472;
  --primary: #1E2633;
  --on-primary: #FAF7F2;
  --dusk-tint: #E4EEF8;
  --dusk-fg: #24496F;
  --dusk-soft: #6E9BCB;
  --apr-tint: #FDEBDD;
  --apr-fg: #8A4313;
  --apr-text: #B1561A;
  --apr-bar: #EE9555;
  --bar-off: #E6DFD5;
  --success: #4E8E6C;
  --link: #24496F;
  --shadow: 0 2px 10px rgba(30, 38, 51, .05);
  --face: #F6B98A;
  --moon: #EE9555;
  --arc: #6E9BCB;
  --star: #F6B98A;
  --frame: #1E2633;
  --focus: #2E5E8F;

  --font-head: 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito Sans', system-ui, sans-serif;

  --wrap: 1160px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151D;
    --surface: #18202B;
    --surface2: #151B24;
    --footer-bg: #0B0F15;
    --line: #2B3544;
    --ink: #EDE7DE;
    --ink2: #A3ACB9;
    --primary: #EDE7DE;
    --on-primary: #10151D;
    --dusk-tint: #1F3147;
    --dusk-fg: #C9DBF0;
    --dusk-soft: #93B6DD;
    --apr-tint: #3A2A20;
    --apr-fg: #F6CDB0;
    --apr-text: #F2A877;
    --apr-bar: #F2A877;
    --bar-off: #2B3544;
    --success: #7FB89A;
    --link: #93B6DD;
    --shadow: none;
    --face: #F2A877;
    --moon: #F6B98A;
    --arc: #A9C6E6;
    --star: #FDEBDD;
    --frame: #2B3544;
    --focus: #93B6DD;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.6; }
img, svg { display: block; }
h1, h2, h3 { margin: 0; font-family: var(--font-head); }
p { margin: 0; }
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[id] { scroll-margin-top: 16px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  padding: 10px 16px; border-radius: 12px;
  background: var(--primary); color: var(--on-primary); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Moonbeam mark ---------- */
.mark .moon { fill: var(--moon); }
.mark .arc { fill: none; stroke: var(--arc); stroke-linecap: round; }
.mark .star { fill: var(--star); }

/* ---------- Site header ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header__inner {
  min-height: 88px; padding-top: 12px; padding-bottom: 12px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px;
}
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--ink); }
.brand__name { font-family: var(--font-head); font-weight: 900; font-size: 24px; letter-spacing: -.02em; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.nav__link {
  min-height: 44px; display: flex; align-items: center; padding: 0 14px; border-radius: 12px;
  text-decoration: none; font-size: 15px; font-weight: 700; color: var(--ink2);
}
.nav__link:hover { color: var(--ink); }
.nav__link[aria-current="page"] { color: var(--ink); background: var(--surface2); }
.nav .btn { margin-left: 8px; }

/* ---------- Buttons ---------- */
.btn {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 18px; border-radius: 14px; border: 0;
  font: inherit; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { opacity: .9; }
.btn--block { min-height: 52px; border-radius: 16px; font-size: 16px; width: 100%; }

/* ---------- Store badges ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 12px; }
.store-badge {
  height: 54px; border-radius: 12px; background: #000000; color: #FFFFFF;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
  font-size: 13px; font-weight: 700;
}
.store-badge--apple { width: 168px; }
.store-badge--google { width: 180px; }

/* ---------- Section heading ---------- */
.kicker { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--apr-text); }
.section-head { display: flex; flex-direction: column; gap: 8px; }
.section-head h2 { font-weight: 900; font-size: clamp(30px, 3.4vw, 40px); line-height: 1.15; }
.section-head p { font-size: 17px; line-height: 26px; color: var(--ink2); }
.page-head { display: flex; flex-direction: column; gap: 10px; }
.page-head h1 { font-weight: 900; font-size: clamp(34px, 4.4vw, 52px); line-height: 1.08; }
.page-head .lead { font-size: 18px; line-height: 28px; color: var(--ink2); }
.page-head .meta { font-size: 15px; color: var(--ink2); }

.section { padding-top: 96px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 44px; }
.band--soft { background: var(--surface2); }

/* ---------- Card (feature card, unit card, help card) ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.feature { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.feature h3 { font-weight: 800; font-size: 21px; }
.feature p { font-size: 15px; line-height: 23px; color: var(--ink2); }
.icon-tile { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.icon-tile svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-tile--dusk { background: var(--dusk-tint); color: var(--dusk-fg); }
.icon-tile--apricot { background: var(--apr-tint); color: var(--apr-text); }

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 32px 40px; }
.step { display: flex; gap: 16px; }
.step__num {
  width: 44px; height: 44px; flex: none; border-radius: 22px; background: var(--apr-tint); color: var(--apr-fg);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 900; font-size: 19px;
}
.step__body { display: flex; flex-direction: column; gap: 4px; }
.step h3 { font-weight: 800; font-size: 20px; }
.step p { font-size: 15px; line-height: 23px; color: var(--ink2); }

/* ---------- Phone mockup with baby unit cards ---------- */
.phone { width: 300px; max-width: 100%; border-radius: 44px; background: var(--frame); padding: 12px; }
.phone__screen { border-radius: 34px; background: var(--bg); padding: 28px 16px 24px; display: flex; flex-direction: column; gap: 14px; min-height: 500px; }
.phone__title { font-family: var(--font-head); font-weight: 900; font-size: 24px; padding: 0 4px; }
.unit { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.unit__row { display: flex; align-items: center; gap: 12px; }
.unit__icon { width: 42px; height: 42px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.unit__icon svg { width: 24px; height: 24px; }
.unit__icon--apricot { background: var(--apr-tint); }
.unit__icon--apricot .face { fill: var(--face); }
.unit__icon--apricot .crib { stroke: var(--apr-text); }
.unit__icon--dusk { background: var(--dusk-tint); }
.unit__icon--dusk .face { fill: var(--dusk-soft); }
.unit__icon--dusk .crib { stroke: var(--dusk-fg); }
.unit__icon .crib { fill: none; stroke-width: 3; stroke-linecap: round; }
.unit__text { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.unit__text b { font-family: var(--font-head); font-weight: 800; font-size: 16px; }
.unit__text span { font-size: 13px; color: var(--ink2); }
.unit__dot { width: 10px; height: 10px; border-radius: 5px; background: var(--success); }
.level { display: flex; align-items: flex-end; gap: 4px; height: 34px; }
.level span { flex: 1; border-radius: 3px; background: var(--apr-bar); }
.level span.off { background: var(--bar-off); }

/* ---------- Privacy band (always dark) ---------- */
.night { background: #10151D; color: #EDE7DE; }
.night__inner { padding-top: 88px; padding-bottom: 88px; display: flex; flex-wrap: wrap; gap: 40px 72px; align-items: center; }
.night__text { flex: 1 1 360px; display: flex; flex-direction: column; gap: 12px; }
.night .kicker { color: #F2A877; }
.night h2 { font-weight: 900; font-size: clamp(30px, 3.4vw, 40px); line-height: 1.15; }
.night p { font-size: 17px; line-height: 27px; color: #A3ACB9; }
.night a { min-height: 44px; display: inline-flex; align-items: center; font-size: 16px; font-weight: 700; color: #93B6DD; }
.night :focus-visible { outline-color: #93B6DD; }
.ticks { flex: 1 1 360px; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ticks li { display: flex; gap: 12px; align-items: center; font-size: 17px; font-weight: 600; }
.ticks__tick { width: 32px; height: 32px; flex: none; border-radius: 16px; background: #1F3147; display: flex; align-items: center; justify-content: center; }
.ticks__tick svg { width: 16px; height: 16px; fill: none; stroke: #C9DBF0; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Check list (privacy summary) ---------- */
.checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.checks li { display: flex; gap: 12px; font-size: 16px; line-height: 24px; }
.checks__tick { width: 24px; height: 24px; flex: none; border-radius: 12px; background: var(--dusk-tint); display: flex; align-items: center; justify-content: center; }
.checks__tick svg { width: 13px; height: 13px; fill: none; stroke: var(--dusk-fg); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- FAQ item ---------- */
.faq-group { display: flex; flex-direction: column; gap: 10px; }
.faq-group h2 { margin: 0 0 4px; font-weight: 800; font-size: 22px; }
.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0 20px; }
.faq summary {
  min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-family: var(--font-head); font-weight: 800; font-size: 17px; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 4px;
  border-right: 2.5px solid var(--ink2); border-bottom: 2.5px solid var(--ink2);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s;
}
.faq[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq p { margin: 0 0 18px; font-size: 15px; line-height: 24px; color: var(--ink2); }

/* ---------- Callout ---------- */
.callout { background: var(--dusk-tint); color: var(--dusk-fg); border-radius: 16px; padding: 18px 20px; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 21px; }
.callout svg { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Permissions table ---------- */
.perms { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin: 0; }
.perms__row { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 14px 18px; background: var(--surface); }
.perms__row + .perms__row { border-top: 1px solid var(--line); }
.perms dt { flex: 0 0 150px; font-size: 15px; font-weight: 700; }
.perms dd { flex: 1 1 300px; margin: 0; font-size: 15px; line-height: 23px; color: var(--ink2); }

/* ---------- Site footer ---------- */
.site-footer { background: var(--footer-bg); border-top: 1px solid var(--line); }
.site-footer__inner { padding-top: 44px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 28px; }
.site-footer__top { display: flex; flex-wrap: wrap; gap: 24px 56px; justify-content: space-between; align-items: flex-start; }
.site-footer__brand { display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.site-footer__brand .brand { min-height: 0; gap: 8px; }
.site-footer__brand .brand__name { font-size: 19px; letter-spacing: 0; }
.site-footer__brand p { font-size: 14px; line-height: 21px; color: var(--ink2); }
.site-footer__brand p a { font-weight: 700; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.footer-nav a { min-height: 44px; display: flex; align-items: center; padding: 0 10px; font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.site-footer__legal { display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; font-size: 13px; line-height: 20px; color: var(--ink2); }

/* ---------- Home ---------- */
.hero { padding-top: 80px; padding-bottom: 96px; display: flex; flex-wrap: wrap; align-items: center; gap: 56px 72px; }
.hero__text { flex: 1.2 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.hero__trust { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink2); }
.hero__trust svg { width: 16px; height: 16px; fill: none; stroke: var(--success); stroke-width: 2.2; stroke-linecap: round; }
.hero h1 { font-weight: 900; font-size: clamp(40px, 5.2vw, 64px); line-height: 1.05; letter-spacing: -.02em; }
.hero__lead { font-size: 19px; line-height: 30px; color: var(--ink2); max-width: 560px; }
.hero .badges { margin-top: 6px; }
.hero__note { font-size: 14px; color: var(--ink2); }
.hero__visual { flex: 1 1 340px; min-width: 0; display: flex; justify-content: center; }
.download { padding-top: 96px; padding-bottom: 96px; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.download h2 { font-weight: 900; font-size: clamp(30px, 3.4vw, 40px); line-height: 1.15; }
.download p { font-size: 17px; line-height: 26px; color: var(--ink2); max-width: 520px; }
.download .badges { justify-content: center; margin-top: 6px; }

/* ---------- Support ---------- */
.support { padding-top: 72px; padding-bottom: 104px; display: flex; flex-wrap: wrap; gap: 48px 64px; align-items: flex-start; }
.support__main { flex: 2 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.support__groups { display: flex; flex-direction: column; gap: 28px; }
.support__aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.help { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.help h2 { font-weight: 800; font-size: 21px; }
.help p { font-size: 15px; line-height: 23px; color: var(--ink2); }

/* ---------- Prose pages (privacy) ---------- */
.prose-page { max-width: 780px; margin: 0 auto; padding: 72px var(--gutter) 104px; display: flex; flex-direction: column; gap: 36px; }
.summary { padding: 24px 28px; display: flex; flex-direction: column; gap: 12px; }
.summary h2 { font-weight: 800; font-size: 21px; }
.prose { display: flex; flex-direction: column; gap: 34px; font-size: 16px; line-height: 27px; }
.prose section { display: flex; flex-direction: column; gap: 10px; }
.prose h2 { font-weight: 800; font-size: 24px; }
.prose p { color: var(--ink2); }

/* ---------- 404 ---------- */
.not-found { padding-top: 112px; padding-bottom: 128px; display: flex; flex-direction: column; gap: 20px; align-items: center; text-align: center; }
.not-found h1 { font-weight: 900; font-size: clamp(34px, 4.4vw, 52px); line-height: 1.1; }
.not-found p { font-size: 18px; line-height: 28px; color: var(--ink2); }

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .hero { padding-top: 48px; padding-bottom: 64px; }
  .section, .download, .night__inner { padding-top: 64px; padding-bottom: 64px; }
  .support, .prose-page { padding-top: 48px; padding-bottom: 72px; }
  .nav .btn { margin-left: 0; }
}
