/* base.css — reset + tokens + base styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Fluid type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(3rem, 0.5rem + 7vw, 7.25rem);

  /* Spacing */
  --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.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --transition-interactive: 220ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 1040px;
  --content-wide: 1240px;

  /* Fonts */
  --font-display: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Work Sans', 'Helvetica Neue', system-ui, sans-serif;
}

/* LIGHT — warm sand & linen, deep Gulf teal, sea-glass, driftwood text, coral accent */
:root,
[data-theme='light'] {
  --color-bg: #f3ede0;            /* warm linen */
  --color-surface: #f7f2e6;       /* lighter linen */
  --color-surface-2: #fbf7ec;     /* paper */
  --color-surface-offset: #eae2cf;
  --color-surface-deep: #e0d6bd;
  --color-divider: #d8cdb3;
  --color-border: #c9bda0;

  --color-text: #2a2419;          /* driftwood */
  --color-text-muted: #6f6552;
  --color-text-faint: #a59c84;
  --color-text-inverse: #fbf7ec;

  --color-primary: #0d4a52;       /* deep Gulf teal */
  --color-primary-hover: #093a40;
  --color-primary-soft: #cfe1dc;

  --color-seaglass: #8ab9a8;      /* soft sea-glass */
  --color-seaglass-soft: #d9e7df;
  --color-coral: #d96a4f;         /* tiny coral accent */
  --color-coral-soft: #f1c8b9;

  --shadow-sm: 0 1px 2px rgba(45, 36, 22, 0.06);
  --shadow-md: 0 8px 24px rgba(45, 36, 22, 0.08);
  --shadow-lg: 0 18px 48px rgba(45, 36, 22, 0.14);

  --grain-opacity: 0.5;
}

/* DARK — deep dusk Gulf, low-light linen feel */
[data-theme='dark'] {
  --color-bg: #11201f;
  --color-surface: #152826;
  --color-surface-2: #1a2f2d;
  --color-surface-offset: #1e3937;
  --color-surface-deep: #244644;
  --color-divider: #2c4a47;
  --color-border: #36605c;

  --color-text: #ece4d1;
  --color-text-muted: #a5a394;
  --color-text-faint: #6e6c61;
  --color-text-inverse: #11201f;

  --color-primary: #6cbab0;
  --color-primary-hover: #97d2c8;
  --color-primary-soft: #244644;

  --color-seaglass: #a8d0c1;
  --color-seaglass-soft: #244644;
  --color-coral: #e88a72;
  --color-coral-soft: #4a2a23;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);

  --grain-opacity: 0.35;
}

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

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  position: relative;
  overflow-x: hidden;
}

/* Subtle linen/paper grain via SVG noise data URI */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.14  0 0 0 0 0.10  0 0 0 0.08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}
[data-theme='dark'] body::before {
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.85  0 0 0 0 0.82  0 0 0 0 0.72  0 0 0 0.05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover {
  color: var(--color-primary-hover);
}

button {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4 {
  text-wrap: balance;
  line-height: 1.1;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
}

p, li, figcaption {
  text-wrap: pretty;
  max-width: 70ch;
}

::selection {
  background: var(--color-coral-soft);
  color: var(--color-text);
}

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

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !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-width: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  z-index: 200;
}
.skip-link:focus {
  top: var(--space-2);
}

/* ───────────────────────────────────────────────
   PALETTE VARIANTS — explore a few beach moods.
   Toggled via [data-palette] on <html>. Default
   ('linen') uses the base light tokens above.
   ─────────────────────────────────────────────── */

/* Sea glass — cooler, beachier: aqua, sky & cool sand */
[data-theme='light'][data-palette='seaglass'] {
  --color-bg: #e9efec;
  --color-surface: #eff4f0;
  --color-surface-2: #f7fbf8;
  --color-surface-offset: #dde7e2;
  --color-surface-deep: #cdd9d3;
  --color-divider: #c3d3cb;
  --color-border: #afc5bb;

  --color-text: #1e2a28;
  --color-text-muted: #54655f;
  --color-text-faint: #96a8a0;

  --color-primary: #15808f;
  --color-primary-hover: #0f6873;
  --color-primary-soft: #cde6e6;

  --color-seaglass: #7cc1b5;
  --color-seaglass-soft: #d4ece6;
  --color-coral: #e0795b;
  --color-coral-soft: #f3d3c5;
}

/* Sunset — warmer, sunnier: terracotta forward, teal as a co-star */
[data-theme='light'][data-palette='sunset'] {
  --color-bg: #f7efdc;
  --color-surface: #faf3e2;
  --color-surface-2: #fdf8ee;
  --color-surface-offset: #efe2c6;
  --color-surface-deep: #e6d3af;
  --color-divider: #e1cda9;
  --color-border: #d4ba8d;

  --color-text: #2e2416;
  --color-text-muted: #7b6644;
  --color-text-faint: #b29c75;

  --color-primary: #bd5a3c;
  --color-primary-hover: #a14730;
  --color-primary-soft: #f1d4c2;

  --color-seaglass: #3f8f86;
  --color-seaglass-soft: #cfe6e1;
  --color-coral: #e0902f;
  --color-coral-soft: #f6dcad;
}

/* Dark-mode accent tints so the switcher stays meaningful at night */
[data-theme='dark'][data-palette='seaglass'] {
  --color-primary: #74c8bd;
  --color-primary-hover: #9bdcd2;
  --color-coral: #ec9277;
}
[data-theme='dark'][data-palette='sunset'] {
  --color-primary: #e3a06e;
  --color-primary-hover: #f0b885;
  --color-coral: #7fc3bb;
}
