/* ==========================================================================
   Blooming Baby — marketing site
   Brand tokens mirror lib/core/theme/app_theme.dart (AppColors).
   Where the app palette fails WCAG on the web, a web-only deepened variant is
   defined and noted inline — never silently substituted.
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */
:root {
  /* Brand — 1:1 with AppColors */
  --cream: #fff9f2;
  --white: #ffffff;
  --sage: #8faf8b;
  --sage-dark: #5f7f5c;
  --sage-tint: #e3eddf;
  --blush: #f6c9be;
  --marigold: #ffb454;
  --ink: #3a342e;
  --sand: #f1e9dc;
  --outline: #c9beae;
  --hairline: #eee6d8;

  /* Web-only accessible variants.
     AppColors.sage on white text is 2.4:1 — fails WCAG AA. Buttons use
     --sage-deep (5.9:1). AppColors.inkSoft (#8A8178) on cream is 3.5:1 —
     fails for body copy, so secondary text uses --ink-muted (5.4:1). */
  --sage-deep: #4f6b4c;
  --ink-muted: #6e665c;

  /* Spacing — density dial 3/10 (spacious) */
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 8rem;

  /* Radii — 20px matches the app's cardTheme */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Soft UI Evolution: layered, low-opacity, warm-tinted shadows */
  --shadow-sm: 0 1px 2px rgba(58, 52, 46, 0.04), 0 2px 8px rgba(58, 52, 46, 0.04);
  --shadow-md: 0 2px 4px rgba(58, 52, 46, 0.04), 0 8px 24px rgba(58, 52, 46, 0.07);
  --shadow-lg: 0 4px 8px rgba(58, 52, 46, 0.05), 0 16px 48px rgba(58, 52, 46, 0.1);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms;
  --dur-mid: 280ms;

  --measure: 65ch;
  --container: 1140px;

  --font-display: "Baloo 2", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* --- Reset ---------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 var(--space-sm);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 6vw, 3.9rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.4rem); }

p { margin: 0 0 var(--space-sm); max-width: var(--measure); }

a { color: var(--sage-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }

:focus-visible {
  outline: 3px solid var(--sage-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -100px; left: var(--space-sm);
  z-index: 200; padding: 0.75rem 1.25rem;
  background: var(--white); color: var(--ink);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: var(--space-sm); }

/* --- Layout --------------------------------------------------------------- */
.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.section { padding-block: var(--space-2xl); }
.section--tight { padding-block: var(--space-xl); }

.section__head {
  max-width: 44rem;
  margin-bottom: var(--space-lg);
}
.section__head--center {
  margin-inline: auto;
  text-align: center;
}
.section__head--center p { margin-inline: auto; }

.eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sage-deep);
  background: var(--sage-tint);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-sm);
}

.lede {
  font-size: 1.1875rem;
  color: var(--ink-muted);
}

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.85rem 1.6rem;
  border: 0;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.btn--primary {
  background: var(--sage-deep);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: #435c40; box-shadow: var(--shadow-md); }
.btn--primary:active { transform: scale(0.985); }

.btn--accent {
  background: var(--marigold);
  color: var(--ink); /* 6.9:1 — ink on marigold, verified */
  box-shadow: var(--shadow-sm);
}
.btn--accent:hover { background: #f5a63c; box-shadow: var(--shadow-md); }
.btn--accent:active { transform: scale(0.985); }

.btn--ghost {
  background: transparent;
  color: var(--sage-deep);
  border: 1.5px solid var(--outline);
}
.btn--ghost:hover { background: var(--sage-tint); border-color: var(--sage); }

.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* --- Header --------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 249, 242, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-mid) var(--ease-out),
              box-shadow var(--dur-mid) var(--ease-out);
}
.site-header.is-stuck {
  border-bottom-color: var(--hairline);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.brand__mark { width: 34px; height: 34px; flex: none; }

.site-nav { display: flex; align-items: center; gap: var(--space-md); }
.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: color var(--dur-fast) var(--ease-out);
}
.site-nav a:hover { color: var(--ink); }
.site-nav .btn { min-height: 44px; padding: 0.55rem 1.15rem; font-size: 0.9375rem; }

@media (max-width: 720px) {
  .site-nav__links { display: none; }
}

/* --- Hero ----------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: var(--space-2xl) var(--space-xl);
  overflow: hidden;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  align-items: center;
}
@media (min-width: 960px) {
  .hero__grid { grid-template-columns: 1.05fr 0.95fr; gap: var(--space-2xl); }
}

.hero h1 { margin-bottom: var(--space-md); }
.hero h1 .accent {
  color: var(--sage-deep);
  position: relative;
  white-space: nowrap;
}
.hero__lede { font-size: 1.25rem; color: var(--ink-muted); }

/* Decorative background blooms */
.bloom {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}
.bloom--1 { width: 420px; height: 420px; background: var(--sage-tint); top: -120px; right: -80px; animation: drift 22s ease-in-out infinite; }
.bloom--2 { width: 300px; height: 300px; background: var(--blush); bottom: -100px; left: -60px; animation: drift 18s ease-in-out infinite reverse; }

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(0, -28px, 0) scale(1.06); }
}

/* --- Waitlist form -------------------------------------------------------- */
.waitlist-form {
  margin-top: var(--space-md);
  max-width: 30rem;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
}
.field-row .field { flex: 1 1 15rem; }
.field-row .btn { flex: 0 0 auto; }

.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--ink);
}

.field input {
  width: 100%;
  min-height: 52px;
  padding: 0.8rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.field input::placeholder { color: #948b81; }
.field input:focus {
  outline: none;
  border-color: var(--sage-deep);
  box-shadow: 0 0 0 3px rgba(79, 107, 76, 0.16);
}
.field input[aria-invalid="true"] {
  border-color: #ba1a1a;
  box-shadow: 0 0 0 3px rgba(186, 26, 26, 0.12);
}

.field__error {
  display: block;
  min-height: 1.25rem;
  margin-top: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #a01414;
}

.form-note {
  margin-top: var(--space-2xs);
  font-size: 0.875rem;
  color: var(--ink-muted);
  max-width: none;
}

.form-status {
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 600;
  display: none;
}
.form-status.is-visible { display: block; }
.form-status--ok {
  background: var(--sage-tint);
  color: #2f4a2c;
  border: 1px solid var(--sage);
}
.form-status--err {
  background: #fdecec;
  color: #8c1414;
  border: 1px solid #e5a3a3;
}

/* Spinner shown while submitting */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Phone mockup --------------------------------------------------------- */
.phone {
  position: relative;
  width: min(300px, 78vw);
  margin-inline: auto;
  aspect-ratio: 9 / 19;
  background: var(--ink);
  border-radius: 44px;
  padding: 11px;
  box-shadow: var(--shadow-lg);
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -14px, 0); }
}

.phone__screen {
  height: 100%;
  background: var(--cream);
  border-radius: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1rem 0.75rem;
}

.phone__notch {
  position: absolute;
  top: 11px; left: 50%;
  transform: translateX(-50%);
  width: 92px; height: 22px;
  background: var(--ink);
  border-radius: 0 0 14px 14px;
  z-index: 2;
}

.phone__greeting {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0.5rem 0 0.1rem;
}
.phone__sub { font-size: 0.7rem; color: var(--ink-muted); margin: 0 0 0.7rem; }

.phone__card {
  background: var(--white);
  border-radius: 14px;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.phone__dot {
  width: 28px; height: 28px; flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
}
.phone__dot svg { width: 15px; height: 15px; }
.phone__card-title { font-size: 0.72rem; font-weight: 800; line-height: 1.25; }
.phone__card-meta { font-size: 0.63rem; color: var(--ink-muted); line-height: 1.3; }

.phone__quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin: 0.35rem 0 0.6rem;
}
.phone__quick div {
  background: var(--sage-tint);
  border-radius: 12px;
  padding: 0.5rem 0.25rem;
  text-align: center;
  font-size: 0.6rem;
  font-weight: 800;
  color: #34432e;
}

.phone__nav {
  margin-top: auto;
  background: var(--white);
  border-radius: 16px;
  padding: 0.45rem;
  display: flex;
  justify-content: space-around;
  box-shadow: var(--shadow-sm);
}
.phone__nav span {
  width: 20px; height: 4px;
  border-radius: 3px;
  background: var(--hairline);
}
.phone__nav span:first-child { background: var(--sage); width: 26px; }

/* --- Cards / features ----------------------------------------------------- */
.grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.card {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-mid) var(--ease-out),
              box-shadow var(--dur-mid) var(--ease-out);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card h3 { margin-bottom: 0.4rem; }
.card p { font-size: 0.9375rem; color: var(--ink-muted); margin-bottom: 0; }

.card__icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: var(--space-sm);
}
.card__icon svg { width: 23px; height: 23px; }

.icon--sage { background: var(--sage-tint); color: #34432e; }
.icon--blush { background: var(--blush); color: #7a3b2c; }
.icon--marigold { background: #ffe6c2; color: #7a4a10; }
.icon--sand { background: var(--sand); color: #5a4c38; }

/* --- Steps ---------------------------------------------------------------- */
.steps { counter-reset: step; }
.step {
  position: relative;
  padding-left: 4.25rem;
  margin-bottom: var(--space-lg);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0; top: -0.15rem;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  background: var(--sage-deep);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: 50%;
}
.step h3 { margin-bottom: 0.25rem; }
.step p { color: var(--ink-muted); margin-bottom: 0; }

/* --- Trust band ----------------------------------------------------------- */
.band {
  background: var(--sage-tint);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-lg);
}
.band--sand { background: var(--sand); }

.trust-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-md); }
@media (min-width: 760px) { .trust-list { grid-template-columns: 1fr 1fr; } }

.trust-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.trust-list svg {
  width: 22px; height: 22px; flex: none;
  margin-top: 0.2rem;
  color: var(--sage-deep);
}
.trust-list strong { display: block; margin-bottom: 0.1rem; }
.trust-list span { font-size: 0.9375rem; color: var(--ink-muted); }

/* --- FAQ ------------------------------------------------------------------ */
.faq { max-width: 46rem; margin-inline: auto; }

.faq details {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2xs);
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: var(--space-sm) var(--space-md);
  font-weight: 700;
  font-size: 1.0625rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  min-height: 56px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  width: 11px; height: 11px;
  flex: none;
  border-right: 2.5px solid var(--sage-deep);
  border-bottom: 2.5px solid var(--sage-deep);
  transform: rotate(45deg);
  transition: transform var(--dur-mid) var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq summary:hover { background: var(--cream); }
.faq .faq__body { padding: 0 var(--space-md) var(--space-md); }
.faq .faq__body p { color: var(--ink-muted); font-size: 0.9375rem; margin-bottom: 0.75rem; }
.faq .faq__body p:last-child { margin-bottom: 0; }

/* --- Final CTA ------------------------------------------------------------ */
.cta-panel {
  background: var(--ink);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  color: var(--cream);
}
.cta-panel h2 { color: var(--cream); }
.cta-panel p { color: #cbc2b6; margin-inline: auto; }
.cta-panel .waitlist-form { margin-inline: auto; }
.cta-panel .field label { color: var(--cream); }
.cta-panel .form-note { color: #b3aa9e; }

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: var(--space-lg);
  margin-top: var(--space-2xl);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: space-between;
  align-items: center;
}
.site-footer p { font-size: 0.875rem; color: var(--ink-muted); margin: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: var(--space-md); }
.footer-nav a { font-size: 0.875rem; font-weight: 600; }

.disclaimer {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--hairline);
  font-size: 0.8125rem;
  color: var(--ink-muted);
  max-width: none;
}

/* --- Legal pages ---------------------------------------------------------- */
.legal { padding-block: var(--space-xl) var(--space-2xl); }
.legal__body { max-width: 46rem; }
.legal__body h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  margin-top: var(--space-lg);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--hairline);
}
.legal__body h3 { font-size: 1.1rem; margin-top: var(--space-md); }
.legal__body ul { padding-left: 1.15rem; margin-bottom: var(--space-sm); }
.legal__body li { margin-bottom: 0.4rem; max-width: var(--measure); }
.legal__body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-md);
  font-size: 0.9375rem;
}
.legal__body th, .legal__body td {
  text-align: left;
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}
.legal__body th { font-weight: 800; background: var(--sand); }
.table-wrap { overflow-x: auto; }

.meta-line {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin-bottom: var(--space-lg);
}

.callout {
  background: var(--sand);
  border-left: 4px solid var(--marigold);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
}
.callout p { margin-bottom: 0; font-size: 0.9375rem; }

/* --- Scroll reveal -------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* --- Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .phone, .bloom--1, .bloom--2 { animation: none; }
}
