/* ============================================================
   BodyLeveling web, "Midnight Volt"
   Tokens mirror my-app/constants/theme.ts. Keep them in sync.
   ============================================================ */

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Backgrounds */
  --bg: #0a0a0f;
  --bg-2: #12121a;
  --bg-3: #1a1a24;
  --bg-nav: #0e0e14;
  --bg-elev: #1e1e2a;

  /* Brand */
  --volt: #c8ff00;
  --volt-hover: #b8ee00;
  --violet: #8b5cf6;

  /* Status */
  --success: #34d399;
  --warning: #fbbf24;
  --error: #ef4444;
  --info: #60a5fa;

  /* Text */
  --text: #f0f0f5;
  --text-2: #8888a0;
  --text-3: #55556a;
  --text-inv: #0a0a0f;

  /* Lines */
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(200, 255, 0, 0.15);

  /* Gradients */
  --grad-brand: linear-gradient(135deg, #c8ff00, #8b5cf6);

  /* Glass */
  --glass-card: rgba(14, 14, 20, 0.4);
  --glass-bar: rgba(14, 14, 20, 0.55);
  --shadow-glass: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-bar: 0 8px 24px rgba(0, 0, 0, 0.3);
  --glow-volt: 0 0 20px rgba(200, 255, 0, 0.05);

  /* Radius */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 9999px;

  /* Spacing */
  --s-xxs: 2px;
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 32px;
  --s-xxl: 48px;
  --s-xxxl: 64px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --stagger: 80ms;

  --measure: 1120px;
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
button {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--volt);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* ---------- Type presets (theme.ts Typography) ---------- */
.t-colossal {
  font-size: clamp(56px, 13vw, 128px);
  line-height: 1.03;
  letter-spacing: -0.047em;
  font-weight: 700;
}
.t-mega {
  font-size: clamp(38px, 7.2vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.047em;
  font-weight: 700;
}
.t-display {
  font-size: clamp(30px, 4.4vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.037em;
  font-weight: 700;
}
.t-title {
  font-size: clamp(24px, 3vw, 28px);
  line-height: 1.21;
  letter-spacing: -0.028em;
  font-weight: 700;
}
.t-subtitle {
  font-size: 20px;
  line-height: 26px;
  letter-spacing: -0.02em;
  font-weight: 600;
}
.t-body {
  font-size: 16px;
  line-height: 24px;
}
.t-small {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.007em;
}
.t-caption {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.025em;
}
.t-label {
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 0.073em;
  font-weight: 600;
  text-transform: uppercase;
}

.dim {
  color: var(--text-2);
}
.dimmer {
  color: var(--text-3);
}
.volt {
  color: var(--volt);
}
.grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--s-lg);
}
section {
  position: relative;
  padding-block: clamp(64px, 11vw, 128px);
}
.band {
  background: var(--bg-2);
}
.eyebrow {
  color: var(--text-2);
  margin-bottom: var(--s-md);
}
.lede {
  color: var(--text-2);
  max-width: 56ch;
  margin-top: var(--s-md);
}

/* ---------- Cards (components/ui/Card.tsx) ---------- */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-md);
}
.card--accent {
  border-color: var(--border-accent);
}
.card--elevated {
  box-shadow: var(--glow-volt);
}
.card--pad {
  padding: var(--s-lg);
}

/* Glass: blur layer sits behind content, exactly as AdaptiveGlass stacks it. */
.glass {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-glass);
  padding: var(--s-lg);
  isolation: isolate;
}
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
  background: var(--glass-card);
}

/* ---------- Buttons (components/ui/Button.tsx) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-sm);
  min-height: 52px;
  padding: var(--s-md) var(--s-xl);
  border: none;
  border-radius: var(--r-sm);
  background: var(--volt);
  color: var(--text-inv);
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.0125em;
  text-decoration: none;
  cursor: pointer;
  transition: background 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.btn:hover {
  background: var(--volt-hover);
}
.btn:active {
  transform: scale(0.98);
}
.btn--secondary {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text);
}
.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.04);
}
.btn--ghost {
  background: transparent;
  color: var(--volt);
  padding-inline: 0;
  min-height: 0;
}

/* ---------- Progress bar (components/ui/ProgressBar.tsx) ---------- */
.track {
  height: 8px;
  background: var(--bg-3);
  border-radius: var(--r-full);
  overflow: hidden;
}
.track__fill {
  height: 100%;
  background: var(--volt);
  border-radius: var(--r-full);
  transform-origin: left center;
  transform: scaleX(var(--to, 0));
  transition: transform 1200ms cubic-bezier(0.33, 1, 0.68, 1);
}

/* ---------- Progressive edge fade (components/ui/ProgressiveBlur.tsx) ---------- */
.edge-fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 60px;
  pointer-events: none;
  z-index: 9;
}
.edge-fade--top {
  top: 0;
}
.edge-fade--bottom {
  bottom: 0;
}
.edge-fade::before {
  content: '';
  position: absolute;
  inset: 0;
  backdrop-filter: blur(12.5px);
  -webkit-backdrop-filter: blur(12.5px);
}
.edge-fade--bottom::before {
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.5) 50%,
    #000 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.5) 50%,
    #000 100%
  );
}
.edge-fade--top::before {
  -webkit-mask-image: linear-gradient(
    to top,
    transparent 0%,
    rgba(0, 0, 0, 0.5) 50%,
    #000 100%
  );
  mask-image: linear-gradient(
    to top,
    transparent 0%,
    rgba(0, 0, 0, 0.5) 50%,
    #000 100%
  );
}

/* ---------- Reveal cascade (80ms stagger, ease-out, fade + scale from .8) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .track__fill {
    transform: scaleX(var(--to, 1));
  }
}
