/* ==========================================================================
   BETTER EVERY DAY — DESIGN SYSTEM
   Version 1.0

   Grounded in Brand Personality (see IdeaSummary.md):
   Minimalistic · Calm · Premium · Scientific without clinical
   Apple rather than GNC · WHOOP rather than bodybuilding · Muji rather than pharmacy

   HOW TO USE THIS FILE
   - Link it in every page: <link rel="stylesheet" href="design-system.css">
   - Never hardcode colors, spacing or font sizes in new markup —
     always reference the CSS variables below.
   - When briefing Claude Code / Lovable for a new increment, say:
     "Use design-system.css as the single source of truth for all
     colors, type, spacing and components. Do not introduce new values —
     extend the token list at the top of the file if something is missing."
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */

:root {
  /* Color — surfaces */
  --color-bg: #FAF8F4;            /* page canvas, warm off-white (Muji) */
  --color-surface: #FFFFFF;       /* cards, nav, raised elements */
  --color-surface-alt: #F1EEE6;   /* muted/alternating section background */

  /* Color — text */
  --color-text-primary: #1C1B19;    /* headlines, body copy */
  --color-text-secondary: #6B675F;  /* supporting copy, captions */
  --color-text-muted: #9B968B;      /* hints, fine print */
  --color-text-on-accent: #FAF8F4;  /* text on solid accent fill */

  /* Color — accent (sage/forest — calm, natural, not clinical) */
  --color-accent: #3F5A45;
  --color-accent-hover: #2E4234;
  --color-accent-soft: #E4EAE2;     /* tint background for badges/highlights */

  /* Color — highlight (warm clay — sparing use, e.g. one stat or tag) */
  --color-highlight: #C17A54;
  --color-highlight-soft: #F3E4D9;

  /* Color — structure */
  --color-border: #E5E1D8;
  --color-border-strong: #D2CCBE;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;

  --text-xs: 0.75rem;    /* 12px — fine print */
  --text-sm: 0.875rem;   /* 14px — captions, nav */
  --text-base: 1rem;     /* 16px — body */
  --text-lg: 1.25rem;    /* 20px — lede, subhead */
  --text-xl: 1.5rem;     /* 24px — card title */
  --text-2xl: 2rem;      /* 32px — section heading */
  --text-3xl: 2.75rem;   /* 44px — page heading */
  --text-4xl: 3.5rem;    /* 56px — hero headline */

  --weight-regular: 400;
  --weight-medium: 500;   /* use instead of bold — calmer, more premium */
  --weight-light: 300;    /* hero display moments only */

  --leading-tight: 1.15;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;

  /* Spacing (4px base grid) */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.5rem;    /* 24px */
  --space-6: 2rem;      /* 32px */
  --space-7: 3rem;      /* 48px */
  --space-8: 4rem;      /* 64px */
  --space-9: 6rem;      /* 96px */
  --space-10: 8rem;     /* 128px */

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 999px;

  /* Shadow (subtle only — premium, not flashy) */
  --shadow-sm: 0 1px 2px rgba(28, 27, 25, 0.04);
  --shadow-md: 0 4px 16px rgba(28, 27, 25, 0.06);
  --shadow-lg: 0 12px 32px rgba(28, 27, 25, 0.08);

  /* Layout */
  --container-max: 1120px;
  --container-pad: var(--space-5);
}

/* --------------------------------------------------------------------------
   2. RESET / BASE
   -------------------------------------------------------------------------- */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

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

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */

.eyebrow {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 var(--space-3);
}

h1, .h1 {
  font-size: var(--text-4xl);
  font-weight: var(--weight-light);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-5);
}

h2, .h2 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-light);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-4);
}

h3, .h3 {
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-3);
}

.lede {
  font-size: var(--text-lg);
  font-weight: var(--weight-regular);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0 0 var(--space-6);
}

p { margin: 0 0 var(--space-4); }

.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }

/* --------------------------------------------------------------------------
   4. LAYOUT
   -------------------------------------------------------------------------- */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.section {
  padding-top: var(--space-9);
  padding-bottom: var(--space-9);
}

.section--alt {
  background: var(--color-surface-alt);
}

.section--tight {
  padding-top: var(--space-7);
  padding-bottom: var(--space-7);
}

.stack { display: flex; flex-direction: column; }
.row { display: flex; flex-wrap: wrap; align-items: center; }

.grid {
  display: grid;
  gap: var(--space-5);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 768px) {
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  h1, .h1 { font-size: var(--text-3xl); }
  h2, .h2 { font-size: var(--text-xl); }
}

/* --------------------------------------------------------------------------
   5. COMPONENTS
   -------------------------------------------------------------------------- */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--color-accent);
  color: var(--color-text-on-accent);
}
.btn-primary:hover { background: var(--color-accent-hover); }

.btn-secondary {
  background: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-border-strong);
}
.btn-secondary:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.card--elevated {
  box-shadow: var(--shadow-md);
  border: none;
}

/* Badges / pills */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.badge--highlight {
  background: var(--color-highlight-soft);
  color: var(--color-highlight);
}

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 248, 244, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

.nav__logo {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  letter-spacing: -0.01em;
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}
