/* =============================================================================
   DGClubHQ — Design System
   Source of truth for tokens + base styles. Always read DESIGN.md first.
   Loaded before site.css so components in site.css can consume these tokens.
   ============================================================================= */

:root {
  /* ── Brand + accent ─────────────────────────────────────────── */
  --brand-primary: #1a3a1a;
  --brand-primary-hover: #244c24;
  --brand-bright: #4ade80;
  --brand-bright-hover: #22c55e;
  --accent-tan: #d4a574;
  --accent-tan-dark: #a67845;

  /* ── Semantic ───────────────────────────────────────────────── */
  --success: #1a6b3c;
  --success-bg: #edfbf0;
  --success-border: #b2dfdb;
  --warning: #c98a2b;
  --warning-bg: #fff8e1;
  --warning-border: #ffd79a;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --info: #2563eb;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;

  /* ── Surfaces + text ────────────────────────────────────────── */
  --bg: #ffffff;
  --bg-elevated: #fafafa;
  --surface: #ffffff;
  --surface-elevated: #fafafa;
  --text: #111827;
  --text-muted: #4b5563;
  --text-subtle: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  /* ── Contextual highlights ──────────────────────────────────── */
  --winner-row-bg: #faefdf;
  --winner-row-grad: linear-gradient(90deg, #f5e3c9 0%, #ffffff 60%);
  --tag-member-row-bg: #fbf5ec;
  --row-alt: #f9fafb;

  /* ── Fonts ──────────────────────────────────────────────────── */
  --font-display: "General Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body:    "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* ── Radius ─────────────────────────────────────────────────── */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 9999px;

  /* ── Spacing — 4px base ─────────────────────────────────────── */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;

  /* ── Shadow ─────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);

  /* ── Motion ─────────────────────────────────────────────────── */
  --dur-micro: 100ms;
  --dur-short: 200ms;
  --dur-med: 300ms;
  --dur-long: 500ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode — first-class, not a color invert.
   Surfaces redesigned; saturation reduced ~15%; primary swaps to bright green. */
html.dark {
  --brand-primary: #4ade80;
  --brand-primary-hover: #65e891;
  --brand-bright: #4ade80;
  --brand-bright-hover: #86efac;
  --accent-tan: #e0b887;
  --accent-tan-dark: #c9a672;

  --success: #86efac;
  --success-bg: #0f2a19;
  --success-border: #1f4a2e;
  --warning: #fbbf24;
  --warning-bg: #2a1f0d;
  --warning-border: #473315;
  --error: #f87171;
  --error-bg: #2a0f0f;
  --error-border: #4a1e1e;
  --info: #60a5fa;
  --info-bg: #0f1a2a;
  --info-border: #1e3352;

  --bg: #0a1a0e;
  --bg-elevated: #111e15;
  --surface: #162420;
  --surface-elevated: #1d2e27;
  --text: #e8efe9;
  --text-muted: #9cb0a2;
  --text-subtle: #6b8072;
  --border: #24332c;
  --border-strong: #33473d;

  --winner-row-bg: #1f2a1b;
  --winner-row-grad: linear-gradient(90deg, #2a2518 0%, #162420 60%);
  --tag-member-row-bg: #1f2419;
  --row-alt: #111e15;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
}

/* ── Base ──────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--dur-short) var(--ease-out),
              color var(--dur-short) var(--ease-out);
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 var(--s-3);
}
h1 { font-size: 1.75rem; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: 1.35rem; line-height: 1.2; }
h3 { font-size: 1.1rem; line-height: 1.25; }

a {
  color: var(--info);
  text-decoration: none;
  transition: color var(--dur-short) var(--ease-out);
}
a:hover { text-decoration: underline; }

code, pre, kbd, samp { font-family: var(--font-mono); }

hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-5) 0; }

/* ── Utility classes ──────────────────────────────────────────── */
.tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
}
.h-display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
