:root {
  /* color — light (default) */
  --bg: #F7F5EF;
  --bg-elevated: #FFFFFF;
  --text: #1C2321;
  --text-muted: #5B6560;
  --accent: #1F5C4A;
  --accent-strong: #163F33;
  --accent-soft: #E4EDE8;
  --alert: #B5502D;
  --alert-soft: #F5E4DA;
  --border: #E3DFD3;
  --shadow-sm: 0 1px 3px rgba(28,35,33,0.08);
  --shadow-md: 0 4px 12px rgba(28,35,33,0.06);

  /* #view's usual top padding (--space-4) plus the status bar/notch strip
     on an installed PWA, when the browser reports one. Shared so every
     element that bleeds up past #view's own top padding (the day hero,
     the day-detail sticky nav — see css/day.css, css/app.css) bleeds up by
     the exact same amount and lines up with no seam between them. */
  --safe-top: calc(var(--space-4) + env(safe-area-inset-top));

  /* spacing (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  /* type */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Fraunces", system-ui, serif;
  --text-xs: 12px;   --lh-xs: 16px;
  --text-sm: 14px;   --lh-sm: 20px;
  --text-base: 16px; --lh-base: 24px;
  --text-lg: 19px;   --lh-lg: 26px;
  --text-xl: 24px;   --lh-xl: 30px;
  --text-2xl: 32px;  --lh-2xl: 38px;

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-base: 200ms;
  --dur-spring: 250ms;
}

:root[data-theme="dark"] {
  --bg: #14181A;
  --bg-elevated: #1D2225;
  --text: #EDEDE6;
  --text-muted: #9AA39C;
  --accent: #4FAE8C;
  --accent-strong: #7BC7AA;
  --accent-soft: #1F3A30;
  --alert: #E08A5E;
  --alert-soft: #3A241B;
  --border: #2A302E;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14181A;
    --bg-elevated: #1D2225;
    --text: #EDEDE6;
    --text-muted: #9AA39C;
    --accent: #4FAE8C;
    --accent-strong: #7BC7AA;
    --accent-soft: #1F3A30;
    --alert: #E08A5E;
    --alert-soft: #3A241B;
    --border: #2A302E;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  }
}

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-subset.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
