/* ===========================
   SavrBite: Base Styles
   Reset, variables, typography
   =========================== */

:root {
  color-scheme: light;

  /* Colors */
  --color-bg: #FAFAF8;
  --color-bg-rgb: 250, 250, 248;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F3F7F4;

  --color-primary: #2F9E6E;
  --color-primary-dark: #1F7A54;
  --color-primary-light: #E6F6EE;

  --color-accent: #FF8A5B;
  --color-accent-dark: #E8703F;
  --color-accent-light: #FFEDE3;

  --color-text: #17251C;
  --color-text-muted: #5B6B62;
  --color-text-soft: #8A968E;

  --color-border: #E7EDE9;
  --color-border-strong: #D3DED8;

  /* Fixed regardless of theme (phone bezel, store badges) */
  --color-ink: #17251C;

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-full: 999px;

  /* Shadow */
  --shadow-sm: 0 2px 8px rgba(23, 37, 28, 0.06);
  --shadow-md: 0 8px 24px rgba(23, 37, 28, 0.08);
  --shadow-lg: 0 20px 48px rgba(23, 37, 28, 0.12);

  /* Layout */
  --container: 1180px;
  --container-narrow: 760px;
  --nav-height: 76px;

  /* Fonts */
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset */
*, *::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);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font: inherit;
  color: inherit;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

h1 { font-size: clamp(2.4rem, 5vw, 3.75rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 3.5vw, 2.75rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

p { color: var(--color-text-muted); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 18px;
}

.beta-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-accent-dark);
  background: var(--color-accent-light);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}
.beta-badge-light {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

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

/* Layout helpers */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: 24px;
}

section {
  padding-block: clamp(56px, 8vw, 108px);
}

.section-head {
  max-width: 640px;
  margin-bottom: 52px;
}

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

.section-head p {
  margin-top: 14px;
  font-size: 1.08rem;
}

.text-center { text-align: center; }

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

/* Focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===========================
   Dark mode
   Defaults to OS preference; [data-theme] on <html>
   (set by assets/js/main.js) overrides it explicitly.
   =========================== */
body, .navbar, .site-footer, .feature-card, .testimonial-card,
.blog-card, .form-card, .mission-stat, .phone-screen, .prose .toc {
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-bg: #101A14;
    --color-bg-rgb: 16, 26, 20;
    --color-surface: #182420;
    --color-surface-alt: #1E2B25;

    --color-primary: #3DDB94;
    --color-primary-dark: #22C480;
    --color-primary-light: rgba(61, 219, 148, 0.16);

    --color-accent: #FF9D72;
    --color-accent-dark: #FFB088;
    --color-accent-light: rgba(255, 138, 91, 0.18);

    --color-text: #EEF4F0;
    --color-text-muted: #A6B8AC;
    --color-text-soft: #78897E;

    --color-border: #253028;
    --color-border-strong: #34433A;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.32);
    --shadow-lg: 0 20px 52px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #101A14;
  --color-bg-rgb: 16, 26, 20;
  --color-surface: #182420;
  --color-surface-alt: #1E2B25;

  --color-primary: #3DDB94;
  --color-primary-dark: #22C480;
  --color-primary-light: rgba(61, 219, 148, 0.16);

  --color-accent: #FF9D72;
  --color-accent-dark: #FFB088;
  --color-accent-light: rgba(255, 138, 91, 0.18);

  --color-text: #EEF4F0;
  --color-text-muted: #A6B8AC;
  --color-text-soft: #78897E;

  --color-border: #253028;
  --color-border-strong: #34433A;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 20px 52px rgba(0, 0, 0, 0.4);
}
