/* ============================================
   base.css — Reset & Design Tokens
   Trackback by Rightlander
   ============================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

body {
  font-family: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  color: #fff;
  background: #050505;
  min-height: 100vh;
  overflow-x: hidden;
}

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

img {
  height: auto;
}

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

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

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

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

:focus-visible {
  outline: 2px solid #e0198c;
  outline-offset: 3px;
  border-radius: 4px;
}

:focus:not(:focus-visible) {
  outline: none;
}

::selection {
  background: rgba(224, 25, 140, 0.3);
  color: #fff;
}

/* ---------- Design Tokens ---------- */
:root {
  /* Colors — Dark (default) */
  --bg-dark: #050505;
  --bg-dark-2: #0a0a0a;
  --bg-dark-card: #111111;
  --bg-light: #f7f6f2;
  --bg-sage: #e8ece4;
  --bg-white: #ffffff;

  --text-white: #ffffff;
  --text-light: rgba(255,255,255,0.7);
  --text-muted: rgba(255,255,255,0.5);
  --text-dark: #1a1a1a;
  --text-dark-muted: #555555;

  --pink: #e0198c;
  --orange: #f5a623;
  --lime: #c8f000;
  --teal: #0d9488;
  --sage-dark: #3d5a3d;

  --gradient-primary: linear-gradient(135deg, #e0198c, #f5a623);
  --gradient-hero: linear-gradient(135deg, #e0198c, #f5a623, #c8f000);

  --border-dark: rgba(255,255,255,0.08);
  --border-light: rgba(0,0,0,0.08);

  /* Theme toggle transition */
  --theme-transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;

  /* Spacing */
  --container-max: 1200px;
  --container-wide: 1320px;
  --section-pad: clamp(56px, 7vw, 96px);
  --section-pad-sm: clamp(36px, 5vw, 64px);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 100px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.2s;
  --dur-med: 0.4s;
  --dur-slow: 0.7s;

  /* Nav */
  --nav-height: 72px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Utility ---------- */
[hidden] {
  display: none !important;
}

.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;
}

/* ---------- Light Theme Override ---------- */
[data-theme="light"] {
  --bg-dark: #f7f6f2;
  --bg-dark-2: #efeeea;
  --bg-dark-card: #ffffff;
  --bg-light: #ffffff;
  --bg-sage: #e8ece4;
  --bg-white: #ffffff;

  --text-white: #1a1a1a;
  --text-light: rgba(0,0,0,0.65);
  --text-muted: rgba(0,0,0,0.45);
  --text-dark: #1a1a1a;
  --text-dark-muted: #555555;

  --border-dark: rgba(0,0,0,0.1);
  --border-light: rgba(0,0,0,0.08);
}

[data-theme="light"] body {
  color: #1a1a1a;
  background: #f7f6f2;
}

/* ---------- Theme Toggle Button ---------- */
.theme-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease;
  flex-shrink: 0;
  margin-left: 8px;
}
.theme-toggle:hover {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.05);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.theme-toggle__sun,
.theme-toggle__moon { position: absolute; }
.theme-toggle__moon { opacity: 1; }
.theme-toggle__sun  { opacity: 0; transform: rotate(-90deg) scale(0.5); }

[data-theme="light"] .theme-toggle {
  border-color: rgba(0,0,0,0.15);
}
[data-theme="light"] .theme-toggle:hover {
  border-color: rgba(0,0,0,0.35);
  background: rgba(0,0,0,0.04);
}
[data-theme="light"] .theme-toggle__moon { opacity: 0; transform: rotate(90deg) scale(0.5); }
[data-theme="light"] .theme-toggle__sun  { opacity: 1; transform: rotate(0deg) scale(1); }

/* ---------- Light-Mode Specific Overrides ---------- */
/* Nav */
[data-theme="light"] .nav.scrolled {
  background: rgba(247,246,242,0.92);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
[data-theme="light"] .nav__logo { color: #1a1a1a; }
[data-theme="light"] .nav__link { color: rgba(0,0,0,0.6); }
[data-theme="light"] .nav__link:hover,
[data-theme="light"] .nav__link.active { color: #1a1a1a; }
[data-theme="light"] .nav__login { color: rgba(0,0,0,0.6); }
[data-theme="light"] .nav__login:hover { color: #1a1a1a; }
[data-theme="light"] .nav__signup { background: #1a1a1a; color: #fff; }
[data-theme="light"] .nav__signup:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
[data-theme="light"] .nav__mobile-menu { background: rgba(247,246,242,0.97); }
[data-theme="light"] .nav__mobile-link { color: #1a1a1a; }
[data-theme="light"] .nav__hamburger span { background: #1a1a1a; }

/* Heroes in light mode: keep dark for readability over images */
[data-theme="light"] .hero { background: #050505; }
[data-theme="light"] .hero .hero-title,
[data-theme="light"] .hero .hero__right,
[data-theme="light"] .hero .hero__right p,
[data-theme="light"] .hero .label { color: #fff; }

/* Dark sections become light in light mode */
[data-theme="light"] .section--dark,
[data-theme="light"] .section--dark-2 {
  background: var(--bg-dark);
  color: var(--text-white);
}
[data-theme="light"] .section--dark .section-title,
[data-theme="light"] .section--dark-2 .section-title,
[data-theme="light"] .section--dark h2,
[data-theme="light"] .section--dark-2 h2 { color: var(--text-white); }
[data-theme="light"] .section--dark .section-subtitle,
[data-theme="light"] .section--dark-2 .section-subtitle,
[data-theme="light"] .section--dark p,
[data-theme="light"] .section--dark-2 p { color: var(--text-light); }

/* Cards in light mode */
[data-theme="light"] .problem-card,
[data-theme="light"] .timeline-card,
[data-theme="light"] .prefs-table,
[data-theme="light"] .alert-card {
  background: var(--bg-dark-card);
  border-color: var(--border-dark);
}
[data-theme="light"] .problem-card__title,
[data-theme="light"] .timeline-card h3 { color: var(--text-white); }
[data-theme="light"] .problem-card__text,
[data-theme="light"] .timeline-card p { color: var(--text-light); }

/* Pricing table */
[data-theme="light"] .pricing-table {
  border-color: var(--border-dark);
  background: var(--bg-dark-card);
}
[data-theme="light"] .pricing-table th,
[data-theme="light"] .pricing-table td {
  border-color: var(--border-dark);
  color: var(--text-white);
}

/* FAQ items */
[data-theme="light"] .faq-item { border-color: var(--border-dark); }
[data-theme="light"] .faq-item__q { color: var(--text-white); }
[data-theme="light"] .faq-item__a p { color: var(--text-light); }

/* Footer */
[data-theme="light"] .footer { background: var(--bg-dark-2); }
[data-theme="light"] .footer,
[data-theme="light"] .footer a,
[data-theme="light"] .footer p,
[data-theme="light"] .footer h4 { color: var(--text-light); }
[data-theme="light"] .footer h4 { color: var(--text-white); }
[data-theme="light"] .footer__bottom { border-color: var(--border-dark); }

/* Form inputs */
[data-theme="light"] .form-input,
[data-theme="light"] .form-textarea,
[data-theme="light"] .footer__newsletter input {
  background: rgba(0,0,0,0.04);
  border-color: var(--border-dark);
  color: var(--text-white);
}

/* Tagline band */
[data-theme="light"] .cta-band { background: var(--bg-dark); }
[data-theme="light"] .cta-band h2,
[data-theme="light"] .cta-band p { color: var(--text-white); }

/* Email preview card in light sections */
[data-theme="light"] .health-email { background: var(--bg-dark-card); border-color: var(--border-dark); }

/* Ghost buttons */
[data-theme="light"] .btn--ghost {
  color: var(--text-dark);
  border-color: var(--text-dark);
}

/* Cookie banner */
[data-theme="light"] .cookie-banner {
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.1);
  color: rgba(0,0,0,0.65);
}
[data-theme="light"] .cookie-banner__btn--decline {
  color: rgba(0,0,0,0.5);
  border-color: rgba(0,0,0,0.15);
}
