/* ============================================================
   My Huckleberry Life — Base Stylesheet
   Trust-first home safety & medical alert reviews for adults 55+
   Palette: Navy / Mint / Gold / Cream
   ============================================================ */

:root {
  /* Type scale (fluid, senior-legible: floors raised for 55+ readability) */
  --text-xs: clamp(0.8125rem, 0.78rem + 0.2vw, 0.9375rem);   /* 13-15px */
  --text-sm: clamp(0.9375rem, 0.9rem + 0.25vw, 1.0625rem);   /* 15-17px */
  --text-base: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);    /* 17-19px  — larger base for seniors */
  --text-lg: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);       /* 20-26px */
  --text-xl: clamp(1.625rem, 1.3rem + 1.2vw, 2.375rem);      /* 26-38px */
  --text-2xl: clamp(2.125rem, 1.4rem + 2.6vw, 3.5rem);       /* 34-56px */
  --text-3xl: clamp(2.75rem, 1.4rem + 4vw, 5rem);            /* 44-80px */

  /* 4px spacing system */
  --space-1: 0.25rem;  --space-2: 0.5rem;  --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem;  --space-6: 1.5rem;  --space-8: 2rem;    --space-10: 2.5rem;
  --space-12: 3rem;    --space-16: 4rem;   --space-20: 5rem;   --space-24: 6rem;
  --space-32: 8rem;

  /* Content widths */
  --content-narrow: 680px;
  --content-default: 1000px;
  --content-wide: 1220px;

  /* Radius */
  --radius-sm: 0.375rem; --radius-md: 0.625rem; --radius-lg: 1rem; --radius-xl: 1.5rem; --radius-full: 9999px;
  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Fonts */
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Source Sans 3', 'Helvetica Neue', system-ui, sans-serif;
}

/* ---------- LIGHT MODE (brand default) ---------- */
:root, [data-theme='light'] {
  --color-bg: #faf6ee;            /* warm cream */
  --color-surface: #ffffff;
  --color-surface-2: #fbf8f1;
  --color-surface-offset: #f2ece0;
  --color-surface-dynamic: #ece4d5;
  --color-divider: #e4dccc;
  --color-border: #d8cfbb;

  --color-text: #1c2a3a;          /* deep navy-ink */
  --color-text-muted: #55606d;
  --color-text-faint: #8b93a0;
  --color-text-inverse: #faf6ee;

  --color-primary: #16324f;        /* navy */
  --color-primary-hover: #0f2438;
  --color-primary-active: #0a1a2a;
  --color-primary-highlight: #d6e0ea;

  --color-mint: #3f9d86;           /* mint/teal-green */
  --color-mint-hover: #337f6c;
  --color-mint-highlight: #d5ece5;

  --color-gold: #c99a2e;           /* warm gold */
  --color-gold-hover: #a97f1e;
  --color-gold-highlight: #f0e4c4;

  --color-success: #2e7d4f;
  --color-success-highlight: #d4e8dc;
  --color-warning: #b5641b;
  --color-warning-highlight: #f2ddc6;
  --color-error: #a32d2d;
  --color-error-highlight: #efd5d1;

  --shadow-sm: 0 1px 3px rgba(28, 42, 58, 0.08);
  --shadow-md: 0 6px 18px rgba(28, 42, 58, 0.10);
  --shadow-lg: 0 16px 40px rgba(28, 42, 58, 0.16);
}

/* ---------- DARK MODE ---------- */
[data-theme='dark'] {
  --color-bg: #10161d;
  --color-surface: #171f28;
  --color-surface-2: #1c2530;
  --color-surface-offset: #1a222c;
  --color-surface-dynamic: #24303c;
  --color-divider: #26313d;
  --color-border: #33404e;

  --color-text: #e8e2d4;
  --color-text-muted: #a2aab5;
  --color-text-faint: #6c7682;
  --color-text-inverse: #10161d;

  --color-primary: #6fa8d6;
  --color-primary-hover: #8bbce3;
  --color-primary-active: #a3cbeb;
  --color-primary-highlight: #24303c;

  --color-mint: #57c2a6;
  --color-mint-hover: #74d2ba;
  --color-mint-highlight: #1f3a34;

  --color-gold: #e0b957;
  --color-gold-hover: #ecc871;
  --color-gold-highlight: #3a3320;

  --color-success: #5bb37e;
  --color-success-highlight: #21362a;
  --color-warning: #d68a4a;
  --color-warning-highlight: #3a2c1c;
  --color-error: #d97570;
  --color-error-highlight: #3a2321;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #10161d; --color-surface: #171f28; --color-surface-2: #1c2530;
    --color-surface-offset: #1a222c; --color-surface-dynamic: #24303c;
    --color-divider: #26313d; --color-border: #33404e;
    --color-text: #e8e2d4; --color-text-muted: #a2aab5; --color-text-faint: #6c7682;
    --color-text-inverse: #10161d;
    --color-primary: #6fa8d6; --color-primary-hover: #8bbce3; --color-primary-active: #a3cbeb;
    --color-primary-highlight: #24303c;
    --color-mint: #57c2a6; --color-mint-hover: #74d2ba; --color-mint-highlight: #1f3a34;
    --color-gold: #e0b957; --color-gold-hover: #ecc871; --color-gold-highlight: #3a3320;
    --color-success: #5bb37e; --color-success-highlight: #21362a;
    --color-warning: #d68a4a; --color-warning-highlight: #3a2c1c;
    --color-error: #d97570; --color-error-highlight: #3a2321;
  }
}

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

html {
  -webkit-text-size-adjust: none; text-size-adjust: none;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  min-height: 100dvh; line-height: 1.65;
  font-family: var(--font-body); font-size: var(--text-base);
  color: var(--color-text); background-color: var(--color-bg);
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
ul[role='list'], ol[role='list'] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4 { text-wrap: balance; line-height: 1.15; font-family: var(--font-display); font-weight: 600; color: var(--color-primary); }
[data-theme='dark'] h1, [data-theme='dark'] h2, [data-theme='dark'] h3, [data-theme='dark'] h4 { color: var(--color-text); }
p, li, figcaption { text-wrap: pretty; }

a { color: var(--color-mint-hover); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--color-primary); }

::selection { background: var(--color-gold-highlight); color: var(--color-text); }
:focus-visible { outline: 3px solid var(--color-mint); outline-offset: 3px; border-radius: var(--radius-sm); }

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

button { cursor: pointer; background: none; border: none; }
table { border-collapse: collapse; width: 100%; }

a, button, [role='button'], input, textarea, select {
  transition: color var(--transition-interactive), background var(--transition-interactive),
    border-color var(--transition-interactive), box-shadow var(--transition-interactive), transform var(--transition-interactive);
}

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