/* ============================================================
   Sylvan Lake Local — base.css
   Design tokens, reset, and primitives
   ============================================================ */

:root {
  /* Type scale (fluid) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.82rem + 0.25vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.04rem + 0.4vw, 1.3125rem);
  --text-xl: clamp(1.375rem, 1.15rem + 1.1vw, 2rem);
  --text-2xl: clamp(1.875rem, 1.3rem + 2.6vw, 3.25rem);
  --text-3xl: clamp(2.5rem, 1.4rem + 4.4vw, 4.75rem);

  /* Spacing (4px base) */
  --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;

  /* Radii */
  --radius-sm: 0.375rem; --radius-md: 0.625rem; --radius-lg: 1rem;
  --radius-xl: 1.5rem; --radius-full: 9999px;

  /* Fonts */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Content widths */
  --content-narrow: 680px;
  --content-default: 1040px;
  --content-wide: 1280px;

  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Light theme (default) ---------- */
:root, [data-theme='light'] {
  --color-bg: #faf6f0;          /* dawn cream */
  --color-surface: #ffffff;
  --color-surface-2: #f5efe6;   /* sandy warm */
  --color-surface-3: #e8dfd2;   /* deeper sand */
  --color-border: #e3d8c8;
  --color-divider: #ece3d6;

  --color-text: #1e2830;        /* charcoal */
  --color-text-muted: #5c6873;
  --color-text-faint: #94a0a8;
  --color-text-inverse: #faf6f0;

  --color-primary: #0f4c5c;     /* deep lake teal */
  --color-primary-hover: #0b3a47;
  --color-primary-soft: #dce9ec;

  --color-accent: #c9a961;      /* brass gold */
  --color-accent-hover: #b8963f;
  --color-accent-soft: #f2e8d1;

  --shadow-sm: 0 1px 2px rgba(30, 40, 48, 0.06);
  --shadow-md: 0 6px 20px rgba(30, 40, 48, 0.09);
  --shadow-lg: 0 18px 44px rgba(30, 40, 48, 0.14);

  --hero-overlay: linear-gradient(180deg, rgba(15,40,48,0.15) 0%, rgba(15,40,48,0.55) 100%);
}

/* ---------- Dark theme ---------- */
[data-theme='dark'] {
  --color-bg: #0d1721;          /* midnight navy */
  --color-surface: #14212c;
  --color-surface-2: #1a2833;
  --color-surface-3: #223240;
  --color-border: #2a3a48;
  --color-divider: #223240;

  --color-text: #e8dfd2;
  --color-text-muted: #a9b4bd;
  --color-text-faint: #6d7c88;
  --color-text-inverse: #0d1721;

  --color-primary: #4fa8b8;
  --color-primary-hover: #6dbecd;
  --color-primary-soft: #16323b;

  --color-accent: #d4b876;
  --color-accent-hover: #e0c88d;
  --color-accent-soft: #2a2417;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 22px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);

  --hero-overlay: linear-gradient(180deg, rgba(6,14,20,0.35) 0%, rgba(6,14,20,0.75) 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0d1721; --color-surface: #14212c; --color-surface-2: #1a2833;
    --color-surface-3: #223240; --color-border: #2a3a48; --color-divider: #223240;
    --color-text: #e8dfd2; --color-text-muted: #a9b4bd; --color-text-faint: #6d7c88;
    --color-text-inverse: #0d1721; --color-primary: #4fa8b8; --color-primary-hover: #6dbecd;
    --color-primary-soft: #16323b; --color-accent: #d4b876; --color-accent-hover: #e0c88d;
    --color-accent-soft: #2a2417;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4); --shadow-md: 0 6px 22px rgba(0,0,0,0.45);
    --shadow-lg: 0 20px 48px rgba(0,0,0,0.55);
    --hero-overlay: linear-gradient(180deg, rgba(6,14,20,0.35) 0%, rgba(6,14,20,0.75) 100%);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--transition), color var(--transition);
}
img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; padding: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--color-text);
}
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 3px;
}

.container { width: 100%; max-width: var(--content-wide); margin-inline: auto; padding-inline: var(--space-6); }
.container--default { max-width: var(--content-default); }
.container--narrow { max-width: var(--content-narrow); }

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

.skip-link {
  position: absolute; left: var(--space-4); top: -3rem; z-index: 200;
  background: var(--color-primary); color: #fff; padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md); transition: top var(--transition);
}
.skip-link:focus { top: var(--space-4); }
