/* CuratorBits Design System — tokens, reset, base typography, layout utilities.
   Single source of truth for design tokens. Load BEFORE style.css.

   Brand: yellow #FFD60A on dark #0F0F10, Space Grotesk typography,
   Wirecutter-style editorial. UX-REVAMP-1 (2026-05-24): extracted tokens +
   reset + base out of style.css; added spacing/radius/shadow/type scales +
   wider layout containers + a11y primitives. Palette is UNCHANGED (existing
   --bg-* / --accent / --border values preserved verbatim — new vars are
   additive only). */

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

:root {
  /* --- Palette (unchanged from pre-revamp style.css) --- */
  --bg: #0F0F10;
  --bg-soft: #18181B;
  --bg-elevated: #1F1F23;
  --text: #FAFAFA;
  --text-dim: #A1A1AA;
  --text-faint: #71717A;
  --accent: #FFD60A;
  --accent-dim: #B8941F;
  --accent-soft: rgba(255, 214, 10, 0.08);
  --border: #27272A;
  --border-strong: #3F3F46;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;

  /* --- CTA surfaces (NEW — additive aliases for the primary action) --- */
  --bg-cta: var(--accent);
  --bg-cta-hover: #FFE03D;     /* slightly lighter yellow for hover lift */
  --bg-card: var(--bg-elevated); /* semantic alias for nested sidebar cards */

  /* --- Spacing scale (NEW — 8pt grid) --- */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-7: 96px;

  /* --- Border radius scale (NEW) --- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* --- Shadows (NEW — subtle on dark bg) --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

  /* --- Typography scale (NEW — fluid clamps) --- */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: clamp(20px, 2.5vw, 24px);
  --text-2xl: clamp(24px, 3.5vw, 32px);
  --text-3xl: clamp(32px, 5vw, 48px);

  /* --- Layout (NEW — review-page sidebar dimensions) --- */
  --aside-width: 300px;
  --layout-gap: 60px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Layout containers --- */

.container { max-width: 720px; margin: 0 auto; padding: 0 24px; }       /* body text column */
.container-wide { max-width: 1180px; margin: 0 auto; padding: 0 24px; } /* review pages w/ sidebar */
.container-full { max-width: 100%; padding: 0 24px; }                   /* full-bleed sections */

/* --- Accessibility primitives --- */

/* Skip-to-content link — visible only on keyboard focus */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 12px 20px;
  background: var(--accent);
  color: #0F0F10;
  font-weight: 700;
  border-radius: 0 0 var(--radius-md) 0;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}

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

/* Visible, consistent focus ring on all interactive elements */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Honor reduced-motion preference — kill transitions/animations + smooth scroll */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
