/* ==========================================================================
   CaloBuddy — Introductory Site
   Design system translated 1:1 from the Flutter app:
   lib/config/theme.dart + lib/shared/widgets/glass_card.dart
   Light & dark themes, exactly like ThemeData.light() / ThemeData.dark()
   ========================================================================== */

/* ---------- App tokens (single source of truth, same as AppTheme) ------- */
:root {
  /* Brand */
  --c-navy:        #0F172A;   /* AppTheme.primary   */
  --c-slate:       #334155;   /* AppTheme.secondary */
  --c-cta:         #0369A1;   /* AppTheme.accent    */
  --c-paper:       #F1F5F9;   /* AppTheme.background (light scaffold) */
  --c-ink:         #020617;   /* AppTheme.textMain  */

  /* CaloBuddy Authentic Brand Blue Tokens (lib/config/theme.dart AppTheme.accent) */
  --c-authentic-blue: #0369A1;  /* AppTheme.accent / CTA blue */
  --c-blue-bright:    #38BDF8;  /* sky-400 (high contrast on dark backdrops) */
  --c-blue-accent:    #0284C7;  /* sapphire accent */

  /* Macro telemetry — AppTheme macro colours, identical in both themes */
  --c-protein:     #F59E0B;   /* amber-500  */
  --c-carbs:       #0369A1;   /* accent blue */
  --c-carbs-bright:#38BDF8;   /* sky-400 (dark-mode legible blue) */
  --c-fat:         #F43F5E;   /* rose-500   */
  --c-water:       #38BDF8;   /* sky-400    */
  --c-success:     #10B981;
  --c-danger:      #EF4444;

  /* Macro tints — withValues(alpha: 0.12) */
  --tint-protein:  rgba(245, 158, 11, 0.12);
  --tint-carbs:    rgba(3, 105, 161, 0.12);
  --tint-fat:      rgba(244, 63, 94, 0.12);
  --tint-water:    rgba(56, 189, 248, 0.12);

  /* Radii — AppTheme.cardRadius / buttonRadius */
  --r-card:   24px;
  --r-button: 20px;
  --r-chip:   999px;

  /* Type */
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Plus Jakarta Sans", "Montserrat", system-ui, sans-serif;

  /* Motion — mirrors GoalRing: 1200ms easeOutCubic */
  --ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
  --dur-ring: 1200ms;
}

/* ---------- Theme: DARK (default — matches ThemeData.dark + glass_card) - */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:            #060B18;
  --bg-deep:       #020617;
  --surface:       #0F172A;
  --text:          #F8FAFC;
  --text-muted:    rgba(248, 250, 252, 0.72);  /* WCAG alpha token */
  --text-faint:    rgba(248, 250, 252, 0.48);

  /* Authentic Blue Typography tokens (WCAG AA compliant against dark background) */
  --blue-word:        #38BDF8;  /* sky-400: bright, vivid, 8.5:1 contrast against #060B18 */
  --blue-word-glow:   rgba(56, 189, 248, 0.35);

  /* GlassCard dark recipe */
  --glass-hi:      rgba(255, 255, 255, 0.10);
  --glass-mid:     rgba(255, 255, 255, 0.06);
  --glass-lo:      rgba(255, 255, 255, 0.03);
  --glass-border:  rgba(255, 255, 255, 0.22);
  --glass-shadow:  0 8px 24px rgba(0, 0, 0, 0.28);

  --carbs-ink:     var(--c-carbs-bright);      /* legible blue on navy */
  --hairline:      rgba(255, 255, 255, 0.08);
  --chip-bg:       rgba(255, 255, 255, 0.06);
  --nav-bg:        rgba(6, 11, 24, 0.72);
  --toggle-track:  rgba(255, 255, 255, 0.10);
  --grain-opacity: 0.05;
}

/* ---------- Theme: LIGHT (ThemeData.light + glass_card) ---------------- */
:root[data-theme="light"] {
  color-scheme: light;

  --bg:            #F1F5F9;
  --bg-deep:       #E2E8F0;
  --surface:       #FFFFFF;
  --text:          #020617;
  --text-muted:    rgba(2, 6, 23, 0.73);       /* AppTheme.secondaryTextAlpha */
  --text-faint:    rgba(2, 6, 23, 0.45);

  /* Authentic Blue Typography tokens (WCAG AA compliant against light background) */
  --blue-word:        #0369A1;  /* AppTheme.accent: rich authentic CTA blue, 5.2:1 contrast */
  --blue-word-glow:   rgba(3, 105, 161, 0.20);

  /* GlassCard light recipe */
  --glass-hi:      rgba(255, 255, 255, 0.96);
  --glass-mid:     rgba(255, 255, 255, 0.90);
  --glass-lo:      rgba(255, 255, 255, 0.84);
  --glass-border:  rgba(15, 23, 42, 0.14);
  --glass-shadow:  0 8px 20px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15, 23, 42, 0.04);

  --carbs-ink:     var(--c-carbs);
  --hairline:      rgba(15, 23, 42, 0.10);
  --chip-bg:       rgba(15, 23, 42, 0.05);
  --nav-bg:        rgba(241, 245, 249, 0.78);
  --toggle-track:  rgba(15, 23, 42, 0.10);
  --grain-opacity: 0.035;
}

/* ---------- Reset / base ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.5s var(--ease-out-cubic), color 0.5s var(--ease-out-cubic);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { list-style: none; }

/* Screen-reader-only text (live regions, carousel status) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

::selection { background: var(--c-protein); color: #1A1000; }

/* Film grain — breaks the flat "AI render" look */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 9998;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container {
  width: min(1180px, 100% - clamp(2rem, 6vw, 5rem));
  margin-inline: auto;
}

.font-display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.06;
}

/* Glass surface — direct translation of GlassCard */
.glass {
  background: linear-gradient(135deg, var(--glass-hi) 0%, var(--glass-mid) 50%, var(--glass-lo) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}


/* ==========================================================================
   NAVIGATION — glass pill, wordmark, light/dark toggle (app settings gear)
   ========================================================================== */
.nav-wrapper {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: clamp(0.75rem, 2vw, 1.25rem) clamp(1rem, 3vw, 2rem);
}

.island-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1180px;
  margin-inline: auto;
  padding: 0.5rem 0.625rem 0.5rem 1rem;
  border-radius: var(--r-chip);
  background: var(--nav-bg);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav-brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  position: relative;
  padding: 0.45rem 0.9rem;
  border-radius: var(--r-chip);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.25s, background-color 0.25s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--chip-bg);
}

/* Active section marker — filled pill + amber dot */
.nav-link.active {
  color: var(--text);
  background: var(--chip-bg);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--c-protein);
  transform: translateX(-50%);
}

.mobile-nav-link.active { color: var(--c-protein); }

/* Scroll progress hairline — thin gradient line on the top viewport edge */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 120;
  background: linear-gradient(90deg, var(--c-protein), #FBBF24 55%, var(--c-carbs-bright));
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme toggle — sun/moon pill, like the app's appearance setting */
.theme-toggle {
  position: relative;
  width: 58px;
  height: 30px;
  border-radius: var(--r-chip);
  background: var(--toggle-track);
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
  transition: background-color 0.3s;
}

.theme-toggle .toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text);
  display: grid;
  place-items: center;
  transition: transform 0.45s var(--ease-out-cubic), background-color 0.3s;
}

:root[data-theme="light"] .theme-toggle .toggle-thumb { transform: translateX(28px); }

.theme-toggle svg { width: 14px; height: 14px; }
.theme-toggle .icon-moon { display: block; color: #060B18; }
.theme-toggle .icon-sun  { display: none;  color: #F8FAFC; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun  { display: block; }

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  place-items: center;
  flex-direction: column;
  gap: 5px;
}

.mobile-menu-btn .hamburger-line {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.35s var(--ease-out-cubic), opacity 0.3s;
}

body.menu-open .mobile-menu-btn .hamburger-line:nth-child(1) { transform: translateY(3.25px) rotate(45deg); }
body.menu-open .mobile-menu-btn .hamburger-line:nth-child(2) { transform: translateY(-3.25px) rotate(-45deg); }

/* Mobile drawer */
.mobile-nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem clamp(1.5rem, 8vw, 4rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-out-cubic), visibility 0.4s;
}

body.menu-open .mobile-nav-drawer { opacity: 1; visibility: visible; }

.mobile-nav-links li { border-bottom: 1px solid var(--hairline); }

.mobile-nav-link {
  display: block;
  padding: 1.1rem 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  font-weight: 700;
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.5s var(--ease-out-cubic), opacity 0.5s;

}

body.menu-open .mobile-nav-link { transform: none; opacity: 1; }
body.menu-open .mobile-nav-links li:nth-child(1) .mobile-nav-link { transition-delay: 0.06s; }
body.menu-open .mobile-nav-links li:nth-child(2) .mobile-nav-link { transition-delay: 0.12s; }
body.menu-open .mobile-nav-links li:nth-child(3) .mobile-nav-link { transition-delay: 0.18s; }
body.menu-open .mobile-nav-links li:nth-child(4) .mobile-nav-link { transition-delay: 0.24s; }
body.menu-open .mobile-nav-links li:nth-child(5) .mobile-nav-link { transition-delay: 0.30s; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.6rem;
  border-radius: var(--r-button);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  position: relative;
  transition: transform 0.3s var(--ease-out-cubic), box-shadow 0.3s, background-color 0.3s;
  will-change: transform;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

:root[data-theme="dark"] .btn-primary { background: #F8FAFC; color: #060B18; }

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); }

.btn-amber {
  background: var(--c-protein);
  color: #1A1000;
}

.btn-amber:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(245, 158, 11, 0.35); }

.btn-ghost {
  border: 1px solid var(--hairline);
  color: var(--text);
  background: var(--chip-bg);
}

.btn-ghost:hover { background: var(--glass-border); }

.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.85rem; border-radius: var(--r-chip); }

.btn .btn-arrow { transition: transform 0.3s var(--ease-out-cubic); }
.btn:hover .btn-arrow { transform: translateX(4px); }


/* ==========================================================================
   SECTION SCAFFOLD — numbered editorial sections, alternating skins
   ========================================================================== */
.section { position: relative; padding: clamp(5rem, 12vh, 9rem) 0; }

/* Anchor jumps land below the fixed island nav, not underneath it */
.section[id] { scroll-margin-top: 84px; }

.section--invert {
  background: var(--surface);
}
.section--invert .section-subtitle { color: var(--text-muted); }

.section-head { max-width: 720px; margin-bottom: clamp(2.5rem, 6vh, 4.5rem); }
.section-head--center { margin-inline: auto; text-align: center; }

.section-index {
  display: inline-flex;
  align-items: baseline;
  gap: 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-protein);
  margin-bottom: 1.4rem;
  transition: color 0.3s ease;
}

.section-index.index-blue {
  color: var(--blue-word);
}

.section-index::after {
  content: "";
  width: 56px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.section-title {
  font-size: clamp(2.2rem, 5.2vw, 4rem);
  margin-bottom: 1.1rem;
  text-wrap: balance;
}

.section-title em {
  font-style: italic;
  font-weight: 600;
  color: var(--c-protein);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.section-title em.em-blue,
.hero-headline em.em-blue,
.em-blue,
.word-blue {
  color: var(--blue-word) !important;
  text-shadow: 0 0 24px var(--blue-word-glow);
}

.section-subtitle {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--text-muted);
  max-width: 56ch;
}

.section-head--center .section-subtitle { margin-inline: auto; }

/* ==========================================================================
   HERO — editorial broken grid, real product UI as the asset
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(6.5rem, 12vh, 8.5rem) 0 0;
  overflow: hidden;
}

.hero > .container {
  flex: 1;
  display: flex;
  align-items: center;
  width: min(1180px, 100% - clamp(2rem, 6vw, 5rem));
  margin-inline: auto;
}

/* Ambient ember glow — one warm light, not a mesh gradient */
.hero::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 55vw;
  height: 55vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.14), transparent 62%);
  pointer-events: none;
}

:root[data-theme="light"] .hero::before {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.18), transparent 62%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  width: 100%;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.6rem;
}

.hero-kicker .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-success);
  box-shadow: 0 0 12px var(--c-success);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.6; }
}

.hero-headline {
  font-size: clamp(2.5rem, 5.2vw, 4.6rem);
  line-height: 1.08;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

.hero-headline .line { display: block; overflow: hidden; }
.hero-headline .line-inner { display: block; transform: translateY(110%); }

.hero-headline em { font-style: italic; font-weight: 600; color: var(--c-protein); }

.hero-subtext {
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  color: var(--text-muted);
  max-width: 46ch;
  margin-bottom: 2.2rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 2.6rem; }

/* Real telemetry strip — specific numbers beat vague claims */
.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.2rem, 3vw, 2.4rem);
  padding-top: 1.6rem;
  border-top: 1px solid var(--hairline);
}

.proof-item .proof-value {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1;
}

.proof-item .proof-label {
  font-size: 0.78rem;
  color: var(--text-faint);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-top: 0.35rem;
}

/* Hero phone — tilt stage */
.hero-stage {
  position: relative;
  display: grid;
  place-items: center;
  perspective: 1200px;
  padding: 1rem 0;
}

.hero-stage .phone {
  width: min(300px, 78vw);
  max-width: 300px;
  transform: rotateY(-12deg) rotateX(4deg);
}

.hero-stage .streak-chip {
  position: absolute;


  z-index: 3;
  top: 12%;
  left: -4%;
  animation: float-y 5s ease-in-out infinite;
}

.hero-stage .water-chip {
  position: absolute;
  z-index: 3;
  bottom: 14%;
  right: -2%;
  animation: float-y 6s ease-in-out 0.8s infinite;
}

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.float-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1rem;
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: 700;
}

.float-chip .chip-icon { font-size: 1rem; }
.float-chip small { display: block; font-size: 0.68rem; font-weight: 600; color: var(--text-muted); }


/* ==========================================================================
   PHONE FRAME — hand-built device bezel for real screenshots & replicas
   ========================================================================== */
.phone {
  position: relative;
  width: min(300px, 78vw);
  border-radius: 44px;
  padding: 11px;
  background: linear-gradient(160deg, #3A4152, #12151F 40%, #2B3040);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    0 40px 90px rgba(0, 0, 0, 0.55),
    0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease-out;
  will-change: transform;
}

.phone-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 1200 / 2670;
  border-radius: 34px;
  overflow: hidden;
  background: var(--bg-deep);
}

.phone-screen img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: top center;
}

/* Screen glare */
.phone-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.10) 0%, transparent 28%);
  pointer-events: none;
  z-index: 5;
}

/* Front camera punch-hole cutout matching real Android capture */
.phone-notch {
  position: absolute;
  top: 17px;
  left: 50%;
  transform: translateX(-50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #020408;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.10), 0 0 3px rgba(0, 0, 0, 0.6);
  z-index: 6;
  pointer-events: none;
}

/* Side buttons */
.phone::before,
.phone::after {
  content: "";
  position: absolute;
  right: -3px;

  width: 3px;
  border-radius: 2px;
  background: #2B3040;
}

.phone::before { top: 22%; height: 52px; }
.phone::after  { top: 34%; height: 84px; }


/* ==========================================================================
   1:1 DASHBOARD REPLICA — pure HTML/CSS build of DashboardScreen.
   Both themes via the same DOM + tokens, like ThemeData.light()/.dark().
   ========================================================================== */
.replica {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.55rem 3.2rem;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(56, 189, 248, 0.10), transparent 60%),
    var(--bg-deep);
  color: var(--text);
  transition: background-color 0.5s var(--ease-out-cubic), color 0.5s var(--ease-out-cubic);
}

:root[data-theme="light"] .replica { background: var(--bg); }
.replica * { box-sizing: border-box; }

.rep-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.15rem 0.6rem 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.9;
}

/* AppBar: greeting + streak pill + gear */
.rep-appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.25rem 0.35rem 0.55rem;
}

.rep-greeting {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rep-appbar-right { display: flex; align-items: center; gap: 0.3rem; }

.rep-streak-pill {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.28rem 0.55rem;
  border-radius: var(--r-chip);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.28), rgba(139, 92, 246, 0.28));
  border: 1px solid rgba(244, 63, 94, 0.25);
  font-weight: 800;
  font-size: 0.66rem;
}

.rep-gear {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--chip-bg);
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
}

.rep-scroll {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0 0.1rem;
}

.rep-card {
  border-radius: 18px;
  padding: 0.55rem;
  background: linear-gradient(135deg, var(--glass-hi), var(--glass-mid) 50%, var(--glass-lo));
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

/* Calories ring + macro bars */
.rep-calorie-card { display: flex; gap: 0.55rem; align-items: center; }

.rep-ring-wrap { position: relative; width: 6.2rem; height: 6.2rem; flex-shrink: 0; }
.rep-ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rep-ring-track { fill: none; stroke: var(--hairline); stroke-width: 14; }
.rep-ring-fill {
  fill: none;
  stroke: var(--text);
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dashoffset var(--dur-ring) var(--ease-out-cubic);
}

.rep-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
}

.rep-ring-center .kcal { font-family: var(--font-display); font-size: 1.42rem; font-weight: 700; line-height: 1; }
.rep-ring-center .of { font-size: 0.56rem; color: var(--text-muted); }
.rep-ring-center .left {
  font-size: 0.58rem;
  font-weight: 700;
  background: var(--chip-bg);
  border-radius: var(--r-chip);
  padding: 0.08rem 0.4rem;
  margin-top: 0.14rem;
}

.rep-macros { flex: 1; display: flex; flex-direction: column; gap: 0.28rem; }

.rep-macro { border-radius: 10px; padding: 0.3rem 0.45rem; }
.rep-macro.p { background: var(--tint-protein); }
.rep-macro.c { background: var(--tint-carbs); }
.rep-macro.f { background: var(--tint-fat); }

.rep-macro .row { display: flex; align-items: center; gap: 0.28rem; font-size: 0.6rem; font-weight: 700; }
.rep-macro .dot { width: 6px; height: 6px; border-radius: 50%; }
.rep-macro.p .dot { background: var(--c-protein); }
.rep-macro.c .dot { background: var(--carbs-ink); }
.rep-macro.f .dot { background: var(--c-fat); }

.rep-macro .over-badge {
  margin-left: auto;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--c-fat);
  color: #fff;
  font-size: 8px;
  display: grid;
  place-items: center;
}

.rep-macro .bar { height: 4px; border-radius: 4px; background: rgba(128, 128, 128, 0.18); margin: 0.2rem 0 0.14rem; overflow: hidden; }
.rep-macro .bar-fill { height: 100%; border-radius: 4px; width: 0; transition: width var(--dur-ring) var(--ease-out-cubic); }
.rep-macro.p .bar-fill { background: var(--c-protein); }
.rep-macro.c .bar-fill { background: var(--carbs-ink); }
.rep-macro.f .bar-fill { background: var(--c-fat); }
.rep-macro .grams { font-size: 0.6rem; font-weight: 600; color: var(--text-muted); }


/* Buddy + nudge card */
.rep-pet-card { display: flex; align-items: center; gap: 0.55rem; }
.rep-pet-col { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }

.rep-pet-img {
  width: 3.2rem;
  height: 3.2rem;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

.rep-pet-level {
  font-size: 0.54rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: var(--r-chip);
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.35);
  white-space: nowrap;
}

.rep-nudge { flex: 1; border-radius: 12px; padding: 0.42rem 0.55rem; background: var(--tint-carbs); }
.rep-nudge .nudge-title { font-size: 0.62rem; font-weight: 800; color: var(--carbs-ink); display: flex; gap: 0.25rem; align-items: center; }
.rep-nudge .nudge-body { font-size: 0.56rem; color: var(--text-muted); margin-top: 0.12rem; line-height: 1.4; }

/* Today meal slots */
.rep-today-title { font-family: var(--font-display); font-size: 0.9rem; font-weight: 700; margin-bottom: 0.35rem; }

.rep-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.28rem; }

.rep-slot {
  border-radius: 10px;
  padding: 0.3rem 0.15rem;
  text-align: center;
  font-size: 0.52rem;
  background: var(--chip-bg);
  border: 1px solid transparent;
}

.rep-slot .slot-name { font-weight: 700; display: block; }
.rep-slot .slot-kcal { font-weight: 800; font-size: 0.58rem; margin-top: 0.1rem; display: block; }
.rep-slot.logged { border-color: rgba(3, 105, 161, 0.4); background: var(--tint-carbs); }
.rep-slot .slot-log { color: var(--text-faint); margin-top: 0.1rem; display: block; }

/* Hydration card */
.rep-hydro-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.32rem; }
.rep-hydro-head .label { display: flex; align-items: center; gap: 0.3rem; font-family: var(--font-display); font-weight: 700; font-size: 0.82rem; }
.rep-hydro-head .amount { font-size: 0.62rem; font-weight: 800; color: var(--c-water); background: var(--tint-water); padding: 0.12rem 0.45rem; border-radius: var(--r-chip); }
.rep-hydro .bar { height: 5px; border-radius: 5px; background: rgba(128, 128, 128, 0.18); overflow: hidden; }
.rep-hydro .bar-fill { height: 100%; width: 0; border-radius: 5px; background: var(--c-water); transition: width var(--dur-ring) var(--ease-out-cubic); }

/* Tab bar — Selection of tab ON TOP of the phone screen */
.rep-tabbar {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.3rem;
  margin: 0 auto 1.5rem;
  padding: 0.35rem 0.45rem;
  background: rgba(8, 22, 40, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.rep-tabbar::-webkit-scrollbar {
  display: none;
}

.rep-tab {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.rep-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.rep-tab.active {
  color: #0d2f4f !important;
  background: #8fd3f4 !important;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(143, 211, 244, 0.35);
}

.rep-fab {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: #4C5FD5;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  box-shadow: 0 6px 18px rgba(76, 95, 213, 0.45);
  transform: translateY(-0.5rem);
  transition: transform 0.25s var(--ease-out-cubic), box-shadow 0.25s;
}

.rep-fab:hover { transform: translateY(-0.5rem) scale(1.08); box-shadow: 0 10px 26px rgba(76, 95, 213, 0.6); }

/* Screen swap — tab taps crossfade between the replica and real shots */
.rep-screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.4s var(--ease-out-cubic), transform 0.4s var(--ease-out-cubic);
  z-index: 2;
  background: var(--bg-deep);
}

.rep-screen.visible { opacity: 1; transform: none; pointer-events: auto; }
.rep-screen img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
}


/* ==========================================================================
   01 · SNAP IT — logging flow (photo / voice / barcode)
   ========================================================================== */
.flow-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.flow-steps { display: flex; flex-direction: column; }

.flow-step {
  display: flex;
  gap: 1.1rem;
  padding: 1.3rem 0;
  border-top: 1px solid var(--hairline);
  transition: opacity 0.3s;
}

.flow-step:last-child { border-bottom: 1px solid var(--hairline); }

.flow-step .step-num {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--c-protein);
  line-height: 1.2;
  min-width: 2.2rem;
  transition: color 0.3s ease;
}

.flow-step .step-num.step-blue {
  color: var(--blue-word);
}

.flow-step h3 { font-size: 1.06rem; font-weight: 700; margin-bottom: 0.3rem; }
.flow-step p { font-size: 0.9rem; color: var(--text-muted); max-width: 42ch; }

/* Detected-item card that "pops" over the replica like an analysis result */
.detect-card {
  position: absolute;
  z-index: 3;
  right: -6%;
  bottom: 20%;
  width: 210px;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  animation: float-y 6.5s ease-in-out 0.4s infinite;
}

.detect-card .detect-head {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}

.detect-card .detect-grams { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.5rem; }

.detect-chips { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.mchip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: var(--r-chip);
}

.mchip.p { background: var(--tint-protein); color: var(--c-protein); }
.mchip.c { background: var(--tint-carbs); color: var(--carbs-ink); }
.mchip.f { background: var(--tint-fat); color: var(--c-fat); }

/* ==========================================================================
   02 · LIVING DASHBOARD — the interactive replica section
   ========================================================================== */
.duo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.replica-stage {
  position: relative;
  display: grid;
  place-items: center;
  perspective: 1200px;
}

.replica-stage .phone { transform: rotateY(10deg) rotateX(3deg); }

.replica-hint {
  margin-top: 1.6rem;
  font-size: 0.82rem;
  color: var(--text-faint);
  text-align: center;
  font-weight: 600;
}

.replica-hint kbd {
  font-family: inherit;

  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 0.05rem 0.45rem;
  background: var(--chip-bg);
}

.spec-list { display: flex; flex-direction: column; }

.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--hairline);
}

.spec-item:last-child { border-bottom: 1px solid var(--hairline); }
.spec-item .spec-key { font-weight: 700; font-size: 0.95rem; }
.spec-item .spec-val { color: var(--text-muted); font-size: 0.88rem; text-align: right; }


/* ==========================================================================
   03 · BUDDY — pet evolution stage (3 stages × 5 moods, real assets)
   ========================================================================== */
.pet-stage-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: clamp(2rem, 5vh, 3.5rem);
}

.stage-tab {
  padding: 0.6rem 1.3rem;
  border-radius: var(--r-chip);
  border: 1px solid var(--hairline);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: all 0.3s var(--ease-out-cubic);
}

.stage-tab:hover { color: var(--text); }
.stage-tab.active {
  background: var(--text);
  color: var(--bg);
  border-color: transparent;
}

.pet-showcase {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  max-width: 980px;
  margin-inline: auto;
}

.pet-visual {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: var(--r-card);
  overflow: hidden;
}

/* Warm hearth glow behind the buddy — amber, like a streak flame */
.pet-visual::before {
  content: "";
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.22), transparent 65%);
}

/* Posture carousel — fixed square stage, two stacked layers slide through.
   The slide transform lives on the layer so pet-breathe on the <img>
   never fights it. */
.pet-frame {
  position: relative;
  width: min(260px, 60%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.pet-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s var(--ease-out-cubic), opacity 0.4s ease;
}

.pet-layer.is-front { opacity: 1; }

/* Incoming pose starts just off-stage */
.pet-layer.enter-right { transform: translateX(30px); }
.pet-layer.enter-left  { transform: translateX(-30px); }

/* Outgoing pose accelerates away (easeInCubic) */
.pet-layer.exit-left,
.pet-layer.exit-right {
  opacity: 0;
  transition-timing-function: cubic-bezier(0.55, 0.06, 0.68, 0.19);
}
.pet-layer.exit-left  { transform: translateX(-30px); }
.pet-layer.exit-right { transform: translateX(30px); }

.pet-layer.no-transition { transition: none; }

.pet-layer img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.45));
  animation: pet-breathe 4s ease-in-out infinite;
}

/* Level-up pulse — amber heartbeat behind the buddy on stage change */
.pet-pulse {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.45), transparent 65%);
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
}

.pet-pulse.go { animation: pet-pulse-go 0.6s var(--ease-out-cubic); }

@keyframes pet-pulse-go {
  0%   { opacity: 0.55; transform: scale(0.6); }
  100% { opacity: 0;    transform: scale(1.45); }
}

@keyframes pet-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.015); }
}

.pet-xp {
  position: relative;
  width: 100%;
  margin-top: 1.4rem;
}

.pet-xp .xp-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.pet-xp .xp-bar { height: 8px; border-radius: 8px; background: rgba(128, 128, 128, 0.2); overflow: hidden; }
.pet-xp .xp-fill {
  height: 100%;
  width: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--c-protein), #FBBF24);
  transition: width var(--dur-ring) var(--ease-out-cubic);
}

.mood-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 1.3rem;
  position: relative;
}

.mood-btn {
  position: relative;
  overflow: hidden;
  padding: 0.4rem 0.85rem;
  border-radius: var(--r-chip);
  border: 1px solid var(--hairline);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.25s;
}

.mood-btn:hover { color: var(--text); }
.mood-btn.active { background: var(--c-protein); border-color: transparent; color: #1A1000; }

/* Auto-rotation countdown — underline fills over one mood interval */
.mood-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(26, 16, 0, 0.55);
  transform: scaleX(0);
  transform-origin: left;
}

.mood-btn.active.is-counting::after { animation: mood-tick 3.2s linear forwards; }

@keyframes mood-tick {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.pet-quote {
  font-family: var(--font-display);

  font-style: italic;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  color: var(--c-protein);
  margin: 0.9rem 0;
}

.pet-details h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.pet-details .pet-desc { color: var(--text-muted); margin: 0.8rem 0 1.2rem; max-width: 46ch; }

.pet-perks li {
  display: flex;
  gap: 0.65rem;
  align-items: baseline;
  padding: 0.4rem 0;
  font-size: 0.92rem;
}

.pet-perks .perk-check { color: var(--c-success); font-weight: 800; }

/* ==========================================================================
   04 · SQUAD — dual tilted phones with real feed & arena shots
   ========================================================================== */
.squad-phones {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(-2rem, -1vw, 0rem);
  perspective: 1400px;
}

.squad-phones .phone { width: min(270px, 42vw); flex-shrink: 0; }
.squad-phones .phone-a { transform: rotateY(14deg) rotateZ(-3deg) translateX(8%); z-index: 1; }
.squad-phones .phone-b { transform: rotateY(-10deg) rotateZ(2deg) translateX(-8%) translateY(6%); z-index: 2; }

/* ==========================================================================
   05 · PROOF — report phone + streak flame card + badge marquee
   ========================================================================== */
.proof-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

/* Streak flame card — mirrors the app's orange-red streak banner */
.streak-card {
  position: relative;
  border-radius: var(--r-card);
  padding: clamp(1.4rem, 3vw, 2.2rem);
  overflow: hidden;
  color: #FFF7ED;
  background: linear-gradient(120deg, #F43F5E 0%, #F97316 55%, #D946EF 130%);
  box-shadow: 0 24px 60px rgba(249, 115, 22, 0.35);
  margin-bottom: 1.2rem;
}

.streak-card::after {
  content: "🔥";
  position: absolute;
  right: -1.5rem;
  bottom: -2.5rem;
  font-size: 9rem;
  opacity: 0.22;
  filter: blur(1px);
  animation: flame-flicker 2.2s ease-in-out infinite;
}

@keyframes flame-flicker {
  0%, 100% { transform: scale(1) rotate(-2deg); opacity: 0.22; }
  50% { transform: scale(1.06) rotate(2deg); opacity: 0.3; }
}

.streak-card .streak-days {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1;
}

.streak-card .streak-meta { font-size: 0.9rem; opacity: 0.9; margin-top: 0.3rem; }

.streak-card .freeze-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.1rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--r-chip);
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 0.8rem;
  font-weight: 700;
}

.stat-rows { display: flex; flex-direction: column; }

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--hairline);
  font-size: 0.92rem;
}

.stat-row:last-child { border-bottom: 1px solid var(--hairline); }
.stat-row .stat-key { font-weight: 700; }
.stat-row .stat-val { color: var(--text-muted); text-align: right; }

/* Badge marquee — real medal assets drifting */
.badge-marquee {
  margin-top: clamp(3rem, 7vh, 5rem);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.badge-track {
  display: flex;
  gap: 2.6rem;
  width: max-content;
  animation: marquee 32s linear infinite;

}

.badge-marquee:hover .badge-track { animation-play-state: paused; }

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.badge-track img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
  transition: transform 0.3s var(--ease-out-cubic);
}

.badge-track img:hover { transform: translateY(-6px) scale(1.08); }

/* ==========================================================================
   DOWNLOAD — oversized serif CTA
   ========================================================================== */
.download-section { text-align: center; }

.download-section .section-title {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
}

.store-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.4rem;
}

.store-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.7rem;
  border-radius: var(--r-button);
  border: 1px solid var(--hairline);
  background: var(--chip-bg);
  transition: transform 0.3s var(--ease-out-cubic), background-color 0.3s;
  text-align: left;
}

.store-btn:hover { transform: translateY(-3px); background: var(--glass-border); }
.store-btn .store-icon { font-size: 1.6rem; line-height: 1; }
.store-btn small { display: block; font-size: 0.68rem; color: var(--text-muted); font-weight: 600; }
.store-btn strong { font-size: 1rem; font-weight: 800; }

/* ==========================================================================
   FAQ — hairline accordion, editorial
   ========================================================================== */
.faq-list { max-width: 760px; margin-inline: auto; }

.faq-item { border-top: 1px solid var(--hairline); }
.faq-item:last-child { border-bottom: 1px solid var(--hairline); }

.faq-q {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem 0.2rem;
  text-align: left;
  font-weight: 700;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
}

.faq-q .faq-icon {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--c-protein);
  transition: transform 0.4s var(--ease-out-cubic);
  flex-shrink: 0;
}

.faq-item.open .faq-icon { transform: rotate(45deg); }

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease-out-cubic);
}

.faq-a p {
  padding: 0 0.2rem 1.4rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 62ch;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  border-top: 1px solid var(--hairline);
  padding: clamp(3rem, 7vh, 5rem) 0 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-brand img { width: 40px; height: 40px; border-radius: 12px; margin-bottom: 0.9rem; }
.footer-brand h4 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 0.4rem; }
.footer-brand p { font-size: 0.88rem; color: var(--text-muted); max-width: 30ch; }

.footer-col h5 {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

.footer-links li { margin-bottom: 0.55rem; }
.footer-links a { font-size: 0.9rem; color: var(--text-muted); transition: color 0.25s; }
.footer-links a:hover { color: var(--c-protein); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.6rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.8rem;
  color: var(--text-faint);
}

.footer-bottom .legal-inline { display: flex; gap: 1.4rem; }
.footer-bottom a:hover { color: var(--text); }

/* ==========================================================================
   NOTIFY MODAL
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}

.modal-backdrop.open { opacity: 1; visibility: visible; }

.modal-card {
  position: relative;
  width: min(440px, 100%);
  padding: 2.2rem;
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--text);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.4s var(--ease-out-cubic);
}

.modal-backdrop.open .modal-card { transform: none; }

.modal-close-btn {
  position: absolute;
  top: 0.9rem;
  right: 1rem;

  font-size: 1.5rem;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: background-color 0.25s;
}

.modal-close-btn:hover { background: var(--chip-bg); }

.modal-title { font-size: 1.6rem; margin-bottom: 0.6rem; }
.modal-desc { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 1.4rem; }

.modal-form { display: flex; flex-direction: column; gap: 0.8rem; }

.form-input {
  padding: 0.95rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background: var(--chip-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.25s;
}

.form-input:focus { border-color: var(--c-protein); }
.form-input::placeholder { color: var(--text-faint); }


/* ==========================================================================
   SCROLL REVEALS — elements rise + unblur into place
   ========================================================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
  transition:
    opacity 0.9s var(--ease-out-cubic),
    transform 0.9s var(--ease-out-cubic),
    filter 0.9s var(--ease-out-cubic);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].revealed {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Directional & scale variants — same 0.9s budget, different entry vector */
[data-reveal="left"]  { transform: translateX(-32px); }
[data-reveal="right"] { transform: translateX(32px); }
[data-reveal="zoom"]  { transform: scale(0.94); }

/* Section index rule draws itself in once the head has landed */
.section-head[data-reveal] .section-index::after {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.7s var(--ease-out-cubic) 0.3s;
}
.section-head--center[data-reveal] .section-index::after { transform-origin: center; }
.section-head[data-reveal].revealed .section-index::after { transform: scaleX(1); }

/* Hero entrance (JS adds .loaded to body) */
.hero-headline .line-inner {
  transition: transform 1.1s var(--ease-out-cubic);
}
body.loaded .hero-headline .line-inner { transform: translateY(0); }
body.loaded .hero-headline .line:nth-child(2) .line-inner { transition-delay: 0.12s; }
body.loaded .hero-headline .line:nth-child(3) .line-inner { transition-delay: 0.24s; }

.hero-kicker, .hero-subtext, .hero-actions, .hero-proof {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease-out-cubic), transform 0.8s var(--ease-out-cubic);
}

body.loaded .hero-kicker  { opacity: 1; transform: none; transition-delay: 0.15s; }
body.loaded .hero-subtext { opacity: 1; transform: none; transition-delay: 0.4s; }
body.loaded .hero-actions { opacity: 1; transform: none; transition-delay: 0.55s; }
body.loaded .hero-proof   { opacity: 1; transform: none; transition-delay: 0.7s; }

.hero-stage { opacity: 0; transform: translateY(40px) scale(0.96); transition: opacity 1.1s var(--ease-out-cubic), transform 1.1s var(--ease-out-cubic); transition-delay: 0.35s; }
body.loaded .hero-stage { opacity: 1; transform: none; }

/* ==========================================================================
   RESPONSIVE — fluid clamp() everywhere + breakpoints 1024 / 768 / 480
   ========================================================================== */
@media (max-width: 1024px) {
  /* Directional reveals collapse to a plain rise once columns stack */
  [data-reveal="left"],
  [data-reveal="right"],
  [data-reveal="zoom"] { transform: translateY(28px); }

  .hero-grid { grid-template-columns: 1fr; gap: 3.5rem; }
  .hero { min-height: auto; }
  .hero-stage { order: 2; }
  .hero-stage .phone { transform: none; }
  .replica-stage .phone { transform: none; }

  .flow-grid, .duo-grid, .proof-grid, .pet-showcase { grid-template-columns: 1fr; }
  .detect-card { right: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-actions .btn { display: none; }
  .mobile-menu-btn { display: grid; }

  .squad-phones { flex-direction: column; gap: 2rem; }
  .squad-phones .phone { width: min(280px, 78vw); }
  .squad-phones .phone-a,
  .squad-phones .phone-b { transform: none; }

  .hero-stage .streak-chip { left: 0; }
  .hero-stage .water-chip { right: 0; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .hero-proof { gap: 1.2rem; }
  .btn { width: 100%; justify-content: center; }
  .hero-actions .btn { width: 100%; }
  .nav-actions .theme-toggle { display: grid; }
}

/* ==========================================================================
   REDUCED MOTION — honor the user's setting, same as the app does
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .pet-pulse { display: none; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal],
  .hero-headline .line-inner,
  .hero-kicker, .hero-subtext, .hero-actions, .hero-proof, .hero-stage {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* ==========================================================================
   NEW CALOBUDDY REDESIGN STYLES (MIGRATED FROM GENERATE-CALOBUDDY-LANDING-PAGE)
   ========================================================================== */

/* Modern typography & font utility classes */
.font-display { font-family: 'Bricolage Grotesque', system-ui, sans-serif !important; letter-spacing: -0.03em; }
.serif-em { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: -0.01em; }

/* Palette tokens & utility backgrounds */
:root {
  --c-cb-cream: #f6f4ee;
  --c-cb-navy: #0d2f4f;
  --c-cb-ocean: #1a6aa0;
  --c-cb-mint: #12d69c;
  --c-cb-coral: #ff5d7e;
  --c-cb-flame: #ff8a3d;
  --c-cb-cyan: #1fe3f0;
  --c-cb-sky: #8fd3f4;
}

/* Texture & glowing blobs */
.noise { position: relative; }
.noise::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  z-index: 1;
}

.glow-blob {
  pointer-events: none;
  position: absolute;
  border-radius: 9999px;
  filter: blur(60px);
}

/* Animations */
@keyframes blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.1); }
  66% { transform: translate(-30px, 20px) scale(0.95); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-12px) rotate(3deg); }
}
@keyframes floatAnim {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-14px) rotate(2deg); }
}
@keyframes floatSm {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes scanline {
  0% { top: 8%; }
  50% { top: 88%; }
  100% { top: 8%; }
}
@keyframes wave {
  0%, 100% { transform: scaleY(0.25); }
  50% { transform: scaleY(1); }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes marqueeRev {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}
@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes spinSlow {
  to { transform: rotate(360deg); }
}
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-2deg); filter: brightness(1); }
  50% { transform: scale(1.12) rotate(3deg); filter: brightness(1.2); }
}
@keyframes cheerUp {
  from { transform: translateX(-50%) translateY(0) scale(0.6); opacity: 1; }
  to { transform: translateX(-50%) translateY(-50px) scale(1.4); opacity: 0; }
}
@keyframes progressBar {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-8deg) scale(1.03); }
  75% { transform: rotate(8deg) scale(1.03); }
}
@keyframes jump {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  30% { transform: translateY(-30px) scale(0.95, 1.05); }
  50% { transform: translateY(0) scale(1.08, 0.92); }
  65% { transform: translateY(-8px); }
}
@keyframes droop {
  0%, 100% { transform: translateY(6px) rotate(-2deg); }
  50% { transform: translateY(12px) rotate(2deg); }
}
@keyframes fillX {
  from { width: 0%; }
  to { width: 100%; }
}
@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

.animate-blob { animation: blob 14s ease-in-out infinite; }
.animate-bob { animation: bob 3.5s ease-in-out infinite; }
.animate-float { animation: floatAnim 6s ease-in-out infinite; }
.animate-float-sm { animation: floatSm 4s ease-in-out infinite; }
.animate-spin-slow { animation: spinSlow 18s linear infinite; }
.animate-flicker { animation: flicker 1.2s ease-in-out infinite; }
.animate-wiggle { animation: wiggle 1s ease-in-out infinite; }
.animate-jump { animation: jump 1.4s ease-in-out infinite; }
.animate-droop { animation: droop 2.4s ease-in-out infinite; }
.animate-marquee-rev { animation: marqueeRev 32s linear infinite; }
.buddy-img { mix-blend-mode: multiply; }
:root[data-theme="dark"] .buddy-img { mix-blend-mode: normal; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5)); }

/* Tilted Marquee Ribbon */
.marquee-ribbon {
  position: relative;
  width: calc(100% + 4rem);
  margin-left: -2rem;
  margin-top: clamp(1.5rem, 3vh, 2.5rem);
  margin-bottom: clamp(3.5rem, 7vh, 5.5rem);
  transform: rotate(-2deg);
  background: #0d2f4f;
  padding: 1.25rem 0;
  box-shadow: 0 20px 40px rgba(13, 47, 79, 0.4);
  overflow: hidden;
  z-index: 3;
}
.marquee-track {
  display: flex;
  width: max-content;
  gap: 2rem;
  white-space: nowrap;
  animation: marquee 50s linear infinite;
  will-change: transform;
}
.marquee-track.animate-marquee-rev {
  animation: marqueeRev 50s linear infinite;
}
.marquee-item {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: clamp(1.25rem, 2.5vw, 1.85rem);
  font-weight: 800;
  color: #fff;
}
.marquee-item.mint { color: #12d69c; }

/* Titanium Phone Container */
.phone {
  position: relative;
  width: min(300px, 78vw);
  border-radius: 3rem;
  padding: 10px;
  background: linear-gradient(145deg, #d9d4ca, #8c877e 40%, #cfc9be 70%, #7a756d);
  box-shadow: 0 50px 100px -20px rgba(13,47,79,.35), 0 30px 60px -30px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.4);
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.phone-screen {
  position: relative;
  border-radius: 2.4rem;
  overflow: hidden;
  background: #0b0b0b;
  aspect-ratio: 9 / 19.5;
  border: 3px solid #0b0b0b;
}
.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.phone-island {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 32%;
  height: 24px;
  border-radius: 999px;
  background: #000;
  z-index: 5;
}

/* Glassmorphism chips */
.glass-pill {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 30px rgba(13, 47, 79, 0.08);
}
:root[data-theme="dark"] .glass-pill {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Floating chips on hero stage */
.hero-streak-card {
  position: absolute;
  left: -2.5rem;
  top: 4.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 1.25rem;
  padding: 0.85rem 1.15rem;
  box-shadow: 0 20px 40px rgba(13, 47, 79, 0.12);
  z-index: 20;
}
.hero-water-card {
  position: absolute;
  right: -2rem;
  top: 48%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 1.25rem;
  padding: 0.85rem 1.15rem;
  box-shadow: 0 20px 40px rgba(13, 47, 79, 0.12);
  z-index: 20;
}
.hero-today-chip {
  position: absolute;
  left: -2rem;
  bottom: -1rem;
  border-radius: 1.25rem;
  background: #0d2f4f;
  color: #fff;
  padding: 0.85rem 1.25rem;
  box-shadow: 0 20px 40px rgba(13, 47, 79, 0.25);
  z-index: 20;
}

/* Eyebrows */
.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: 9999px;
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.85);
  color: #1a6aa0;
  border: 1px solid rgba(13, 47, 79, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
:root[data-theme="dark"] .eyebrow-pill {
  background: rgba(255, 255, 255, 0.08);
  color: #8fd3f4;
  border-color: rgba(255, 255, 255, 0.15);
}
.eyebrow-pill.light {
  background: rgba(255, 255, 255, 0.1);
  color: #8fd3f4;
  border-color: rgba(255, 255, 255, 0.15);
}
.eyebrow-num {
  display: grid;
  height: 1.25rem;
  width: 1.25rem;
  place-items: center;
  border-radius: 9999px;
  background: #0d2f4f;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
}
.eyebrow-pill.light .eyebrow-num {
  background: #8fd3f4;
  color: #0d2f4f;
}

/* Logging 3-mode switcher */
.log-mode-btn {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 1.5rem;
  padding: 1.5rem;
  text-align: left;
  background: #fff;
  color: #0d2f4f;
  border: 1px solid rgba(13, 47, 79, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: all 0.4s ease;
  cursor: pointer;
}
:root[data-theme="dark"] .log-mode-btn {
  background: #0f172a;
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.1);
}
.log-mode-btn.active {
  background: #0d2f4f !important;
  color: #fff !important;
  transform: scale(1.02);
  box-shadow: 0 20px 40px rgba(13, 47, 79, 0.35);
  border-color: #0d2f4f;
}
.log-mode-btn .log-progress-bar {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: #12d69c;
  width: 100%;
  transform-origin: left;
  animation: progressBar 9s linear forwards;
}
.log-mode-btn.active .log-progress-bar {
  display: block;
}
.log-mode-panel {
  display: none;
  width: 100%;
  animation: pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}
.log-mode-panel.active {
  display: block;
}

/* Voice panel equalizer */
.equalizer-bar {
  width: 4px;
  border-radius: 9999px;
  background: linear-gradient(to top, #1a6aa0, #12d69c);
  transform-origin: center;
  animation: wave 1s ease-in-out infinite;
}

/* Smart Food Breakdown Composition */
.comp-card {
  border-radius: 2rem;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  padding: 1.75rem;
  box-shadow: 0 25px 60px rgba(13, 47, 79, 0.08);
  border: 1px solid rgba(13, 47, 79, 0.08);
}
:root[data-theme="dark"] .comp-card {
  background: linear-gradient(135deg, #0f172a, #060b18);
  border-color: rgba(255, 255, 255, 0.1);
}
.comp-item {
  border-radius: 1.25rem;
  background: #fff;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 0.75rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
:root[data-theme="dark"] .comp-item {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}
.comp-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Macro chips */
.macro-pill {
  display: inline-flex;
  border-radius: 0.5rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
}
.macro-pill.p { background: #fef3c7; color: #b45309; }
.macro-pill.c { background: #e0f2fe; color: #0369a1; }
.macro-pill.f { background: #ffe4e6; color: #e11d48; }

/* Weekly progress & consistency */
.weekly-progress-card {
  border-radius: 2rem;
  background: #fff;
  padding: 1.75rem;
  box-shadow: 0 20px 50px rgba(13, 47, 79, 0.08);
  border: 1px solid rgba(13, 47, 79, 0.08);
}
:root[data-theme="dark"] .weekly-progress-card {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.1);
}

/* Consistency matrix */
.consistency-matrix {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.45rem;
  margin-top: 1.25rem;
  text-align: center;
}
.matrix-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  transition: transform 0.2s ease;
}
:root[data-theme="dark"] .matrix-cell {
  background: rgba(18, 214, 156, 0.15);
  color: #12d69c;
  border-color: rgba(18, 214, 156, 0.3);
}

/* Fiery 24-day streak banner */
.streak-banner {
  position: relative;
  overflow: hidden;
  border-radius: 2rem;
  background: linear-gradient(135deg, #f97316, #ff8a3d 50%, #f43f5e);
  padding: 2.25rem;
  color: #fff;
  box-shadow: 0 25px 60px rgba(255, 138, 61, 0.35);
}

/* Squad Cheers interactive button */
.cheers-btn {
  position: relative;
  display: grid;
  height: 2.75rem;
  width: 2.75rem;
  place-items: center;
  border-radius: 9999px;
  background: #ff5d7e;
  font-size: 1.35rem;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.cheers-btn:active { transform: scale(0.92); }
.cheer-emoji-pop {
  pointer-events: none;
  position: absolute;
  left: 50%;
  top: -10px;
  font-size: 1.5rem;
  transform: translateX(-50%);
  animation: cheerUp 0.9s ease-out forwards;
}

/* Badges dual marquee */
.badge-card {
  width: 10.5rem;
  flex-shrink: 0;
  border-radius: 1.75rem;
  background: #fff;
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: 0 8px 24px rgba(13, 47, 79, 0.08);
  border: 1px solid rgba(13, 47, 79, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.badge-card img {
  transition: transform 0.3s ease;
}
:root[data-theme="dark"] .badge-card {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.badge-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(13, 47, 79, 0.16);
}
.badge-card:hover img {
  transform: scale(1.1) rotate(6deg);
}

/* Accordion FAQ */
.faq-item {
  border-radius: 1.25rem;
  background: #fff;
  border: 1px solid rgba(13, 47, 79, 0.08);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: all 0.3s ease;
}
:root[data-theme="dark"] .faq-item {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.1);
}
.faq-item.open {
  box-shadow: 0 12px 32px rgba(13, 47, 79, 0.08);
  border-color: #0d2f4f;
}
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  text-align: left;
  font-weight: 700;
  font-size: 1.05rem;
  color: #0d2f4f;
  background: none;
  border: none;
  cursor: pointer;
}
:root[data-theme="dark"] .faq-q { color: #f8fafc; }
.faq-icon {
  display: grid;
  height: 2rem;
  width: 2rem;
  flex-shrink: 0;
  place-items: center;
  border-radius: 9999px;
  background: rgba(13, 47, 79, 0.06);
  font-size: 1.2rem;
  transition: transform 0.3s ease, background 0.3s ease;
}
.faq-item.open .faq-icon {
  transform: rotate(45deg);
  background: #0d2f4f;
  color: #fff;
}
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.faq-a p {
  padding: 0 1.5rem 1.35rem;
  margin: 0;
  color: #475569;
  line-height: 1.65;
}
:root[data-theme="dark"] .faq-a p { color: #94a3b8; }

/* Hero Rotating Word */
#heroRotatingWord {
  display: inline-block;
  min-width: 6ch;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
:root[data-theme="dark"] #heroRotatingWord {
  color: var(--blue-word) !important;
}
:root[data-theme="light"] #heroRotatingWord {
  color: #1a6aa0 !important;
}

/* Dashboard 5-Segment Progress Bar */
.rep-progress-bar {
  display: flex;
  width: 10rem;
  gap: 0.35rem;
  margin: 1.5rem auto 0;
}
.rep-progress-seg {
  height: 4px;
  flex: 1;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
.rep-progress-seg .seg-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: #12d69c;
}

/* Scan Panel Card & Dark Theme Adaptations */
.scan-panel-card {
  max-width: 24rem;
  margin: 0 auto;
  border-radius: 2rem;
  background: #fff;
  padding: 2rem;
  box-shadow: 0 30px 70px rgba(13,47,79,0.12);
  border: 1px solid rgba(13,47,79,0.08);
}
:root[data-theme="dark"] .scan-panel-card {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
}
.scan-laser-line {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  height: 2px;
  background: #ff5d7e !important;
  box-shadow: 0 0 16px 3px #ff5d7e;
  animation: scanline 2s ease-in-out infinite;
  pointer-events: none;
  z-index: 5;
}
.barcode-svg {
  color: #0f172a;
}
:root[data-theme="dark"] .scan-barcode-box {
  background: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
:root[data-theme="dark"] .barcode-svg {
  color: #f8fafc !important;
}
:root[data-theme="dark"] .scan-item-card {
  background: rgba(18, 214, 156, 0.15) !important;
  border-color: rgba(18, 214, 156, 0.3) !important;
}
:root[data-theme="dark"] .scan-item-card .scan-title {
  color: #f8fafc !important;
}
:root[data-theme="dark"] .scan-search-box {
  background: #1e293b !important;
  color: #94a3b8 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Pet Companion Visual Card Dark Theme */
:root[data-theme="dark"] .pet-visual {
  background: linear-gradient(180deg, #0f172a, rgba(15, 23, 42, 0.95)) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4) !important;
}

/* Weight Trend SVG Curve */
.weight-trend-line {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: drawLine 1.8s 0.3s ease-out forwards;
}
:root[data-theme="dark"] .weight-trend-line {
  stroke: #38bdf8 !important;
}
:root[data-theme="dark"] svg circle {
  stroke: #38bdf8 !important;
  fill: #0f172a !important;
}

/* Badge Marquee Mask */
.badge-marquee-wrap {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track:hover {
  animation-play-state: paused;
}

/* Base styles for interactive components */
.logging-mobile-tabs {
  display: none;
}
.preview-navigation {
  display: none;
}
.portion-input-field {
  width: 60px;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  text-align: center;
  padding: 2px 4px;
}
.portion-input-field:focus {
  outline: 2px solid var(--c-authentic-blue);
  border-color: var(--c-authentic-blue);
}
#editPortionsBtn, #resetPortionsBtn, #toggleAllIngredientsBtn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
#toggleAllIngredientsBtn {
  justify-content: center;
}
.search-food-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border-radius: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.88rem;
}
.search-food-item:hover, .search-food-item:active {
  background: rgba(26, 106, 160, 0.08);
  border-color: var(--c-authentic-blue);
}
.chart-bar-column {
  transition: transform 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}
.chart-bar-column:focus {
  outline: none;
}
.chart-bar-column.is-selected .chart-bar-fill {
  filter: brightness(1.25);
  box-shadow: 0 0 12px rgba(18, 214, 156, 0.7);
}
.matrix-cell {
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}
.matrix-cell.is-selected {
  outline: 2px solid #12d69c !important;
  outline-offset: 1px;
  font-weight: 800 !important;
}
.arena-mode-card {
  transition: all 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}
.arena-mode-card.is-active {
  border-color: #12d69c !important;
  background: rgba(18, 214, 156, 0.12) !important;
  box-shadow: 0 8px 24px rgba(18, 214, 156, 0.25) !important;
}
.badge-card {
  cursor: pointer;
}
.badge-tier {
  display: inline-block;
  border-radius: 9999px;
  padding: 0.2rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}
.badge-tier.tier-bronze {
  background: #ffedd5;
  color: #9a3412;
}
.badge-tier.tier-silver {
  background: #f1f5f9;
  color: #475569;
}
.badge-tier.tier-gold {
  background: #fef3c7;
  color: #b45309;
}
:root[data-theme="dark"] .badge-tier.tier-bronze {
  background: rgba(249, 115, 22, 0.2);
  color: #fdba74;
}
:root[data-theme="dark"] .badge-tier.tier-silver {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}
:root[data-theme="dark"] .badge-tier.tier-gold {
  background: rgba(245, 158, 11, 0.2);
  color: #fde047;
}


/* ==========================================================================
   SECTION 02 — TODAY DASHBOARD LAYOUT & REDUCED GAUSSIAN BLUR
   ========================================================================== */
.dashboard-stage-grid {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 420px) 1fr;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
  margin-top: 3.5rem;
}

@media (max-width: 960px) {
  .dashboard-stage-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }
  .dashboard-phone-col {
    order: -1;
  }
}

.dashboard-specs-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dashboard-phone-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Reduced gaussian blur cards (from 14px down to 4px) for sharp legibility */
#dashboard .glass-pill,
.dash-spec-card {
  border-radius: 1.75rem;
  padding: 1.6rem 1.75rem;
  background: rgba(10, 28, 49, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  backdrop-filter: blur(4px) !important; /* Reduced gaussian blur: clear, crisp, no fuzzy halos */
  -webkit-backdrop-filter: blur(4px) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35) !important;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

#dashboard .glass-pill:hover,
.dash-spec-card:hover {
  transform: translateY(-3px);
  border-color: rgba(143, 211, 244, 0.35) !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45) !important;
}

#dashboard .glass-pill .dash-spec-icon,
.dash-spec-card .dash-spec-icon {
  font-size: 2rem;
  display: inline-block;
}

#dashboard .glass-pill h3,
.dash-spec-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 0.6rem;
  color: #ffffff !important;
  letter-spacing: -0.01em;
}

#dashboard .glass-pill p,
.dash-spec-card p {
  font-size: 0.92rem;
  color: rgba(240, 246, 255, 0.9) !important;
  margin-top: 0.4rem;
  line-height: 1.6;
}

/* ==========================================================================
   DESKTOP BASELINE FOR MOBILE-SPECIFIC ENHANCEMENTS (ZERO DESKTOP SIDE-EFFECTS)
   ========================================================================== */
.desktop-copy { display: inline; }
.mobile-copy,
.hero-subtext-mobile,
.progress-mobile-tabs,
.squad-mobile-tabs,
.badge-swipe-hint {
  display: none !important;
}

/* Disclosure elements stay completely transparent and open on desktop */
.breakdown-disclosure {
  display: block;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
.breakdown-disclosure > summary.breakdown-summary {
  display: none !important;
}

.dash-spec-summary {
  display: contents !important;
  pointer-events: none !important;
}
.dash-spec-chevron,
.spec-chevron {
  display: none !important;
}
.dash-spec-icon,
.spec-icon {
  display: inline-flex;
  align-items: center;
  color: #8fd3f4;
  margin-bottom: 0.5rem;
}
.spec-amber .spec-icon { color: #f59e0b; }
.spec-cyan .spec-icon { color: #12d69c; }

/* ==========================================================================
   COMPREHENSIVE MOBILE VIEWPORT OPTIMIZATIONS (<= 768px & <= 480px)
   ========================================================================== */

@media (max-width: 768px) {
  /* ── 0. Global & Navigation ────────────────────────────────────────── */
  .desktop-copy { display: none !important; }
  .mobile-copy { display: inline !important; }

  .section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
  .section-head {
    margin-bottom: 2rem;
  }
  .section-title {
    font-size: clamp(2rem, 6.5vw, 2.75rem);
    line-height: 1.15;
  }
  .section-subtitle {
    font-size: 0.98rem;
    line-height: 1.6;
  }

  .nav-wrapper {
    padding: env(safe-area-inset-top) 0 0;
    background: var(--bg);
    border-bottom: 1px solid var(--hairline);
  }
  .island-nav {
    top: 0;
    left: 0;
    right: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0.75rem max(1.25rem, env(safe-area-inset-right)) 0.75rem max(1.25rem, env(safe-area-inset-left));
    min-height: 66px;
    gap: 0.5rem;
  }
  .nav-brand {
    gap: 0.5rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .nav-brand-icon {
    width: 32px;
    height: 32px;
  }
  .nav-actions {
    gap: 0.35rem;
  }
  .nav-actions .theme-toggle {
    display: grid;
    min-width: 48px;
    min-height: 44px;
  }
  .mobile-menu-btn {
    display: grid;
    min-width: 44px;
    min-height: 44px;
    place-items: center;
  }

  /* Mobile Navigation Drawer */
  .mobile-nav-drawer {
    background: rgba(6, 11, 24, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  :root[data-theme="light"] .mobile-nav-drawer {
    background: rgba(248, 250, 252, 0.98);
  }
  .mobile-nav-links {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 320px !important;
  }
  .mobile-nav-link {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif !important;
    font-size: clamp(1.25rem, 4.5vw, 1.6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    padding: 0.85rem 0;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 52px !important;
    border-bottom: 1px solid var(--hairline);
    color: var(--text) !important;
    text-decoration: none !important;
  }
  .mobile-link-num {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--c-authentic-blue);
    opacity: 0.85;
    min-width: 1.8rem;
  }
  .mobile-link-arrow {
    font-size: 1.1rem;
    color: var(--text-muted);
  }
  .mobile-drawer-cta-wrap {
    width: 100%;
    max-width: 320px;
    margin-top: 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
  }
  .mobile-drawer-cta {
    width: 100%;
    min-height: 50px;
    justify-content: center;
    font-size: 0.98rem;
  }
  .mobile-drawer-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
  }

  /* ── 1. Hero Section ────────────────────────────────────────────────── */
  .hero {
    min-height: auto;
    padding-top: calc(88px + env(safe-area-inset-top));
    padding-bottom: 2rem;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .hero-content {
    text-align: center;
    padding: 0;
    max-width: 440px;
    margin: 0 auto;
  }
  .hero-kicker {
    margin-left: auto;
    margin-right: auto;
    font-size: 0.72rem;
    margin-bottom: 1rem;
  }
  .hero-headline {
    font-size: clamp(2.3rem, 7.5vw, 3.4rem);
    line-height: 1.1;
    margin-bottom: 1rem;
  }
  .hero-subtext-desktop {
    display: none !important;
  }
  .hero-subtext-mobile {
    display: block !important;
    margin: 0 auto 1.5rem;
    max-width: 28rem;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-muted);
  }
  .hero-actions {
    display: flex;
    flex-direction: row;
    gap: 0.65rem;
    justify-content: center;
    max-width: 24rem;
    margin: 0 auto;
    width: 100%;
  }
  .hero-actions .btn {
    flex: 1.2;
    min-height: 50px;
    font-size: 0.92rem;
    padding: 0.75rem 0.65rem;
    justify-content: center;
    border-radius: 14px;
  }
  .hero-actions .btn-ghost {
    flex: 1;
    min-height: 50px;
  }

  /* Clutter-free mobile hero stage */
  .hero-proof,
  .hero-streak-card,
  .hero-water-card,
  .hero-today-chip,
  .hero-stage .buddy-img,
  .marquee-ribbon {
    display: none !important;
  }

  .hero-stage {
    position: relative;
    width: 100%;
    height: 450px;
    max-width: 440px;
    margin: 1.5rem auto 0;
    padding: 0;
    perspective: none;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden;
    mask-image: linear-gradient(#000 0%, #000 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(#000 0%, #000 85%, transparent 100%);
  }
  .hero-stage .phone {
    width: min(250px, 72vw);
    margin: 0 auto;
    transform: none !important;
  }

  /* ── 2. Logging & Smart Food Breakdown ──────────────────────────────── */
  #log {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
  .logging-mobile-tabs {
    display: flex !important;
    flex-direction: row !important;
    gap: 4px !important;
    border-radius: 15px !important;
    background: var(--surface) !important;
    border: 1px solid var(--hairline) !important;
    padding: 4px !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.5rem !important;
    width: 100% !important;
    max-width: 440px !important;
    margin-inline: auto !important;
  }
  .log-m-tab {
    flex: 1 !important;
    min-height: 70px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    border: 0 !important;
    background: transparent !important;
    border-radius: 11px !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 8px 4px !important;
  }
  .log-m-tab .m-tab-icon {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
  }
  .log-m-tab.active {
    background: rgba(26, 106, 160, 0.12) !important;
    color: #1a6aa0 !important;
    box-shadow: none !important;
  }
  :root[data-theme="dark"] .log-m-tab.active {
    background: rgba(143, 211, 244, 0.15) !important;
    color: #8fd3f4 !important;
  }
  #log .m-stack {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    margin-top: 1.5rem !important;
  }
  #log .m-stack > div:first-child {
    display: none !important;
  }

  .log-mode-panel {
    min-height: auto !important;
  }
  .log-mode-panel[data-panel="snap"] .phone {
    width: min(240px, 68vw) !important;
    margin: 0 auto !important;
  }
  .log-mode-panel[data-panel="snap"] div[style*="position: absolute; right: -2.5rem"] {
    position: relative !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    max-width: 330px !important;
    margin: -1.5rem auto 0 !important;
    padding: 1.15rem 1.25rem !important;
    border-radius: 1.25rem !important;
    z-index: 10 !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3) !important;
  }

  /* Smart food breakdown collapsible accordion */
  .breakdown-disclosure {
    margin-top: 2rem !important;
    border-radius: 1.5rem !important;
    border: 1px solid var(--hairline) !important;
    background: var(--surface) !important;
    overflow: hidden !important;
  }
  .breakdown-disclosure summary.breakdown-summary {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 56px !important;
    padding: 0.85rem 1.25rem !important;
    font-family: 'Bricolage Grotesque', sans-serif !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: var(--text) !important;
    cursor: pointer !important;
    list-style: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
  }
  .breakdown-disclosure summary::-webkit-details-marker {
    display: none !important;
  }
  .breakdown-chevron {
    display: inline-block !important;
    font-size: 1.2rem !important;
    color: var(--c-authentic-blue) !important;
    transition: transform 0.25s ease !important;
  }
  .breakdown-disclosure[open] .breakdown-chevron {
    transform: rotate(180deg) !important;
  }
  .breakdown-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
    padding: 1.25rem 0.5rem !important;
    border-top: 1px solid var(--hairline) !important;
  }
  .breakdown-body > div:first-child {
    margin-bottom: 0.5rem !important;
  }
  .comp-card {
    padding: 1.25rem 1rem !important;
    border-radius: 1.25rem !important;
    box-shadow: none !important;
  }
  .comp-item {
    padding: 0.75rem 0.85rem !important;
    border-radius: 1rem !important;
    margin-bottom: 0.5rem !important;
  }
  #log .comp-card + .buddy-img {
    display: none !important;
  }

  /* ── 3. Today Dashboard ─────────────────────────────────────────────── */
  #dashboard {
    padding: 3.5rem 0 !important;
  }
  .dashboard-stage-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
    margin-top: 1.75rem !important;
  }
  .dashboard-phone-col {
    order: -1 !important;
    width: 100% !important;
  }
  .rep-tabbar {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
    max-width: 100% !important;
    gap: 0.35rem !important;
    padding: 0.35rem 0.5rem !important;
    margin-bottom: 1.25rem !important;
  }
  .rep-tab {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    min-height: 44px !important;
    padding: 0.45rem 0.85rem !important;
    font-size: 0.8rem !important;
    scroll-snap-align: center !important;
  }
  .preview-navigation {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 290px !important;
    margin: 1.25rem auto 0 !important;
    gap: 0.75rem !important;
  }
  .preview-navigation .icon-button {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.5rem !important;
    line-height: 1 !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
  }
  .preview-navigation .icon-button:active {
    background: rgba(255, 255, 255, 0.25) !important;
  }
  .preview-caption {
    flex: 1 !important;
    text-align: center !important;
  }
  .preview-caption p {
    font-size: 0.82rem !important;
    color: rgba(255, 255, 255, 0.88) !important;
    margin: 0 !important;
    min-height: 1.4rem !important;
  }
  .preview-dots {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    margin-top: 6px !important;
  }
  .preview-dots .dash-dot {
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.35) !important;
    transition: all 0.25s ease !important;
  }
  .preview-dots .dash-dot.is-active {
    width: 18px !important;
    border-radius: 9999px !important;
    background: #12d69c !important;
  }
  .dashboard-phone-col .phone {
    max-width: 260px !important;
    margin: 0 auto !important;
  }
  .dashboard-specs-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
    width: 100% !important;
  }
  .dash-spec-card,
  .dashboard-spec {
    padding: 0 !important;
    border: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #ffffff !important;
    box-shadow: none !important;
    width: 100% !important;
  }
  .dashboard-side-right .dashboard-spec:last-child,
  .dashboard-specs-col:last-child .dash-spec-card:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
  }
  .dash-spec-summary {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 56px !important;
    padding: 0.95rem 0.25rem !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    list-style: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
  }
  .dash-spec-summary::-webkit-details-marker {
    display: none !important;
  }
  .dash-spec-icon,
  .spec-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 22px !important;
    height: 22px !important;
    margin-right: 0.75rem !important;
    color: #8fd3f4 !important;
    flex-shrink: 0 !important;
  }
  .spec-amber .spec-icon { color: #f59e0b !important; }
  .spec-cyan .spec-icon { color: #12d69c !important; }
  .dash-spec-card h3,
  .dashboard-spec h3 {
    margin: 0 !important;
    font-size: 0.95rem !important;
    font-family: var(--font-body) !important;
    font-weight: 600 !important;
    flex: 1 !important;
    color: #ffffff !important;
    letter-spacing: -0.1px !important;
  }
  .dash-spec-chevron,
  .spec-chevron {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    color: rgba(255, 255, 255, 0.6) !important;
    transition: transform 0.2s ease !important;
    flex-shrink: 0 !important;
  }
  .dash-spec-card[open] .dash-spec-chevron,
  .dashboard-spec[open] .dash-spec-chevron,
  .dash-spec-card[open] .spec-chevron,
  .dashboard-spec[open] .spec-chevron {
    transform: rotate(180deg) !important;
  }
  .dash-spec-card p,
  .dashboard-spec p {
    padding: 0 0.5rem 1rem 2.2rem !important;
    margin: 0 !important;
    font-size: 0.88rem !important;
    line-height: 1.6 !important;
    color: rgba(240, 246, 255, 0.85) !important;
  }

  /* ── 4. Pet Companion ───────────────────────────────────────────────── */
  #buddy {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
  #buddy .m-stack {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
    margin-top: 1.75rem !important;
  }
  #buddy .m-stack > div[data-reveal] {
    display: contents !important;
  }
  #buddy .pet-stage-tabs {
    order: 1 !important;
    width: 100% !important;
  }
  #buddy .pet-visual {
    order: 2 !important;
    width: 100% !important;
    padding: 1.5rem 1rem !important;
    border-radius: 2rem !important;
  }
  #buddy .pet-details {
    order: 3 !important;
    width: 100% !important;
    margin-top: 0 !important;
  }
  .pet-visual > div[style*="height: 20rem"] {
    height: 15rem !important;
  }
  .pet-frame {
    width: 11.5rem !important;
    height: 11.5rem !important;
  }
  #petSpeechBubble {
    font-size: 0.75rem !important;
    padding: 0.4rem 0.75rem !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
  }
  #moodRow {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 0.35rem !important;
    width: 100% !important;
  }
  .mood-btn {
    min-height: 48px !important;
    padding: 0.4rem 0.15rem !important;
    font-size: 0.72rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    border-radius: 0.75rem !important;
  }
  .stage-tab {
    min-height: 46px !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
  }
  #petPerks .glass-pill {
    padding: 0.75rem 1rem !important;
    font-size: 0.88rem !important;
  }

  /* ── 5. Progress & Consistency ──────────────────────────────────────── */
  #progress {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
  .progress-mobile-tabs {
    display: flex !important;
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 auto 1.5rem !important;
    background: var(--surface) !important;
    border: 1px solid var(--hairline) !important;
    border-radius: 9999px !important;
    padding: 4px !important;
    gap: 4px !important;
  }
  .progress-m-tab {
    flex: 1 !important;
    min-height: 44px !important;
    border-radius: 9999px !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: background 0.2s, color 0.2s !important;
  }
  .progress-m-tab.active {
    background: var(--c-authentic-blue) !important;
    color: #ffffff !important;
  }
  #weeklyCard.is-mobile-hidden,
  #consistencyCard.is-mobile-hidden {
    display: none !important;
  }
  #progress .m-stack {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    margin-top: 1.5rem !important;
  }
  .weekly-progress-card {
    padding: 1.35rem 1.25rem !important;
    border-radius: 1.5rem !important;
  }
  .weekly-progress-card > div[style*="position: absolute; right: 1rem; top: -1rem"] {
    position: static !important;
    display: inline-block !important;
    margin-bottom: 0.75rem !important;
    transform: none !important;
    box-shadow: 0 4px 14px rgba(18, 214, 156, 0.3) !important;
  }
  .streak-banner {
    padding: 1.75rem 1.25rem !important;
    border-radius: 1.5rem !important;
  }
  .streak-banner div[style*="font-size: 10rem"] {
    font-size: 6rem !important;
    right: -1rem !important;
    top: -1rem !important;
  }
  .streak-banner .glass-pill {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    font-weight: 700 !important;
    font-size: 0.82rem !important;
    padding: 0.5rem 0.85rem !important;
  }
  .progress-followup-grid {
    display: block !important;
    margin-top: 2rem !important;
  }
  .progress-report-phone-col,
  .streak-banner + div {
    display: none !important;
  }

  /* ── 6. Squad & Arena ───────────────────────────────────────────────── */
  #squad {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
  .squad-mobile-tabs {
    display: flex !important;
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 auto 1.5rem !important;
    background: var(--surface) !important;
    border: 1px solid var(--hairline) !important;
    border-radius: 9999px !important;
    padding: 4px !important;
    gap: 4px !important;
  }
  .squad-m-tab {
    flex: 1 !important;
    min-height: 44px !important;
    border-radius: 9999px !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: background 0.2s, color 0.2s !important;
  }
  .squad-m-tab.active {
    background: var(--c-authentic-blue) !important;
    color: #ffffff !important;
  }
  #squad .m-stack {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    margin-top: 1.5rem !important;
  }
  .squad-phones-wrap {
    transform: none !important;
    margin-bottom: 0 !important;
    height: auto !important;
    min-height: auto !important;
    max-width: 300px !important;
    margin: 0 auto !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  .squad-phones-wrap .phone {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    width: min(250px, 70vw) !important;
    margin: 0 auto !important;
  }
  .squad-phone-feed.is-mobile-hidden,
  .squad-phone-arena.is-mobile-hidden {
    display: none !important;
  }
  .squad-phones-wrap .glass-pill[style*="left: 8rem"],
  .squad-phones-wrap .arena-winner-pill,
  .squad-phones-wrap .buddy-img,
  .squad-features-grid {
    display: none !important;
  }
  .squad-phones-wrap .glass-pill[style*="left: 1rem"] {
    position: relative !important;
    left: auto !important;
    bottom: auto !important;
    width: 100% !important;
    margin-top: 1rem !important;
    justify-content: center !important;
    padding: 0.65rem 1rem !important;
  }
  .cheers-btn {
    height: 44px !important;
    width: 44px !important;
    min-height: 44px !important;
    min-width: 44px !important;
    font-size: 1.2rem !important;
  }

  /* ── 7. Badges Marquee ──────────────────────────────────────────────── */
  #badges {
    padding-bottom: 3.5rem !important;
  }
  .badge-marquee-wrap {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    width: 100% !important;
    padding: 1rem 0 0.5rem !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .badge-marquee-wrap::-webkit-scrollbar {
    display: none !important;
  }
  #badgeTrack {
    display: flex !important;
    width: max-content !important;
    animation: none !important;
    scroll-snap-type: x mandatory !important;
    gap: 0.75rem !important;
    padding: 0 1rem !important;
  }
  .badge-card {
    scroll-snap-align: center !important;
    flex-shrink: 0 !important;
    width: 8.5rem !important;
    padding: 0.85rem 0.65rem !important;
    border-radius: 1.25rem !important;
  }
  #badges .badge-marquee-wrap + .badge-marquee-wrap {
    display: none !important;
  }
  .badge-card[aria-hidden="true"] {
    display: none !important;
  }
  .badge-swipe-hint {
    display: block !important;
    text-align: center !important;
    font-size: 0.85rem !important;
    color: var(--text-muted) !important;
    margin-top: 1rem !important;
  }

  /* ── 8. Download / CTA ──────────────────────────────────────────────── */
  #download .noise {
    padding: 2.75rem 1.25rem !important;
    border-radius: 2rem !important;
  }
  #download .noise > div[style*="height: 9.5rem"] {
    height: 7.5rem !important;
    width: 7.5rem !important;
  }
  #download .noise .buddy-img {
    width: 6.2rem !important;
  }
  .store-buttons {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.65rem !important;
    width: 100% !important;
    max-width: 24rem !important;
    margin: 1.75rem auto 0 !important;
  }
  .store-btn {
    flex: 1 !important;
    min-height: 54px !important;
    padding: 0.65rem 0.75rem !important;
    border-radius: 14px !important;
    justify-content: center !important;
  }

  /* ── 9. FAQ & Footer ────────────────────────────────────────────────── */
  #faq {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
  }
  .faq-q {
    padding: 1.15rem 1.25rem !important;
    font-size: 0.98rem !important;
  }
  .faq-icon {
    height: 40px !important;
    width: 40px !important;
    min-height: 40px !important;
    min-width: 40px !important;
    font-size: 1.3rem !important;
  }
  .faq-a p {
    padding: 0 1.25rem 1.15rem !important;
    font-size: 0.92rem !important;
  }
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  .footer-links a {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 40px !important;
  }
  .footer-bottom a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 40px !important;
    min-width: 44px !important;
    padding: 0 4px !important;
  }
  .footer-bottom {
    flex-direction: column !important;
    gap: 1rem !important;
    align-items: flex-start !important;
  }
}

@media (max-width: 480px) {
  .hero-proof {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.35rem !important;
  }
  .proof-item .proof-label {
    font-size: 0.68rem !important;
  }
  .hero-stage .phone {
    width: min(250px, 72vw) !important;
  }
}





/* ==========================================================================
   MOBILE OPTIMIZATION PASS (v1.2.0)
   Robustness, motion/GPU reduction, touch UX, safe areas, tiny-screen tier.
   ========================================================================== */

/* -- Layout safety --------------------------------------------------------- */
.dashboard-phone-col,
.dashboard-specs-col { min-width: 0; }
section[id] { scroll-margin-top: 5rem; }
img { height: auto; } /* width/height attrs reserve space; CSS keeps aspect ratio */
.phone-screen img { width: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a, button, .rep-tab, .mood-btn, .stage-tab, .log-mode-btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 2px solid #38bdf8; outline-offset: 3px; border-radius: 6px; }

/* -- Progressive enhancement: never hide content if JS fails -------------- */
html:not(.js) [data-reveal],
html:not(.js) .hero-headline .line-inner,
html:not(.js) .hero-kicker,
html:not(.js) .hero-subtext,
html:not(.js) .hero-actions,
html:not(.js) .hero-proof,
html:not(.js) .hero-stage {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

/* -- Drawer scroll lock ---------------------------------------------------- */
body.menu-open { overflow: hidden; touch-action: none; }

/* -- Sticky mobile CTA ------------------------------------------------------ */
.mobile-cta-bar { display: none; }

/* -- Touch devices: no sticky hover lifts ----------------------------------- */
@media (hover: none) {
  .badge-card:hover,
  .badge-card:hover img,
  .dash-spec-card:hover,
  #dashboard .glass-pill:hover { transform: none !important; }
  .marquee-track:hover { animation-play-state: running; }
}

/* -- Phones & small tablets ------------------------------------------------- */
@media (max-width: 768px) {
  /* GPU/battery: static soft glows instead of animated 60px blur layers */
  .glow-blob {
    animation: none !important;
    filter: none !important;
    opacity: 0.55;
    -webkit-mask-image: radial-gradient(closest-side, #000 0%, transparent 100%);
    mask-image: radial-gradient(closest-side, #000 0%, transparent 100%);
  }
  /* Full-viewport SVG film grain is expensive to composite while scrolling */
  body::after { display: none; }
  .noise::after { display: none; }
  /* Backdrop blur layers over scrolling content are costly on mobile GPUs */
  #dashboard .glass-pill,
  .dash-spec-card,
  .streak-banner .glass-pill { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }

  /* Safe areas (notch / home indicator) */
  .nav-wrapper { padding-top: calc(0.75rem + env(safe-area-inset-top)); padding-left: calc(0.75rem + env(safe-area-inset-left)); padding-right: calc(0.75rem + env(safe-area-inset-right)); }
  .mobile-nav-drawer { justify-content: safe center; padding-top: calc(5.5rem + env(safe-area-inset-top)); padding-bottom: calc(2rem + env(safe-area-inset-bottom)); overflow-y: auto; }
  .footer { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }

  /* Readability: nothing under 12px */
  .proof-item .proof-label { font-size: 0.75rem !important; }
  .eyebrow-pill { font-size: 0.75rem; }
  .hero-today-chip > div:first-child { font-size: 0.72rem !important; }
  .hero-streak-card > div > div:last-child,
  .hero-water-card > div > div:last-child { font-size: 0.75rem !important; }

  /* 44px touch targets */
  .nav-actions .theme-toggle { min-height: 44px; }
  .mood-btn, .stage-tab, .log-mode-btn, .rep-tab, .progress-m-tab, .squad-m-tab { min-height: 44px !important; }
  .faq-icon { min-height: 40px !important; min-width: 40px !important; width: 40px !important; height: 40px !important; }
  .nav-brand { min-height: 44px !important; display: inline-flex !important; align-items: center !important; }
  .footer-links a { display: inline-flex !important; align-items: center !important; min-height: 40px !important; }
  .footer-bottom a { display: inline-flex !important; align-items: center !important; justify-content: center !important; min-height: 40px !important; min-width: 44px !important; padding: 0 4px !important; }

  /* Dashboard tab bar: fade hint that it scrolls, hidden scrollbar */
  .rep-tabbar { scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .rep-tabbar::-webkit-scrollbar { display: none; }

  /* Arena: compact 2-col mode cards instead of six stacked rows */
  #squad [data-reveal-group] { gap: 0.6rem !important; }
  #squad [data-reveal-group] > .glass-pill { padding: 0.8rem !important; border-radius: 1rem !important; }
  #squad [data-reveal-group] > .glass-pill > span { height: 2rem !important; width: 2rem !important; font-size: 1.1rem !important; }
  #squad [data-reveal-group] > .glass-pill > div:nth-of-type(1) { margin-top: 0.5rem !important; font-size: 0.9rem; }
  #squad [data-reveal-group] > .glass-pill > div:nth-of-type(2) { font-size: 0.75rem !important; line-height: 1.3; }

  /* Progress: the 30-day phone repeats a Dashboard tab -> skip on phones */
  .streak-banner + div .phone { display: none; }

  /* Sticky CTA appears once the hero CTA scrolls away; hides near #download */
  .mobile-cta-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    position: fixed;
    left: max(16px, env(safe-area-inset-left));
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
    min-height: 53px;
    border-radius: 16px;
    background: #f6ae2d;
    color: #17263b;
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid rgba(205, 137, 37, 0.2);
    box-shadow: 0 7px 24px -7px rgba(10, 28, 48, 0.28);
    z-index: 900;
    transform: translateY(160%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s var(--ease-out-cubic), opacity 0.25s ease;
  }
  .mobile-cta-bar.is-visible { transform: none; opacity: 1; pointer-events: auto; }
  body.menu-open .mobile-cta-bar { transform: translateY(160%); opacity: 0; pointer-events: none; }
}

/* -- Small phones (<= 390px) ------------------------------------------------ */
@media (max-width: 390px) {
  .container { width: calc(100% - 2rem); }
  .hero-headline { font-size: clamp(2.05rem, 9.2vw, 2.5rem) !important; }
  .hero-stage { max-width: 300px; }
  .hero-streak-card, .hero-water-card { padding: 0.5rem 0.7rem !important; }
}

/* -- Tiny phones (<= 359px: Galaxy Fold cover / iPhone SE) ------------------ */
@media (max-width: 359px) {
  .container { width: calc(100% - 1.5rem); }
  .island-nav { padding-inline: max(12px, env(safe-area-inset-left)); }
  .nav-brand .font-display { font-size: 1.05rem !important; }
  .hero-headline { font-size: clamp(1.9rem, 8.5vw, 2.3rem) !important; }
  .hero-stage { height: 414px !important; max-width: 280px; }
  .hero-stage .phone { width: min(228px, 72vw) !important; }
  .section-title { font-size: clamp(1.7rem, 8vw, 2rem) !important; }
  .pet-details h3 { font-size: 1.5rem !important; }
  .mood-btn { font-size: 0.68rem !important; padding: 0.35rem 0.1rem !important; }
  .squad-phones-wrap { height: auto !important; max-width: 260px !important; }
  .squad-phones-wrap .phone { width: min(228px, 72vw) !important; }
  .arena-mode-card { padding: 0.65rem 0.5rem !important; }
  .badge-card { width: 8rem !important; }
  .store-buttons { flex-direction: column !important; gap: 0.65rem !important; }
  .store-btn { width: 100% !important; }
  .comp-card { padding-inline: 0.75rem !important; }
  .comp-item { padding: 0.65rem 0.5rem !important; }
  .log-m-tab { min-height: 64px !important; font-size: 0.72rem !important; }
}

/* -- Ultra compact screens (<= 329px) --------------------------------------- */
@media (max-width: 329px) {
  .container { width: calc(100% - 1rem); }
  .hero-actions { flex-direction: column !important; gap: 0.5rem !important; width: 100% !important; }
  .hero-actions .btn { width: 100% !important; }
  .hero-headline { font-size: 1.75rem !important; }
  .hero-subtext-mobile { font-size: 0.9rem !important; }
  .hero-stage { height: 395px !important; }
  .hero-stage .phone { width: min(210px, 75vw) !important; }
  .pet-details h3 { font-size: 1.35rem !important; }
}

/* -- Landscape phones: avoid oversized hero --------------------------------- */
@media (max-height: 480px) and (orientation: landscape) {
  .hero { padding-top: 4.5rem; }
  .hero-stage .phone { width: min(200px, 40vh) !important; }
  .mobile-cta-bar { display: none; }
}
