/* Raftlings — palette mirrors FeedingTracker/Theme.swift
   raftBackground, moosBlue (teal), raftApricot, moosNight, moosBarn */
:root {
  color-scheme: light dark;
  --bg: #fcf7eb;
  --surface: #ffffff;
  --surface-2: #f4ecd9;
  --ink: #163e3d;
  --muted: #4d6866;
  --line: #e4dbc6;
  --teal: #0a6663;
  --teal-strong: #08514f;
  --teal-soft: #dcefe9;
  --link: #006d69;
  --apricot: #faa86e;
  --apricot-soft: #fde5d2;
  --apricot-ink: #8a4413;
  --night: #5c4fb8;
  --night-soft: #e9e6f8;
  --night-ink: #3b318a;
  --barn: #b8292e;
  --on-teal: #ffffff;
  --shadow: 0 1px 2px rgb(22 62 61 / 6%), 0 12px 32px -12px rgb(22 62 61 / 22%);
  --radius: 22px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1a1f;
    --surface: #16262b;
    --surface-2: #1c3035;
    --ink: #f8f1df;
    --muted: #a8bcb7;
    --line: #2b4044;
    --teal: #47c7ba;
    --teal-strong: #70d6cc;
    --teal-soft: #173a3a;
    --link: #70d6cc;
    --apricot-soft: #3d2a1d;
    --apricot-ink: #fbc499;
    --night: #9d93f2;
    --night-soft: #25224a;
    --night-ink: #c9c3fb;
    --on-teal: #072b29;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 16px 40px -16px rgb(0 0 0 / 60%);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); font-weight: 800; letter-spacing: -0.04em; }
h2 { font-size: clamp(1.8rem, 4.4vw, 2.7rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--apricot); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.nav .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.97rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
@media (max-width: 560px) {
  .nav-links { gap: 16px; }
  .nav-links .hide-sm { display: none; }
}

/* ---------- buttons / badges ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px;
  font: inherit; font-weight: 700; text-decoration: none;
  background: var(--teal); color: var(--on-teal);
  box-shadow: var(--shadow);
}
.btn:hover { background: var(--teal-strong); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 2px var(--teal); }
.appstore {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 20px 10px 16px; border-radius: 14px;
  background: var(--ink); color: var(--bg); text-decoration: none;
  line-height: 1.15;
}
.appstore svg { width: 26px; height: 26px; fill: currentColor; }
.appstore small { display: block; font-size: 0.72rem; opacity: 0.8; font-weight: 600; }
.appstore strong { font-size: 1.12rem; letter-spacing: -0.01em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--teal);
}
.eyebrow.night { color: var(--night); }
.eyebrow.apricot { color: var(--apricot-ink); }
.pill {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: var(--apricot-soft); color: var(--apricot-ink);
  font-weight: 700; font-size: 0.9rem;
}

/* ---------- hero ---------- */
.hero { padding: clamp(40px, 8vw, 96px) 0 clamp(48px, 8vw, 96px); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.hero-otter { width: 96px; height: 96px; border-radius: 26px; box-shadow: var(--shadow); margin-bottom: 24px; }
.lead { font-size: clamp(1.15rem, 2.2vw, 1.35rem); color: var(--muted); max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 28px; }
.hero-note { margin-top: 18px; font-size: 0.95rem; color: var(--muted); }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .phone { margin-inline: auto; }
}

/* ---------- feature sections ---------- */
.feature { padding: clamp(56px, 9vw, 112px) 0; }
.feature + .feature { border-top: 1px solid var(--line); }
.feature .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.feature.flip .copy { order: 2; }
.feature .copy > p { color: var(--muted); font-size: 1.1rem; max-width: 46ch; }
.feature .visual { display: flex; justify-content: center; }
.points { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.points li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.points li::before {
  content: ""; width: 28px; height: 28px; border-radius: 9px; margin-top: 1px;
  background: var(--teal-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a6663' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.night-section .points li::before {
  background-color: var(--night-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235c4fb8'%3E%3Cpath d='M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z'/%3E%3C/svg%3E");
}
.points b { display: block; color: var(--ink); }
.points span { color: var(--muted); }
@media (max-width: 860px) {
  .feature .wrap { grid-template-columns: 1fr; }
  .feature.flip .copy { order: 0; }
}
.night-section { background: linear-gradient(180deg, var(--bg), var(--night-soft) 30%, var(--night-soft) 70%, var(--bg)); }

/* ---------- phone mockup ---------- */
.phone {
  width: min(330px, 100%);
  aspect-ratio: 9 / 19;
  border-radius: 48px;
  padding: 12px;
  background: #0d1416;
  box-shadow: 0 30px 60px -24px rgb(22 62 61 / 45%), 0 0 0 1px rgb(255 255 255 / 6%) inset;
  position: relative;
  flex-shrink: 0;
}
.screen {
  height: 100%; border-radius: 37px; overflow: hidden;
  background: var(--bg); position: relative;
  padding: 50px 16px 16px;
  display: flex; flex-direction: column; gap: 12px;
  font-size: 0.82rem; line-height: 1.35;
}
.island {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 104px; height: 30px; border-radius: 20px; background: #000; z-index: 2;
}
.status {
  position: absolute; top: 16px; left: 28px; right: 28px;
  display: flex; justify-content: space-between; font-weight: 700; font-size: 0.8rem;
}
.app-title { display: flex; align-items: center; justify-content: space-between; }
.app-title strong { font-size: 1.45rem; letter-spacing: -0.03em; }
.baby-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 6px;
  border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--line);
  font-weight: 700; font-size: 0.78rem;
}
.baby-chip i { width: 20px; height: 20px; border-radius: 50%; background: var(--apricot); display: block; }
.card {
  background: var(--surface); border-radius: 20px; padding: 14px;
  box-shadow: 0 0 0 1px var(--line);
}
.card .label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.timer {
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
  font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1;
}
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.muted { color: var(--muted); }
.tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: var(--teal-soft); color: var(--teal); font-weight: 700; font-size: 0.72rem;
}
.tag.night { background: var(--night-soft); color: var(--night); }
.tag.apricot { background: var(--apricot-soft); color: var(--apricot-ink); }
.big-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px; border-radius: 16px; font-weight: 800; font-size: 0.95rem;
  background: var(--teal); color: var(--on-teal);
}
.big-btn.barn { background: var(--barn); color: #fff; }
.big-btn.night { background: var(--night); color: #fff; }
.big-btn.soft { background: var(--surface-2); color: var(--ink); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-actions div {
  background: var(--surface); box-shadow: 0 0 0 1px var(--line); border-radius: 14px;
  padding: 10px 4px; text-align: center; font-weight: 700; font-size: 0.7rem;
}
.mini-actions svg { width: 20px; height: 20px; margin: 0 auto 4px; display: block; stroke: var(--teal); }

/* full-screen feed */
.screen.active { background: var(--teal-soft); justify-content: space-between; text-align: center; padding-bottom: 22px; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.side { background: var(--surface); border-radius: 18px; padding: 14px 8px; box-shadow: 0 0 0 1px var(--line); }
.side.on { box-shadow: 0 0 0 3px var(--teal); }

/* floating cards (non-phone visuals) */
.stack { width: min(420px, 100%); display: grid; gap: 14px; }
.stack .card { padding: 18px 20px; border-radius: var(--radius); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.stack .card:nth-child(even) { margin-left: clamp(0px, 6vw, 40px); }
.stack .card:nth-child(odd) { margin-right: clamp(0px, 6vw, 40px); }
.big-num { font-size: 2.6rem; }
.activity { display: grid; gap: 10px; margin-top: 10px; }
.activity div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.activity .amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.amt.plus { color: var(--teal); }
.amt.minus { color: var(--apricot-ink); }
.dot { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.dot svg { width: 18px; height: 18px; }
.dot.teal { background: var(--teal-soft); color: var(--teal); }
.dot.apricot { background: var(--apricot-soft); color: var(--apricot-ink); }
.dot.night { background: var(--night-soft); color: var(--night); }
.lhs { display: flex; align-items: center; gap: 10px; }

/* nap window bar */
.window-bar { position: relative; height: 12px; border-radius: 999px; background: var(--surface-2); margin: 14px 0 6px; }
.window-bar span { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--night); }
.window-bar em { position: absolute; top: -5px; width: 4px; height: 22px; border-radius: 4px; background: var(--apricot); }
.ticks { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* caregivers */
.avatars { display: flex; }
.avatars i {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-style: normal; font-weight: 800; color: #fff; border: 3px solid var(--surface); margin-left: -10px;
}
.avatars i:first-child { margin-left: 0; }
.code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 700; font-size: 1.5rem; letter-spacing: 0.22em;
  background: var(--surface-2); border-radius: 14px; padding: 10px 14px; text-align: center; margin-top: 10px;
}
.signin { display: grid; gap: 8px; margin-top: 12px; }
.signin div {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px; border-radius: 12px; font-weight: 700; font-size: 0.9rem;
}
.signin .apple { background: var(--ink); color: var(--bg); }
.signin .google { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.signin svg { width: 17px; height: 17px; }
.sync { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.9rem; color: var(--teal); }
.sync::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px var(--teal-soft); }

/* lock screen */
.screen.lock {
  background: linear-gradient(170deg, #1b3a3f 0%, #22305a 55%, #3a2d55 100%);
  color: #fff; text-align: center; gap: 10px; padding-top: 56px;
}
.lock .date { font-weight: 700; opacity: 0.85; font-size: 0.85rem; }
.lock .clock { font-size: 4.6rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin-bottom: 18px; }
.live {
  background: rgb(10 14 16 / 72%); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 22px; padding: 14px; text-align: left; color: #fff;
}
.live .row + .row { margin-top: 10px; }
.live .timer { font-size: 2rem; color: #70d6cc; }
.live small { opacity: 0.7; font-size: 0.72rem; }
.live .ico { width: 30px; height: 30px; border-radius: 9px; overflow: hidden; }
.island.expanded {
  width: 210px; height: 36px; top: 10px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 0 6px; color: #70d6cc; font-weight: 800; font-size: 0.85rem; font-variant-numeric: tabular-nums;
}
.island.expanded img { width: 24px; height: 24px; border-radius: 50%; }
.notif {
  background: rgb(255 255 255 / 18%); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 20px; padding: 11px 13px; text-align: left; display: flex; gap: 10px; align-items: center;
}
.notif img { width: 32px; height: 32px; border-radius: 8px; }
.notif b { display: block; font-size: 0.8rem; }
.notif span { font-size: 0.78rem; opacity: 0.85; }

/* stats */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; }
.stat b { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat span { font-size: 0.75rem; color: var(--muted); font-weight: 700; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; margin-top: 12px; }
.bars div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; height: 100%; }
.bars i { display: block; border-radius: 6px; background: var(--teal); }
.bars i.n { background: var(--night); }
.bars i.d { background: color-mix(in srgb, var(--night) 45%, var(--surface)); }
.days { display: flex; gap: 8px; margin-top: 6px; }
.days span { flex: 1; text-align: center; font-size: 0.7rem; color: var(--muted); font-weight: 700; }
.balance { display: flex; height: 14px; border-radius: 999px; overflow: hidden; margin: 10px 0 6px; }
.balance span:first-child { background: var(--teal); }
.balance span:last-child { background: var(--apricot); }
.legend { display: flex; gap: 14px; font-size: 0.75rem; color: var(--muted); font-weight: 700; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }

/* moments */
.moments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: min(440px, 100%); }
.moment {
  background: var(--surface); border-radius: 20px; padding: 16px 10px; text-align: center;
  box-shadow: var(--shadow), 0 0 0 1px var(--line); font-weight: 700; font-size: 0.82rem; line-height: 1.3;
}
.moment .medal { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; }
.moment.locked { opacity: 0.55; box-shadow: 0 0 0 1px var(--line); background: transparent; }

/* values */
.values { padding: clamp(56px, 9vw, 104px) 0; background: var(--surface-2); }
.values-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-top: 32px; }
.value { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: 0 0 0 1px var(--line); }
.value p { color: var(--muted); margin: 0; font-size: 0.98rem; }
.value .dot { margin-bottom: 14px; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }

/* closing cta */
.cta { padding: clamp(64px, 10vw, 120px) 0; text-align: center; }
.cta img { width: 140px; height: 140px; border-radius: 36px; margin: 0 auto 24px; box-shadow: var(--shadow); }
.cta .hero-actions { justify-content: center; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 32px 0 48px; font-size: 0.92rem; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
footer nav { display: flex; gap: 20px; margin-left: auto; }
footer a { color: var(--muted); }

/* ---------- document pages (support / privacy / 404) ---------- */
.doc { padding: clamp(40px, 7vw, 80px) 0 clamp(56px, 8vw, 96px); }
.doc h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); }
.doc h2 { font-size: 1.45rem; margin-top: 2.2em; }
.doc .lead { max-width: none; }
.doc p, .doc li { color: var(--muted); }
.doc strong { color: var(--ink); }
.callout {
  background: var(--surface); border-radius: var(--radius); padding: 22px 24px;
  box-shadow: 0 0 0 1px var(--line); margin: 28px 0;
}
.callout p:last-child { margin: 0; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 8px; padding: 0; list-style: none; }
.toc a {
  display: inline-block; padding: 7px 14px; border-radius: 999px; text-decoration: none;
  background: var(--surface); box-shadow: 0 0 0 1px var(--line); color: var(--ink); font-weight: 600; font-size: 0.92rem;
}
.toc a:hover { box-shadow: 0 0 0 2px var(--teal); }

/* ---------- reveal on scroll (only when JS has run) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .points li::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2347c7ba' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  }
  :root:not([data-theme="light"]) .night-section .points li::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%239d93f2'%3E%3Cpath d='M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z'/%3E%3C/svg%3E");
  }
}
