/* ============================================================
   SpikeMind — Foundations
   Colors, type, spacing, motion, effects.
   Import this file FIRST in any HTML using the system.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Chakra+Petch:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* -- Brand colors ----------------------------------------- */
  --spike-red:        #FF2E4D;
  --spike-red-deep:   #C9132F;
  --spike-red-glow:   rgba(255, 46, 77, 0.45);

  --neon-cyan:        #00E5C7;
  --neon-cyan-deep:   #00A38C;
  --neon-cyan-glow:   rgba(0, 229, 199, 0.40);

  --amber:            #FFB800;
  --magenta:          #FF3FA4;

  /* -- Backgrounds (cool near-black ladder) ----------------- */
  --bg-0:             #07080A;
  --bg-1:             #0E1014;
  --bg-2:             #15181F;
  --bg-3:             #1E2230;
  --bg-4:             #2A2F40;

  /* -- Foregrounds (warm-neutral whites) -------------------- */
  --fg-0:             #FFFFFF;
  --fg-1:             #E7E9EE;
  --fg-2:             #8B92A4;
  --fg-3:             #545B6E;
  --fg-4:             #353B4A;

  /* -- Strokes --------------------------------------------- */
  --stroke-1:         rgba(255, 255, 255, 0.06);
  --stroke-2:         rgba(255, 255, 255, 0.10);
  --stroke-3:         rgba(255, 255, 255, 0.18);
  --stroke-red:       var(--spike-red);
  --stroke-cyan:      var(--neon-cyan);

  /* -- Semantic --------------------------------------------- */
  --accent:           var(--spike-red);
  --accent-2:         var(--neon-cyan);
  --success:          var(--neon-cyan);
  --warning:          var(--amber);
  --danger:           var(--spike-red);
  --live:             var(--neon-cyan);

  /* -- Surfaces -------------------------------------------- */
  --surface-page:     var(--bg-0);
  --surface-card:     var(--bg-2);
  --surface-card-hi:  var(--bg-3);
  --surface-overlay:  rgba(20, 22, 28, 0.72);
  --surface-input:    rgba(255, 255, 255, 0.03);

  /* -- Type families --------------------------------------- */
  --font-display:     'Bebas Neue', 'Oswald', 'Impact', sans-serif;
  --font-ui:          'Chakra Petch', 'Rajdhani', system-ui, sans-serif;
  --font-body:        'Space Grotesk', system-ui, sans-serif;
  --font-mono:        'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

  /* -- Type scale ------------------------------------------ */
  --fs-display-xl:    clamp(64px, 9vw, 144px);
  --fs-display-l:     clamp(48px, 6vw, 96px);
  --fs-display-m:     clamp(36px, 4.5vw, 64px);
  --fs-h1:            clamp(32px, 3.6vw, 48px);
  --fs-h2:            clamp(24px, 2.4vw, 32px);
  --fs-h3:            20px;
  --fs-h4:            16px;
  --fs-body-lg:       18px;
  --fs-body:          16px;
  --fs-body-sm:       14px;
  --fs-caption:       12px;
  --fs-eyebrow:       11px;

  /* -- Line heights ---------------------------------------- */
  --lh-tight:         0.92;
  --lh-snug:          1.1;
  --lh-normal:        1.4;
  --lh-loose:         1.6;

  /* -- Tracking -------------------------------------------- */
  --tr-display:       -0.02em;
  --tr-heading:       0;
  --tr-body:          0.005em;
  --tr-eyebrow:       0.16em;
  --tr-button:        0.08em;

  /* -- Weights --------------------------------------------- */
  --fw-regular:       400;
  --fw-medium:        500;
  --fw-semibold:      600;
  --fw-bold:          700;

  /* -- Spacing (4px base) ---------------------------------- */
  --space-1:          4px;
  --space-2:          8px;
  --space-3:          12px;
  --space-4:          16px;
  --space-5:          24px;
  --space-6:          32px;
  --space-7:          48px;
  --space-8:          64px;
  --space-9:          96px;
  --space-10:         128px;

  /* -- Radius (intentionally small) ------------------------ */
  --radius-0:         0;
  --radius-1:         2px;
  --radius-2:         4px;
  --radius-3:         6px;

  /* -- Chamfer sizes (clip-path corner cut) ---------------- */
  --chamfer-sm:       8px;
  --chamfer-md:       14px;
  --chamfer-lg:       22px;

  /* -- Shadows --------------------------------------------- */
  --shadow-1:         0 2px 8px rgba(0,0,0,0.40);
  --shadow-2:         0 12px 32px -12px rgba(0,0,0,0.55);
  --shadow-3:         0 24px 60px -20px rgba(0,0,0,0.60);
  --shadow-inset:     inset 0 1px 0 rgba(255,255,255,0.04);

  /* -- Glow ------------------------------------------------- */
  --glow-red:         0 0 0 1px var(--spike-red), 0 0 24px var(--spike-red-glow);
  --glow-red-strong:  0 0 0 1px var(--spike-red), 0 0 40px rgba(255,46,77,0.65);
  --glow-cyan:        0 0 0 1px var(--neon-cyan), 0 0 20px var(--neon-cyan-glow);

  /* -- Motion ---------------------------------------------- */
  --ease-out:         cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in:          cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out:      cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:         80ms;
  --dur-base:         160ms;
  --dur-med:          260ms;
  --dur-slow:         400ms;

  /* -- Grid background plate ------------------------------- */
  --grid-line:        rgba(255,255,255,0.035);
  --grid-size:        32px;
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface-page);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  letter-spacing: var(--tr-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--spike-red); color: var(--fg-0); }

/* ============================================================
   Semantic type
   ============================================================ */
.display-xl, h1.display, .hero-title {
  font-family: var(--font-display);
  font-size: var(--fs-display-xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-display);
  text-transform: uppercase;
  font-weight: 400;
  color: var(--fg-0);
}
.display-l {
  font-family: var(--font-display);
  font-size: var(--fs-display-l);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-display);
  text-transform: uppercase;
  color: var(--fg-0);
}
.display-m {
  font-family: var(--font-display);
  font-size: var(--fs-display-m);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-display);
  text-transform: uppercase;
  color: var(--fg-0);
}
h1, .h1 {
  font-family: var(--font-ui);
  font-size: var(--fs-h1);
  line-height: var(--lh-snug);
  font-weight: var(--fw-bold);
  color: var(--fg-0);
  margin: 0;
}
h2, .h2 {
  font-family: var(--font-ui);
  font-size: var(--fs-h2);
  line-height: var(--lh-snug);
  font-weight: var(--fw-semibold);
  color: var(--fg-0);
  margin: 0;
}
h3, .h3 {
  font-family: var(--font-ui);
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
  font-weight: var(--fw-semibold);
  color: var(--fg-0);
  margin: 0;
}
h4, .h4 {
  font-family: var(--font-ui);
  font-size: var(--fs-h4);
  line-height: var(--lh-snug);
  font-weight: var(--fw-semibold);
  color: var(--fg-0);
  margin: 0;
}
p, .body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--fg-1);
  margin: 0;
}
.body-lg { font-size: var(--fs-body-lg); }
.body-sm { font-size: var(--fs-body-sm); color: var(--fg-2); }
.caption {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--fg-2);
  letter-spacing: 0.04em;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  text-transform: uppercase;
  letter-spacing: var(--tr-eyebrow);
  color: var(--fg-2);
  font-weight: var(--fw-medium);
}
.mono, code, kbd, .metric {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Utility helpers used across the system
   ============================================================ */

/* Chamfered card (one or two cut corners) */
.chamfer-tr     { clip-path: polygon(0 0, calc(100% - var(--chamfer-md)) 0, 100% var(--chamfer-md), 100% 100%, 0 100%); }
.chamfer-tr-bl  { clip-path: polygon(0 0, calc(100% - var(--chamfer-md)) 0, 100% var(--chamfer-md), 100% 100%, var(--chamfer-md) 100%, 0 calc(100% - var(--chamfer-md))); }
.chamfer-tl-br  { clip-path: polygon(var(--chamfer-md) 0, 100% 0, 100% calc(100% - var(--chamfer-md)), calc(100% - var(--chamfer-md)) 100%, 0 100%, 0 var(--chamfer-md)); }

/* Grid background plate */
.grid-bg {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
}

/* LIVE pulse dot */
.dot-live {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 4px rgba(0,229,199,0.18);
  animation: pulse 1.6s var(--ease-in-out) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 4px rgba(0,229,199,0.18); }
  50%      { opacity: 0.55; box-shadow: 0 0 0 6px rgba(0,229,199,0.05); }
}

/* ============================================================
   Language switcher (i18n)
   ============================================================ */
.lang-switch {
  display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid var(--stroke-2);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
  background: rgba(255,255,255,0.02);
}
.lang-btn {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em;
  padding: 6px 10px;
  background: transparent; border: 0; cursor: pointer;
  color: var(--fg-3);
  transition: color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.lang-btn:hover { color: var(--fg-1); }
.lang-btn.active {
  color: var(--fg-0); background: rgba(255,46,77,0.18);
}
