/* ═══════════════════════════════════════════════════════════════
   DESIGN TOKENS. The single source of truth for colour, type and motion.
   Rules: no hex/rgb/hsl literals or font names anywhere else
   (styles.css, index.html, JS). Run `node scripts/check-tokens.mjs`.
   ═══════════════════════════════════════════════════════════════ */

/* Theme-independent tokens */
:root {
  --display: 'Outfit', system-ui, sans-serif;
  --sans: 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(0.25, 0, 0, 1);

  /* On-photo surfaces: identical in both themes (text sits over images) */
  --scrim-hero: linear-gradient(to top, rgba(8,8,8,0.9) 0%, rgba(8,8,8,0.1) 55%);
  --scrim-tile: linear-gradient(to top, rgba(8,8,8,0.92) 0%, rgba(8,8,8,0) 55%);
  --on-image-hover: rgba(245,245,243,0.8);
  --badge-bg: rgba(8,8,8,0.75);

  /* Game canvas and its touch controls */
  --canvas-bg: #000;
  --control-bg: rgba(255,255,255,0.1);
  --control-bg-active: rgba(255,255,255,0.28);
  --control-border: rgba(255,255,255,0.22);
  --control-fg: rgba(255,255,255,0.75);
}

/* Dark theme (default) */
:root {
  color-scheme: dark;
  --bg: #080808;
  --fg: #f5f5f3;
  --muted: #888;
  --border: rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.2);
  --border-hover: rgba(255,255,255,0.3);
  --surface: #111;
  --surface-2: #0e0e0e;
  --nav-bg: rgba(8,8,8,0.8);
  --backdrop: rgba(0,0,0,0.9);
  --scrollbar: rgba(255,255,255,0.1);
}

/* Light theme. Set via [data-theme] in <head> before paint (saved choice, else OS preference). */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f5f1;
  --fg: #141414;
  --muted: #6b6b66;
  --border: rgba(0,0,0,0.1);
  --border-strong: rgba(0,0,0,0.25);
  --border-hover: rgba(0,0,0,0.35);
  --surface: #fff;
  --surface-2: #fff;
  --nav-bg: rgba(246,245,241,0.85);
  --backdrop: rgba(20,20,20,0.6);
  --scrollbar: rgba(0,0,0,0.18);
}

/* Tiles on photos always use the dark palette so text over images stays readable */
.rr-link, .proj {
  --bg: #080808; --fg: #f5f5f3; --muted: #a0a0a0;
  --border: rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.2);
  --border-hover: rgba(255,255,255,0.3);
}
