/* ivla.app: the Apricot theme from spec/design.md §2.1, day and night. No external requests:
   the font is served from here, and there are no cookies, scripts or trackers. */

@font-face {
  font-family: "Baloo 2";
  src: url("/assets/baloo2.woff") format("woff");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --bg: #FCF4EE;
  --surface: #FFFFFF;
  --band: #F9DCCB;
  --soft: #F9E3D6;
  --line: #F4E9E6;
  --text: #33232F;
  --muted: #76606F;
  --primary: #5B3556;
  --on-primary: #FFFFFF;
  --apricot: #F4A27C;
  --plum: #5B3556;
  --shadow: 0 2px 12px rgba(91, 53, 86, 0.08);
  /* Entry types (design.md §6, Apricot day): main and light. */
  --feed: #C8582A;  --feed-light: #F2B59A;
  --sleep: #4A6FA5; --sleep-light: #B9C9E4;
  --diaper: #2E8073;
  --bottle: #B26B12;
  --activity: #5E7C34;
  --on-type: #FFFFFF;
  /* Apple devices get SF Pro Rounded, like the iPhone app; others get Baloo 2, like the Android app. */
  --font: ui-rounded, "SF Pro Rounded", "Baloo 2", system-ui, sans-serif;
  --display: "Baloo 2", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  /* The night palette: warm near-black, no white anywhere. */
  :root {
    --bg: #15101A;
    --surface: #211A26;
    --band: #2A2030;
    --soft: #3A2A3C;
    --line: #2C2331;
    --text: #EADDD6;
    --muted: #A595A3;
    --primary: #E3916B;
    --on-primary: #1E141C;
    --apricot: #E3916B;
    --plum: #7A4F74;
    --shadow: none;
    --feed: #E8956B;  --feed-light: #6B4434;
    --sleep: #8FA8D6; --sleep-light: #3A4A66;
    --diaper: #6FB8A8;
    --bottle: #E2A85A;
    --activity: #95B46E;
    --on-type: #1A1418;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary); text-underline-offset: 0.15em; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 750; }
h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.25em; }
p { margin: 0 0 1em; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }

/* Header and footer */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1; color: var(--primary); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.wordmark .mark { width: 30px; height: 30px; }
.top nav { display: flex; gap: 20px; font-weight: 600; }
.top nav a { color: var(--text); text-decoration: none; }
.top nav a:hover { color: var(--primary); }

.foot { border-top: 1px solid var(--line); padding: 36px 0 48px; margin-top: 40px; font-size: 0.95rem; }
.foot .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot nav a { color: var(--text); }
.foot .fine { margin-top: 20px; color: var(--muted); max-width: 640px; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 26px; border-radius: 16px;
  background: var(--primary); color: var(--on-primary);
  font-weight: 700; font-size: 1.1rem; text-decoration: none;
}
.button:hover { filter: brightness(1.08); }
.button.alt { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary); }
.button svg { width: 20px; height: 22px; fill: currentColor; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; padding: 40px 0 72px; }
.eyebrow { display: inline-block; background: var(--soft); color: var(--primary); font-weight: 700; font-size: 0.95rem; padding: 6px 14px; border-radius: 999px; margin-bottom: 18px; }
.lead { font-size: 1.25rem; color: var(--muted); max-width: 34ch; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 28px; }
.cta .note { color: var(--muted); font-size: 0.95rem; }

.stage { position: relative; display: flex; justify-content: center; padding: 20px 0; }
.stage::before, .stage::after { content: ""; position: absolute; border-radius: 50%; z-index: 0; }
.stage::before { width: 78%; aspect-ratio: 1; background: var(--apricot); opacity: 0.55; left: -4%; top: 6%; }
.stage::after { width: 58%; aspect-ratio: 1; background: var(--plum); opacity: 0.9; right: -2%; bottom: 2%; }
.phone {
  position: relative; z-index: 1; width: min(300px, 78%);
  border-radius: 46px; padding: 10px; background: #1E141C;
  box-shadow: 0 24px 60px rgba(51, 35, 47, 0.25);
}
.phone img { border-radius: 37px; width: 100%; height: auto; }

/* Sections */
section { padding: 64px 0; }
.band { background: var(--band); }
.intro { max-width: 640px; margin-bottom: 36px; }
.intro p { color: var(--muted); font-size: 1.15rem; }

/* Tap counts */
.taps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.tap { background: var(--surface); border-radius: 22px; padding: 22px 20px; box-shadow: var(--shadow); }
.tap svg { height: 64px; width: auto; margin-bottom: 14px; }
.tap .count { font-family: var(--display); font-weight: 800; font-size: 1.05rem; color: var(--primary); }
.tap p { margin: 4px 0 0; color: var(--muted); font-size: 0.98rem; }
.after { margin-top: 24px; color: var(--muted); max-width: 640px; }

/* Feature rows: text beside a phone */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.feature + .feature { margin-top: 72px; }
.feature.flip .text { order: 2; }
.feature .shot { display: flex; justify-content: center; }
.feature .shot .phone { width: min(280px, 80%); }
.feature ul { padding: 0; margin: 18px 0 0; list-style: none; }
.feature li { padding-left: 30px; position: relative; margin-bottom: 10px; }
.feature li::before { content: ""; position: absolute; left: 4px; top: 0.5em; width: 12px; height: 12px; border-radius: 50%; background: var(--apricot); }

/* Cards grid */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--surface); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); }
.card p { color: var(--muted); margin: 0; }

/* Night preview: always the night palette, to show it */
.night { background: #15101A; color: #EADDD6; border-radius: 28px; padding: 40px; display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; }
.night h2 { color: #EADDD6; }
@media (prefers-color-scheme: dark) { .night { border: 1px solid #2C2331; } }
.night p { color: #A595A3; }
.swatches { display: flex; gap: 14px; }
.swatch { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; }

/* FAQ */
.faq { max-width: 760px; }
.faq details { background: var(--surface); border-radius: 18px; padding: 18px 22px; margin-bottom: 12px; box-shadow: var(--shadow); }
.faq summary { font-weight: 700; cursor: pointer; font-size: 1.1rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--primary); font-family: var(--display); font-size: 1.5rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 12px 0 0; color: var(--muted); }

/* Legal and help pages */
.doc { max-width: 720px; margin: 0 auto; padding: 16px 20px 64px; }
.doc h1 { font-size: clamp(2rem, 5vw, 2.6rem); margin-top: 16px; }
.doc h2 { font-size: 1.35rem; margin-top: 2.2rem; }
.doc .meta { color: var(--muted); }
.doc table { border-collapse: collapse; width: 100%; font-size: 0.95rem; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.doc code { font-size: 2rem; letter-spacing: 0.15em; font-family: var(--display); color: var(--primary); }

@media (max-width: 820px) {
  .hero, .feature, .night { grid-template-columns: 1fr; }
  .hero { padding-top: 16px; gap: 32px; }
  .feature { gap: 28px; }
  .feature.flip .text { order: 0; }
  .top nav { gap: 14px; font-size: 0.95rem; }
  .night { padding: 28px; }
  section { padding: 48px 0; }
}
@media (max-width: 480px) {
  .top nav a:first-child { display: none; }
}
