/* ==========================================================================
   Yacht Spotting — Design tokens v1
   Dark theme is the default. Light theme via <html data-theme="light">.
   Any element can re-scope a theme with data-theme="dark|light".
   Fonts: Cormorant Garamond (display) + Manrope (UI/data), both SIL OFL 1.1,
   self-hosted from /fonts (see fonts/OFL.txt).
   ========================================================================== */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/CormorantGaramond-Var.woff2") format("woff2");
  font-weight: 300 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/CormorantGaramond-Italic-Var.woff2") format("woff2");
  font-weight: 300 700; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/Manrope-Var.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}

:root {
  /* ---- Raw palette (theme-independent) -------------------------------- */
  --ink-975: #040913;
  --ink-950: #060d1a;
  --ink-900: #0a1426;
  --ink-850: #0e1a30;
  --ink-800: #13223c;
  --ink-700: #1b2e4d;
  --ink-600: #283f63;
  --ink-500: #3d5679;
  --ink-400: #6a7f9e;
  --ink-300: #9fb0c8;

  --brass-200: #f1e2bd;
  --brass-300: #e6cf9b;
  --brass-400: #d7b678;   /* champagne — primary accent on dark */
  --brass-500: #c39a57;
  --brass-600: #a57d3c;
  --brass-700: #7f5c25;   /* accent text on light */
  --brass-800: #5e4219;

  --ivory-50:  #fdfbf6;
  --ivory-100: #f8f3e9;
  --ivory-200: #f1e9da;
  --sand-300:  #e6dac4;
  --sand-400:  #d5c5a8;

  --sea-400: #5ccaa9; --sea-700: #1d6f58;    /* underway */
  --amber-400: #e9b65e; --amber-700: #8a5508; /* anchored */
  --tide-400: #93b6e6; --tide-700: #2e5a93;  /* moored */
  --coral-400: #f08f7c; --coral-700: #a63a26; /* errors / alerts */

  /* ---- Typography ------------------------------------------------------ */
  --font-display: "Cormorant Garamond", "Cormorant", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-ui: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: var(--font-ui); /* use with .num → tabular-nums */

  /* Fluid type scale (390px → 1366px) */
  --fs-2xs: 0.6875rem;                                  /* 11 — legal, eyebrow */
  --fs-xs:  0.75rem;                                    /* 12 */
  --fs-sm:  0.875rem;                                   /* 14 */
  --fs-md:  1rem;                                       /* 16 — body */
  --fs-lg:  1.125rem;                                   /* 18 */
  --fs-xl:  clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);    /* 20–24 */
  --fs-2xl: clamp(1.625rem, 1.4rem + 0.9vw, 2.125rem);  /* 26–34 display */
  --fs-3xl: clamp(2.125rem, 1.7rem + 1.8vw, 3.25rem);   /* 34–52 display */
  --fs-4xl: clamp(2.625rem, 1.9rem + 3vw, 4.5rem);      /* 42–72 hero */

  --lh-tight: 1.05; --lh-snug: 1.25; --lh-body: 1.55;
  --tracking-display: -0.01em;
  --tracking-caps: 0.14em;      /* eyebrows, small caps labels */
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;

  /* ---- Spacing (4px base) --------------------------------------------- */
  --sp-0: 0; --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.25rem; --sp-6: 1.5rem; --sp-8: 2rem; --sp-10: 2.5rem; --sp-12: 3rem;
  --sp-16: 4rem; --sp-20: 5rem; --sp-24: 6rem;
  --gutter: clamp(1rem, 0.6rem + 1.6vw, 2rem);
  --container: 1200px;
  --tap: 44px; /* minimum touch target */

  /* ---- Radii ------------------------------------------------------------ */
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 26px; --r-pill: 999px;

  /* ---- Motion ----------------------------------------------------------- */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-sheet: cubic-bezier(.32, .72, 0, 1);
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms; --dur-4: 520ms;

  /* ---- Z-index ---------------------------------------------------------- */
  --z-map: 0; --z-map-ui: 10; --z-panel: 20; --z-header: 30; --z-sheet: 40;
  --z-overlay: 50; --z-modal: 60; --z-toast: 70;

  /* ---- Breakpoints (reference only; CSS vars can't be used in @media) ---
     --bp-sm: 480px  --bp-md: 768px  --bp-lg: 1024px  --bp-xl: 1280px
     Mobile-first: write base styles for 390px, then min-width queries. */
  --bp-sm: 480px; --bp-md: 768px; --bp-lg: 1024px; --bp-xl: 1280px;
}

/* ---- Dark theme (default) -------------------------------------------- */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --c-bg: var(--ink-900);
  --c-bg-deep: var(--ink-950);
  --c-surface: var(--ink-850);
  --c-surface-2: var(--ink-800);
  --c-surface-3: var(--ink-700);
  --c-glass: rgba(10, 20, 38, 0.72);
  --c-glass-strong: rgba(8, 16, 31, 0.9);
  --c-line: rgba(215, 182, 120, 0.16);       /* hairline in brass */
  --c-line-strong: rgba(215, 182, 120, 0.32);
  --c-divider: rgba(159, 176, 200, 0.14);

  --c-text: #f3ede0;          /* ivory: 15.8:1 on bg */
  --c-text-muted: #b2bccb;    /* 9.6:1 on bg */
  --c-text-subtle: #8996ab;   /* 6.2:1 on bg, 5.3:1 on surface-2 */
  --c-text-inverse: var(--ink-900);

  --c-accent: var(--brass-400);        /* 9.4:1 on bg */
  --c-accent-strong: var(--brass-300);
  --c-accent-text: var(--brass-300);
  --c-accent-soft: rgba(215, 182, 120, 0.12);
  --c-on-accent: var(--ink-900);

  --c-underway: var(--sea-400);   --c-underway-bg: rgba(92, 202, 169, 0.13);
  --c-anchored: var(--amber-400); --c-anchored-bg: rgba(233, 182, 94, 0.13);
  --c-moored: var(--tide-400);    --c-moored-bg: rgba(147, 182, 230, 0.13);
  --c-danger: var(--coral-400);   --c-danger-bg: rgba(240, 143, 124, 0.12);
  --c-live: var(--sea-400);

  --c-focus: var(--brass-300);
  --c-skeleton: rgba(159, 176, 200, 0.10);
  --c-skeleton-shine: rgba(159, 176, 200, 0.20);

  /* Map */
  --c-map-water: #060f1e;
  --c-map-land: #132339;
  --c-map-label: #8c99ae;

  --shadow-1: 0 1px 2px rgba(0,0,0,.35);
  --shadow-2: 0 6px 20px -6px rgba(0,0,0,.55), 0 1px 0 rgba(255,255,255,.03) inset;
  --shadow-3: 0 24px 60px -18px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.04) inset;
  --shadow-glow: 0 0 0 1px rgba(215,182,120,.35), 0 8px 28px -8px rgba(215,182,120,.35);
}

/* ---- Light theme ------------------------------------------------------ */
[data-theme="light"] {
  color-scheme: light;
  --c-bg: var(--ivory-100);
  --c-bg-deep: var(--ivory-200);
  --c-surface: var(--ivory-50);
  --c-surface-2: #f4ecdd;
  --c-surface-3: var(--sand-300);
  --c-glass: rgba(253, 251, 246, 0.78);
  --c-glass-strong: rgba(253, 251, 246, 0.94);
  --c-line: rgba(127, 92, 37, 0.18);
  --c-line-strong: rgba(127, 92, 37, 0.34);
  --c-divider: rgba(15, 29, 51, 0.10);

  --c-text: #0f1d33;          /* navy ink: 15.3:1 on bg */
  --c-text-muted: #3f4c61;    /* 7.9:1 */
  --c-text-subtle: #5a6578;   /* 5.3:1 (5.0:1 on surface-2) */
  --c-text-inverse: var(--ivory-50);

  --c-accent: var(--brass-600);
  --c-accent-strong: var(--brass-700);
  --c-accent-text: var(--brass-700);   /* 5.5:1 on bg */
  --c-accent-soft: rgba(165, 125, 60, 0.12);
  --c-on-accent: var(--ivory-50);

  --c-underway: var(--sea-700);   --c-underway-bg: rgba(29, 111, 88, 0.10);
  --c-anchored: var(--amber-700); --c-anchored-bg: rgba(138, 85, 8, 0.10);
  --c-moored: var(--tide-700);    --c-moored-bg: rgba(46, 90, 147, 0.10);
  --c-danger: var(--coral-700);   --c-danger-bg: rgba(166, 58, 38, 0.09);
  --c-live: var(--sea-700);

  --c-focus: var(--ink-700);
  --c-skeleton: rgba(15, 29, 51, 0.07);
  --c-skeleton-shine: rgba(15, 29, 51, 0.13);

  --c-map-water: #c6d6e1;
  --c-map-land: #f2ebdd;
  --c-map-label: #4d5a6e;

  --shadow-1: 0 1px 2px rgba(15,29,51,.08);
  --shadow-2: 0 8px 22px -10px rgba(15,29,51,.22), 0 1px 2px rgba(15,29,51,.05);
  --shadow-3: 0 28px 60px -22px rgba(15,29,51,.32), 0 2px 6px rgba(15,29,51,.06);
  --shadow-glow: 0 0 0 1px rgba(127,92,37,.3), 0 8px 28px -10px rgba(127,92,37,.35);
}

/* ---- Reduced motion --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0ms; --dur-2: 0ms; --dur-3: 0ms; --dur-4: 0ms; }
}
