/* ──────────────────────────────────────────────────────────────────
   NutriMatch — site stylesheet (v3, refined)
   Hand-written, no framework. Apple-tier restraint:
   - massive whitespace
   - typography as the protagonist
   - one idea per section
   - no decorative noise
   ────────────────────────────────────────────────────────────────── */

/* ═══ Tokens ══════════════════════════════════════════════════════ */

:root {
  /* Surfaces */
  --bg: #FFFFFF;
  --bg-soft: #FBFBFD;       /* Apple's warm off-white */
  --bg-near-white: #F5F5F7; /* Apple's section background */
  --card: #FFFFFF;
  --border: rgba(15, 23, 42, 0.08);
  --border-soft: rgba(15, 23, 42, 0.04);
  --border-strong: rgba(15, 23, 42, 0.14);

  /* Text */
  --fg: #1D1D1F;            /* Apple's near-black */
  --fg-soft: #424245;
  --muted: #6E6E73;         /* Apple's muted */
  --muted-soft: #86868B;

  /* Brand — used very sparingly */
  --primary: #8B5CF6;
  --primary-deep: #7C3AED;
  --primary-bg: rgba(139, 92, 246, 0.06);
  --accent: #EC4899;        /* Strawberry pink, used as a single accent */

  /* Status */
  --safe: #16A34A;
  --caution: #F59E0B;
  --danger: #EF4444;
  --safe-bg: rgba(22, 163, 74, 0.10);
  --caution-bg: rgba(245, 158, 11, 0.10);
  --danger-bg: rgba(239, 68, 68, 0.10);

  /* Warning callout (legal pages) */
  --warn-bg: rgba(245, 158, 11, 0.08);
  --warn-border: rgba(245, 158, 11, 0.30);
  --warn-fg: #92400E;

  /* Shadows — restrained */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, 0.10);
  --shadow-phone: 0 8px 24px rgba(15, 23, 42, 0.08), 0 32px 80px rgba(15, 23, 42, 0.10);

  /* Radii */
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 28px;

  /* Layout */
  --maxw: 1100px;
  --maxw-narrow: 720px;

  /* Type scale */
  --type-display: clamp(56px, 9vw, 112px);
  --type-h1: clamp(40px, 6.5vw, 72px);
  --type-h2: clamp(32px, 4.8vw, 56px);
  --type-h3: clamp(22px, 2.6vw, 28px);
  --type-lede: clamp(18px, 2.2vw, 22px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-soft: #0B0B0D;
    --bg-near-white: #131316;
    --card: #1A1A1E;
    --border: rgba(255, 255, 255, 0.08);
    --border-soft: rgba(255, 255, 255, 0.04);
    --border-strong: rgba(255, 255, 255, 0.16);
    --fg: #F5F5F7;
    --fg-soft: #D2D2D7;
    --muted: #86868B;
    --muted-soft: #6E6E73;
    --primary: #A78BFA;
    --primary-deep: #8B5CF6;
    --primary-bg: rgba(167, 139, 250, 0.10);
    --safe-bg: rgba(22, 163, 74, 0.16);
    --caution-bg: rgba(245, 158, 11, 0.16);
    --danger-bg: rgba(239, 68, 68, 0.16);
    --warn-bg: rgba(245, 158, 11, 0.12);
    --warn-fg: #FCD34D;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);
    --shadow-phone: 0 8px 24px rgba(0, 0, 0, 0.5), 0 32px 80px rgba(0, 0, 0, 0.5);
  }
}

/* ═══ Base ════════════════════════════════════════════════════════ */

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
@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;
  }
}
body {
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.7; }

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

::selection { background: var(--primary); color: #fff; }

/* ═══ Layout helpers ═══════════════════════════════════════════════ */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.wrap--narrow { max-width: var(--maxw-narrow); }
.wrap--wide { max-width: 1280px; }

/* ═══ Nav ═════════════════════════════════════════════════════════ */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  transition: border-color 0.2s;
}
.nav::after {
  content: '';
  position: absolute;
  inset: auto 0 -1px 0;
  height: 1px;
  background: var(--border);
  opacity: 0;
  transition: opacity 0.2s;
}
.nav.is-scrolled::after { opacity: 1; }

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--fg);
  letter-spacing: -0.3px;
}
.nav__brand:hover { opacity: 1; color: var(--fg); }

.nav__brand-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(236, 72, 153, 0.20));
}

/* Legacy mark, kept for any page that still uses it */
.nav__brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}

.nav__links {
  display: flex;
  gap: 32px;
  font-size: 14px;
  font-weight: 500;
}
.nav__links a {
  color: var(--fg-soft);
}
.nav__links a:hover { opacity: 1; color: var(--primary); }

.nav__cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1px;
  transition: opacity 0.15s, transform 0.15s;
}
.nav__cta:hover { color: var(--bg); opacity: 0.9; transform: scale(1.02); }

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

/* ═══ Hero ════════════════════════════════════════════════════════
   Bulletproof centering: every element gets margin auto + text-align
   center explicitly so a stale cached stylesheet can't fall back to
   browser defaults and ruin the composition.
   ──────────────────────────────────────────────────────────────── */

.hero {
  text-align: center !important;
  padding: 96px 24px 80px;
  max-width: 920px;
  margin: 0 auto !important;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__overline {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin: 0 0 20px;
  text-align: center;
}

.hero__title {
  font-size: var(--type-display);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: -0.045em;
  margin: 0 auto 28px;
  color: var(--fg);
  text-align: center;
  max-width: 100%;
}
.hero__title-accent {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero__lede {
  font-size: var(--type-lede);
  color: var(--muted);
  margin: 0 auto 44px;
  max-width: 560px;
  line-height: 1.45;
  font-weight: 400;
  text-align: center;
}

.hero__strawberry {
  display: block;
  width: clamp(140px, 22vw, 200px);
  max-width: 200px;
  height: auto;
  margin: 56px auto 0;
  filter: drop-shadow(0 16px 40px rgba(236, 72, 153, 0.25));
  animation: floatBob 6s ease-in-out infinite;
  user-select: none;
  -webkit-user-drag: none;
}
@keyframes floatBob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

/* Mobile: tighter spacing so the hero fits one screen on a phone. */
@media (max-width: 720px) {
  .hero {
    padding: 56px 20px 56px;
  }
  .hero__title {
    margin-bottom: 20px;
  }
  .hero__lede {
    font-size: 16.5px;
    margin-bottom: 32px;
  }
  .hero__strawberry {
    width: clamp(120px, 32vw, 160px);
    margin-top: 36px;
  }
}

/* ═══ App Store badges ═══════════════════════════════════════════ */

.badges {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px 12px 18px;
  border-radius: 14px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid var(--fg);
  transition: opacity 0.15s, transform 0.15s;
}
.badge:hover {
  color: var(--bg);
  opacity: 0.92;
  transform: translateY(-1px);
}
.badge--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-strong);
}
.badge--ghost:hover {
  color: var(--fg);
  background: var(--bg-soft);
}
.badge__icon {
  font-size: 20px;
  line-height: 1;
}
.badge small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  opacity: 0.72;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

/* ═══ Section heading kit ═════════════════════════════════════════ */

.section-block {
  padding: 120px 24px;
  text-align: center;
}
.section-block--tight {
  padding: 80px 24px;
}

.section-overline {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--primary);
  margin: 0 0 16px;
}
.section-title {
  font-size: var(--type-h2);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 auto 20px;
  color: var(--fg);
  max-width: 18ch;
}
.section-lede {
  font-size: var(--type-lede);
  color: var(--muted);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.45;
  font-weight: 400;
}

/* ═══ LIVE FOOD-SEARCH DEMO ═══════════════════════════════════════
   Mirrors the onboarding/preview.tsx scripted demo:
     1. typewriter "Big Mac"
     2. brief "Searching…"
     3. 3 results stagger up
     4. top result pulses
     5. crossfade to detail with risk-meter fill
   Loops as long as the section is in view (IntersectionObserver).
   ──────────────────────────────────────────────────────────────── */

.demo-section {
  background: var(--bg-near-white);
  padding: 120px 24px;
}

.demo-section__head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 64px;
}

.demo {
  width: min(380px, 92vw);
  margin: 0 auto;
  position: relative;
}

/* iPhone-ish frame */
.demo__phone {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 19.2;
  background: #0F0F12;
  border-radius: 44px;
  padding: 12px;
  box-shadow: var(--shadow-phone), 0 0 0 1px rgba(255,255,255,0.05) inset;
  overflow: hidden;
}
@media (prefers-color-scheme: light) {
  .demo__phone { background: #1D1D1F; }
}

.demo__screen {
  position: absolute;
  inset: 12px;
  background: #FFFFFF;
  border-radius: 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
@media (prefers-color-scheme: dark) {
  .demo__screen { background: #1A1A1E; }
}

/* iPhone-ish notch/island */
.demo__notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 22px;
  background: #0F0F12;
  border-radius: 999px;
  z-index: 5;
}

/* Status bar */
.demo__status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}
.demo__status-icons { display: inline-flex; gap: 6px; opacity: 0.7; }

/* Cross-fade container (search ↔ detail) */
.demo__view {
  position: absolute;
  inset: 36px 0 0 0;
  padding: 18px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  overflow: hidden;
}
.demo__view.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* The detail view holds A LOT of content (matches the in-app
   food-detail screen one-for-one). Make it a scrollable stack so the
   auto-scroll JS can walk through every section. */
.demo__view--detail {
  padding: 0;
  gap: 0;
}
.demo__detail-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* Hide scrollbars for the cinematic look — the auto-scroll is the
     main interaction; users on mobile can still scroll-touch. */
  scrollbar-width: none;
}
.demo__detail-scroll::-webkit-scrollbar { display: none; }

/* ── Search view ── */
.demo__search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #F2F2F7;
  border-radius: 14px;
  font-size: 16px;
  color: var(--fg);
  font-weight: 500;
  min-height: 46px;
}
@media (prefers-color-scheme: dark) {
  .demo__search-bar { background: #2C2C2E; }
}
.demo__search-icon { opacity: 0.45; font-size: 16px; line-height: 1; }
.demo__search-text { letter-spacing: -0.2px; }
.demo__search-text:empty::before {
  content: 'Search foods, brands, barcodes…';
  color: var(--muted);
  font-weight: 400;
}
.demo__caret {
  display: inline-block;
  width: 1.5px;
  height: 18px;
  background: var(--primary);
  margin-left: 1px;
  vertical-align: middle;
  animation: caretBlink 1s steps(2) infinite;
}
@keyframes caretBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.demo__searching {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 12px 4px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.demo__searching.is-visible { display: inline-flex; }
.demo__spinner {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.demo__results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.demo__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
  .demo__row { background: #2C2C2E; border-color: rgba(255,255,255,0.06); }
}
.demo__row.is-visible { opacity: 1; transform: translateY(0); }
.demo__row.is-tapping {
  animation: rowPulse 0.55s ease-out;
}
@keyframes rowPulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.03); box-shadow: 0 8px 20px rgba(139, 92, 246, 0.25); }
  60% { transform: scale(0.98); }
  100% { transform: scale(1); }
}
.demo__row-emoji { font-size: 24px; line-height: 1; }
.demo__row-info { flex: 1; min-width: 0; }
.demo__row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.demo__row-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.demo__badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.demo__badge--danger { background: var(--danger-bg); color: var(--danger); }
.demo__badge--safe { background: var(--safe-bg); color: var(--safe); }
.demo__badge--caution { background: var(--caution-bg); color: var(--caution); }

/* ── Detail view ── */
.demo__detail-back {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.2px;
}
.demo__detail-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--fg);
  line-height: 1.1;
}
.demo__detail-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.demo__risk {
  margin-top: 4px;
}
.demo__risk-track {
  position: relative;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, var(--safe) 0%, var(--caution) 50%, var(--danger) 100%);
  border-radius: 999px;
  overflow: visible;
}
.demo__risk-dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--fg);
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: left 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.demo__risk-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--muted);
  text-transform: uppercase;
}

.demo__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.demo__chip {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
}
.demo__chip--danger { background: var(--danger-bg); color: var(--danger); }
.demo__chip--caution { background: var(--caution-bg); color: var(--caution); }

.demo__verdict {
  margin-top: auto;
  padding: 12px 14px;
  background: var(--danger-bg);
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--fg);
}
.demo__verdict strong { color: var(--danger); }

/* Phone reflection / glow accent */
.demo::before {
  content: '';
  position: absolute;
  inset: -40px;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.15), transparent 60%);
  z-index: -1;
  pointer-events: none;
}

/* ═══ Pinned feature sections (replaces horizontal carousel) ═══════
   Each .feature-pin is a full-viewport-tall section with:
     - left: title/copy
     - right: a phone screenshot
   Both fade in as the section enters the viewport.
   On mobile they collapse to single column.
   ──────────────────────────────────────────────────────────────── */

.feature-pin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 120px 24px;
}
.feature-pin--reverse .feature-pin__copy { order: 2; }
.feature-pin--reverse .feature-pin__visual { order: 1; }

.feature-pin__copy {
  max-width: 460px;
}
.feature-pin__step {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--primary);
  margin: 0 0 14px;
}
.feature-pin__title {
  font-size: clamp(34px, 4.6vw, 52px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 20px;
  color: var(--fg);
}
.feature-pin__lede {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 18px;
}
.feature-pin__caption {
  font-size: 13px;
  color: var(--muted-soft);
  margin: 18px 0 0;
}

.feature-pin__visual {
  display: flex;
  justify-content: center;
}
.feature-pin__phone {
  width: min(360px, 100%);
  aspect-ratio: 1284 / 2778;
  border-radius: 36px;
  overflow: hidden;
  box-shadow: var(--shadow-phone);
  background: #000;
}
.feature-pin__phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 880px) {
  .feature-pin {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 80px 24px;
    text-align: center;
  }
  .feature-pin__copy { margin: 0 auto; }
  .feature-pin--reverse .feature-pin__copy,
  .feature-pin--reverse .feature-pin__visual { order: initial; }
}

/* ═══ Ribbon — small icon-free feature list ═══════════════════════ */

.ribbon {
  background: var(--bg-near-white);
  padding: 64px 24px;
}
.ribbon__grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 48px;
  border-top: 1px solid var(--border);
}
.ribbon__item {
  padding: 32px 0 0;
  border-top: 1px solid transparent;
}
.ribbon__num {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--primary);
  margin: 0 0 10px;
}
.ribbon__title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin: 0 0 6px;
  color: var(--fg);
}
.ribbon__desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* ═══ Pricing ═════════════════════════════════════════════════════ */

.pricing-section {
  padding: 120px 24px;
  text-align: center;
}
.pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 56px auto 0;
  max-width: 880px;
}
.plan {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: left;
  transition: border-color 0.2s, transform 0.2s;
}
.plan:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.plan--featured {
  border-color: var(--fg);
  border-width: 1px;
}
.plan__name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}
.plan__price {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -1.4px;
  margin: 0;
  color: var(--fg);
  line-height: 1;
}
.plan__period {
  font-size: 14px;
  color: var(--muted);
  margin: 8px 0 0;
}
.plan__note {
  font-size: 13px;
  color: var(--muted-soft);
  margin: 24px 0 0;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.pricing__fineprint {
  font-size: 13px;
  color: var(--muted-soft);
  max-width: 540px;
  margin: 32px auto 0;
}

/* ═══ Privacy statement (single, refined) ═════════════════════════ */

.privacy {
  padding: 140px 24px;
  text-align: center;
}
.privacy__title {
  font-size: var(--type-h1);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0 auto 24px;
  max-width: 14ch;
  color: var(--fg);
}
.privacy__title-accent {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.privacy__lede {
  font-size: var(--type-lede);
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.45;
}
.privacy__link {
  font-size: 15px;
  font-weight: 500;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ═══ Final CTA ═══════════════════════════════════════════════════ */

.final {
  text-align: center;
  padding: 120px 24px 140px;
  background: var(--bg-near-white);
}
.final__strawberry {
  width: 96px;
  margin: 0 auto 32px;
  filter: drop-shadow(0 8px 24px rgba(236, 72, 153, 0.30));
  animation: floatBob 6s ease-in-out infinite;
}
.final__title {
  font-size: var(--type-h1);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0 auto 20px;
  max-width: 16ch;
  color: var(--fg);
}
.final__lede {
  color: var(--muted);
  font-size: 18px;
  margin: 0 auto 40px;
  max-width: 480px;
}

/* ═══ Reveal animation ═══════════════════════════════════════════ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ═══ Long-form pages (privacy, terms, support, delete-account) ═══ */

.page {
  padding: 32px 0 96px;
}
.page h1 {
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: -0.025em;
  margin: 0 0 8px;
  font-weight: 700;
  color: var(--fg);
}
.page__updated {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 36px;
}
.page h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 44px 0 14px;
  letter-spacing: -0.015em;
  color: var(--fg);
}
.page h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 8px;
  color: var(--fg-soft);
}
.page p, .page li {
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg-soft);
}
.page ul, .page ol { padding-left: 24px; }
.page li { margin-bottom: 6px; }
.page strong { font-weight: 600; color: var(--fg); }
.page hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

.callout {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 22px 0;
  font-size: 14px;
  color: var(--warn-fg);
  line-height: 1.55;
}
.callout strong { font-weight: 700; }
.callout--info {
  background: var(--primary-bg);
  border-color: rgba(139, 92, 246, 0.20);
  color: var(--fg-soft);
}

/* ═══ Buttons ═════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.1px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
}
.btn:hover { color: #fff; opacity: 0.92; transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border-strong);
}
.btn--ghost:hover { background: var(--bg-soft); color: var(--fg); }

/* ═══ Footer ═══════════════════════════════════════════════════════ */

footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px 56px;
  background: var(--bg-soft);
}
.footer__grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 36px;
  font-size: 13px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.footer__col h4 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.footer__col a {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}
.footer__col a:hover { color: var(--fg); opacity: 1; }
.footer__col p {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 0;
  max-width: 240px;
  line-height: 1.55;
}
.footer__bottom {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--muted-soft);
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
}
.footer__bottom span:last-child {
  font-size: 11px;
  max-width: 480px;
  text-align: right;
  line-height: 1.5;
}

/* ═══ Detail view — sections (replicates the in-app screen) ══════
   Tokens used:
     .dx-section            — vertical block with an UPPERCASE label
     .dx-card               — intolerance card (Gluten / Lactose / ATI)
     .dx-meter              — threshold-bar inside intolerance card
     .dx-nutrition          — 2-col nutrient grid
     .dx-add                — hidden-additive row
     .ig                    — inline ingredient token (highlight)
   ──────────────────────────────────────────────────────────────── */

.dx-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dx-section__label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 6px 0 4px;
}

.dx-summary {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--fg);
  margin: 0;
}
.dx-disclaimer {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-soft);
  margin: 6px 0 0;
}

/* Intolerance card */
.dx-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.6);
}
@media (prefers-color-scheme: dark) {
  .dx-card { background: rgba(255, 255, 255, 0.03); }
}
.dx-card--danger { border-color: rgba(239, 68, 68, 0.3); }
.dx-card--caution { border-color: rgba(245, 158, 11, 0.3); }
.dx-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dx-card__name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.1px;
  color: var(--fg);
}
.dx-card__badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.dx-card__badge--danger { background: var(--danger-bg); color: var(--danger); }
.dx-card__badge--caution { background: var(--caution-bg); color: var(--caution); }
.dx-card__reason {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--fg-soft);
  margin: 0;
}
.dx-tip {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  margin: 4px 0 0;
  padding: 8px 10px;
  background: var(--primary-bg);
  border-radius: 8px;
}

.dx-meter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}
.dx-meter__row {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted);
}
.dx-meter__row strong { color: var(--fg); font-weight: 700; }
.dx-meter__bar {
  height: 4px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 2px;
}
@media (prefers-color-scheme: dark) {
  .dx-meter__bar { background: rgba(255, 255, 255, 0.08); }
}
.dx-meter__fill {
  height: 100%;
  border-radius: 999px;
}
.dx-meter__fill--danger { background: var(--danger); }
.dx-meter__fill--caution { background: var(--caution); }

/* Nutrition grid — 2 columns of (color-dot + value/label) */
.dx-nutrition {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.dx-nut {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 10px;
}
@media (prefers-color-scheme: dark) {
  .dx-nut { background: rgba(255, 255, 255, 0.04); }
}
.dx-nut__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dx-nut__v {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.2px;
  line-height: 1.2;
}
.dx-nut__l {
  font-size: 9.5px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 1px;
}

/* Hidden additives */
.dx-add {
  border-top: 1px solid var(--border);
  padding: 10px 0;
}
.dx-add:first-child { border-top: 0; padding-top: 4px; }
.dx-add__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.dx-add__e {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--danger);
  background: var(--danger-bg);
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}
.dx-add__name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fg);
}
.dx-add__cat {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: 0.1px;
}
.dx-add__concern {
  font-size: 11px;
  line-height: 1.5;
  color: var(--fg-soft);
  margin: 6px 0 0;
}

/* Annotated ingredients list */
.dx-ingredients {
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--fg-soft);
  margin: 0;
}
.ig {
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 600;
}
.ig--danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.ig--caution {
  background: var(--caution-bg);
  color: var(--caution);
}

/* ═══ Chat preview (Nutri AI) ════════════════════════════════════
   Same phone frame as the food demo, with a custom header (gif
   avatar + name + tagline), a scrollable chat surface, and a mock
   input at the bottom.
   ──────────────────────────────────────────────────────────────── */

.chat-section {
  background: var(--bg);
  padding: 64px 24px 120px;
}
.chat {
  width: min(380px, 92vw);
  margin: 0 auto;
  position: relative;
}
.chat::before {
  content: '';
  position: absolute;
  inset: -40px;
  background: radial-gradient(ellipse at center, rgba(167, 139, 250, 0.18), transparent 60%);
  z-index: -1;
  pointer-events: none;
}

.chat__header {
  position: absolute;
  inset: 36px 0 auto 0;
  padding: 16px 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  z-index: 2;
}
.chat__avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(167, 139, 250, 0.25);
}
.chat__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.chat__header-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.2px;
  margin-top: 2px;
}
.chat__header-sub {
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
  font-weight: 500;
  line-height: 1.4;
  max-width: 220px;
}

/* Chat scroll area sits between the absolutely-positioned header
   (which is sticky-by-position-absolute) and the input row. */
.chat__scroll {
  position: absolute;
  inset: 178px 0 56px 0;
  overflow-y: auto;
  padding: 14px 14px 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.chat__scroll::-webkit-scrollbar { display: none; }

.chat__messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat__bubble {
  max-width: 82%;
  padding: 10px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  border-radius: 18px;
  word-wrap: break-word;
  animation: bubbleIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat__bubble--user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-top-right-radius: 4px;
}
.chat__bubble--nutri {
  align-self: flex-start;
  background: var(--bg-near-white);
  color: var(--fg);
  border-top-left-radius: 4px;
  border: 1px solid var(--border);
}
@media (prefers-color-scheme: dark) {
  .chat__bubble--nutri { background: #2C2C2E; border-color: rgba(255, 255, 255, 0.08); }
}

.chat__typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
  background: var(--bg-near-white);
  border: 1px solid var(--border);
  border-radius: 18px;
  border-top-left-radius: 4px;
  animation: bubbleIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.chat__typing--user {
  align-self: flex-end;
  background: var(--primary);
  border: 0;
  border-top-right-radius: 4px;
  border-top-left-radius: 18px;
}
.chat__typing--user .chat__dot { background: #fff; opacity: 0.85; }
.chat__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: dotBounce 1.05s ease-in-out infinite;
}
.chat__dot:nth-child(2) { animation-delay: 0.13s; }
.chat__dot:nth-child(3) { animation-delay: 0.26s; }
@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Mock input bar at the bottom of the chat phone */
.chat__input {
  position: absolute;
  inset: auto 12px 12px 12px;
  height: 40px;
  background: var(--bg-near-white);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 0 16px;
  font-size: 12.5px;
  color: var(--muted);
}
.chat__input-text { font-weight: 500; }
.chat__input-send {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

/* ═══ Mobile-wide adjustments ═════════════════════════════════════
   One block of phone-screen tweaks so the layout collapses cleanly.
   Each section has its own breakpoint above; this is the catch-all
   to make sure nothing overflows or sits at an awkward size on a
   small device.
   ──────────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  body { font-size: 16px; }

  .nav { padding: 0 18px; }

  /* Demo phone — keep within viewport with breathing room */
  .demo-section { padding: 72px 20px; }
  .demo-section__head { margin-bottom: 44px; }
  .demo { width: min(340px, 88vw); }

  /* Chat phone — same sizing rules so the two demos read as a pair */
  .chat-section { padding: 56px 20px 96px; }
  .chat { width: min(340px, 88vw); }
  .chat__header { padding: 14px 16px 10px; }
  .chat__avatar { width: 56px; height: 56px; }
  .chat__header-name { font-size: 15px; }
  .chat__header-sub { font-size: 10px; max-width: 200px; }
  .chat__scroll { inset: 168px 0 50px 0; padding: 12px 12px 6px; }
  .chat__bubble { font-size: 12px; padding: 9px 12px; }
  .chat__input { inset: auto 10px 10px 10px; height: 36px; }

  /* Detail view — slightly tighter type for small phones */
  .demo__detail-scroll { padding: 16px 14px 20px; gap: 12px; }
  .demo__detail-title { font-size: 22px; }
  .dx-card { padding: 11px 12px; }
  .dx-summary, .dx-card__reason, .dx-add__concern, .dx-ingredients { font-size: 11.5px; }
  .dx-nutrition { gap: 6px; }
  .dx-nut { padding: 7px 9px; }

  /* Pinned features collapse to single column */
  .feature-pin {
    grid-template-columns: 1fr !important;
    gap: 36px;
    padding: 64px 20px;
    text-align: center;
  }
  .feature-pin__copy { margin: 0 auto; max-width: 100%; }
  .feature-pin__title { font-size: clamp(28px, 7.4vw, 36px); }
  .feature-pin__lede { font-size: 16px; }
  .feature-pin--reverse .feature-pin__copy,
  .feature-pin--reverse .feature-pin__visual { order: initial; }
  .feature-pin__phone { width: min(280px, 80vw); }

  /* Quiet ribbon */
  .ribbon { padding: 48px 20px; }
  .ribbon__grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .ribbon__item {
    padding: 28px 0;
    border-top: 1px solid var(--border);
  }
  .ribbon__item:first-child { border-top: 0; padding-top: 16px; }

  /* Pricing */
  .pricing-section { padding: 72px 20px; }
  .pricing { gap: 12px; }
  .plan { padding: 28px 22px; }
  .plan__price { font-size: 34px; }

  /* Privacy + final */
  .privacy { padding: 88px 24px; }
  .final { padding: 88px 24px 100px; }
  .final__strawberry { width: 80px; margin-bottom: 24px; }

  /* Section-block (re-used by various sections) */
  .section-block { padding: 80px 20px; }

  /* Footer collapses to single column */
  footer { padding: 40px 20px 48px; }
  .footer__grid {
    flex-direction: column;
    gap: 28px;
  }
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .footer__bottom span:last-child {
    text-align: left;
  }

  /* Badges stack on very small screens */
  .badges { gap: 10px; }
  .badge { padding: 11px 18px 11px 14px; font-size: 13px; }
  .badge small { font-size: 9.5px; }
}

/* Very small phones (iPhone SE / older Android). */
@media (max-width: 380px) {
  .hero__title { font-size: clamp(40px, 13vw, 56px); }
  .demo { width: 90vw; }
  .demo__detail-title { font-size: 22px; }
}

/* ═══ Center card (404, reset-password) ═══════════════════════════ */

.center-card {
  max-width: 480px;
  margin: 96px auto;
  padding: 0 24px;
  text-align: center;
}
.center-card__icon {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: var(--primary-bg);
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  border: 1px solid rgba(139, 92, 246, 0.2);
}
.center-card h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  color: var(--fg);
}
.center-card p {
  color: var(--muted);
  font-size: 16px;
  margin: 0 0 28px;
  line-height: 1.55;
}
