/* Private Baby Monitor: dusk design language.
   Palette matches the app: deep plum night, peach lamplight. */

:root {
  --bg: #211838;
  --surface: #2A2046;
  --card: #332750;
  --card-edge: #3E3060;
  --primary: #F0A184;
  --accent: #E8896B;
  --text: #F3ECF8;
  --text-soft: #C9BCDD;
  --text-faint: #9A8BB8;
  --radius-lg: 28px;
  --radius-md: 20px;
  --font-display: "Baloo 2", "Nunito", sans-serif;
  --font-body: "Nunito", sans-serif;
  --measure: 62ch;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  position: relative;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 40% at 50% 0%, rgba(62, 44, 94, 0.55), transparent);
  background-repeat: no-repeat;
  background-size: 100% 1400px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.25vi, 1.125rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Faint dusk stars, pure CSS so no extra requests.
   Split into two layers so groups can twinkle out of phase. */
body::before,
body::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1400px;
  pointer-events: none;
  z-index: -1;
  background-repeat: no-repeat;
}

body::before {
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(243, 236, 248, 0.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 6%, rgba(243, 236, 248, 0.3) 50%, transparent 51%),
    radial-gradient(2px 2px at 62% 22%, rgba(240, 161, 132, 0.18) 50%, transparent 51%);
}

body::after {
  background-image:
    radial-gradient(1px 1px at 78% 9%, rgba(240, 161, 132, 0.4) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 90% 32%, rgba(243, 236, 248, 0.22) 50%, transparent 51%),
    radial-gradient(1px 1px at 48% 12%, rgba(243, 236, 248, 0.28) 50%, transparent 51%);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

::selection { background: var(--accent); color: var(--bg); }

.wrap {
  width: min(100% - 2.5rem, 68rem);
  margin-inline: auto;
}

/* ---------- Header ---------- */

.site-header {
  padding: 1.1rem 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.2;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

@media (max-width: 520px) {
  .brand .brand-name { display: none; }
}

.site-nav {
  margin-left: auto;
  display: flex;
  gap: clamp(0.9rem, 3vi, 1.8rem);
}

.site-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--primary); }

/* ---------- Hero ---------- */

.hero {
  padding: clamp(2.5rem, 7vi, 5.5rem) 0 clamp(3rem, 7vi, 5rem);
}

.hero .wrap {
  display: grid;
  gap: clamp(2rem, 5vi, 4rem);
  align-items: center;
}

@media (min-width: 800px) {
  .hero .wrap { grid-template-columns: 1.15fr 1fr; }
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 1.4rem + 3.6vi, 3.9rem);
  line-height: 1.08;
  margin: 0 0 1.1rem;
  letter-spacing: -0.01em;
}

.hero h1 em {
  font-style: normal;
  color: var(--primary);
}

.hero-lede {
  color: var(--text-soft);
  max-width: 34rem;
  margin: 0 0 2rem;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* Coming-soon store badges.
   When a store listing goes live: replace its <span class="store-badge"> with
   <a class="store-badge is-live" href="...store url..."> (same inner markup)
   and drop the .store-note line once both are live. */
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1.4rem 0.8rem 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--card-edge);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: default;
  user-select: none;
}

.store-badge svg { width: 26px; height: 26px; fill: var(--text); opacity: 0.9; }

.store-badge .store-lines { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store-badge .store-small { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; color: var(--text-faint); text-transform: uppercase; }
.store-badge .store-big { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }

.store-badge.is-live { cursor: pointer; border-color: var(--primary); }
.store-badge.is-live:hover { background: var(--card); }

.store-note {
  margin: 0.8rem 0 0;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.hero-art {
  position: relative;
  justify-self: center;
  width: min(100%, 26rem);
}

.hero-art img {
  width: 100%;
  border-radius: 46% 46% var(--radius-lg) var(--radius-lg) / 38% 38% var(--radius-lg) var(--radius-lg);
  border: 1px solid var(--card-edge);
  box-shadow: 0 30px 70px -30px rgba(10, 5, 25, 0.9);
}

.hero-art figcaption {
  position: absolute;
  left: 50%;
  bottom: -1.1rem;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--card);
  border: 1px solid var(--card-edge);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: 999px;
}

/* ---------- Section scaffolding ---------- */

section { padding: clamp(2.5rem, 6vi, 4.5rem) 0; }

.section-head { max-width: 40rem; margin-bottom: clamp(1.8rem, 4vi, 2.8rem); }

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 1.2rem + 1.6vi, 2.4rem);
  line-height: 1.15;
  margin: 0 0 0.6rem;
}

.section-head p { color: var(--text-soft); margin: 0; }

/* ---------- How it works ---------- */

.steps {
  display: grid;
  gap: 1.4rem;
  counter-reset: step;
  position: relative;
}

@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
}

.step {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.1rem 1.5rem;
  position: relative;
}

.step img {
  border-radius: var(--radius-md);
  margin-bottom: 1.1rem;
}

/* Wrapper for the wifi step so the signal ripple can sit over the artwork */
.step-art {
  position: relative;
  margin-bottom: 1.1rem;
}

.step-art img { margin-bottom: 0; }

.ripple {
  position: absolute;
  left: 50%;
  top: 47%;
  width: 90px;
  height: 90px;
  margin: -45px 0 0 -45px;
  border: 1.5px solid rgba(240, 161, 132, 0.5);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.step h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0 0 0.35rem;
  padding-left: 2.4rem;
  position: relative;
}

.step h3::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--bg);
  font-size: 1rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.step p { margin: 0; color: var(--text-soft); font-size: 0.98rem; padding-left: 2.4rem; }

/* ---------- Features ---------- */

.feature-lead {
  display: grid;
  gap: 1.5rem;
  background: linear-gradient(150deg, var(--card), var(--surface) 70%);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 4vi, 2.6rem);
  align-items: center;
  margin-bottom: 1.6rem;
}

@media (min-width: 760px) {
  .feature-lead { grid-template-columns: 1fr 0.8fr; }
}

.feature-lead h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 1.2rem + 1vi, 1.9rem);
  line-height: 1.2;
  margin: 0 0 0.7rem;
}

.feature-lead p { color: var(--text-soft); margin: 0; max-width: 32rem; }

.feature-lead img {
  border-radius: var(--radius-md);
  width: min(100%, 22rem);
  justify-self: center;
}

.feature-grid {
  display: grid;
  gap: 1.4rem 1.6rem;
}

@media (min-width: 560px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }

.feature {
  background: var(--surface);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.4rem 1.4rem;
}

.feature .glyph {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(240, 161, 132, 0.13);
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
}

.feature .glyph svg { width: 24px; height: 24px; stroke: var(--primary); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.feature h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0 0 0.3rem;
}

.feature p { margin: 0; color: var(--text-soft); font-size: 0.95rem; }

/* ---------- Trust ---------- */

.trust .wrap {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 760px) {
  .trust .wrap { grid-template-columns: 0.65fr 1fr; }
}

.trust-art img {
  width: min(100%, 20rem);
  border-radius: 50%;
  border: 1px solid var(--card-edge);
  margin-inline: auto;
}

.trust blockquote {
  margin: 0;
  padding: 0;
  border: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 1.05rem + 1.1vi, 1.8rem);
  line-height: 1.35;
}

.trust blockquote strong { color: var(--primary); font-weight: 700; }

.trust .trust-sub {
  color: var(--text-soft);
  margin: 1rem 0 0;
  max-width: 36rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--card-edge);
  margin-top: clamp(2rem, 5vi, 4rem);
  padding: 2.2rem 0 2.6rem;
  font-size: 0.92rem;
  color: var(--text-faint);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
}

.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-left: auto; }
.site-footer a { color: var(--text-soft); }
.site-footer a:hover { color: var(--primary); }

/* ---------- Prose pages (privacy, support) ---------- */

.page-title {
  padding: clamp(2rem, 5vi, 3.5rem) 0 0;
}

.page-title h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 1.4rem + 2.2vi, 3rem);
  line-height: 1.12;
  margin: 0 0 0.5rem;
}

.page-title .meta { color: var(--text-faint); font-weight: 700; font-size: 0.9rem; margin: 0; }

.prose {
  max-width: var(--measure);
  padding-bottom: 1rem;
}

.prose h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  margin: 2.4rem 0 0.6rem;
}

.prose h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 1.8rem 0 0.4rem;
}

.prose p, .prose li { color: var(--text-soft); }
.prose strong { color: var(--text); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { color: var(--accent); }

.callout {
  background: var(--surface);
  border: 1px solid var(--card-edge);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.3rem;
  margin: 1.6rem 0;
}

.callout p { margin: 0; }

/* Permissions table (privacy page) */
.perm-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0 0.4rem;
  font-size: 0.95rem;
}

.perm-table th, .perm-table td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--card-edge);
  vertical-align: top;
}

.perm-table th {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.perm-table td { color: var(--text-soft); }

@media (max-width: 560px) {
  .perm-table, .perm-table tbody, .perm-table tr, .perm-table th, .perm-table td { display: block; }
  .perm-table thead { display: none; }
  .perm-table tr { padding: 0.4rem 0; }
  .perm-table th, .perm-table td { border: 0; padding: 0.15rem 0; }
  .perm-table tr + tr { border-top: 1px solid var(--card-edge); margin-top: 0.6rem; padding-top: 0.8rem; }
}

/* FAQ (support page) */
.faq {
  max-width: var(--measure);
  display: grid;
  gap: 0.9rem;
  margin-top: 1.8rem;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.05rem 3rem 1.05rem 1.3rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  position: relative;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.2s ease;
}

.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }

.faq .faq-body { padding: 0 1.3rem 1.2rem; color: var(--text-soft); }
.faq .faq-body p { margin: 0 0 0.6rem; }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* Contact block */
.contact-card {
  max-width: var(--measure);
  margin-top: 2.5rem;
  background: linear-gradient(150deg, var(--card), var(--surface) 75%);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 4vi, 2.2rem);
}

.contact-card h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  margin: 0 0 0.4rem;
}

.contact-card p { color: var(--text-soft); margin: 0 0 1.2rem; }

.contact-card .mail-link {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  background: var(--primary);
  color: var(--bg);
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
}

.contact-card .mail-link:hover { background: var(--accent); color: var(--bg); }

/* Motion niceties, respectful of user settings.
   The vibe is a quiet nursery at night: slow, small, nothing bouncy. */
@media (prefers-reduced-motion: no-preference) {

  /* Entrance, once on load */
  .hero-copy, .hero-art { animation: rise 0.5s ease both; }
  .hero-art { animation-delay: 0.1s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(9px); }
    to { opacity: 1; transform: none; }
  }

  /* Stars twinkle in two groups, out of phase, a few at a time */
  body::before { animation: twinkle 5.5s ease-in-out infinite; }
  body::after { animation: twinkle 8.5s ease-in-out 2.2s infinite; }
  @keyframes twinkle {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
  }

  /* The sleeping baby on the cloud breathes, slowly */
  .trust-art img { animation: breathe 6s ease-in-out infinite; }
  @keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.015); }
  }

  /* A soft signal ripple drifts out from the connected phones */
  .ripple { animation: ripple-out 6s ease-out infinite; }
  .ripple-2 { animation-delay: 3s; }
  @keyframes ripple-out {
    0% { transform: scale(0.35); opacity: 0; }
    12% { opacity: 0.65; }
    55% { transform: scale(1.2); opacity: 0; }
    100% { transform: scale(1.2); opacity: 0; }
  }
}
