/*!
 * THE NEXUS — Design Tokens
 * Production CSS Custom Properties. Source of truth: /design-system/02-foundations-tokens.md
 * Load AFTER nexus-fonts.css (font-face declarations live there, not here).
 * v1.0
 */

:root {
  /* ============ COLOR — dark mode (default) ============ */
  --color-void: #000000;
  --color-bg: #050506;
  --color-surface-1: #0D0D10;
  --color-surface-2: #131316;
  --color-surface-3: #1A1A1E;
  --color-glass: rgba(255,255,255,0.04);

  --color-border-subtle: rgba(255,255,255,0.08);
  --color-border-default: rgba(255,255,255,0.14);
  --color-border-strong: rgba(255,255,255,0.24);

  --color-text-primary: #F5F4F1;
  --color-text-secondary: rgba(245,244,241,0.72);
  --color-text-muted: rgba(245,244,241,0.48);
  --color-text-placeholder: rgba(245,244,241,0.34);
  --color-text-disabled: rgba(245,244,241,0.24);

  --color-gold-100: #F1E4C4;
  --color-gold-300: #DEC17F;
  --color-gold-500: #C9A24B; /* brand accent */
  --color-gold-700: #9C7A34;
  --color-gold-900: #5E491F;

  --color-ion-300: #B8DBFF;
  --color-ion-500: #6FA8FF;
  --color-ion-700: #3D6FC2;

  --color-success: #4CC38A;
  --color-warning: #E0A526;
  --color-danger: #E5484D;
  --color-info: #5B9DF5;

  --overlay-scrim: rgba(0,0,0,0.6);
  --overlay-lightbox: rgba(0,0,0,0.9);
  --gradient-image-scrim: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.85) 100%);
  --gradient-aurora: radial-gradient(ellipse at center, rgba(201,162,75,0.22) 0%, rgba(111,168,255,0.08) 45%, transparent 72%);
  --gradient-ember: linear-gradient(125deg, #050506 0%, #3A1408 38%, #C9531F 62%, #E8A339 82%, #F4C978 100%);

  --glow-gold-sm: 0 0 12px rgba(201,162,75,0.35);
  --glow-gold-md: 0 0 24px rgba(201,162,75,0.4);
  --glow-gold-lg: 0 0 48px rgba(201,162,75,0.35);
  --glow-focus: 0 0 0 4px rgba(201,162,75,0.24);

  --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 4px 12px rgba(0,0,0,0.45);
  --shadow-3: 0 12px 32px rgba(0,0,0,0.5);
  --shadow-4: 0 24px 64px rgba(0,0,0,0.55);

  /* ============ TYPOGRAPHY ============ */
  --font-display: "Montana", "Neue Haas Grotesk Display", Arial Narrow, sans-serif;
  --font-heading: "General Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "General Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: "Fragment Mono", "SF Mono", "JetBrains Mono", monospace;

  --text-display-xl: clamp(3.5rem, 2.2rem + 5vw, 8rem);
  --text-display-l: clamp(2.75rem, 2rem + 3vw, 5.5rem);
  --text-h1: clamp(2.25rem, 1.8rem + 1.8vw, 3.75rem);
  --text-h2: clamp(1.875rem, 1.6rem + 1.2vw, 2.75rem);
  --text-h3: clamp(1.5rem, 1.35rem + 0.7vw, 2rem);
  --text-h4: clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);
  --text-h5: 1.125rem;
  --text-h6-overline: 0.875rem;
  --text-body-l: 1.125rem;
  --text-body: 1rem;
  --text-body-s: 0.875rem;
  --text-caption: 0.75rem;
  --text-micro: 0.6875rem;

  --leading-display: 0.95;
  --leading-h1: 1.05;
  --leading-h2: 1.1;
  --leading-h3: 1.15;
  --leading-h4: 1.2;
  --leading-h5: 1.3;
  --leading-body: 1.6;
  --leading-caption: 1.45;

  --tracking-display: -0.02em;
  --tracking-h1: -0.01em;
  --tracking-body: 0em;
  --tracking-overline: 0.08em;

  --measure-reading: 65ch;
  --measure-narrow: 50ch;

  /* ============ SPACING (8pt grid) ============ */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;
  --space-11: 80px;
  --space-12: 96px;
  --space-13: 128px;
  --space-14: 160px;
  --space-15: 192px;
  --space-16: 240px;

  /* ============ RADIUS ============ */
  --radius-none: 0;
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;

  /* ============ GRID / CONTAINERS ============ */
  --container-sm: 100%;
  --container-md: 688px;
  --container-lg: 960px;
  --container-xl: 1200px;
  --container-2xl: 1320px;
  --container-3xl: 1600px;

  --margin-xs: 20px;
  --margin-sm: 24px;
  --margin-md: 32px;
  --margin-lg: 48px;
  --margin-xl: 64px;
  --margin-2xl: 80px;

  --gutter-mobile: 16px;
  --gutter-tablet: 24px;
  --gutter-desktop: 24px;
  --gutter-wide: 32px;

  /* ============ ELEVATION / Z-INDEX ============ */
  --z-base: 0;
  --z-raised: 10;
  --z-sticky: 100;
  --z-dropdown: 200;
  --z-scrim: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;
  --z-max: 9999;

  /* ============ BLUR ============ */
  --blur-xs: 4px;
  --blur-sm: 8px;
  --blur-md: 16px;
  --blur-lg: 24px;
  --blur-xl: 40px;

  /* ============ OPACITY ============ */
  --opacity-4: 0.04;
  --opacity-8: 0.08;
  --opacity-12: 0.12;
  --opacity-16: 0.16;
  --opacity-24: 0.24;
  --opacity-32: 0.32;
  --opacity-48: 0.48;
  --opacity-64: 0.64;
  --opacity-72: 0.72;
  --opacity-88: 0.88;

  /* ============ STROKE ============ */
  --stroke-hairline: 1px;
  --stroke-default: 1.5px;
  --stroke-bold: 2px;
  --icon-stroke: 1.75px;

  --icon-xs: 14px;
  --icon-sm: 16px;
  --icon-md: 20px;
  --icon-lg: 24px;
  --icon-xl: 32px;

  /* ============ MOTION ============ */
  --duration-instant: 80ms;
  --duration-fast: 150ms;
  --duration-base: 240ms;
  --duration-moderate: 360ms;
  --duration-slow: 560ms;
  --duration-cinematic: 1000ms;

  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-soft: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============ LIGHT MODE ============ */
:root[data-theme="light"] {
  --color-bg: #FBFAF7;
  --color-surface-1: #FFFFFF;
  --color-surface-2: #F4F2ED;
  --color-surface-3: #FFFFFF;
  --color-glass: rgba(20,19,15,0.04);

  --color-border-subtle: rgba(20,19,15,0.08);
  --color-border-default: rgba(20,19,15,0.14);
  --color-border-strong: rgba(20,19,15,0.24);

  --color-text-primary: #14130F;
  --color-text-secondary: rgba(20,19,15,0.68);
  --color-text-muted: rgba(20,19,15,0.46);
  --color-text-placeholder: rgba(20,19,15,0.34);
  --color-text-disabled: rgba(20,19,15,0.24);

  --color-gold-500: #A9822E; /* darkened for AA contrast on light bg */

  --shadow-1: 0 1px 2px rgba(20,19,15,0.08);
  --shadow-2: 0 4px 12px rgba(20,19,15,0.10);
  --shadow-3: 0 12px 32px rgba(20,19,15,0.12);
  --shadow-4: 0 24px 64px rgba(20,19,15,0.14);
}

/* The auto (OS-preference-driven) light-mode block that used to live here
   has been removed. The Nexus has no light-theme toggle anywhere in its UI —
   it's a dark-only brand — but this rule auto-applied the light palette
   above to EVERY visitor whose device happens to be in light mode (the OS
   default on a large share of phones), via `:root:not([data-theme="dark"])`,
   whose specificity (0,2,0) beats the plain `:root` dark declaration up top
   despite loading earlier in the cascade. Confirmed live 19 Aug 2026: with
   the OS in light mode, --color-bg resolved to #FBFAF7 (this file's light
   value) instead of #050506, turning every dark nx- page — and the
   single-etn event pages' own overscroll-background fix, which also reads
   --color-bg — white/cream. The opt-in .light block above stays: nothing on
   the site ever sets data-theme="light", so it's inert, not the bug. */

/* ============ BASE APPLICATION ============ */
::selection {
  background: rgba(201,162,75,0.28);
  color: var(--color-text-primary);
}

:focus-visible {
  outline: 2px solid var(--color-gold-500);
  outline-offset: 3px;
  box-shadow: var(--glow-focus);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.glass-surface {
  background: var(--color-glass);
  backdrop-filter: blur(var(--blur-sm)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur-sm)) saturate(140%);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255,255,255,0.06);
}
