/* =====================================================================
   RelicTek / BΛD — Tokenized Design System
   ---------------------------------------------------------------------
   Single source of truth for color, type, spacing, glass fill, border,
   and motion. Consumed via <link rel="stylesheet" href="/css/design-system">
   by every EJS page that server.js renders. Existing class names on the
   pages map to these tokens; the legacy per-page :root blocks are gone.
   ===================================================================== */

:root {
  /* ── Cosmic dark matter — deeper void ── */
  --ink-cosmic-dark-matter: #070709;
  --ink-deep: #0c0c14;
  --ink-glass-fill: rgba(7, 7, 9, 0.62);
  --ink-glass-border: rgba(184, 115, 51, 0.35);
  --ink-glass-border-data: rgba(0, 229, 255, 0.35);
  --ink-glass-elevated: rgba(12, 12, 20, 0.78);

  /* ── High-voltage primary + secondary accents ── */
  --hv-neon-yellow: #FCEE09;
  --hv-neon-yellow-dim: #C9A227;
  --relicosmic-blue: #2952FF;
  --relicosmic-blue-dim: #6B85FF;
  --icy-cyan: #00E5FF;
  --icy-cyan-dim: #0091A8;
  --copper: #B87333;

  /* ── State colors ── */
  --state-warn: #FF9500;
  --state-critical: #FF5500;
  --state-success: #00E676;

  /* ── Text ── */
  --text-primary: #ffffff;
  --text-secondary: #d0d0e0;
  --text-tertiary: #888899;

  /* ── Legacy aliases — kept so existing class names resolve unchanged.
       Original gold #FFD700 / cyan #00D4FF are preserved per-token so the
       existing transitions, gradient linears, and inline rgba() values
       continue to look the same. The new tokens (--hv-neon-yellow,
       --icy-cyan) are used explicitly where the plan calls for migration. */
  --gold: #FFD700;
  --gold-dim: #C9A227;
  --gold-bright: #FFE44D;
  --cyan: #00D4FF;
  --cyan-dim: #0091A8;
  --dark: #050507;
  --dark-card: #0c0c14;
  --dark-border: #1a1a2e;
  --white: #ffffff;
  --gray: #888899;
  --gray-light: #aaaabc;
  --red: #FF6B6B;
  --green: #00E676;
  --green-dim: #00964A;
  --purple: #C084FC;
  --orange: #FF5500;
  --orange-dim: rgba(255, 85, 0, 0.2);

  /* ── Attention-mode binding ── */
  --attention-human: #FFD700;
  --attention-agent: #00D4FF;
  --attention-current: var(--attention-human);
  --attention-current-dim: var(--gold-dim);
  --attention-glow: rgba(255, 215, 0, 0.4);

  /* ── Typography tokens ── */
  --font-display: 'Space Grotesk', 'Orbitron', sans-serif;
  --font-body: 'Inter', 'Rajdhani', sans-serif;
  --font-mono-metric: 'JetBrains Mono', 'Orbitron', monospace;

  /* ── Letter-spacing scale ── */
  --tracking-eyebrow: 0.2em;
  --tracking-nav: 0.12em;
  --tracking-header: 0.04em;

  /* ── Spacing scale (8px modular grid — Clear Street Standard) ── */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 96px;
  --space-7: 128px;
  --space-8: 192px;

  /* ── Type scale (massive readable typography) ── */
  --type-display: clamp(2.4rem, 6.5vw, 5.25rem);
  --type-h1: clamp(1.8rem, 3.6vw, 2.75rem);
  --type-h2: clamp(1.4rem, 2.4vw, 1.9rem);
  --type-metric: clamp(1.6rem, 2.6vw, 2.4rem);
  --type-body-lg: 1.1rem;
  --type-body: 0.95rem;
  --type-eyebrow: 0.7rem;
  --type-micro: 0.55rem;

  /* ── Container + grid ── */
  --container-wide: 1320px;
  --container-prose: 720px;
  --grid-gap: var(--space-3);

  /* ── Motion tokens ── */
  --ease-institutional: cubic-bezier(0.2, 0.7, 0.2, 1);
  --motion-fast: 140ms;
  --motion-base: 280ms;
}

/* Audience-mode accent swap — mirrored from layout.ejs so non-layout
   pages behave identically when the attention-mode cookie is set. */
.product-card[data-tier] { --tier-accent: var(--attention-current); }

html[data-mode="human"] {
  --attention-current: var(--attention-human);
  --attention-current-dim: var(--gold-dim);
  --attention-glow: rgba(255, 215, 0, 0.4);
}

html[data-mode="agent"] {
  --attention-current: var(--attention-agent);
  --attention-current-dim: var(--cyan-dim);
  --attention-glow: rgba(0, 212, 255, 0.4);
}

/* Copy variants — identical-character-count siblings, swapped by mode.
   No-JS fallback: human wins on first paint. */
[data-mode-copy] { display: none; }
html:not([data-mode]) [data-mode-copy="human"],
html[data-mode="human"] [data-mode-copy="human"] { display: inline; }
html:not([data-mode]) [data-mode-copy="agent"] { display: none; }
html[data-mode="agent"] [data-mode-copy="agent"] { display: inline; }

[data-mode-cta] { display: none; }
html:not([data-mode]) [data-mode-cta="human"],
html[data-mode="human"] [data-mode-cta="human"] { display: inline-block; }
html:not([data-mode]) [data-mode-cta="agent"],
html[data-mode="agent"] [data-mode-cta="agent"] { display: inline-block; }

[data-mode-copy-block] { display: none; }
html:not([data-mode]) [data-mode-copy-block="human"],
html[data-mode="human"] [data-mode-copy-block="human"] { display: block; }
html:not([data-mode]) [data-mode-copy-block="agent"],
html[data-mode="agent"] [data-mode-copy-block="agent"] { display: block; }

/* ── Body baseline ─────────────────────────────────────────────────── */
html, body {
  background: var(--ink-cosmic-dark-matter);
  color: var(--text-primary);
}

/* ── Glass utilities (consumed everywhere — kills white cards) ────── */
.glass {
  background: var(--ink-glass-elevated);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  border: 1px solid var(--ink-glass-border);
  border-radius: 0.5rem;
}

.glass--data {
  border-color: var(--ink-glass-border-data);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.06) 0%, rgba(7, 7, 9, 0.72) 60%);
}

.glass--copper {
  border-color: var(--ink-glass-border);
}
