/* ============================================================
   GLOBAL.CSS — Foundations
   Variables · reset · typography · utilities · buttons · FX
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Palette */
  --bg: #050816;
  --bg-2: #0b1120;
  --glow: #7c3aed;     /* primary purple */
  --neon: #00e5ff;     /* electric blue  */
  --pink: #ff3cac;     /* accent pink    */
  --white: #ffffff;
  --muted: #94a3b8;

  /* Derived surfaces */
  --glass-bg: rgba(255, 255, 255, 0.045);
  --glass-brd: rgba(255, 255, 255, 0.10);
  --line: rgba(148, 163, 184, 0.14);

  /* Signature gradient */
  --grad: linear-gradient(120deg, var(--neon) 0%, var(--glow) 48%, var(--pink) 100%);
  --grad-soft: linear-gradient(120deg, rgba(0,229,255,.14), rgba(124,58,237,.14), rgba(255,60,172,.14));

  /* Type */
  --font-display: "Clash Display", system-ui, sans-serif;
  --font-body: "Satoshi", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Spacing / shape */
  --radius: 22px;
  --radius-sm: 14px;
  --max: 1280px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  cursor: none; /* replaced by custom cursor on capable devices */
}

/* Layered radial atmosphere behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 12% 8%, rgba(124, 58, 237, 0.22), transparent 60%),
    radial-gradient(50% 45% at 88% 6%, rgba(0, 229, 255, 0.16), transparent 60%),
    radial-gradient(55% 60% at 78% 92%, rgba(255, 60, 172, 0.14), transparent 60%),
    var(--bg);
  pointer-events: none;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: none; }
svg { display: block; }

::selection { background: rgba(124, 58, 237, 0.4); color: #fff; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.02; letter-spacing: -0.02em; }

.section-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--neon);
  margin-bottom: 1.1rem;
}

.section-title {
  font-size: clamp(2.2rem, 5.2vw, 4.3rem);
  max-width: 16ch;
}

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: gradShift 7s linear infinite;
}

@keyframes gradShift {
  to { background-position: 200% center; }
}

/* ---------- Layout helpers ---------- */
.section {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(5rem, 12vw, 9rem) clamp(1.25rem, 5vw, 3rem);
}

.section-head { margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

/* ---------- Buttons ---------- */
.btn {
  --pad-y: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: var(--pad-y) 1.6rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  position: relative;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease);
  will-change: transform;
}

.btn-glow {
  background: var(--grad);
  background-size: 180% auto;
  color: #06070f;
  box-shadow: 0 0 0 rgba(124, 58, 237, 0);
}
.btn-glow:hover {
  background-position: right center;
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.5), 0 0 26px rgba(0, 229, 255, 0.35);
  transform: translateY(-2px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--glass-brd);
  color: var(--white);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover {
  border-color: rgba(0, 229, 255, 0.6);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.18);
  transform: translateY(-2px);
}

.btn-lg { --pad-y: 1.25rem; padding-left: 2.4rem; padding-right: 2.4rem; font-size: 1.1rem; }

/* ---------- FX layers ---------- */
/* Noise / grain overlay */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Particle canvas */
.particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* Mouse-tracking ambient glow */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 480px; height: 480px;
  margin: -240px 0 0 -240px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.18), transparent 62%);
  transform: translate3d(-1000px, -1000px, 0);
  transition: opacity 0.4s ease;
  will-change: transform;
}

/* Custom cursor */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transform: translate3d(-100px, -100px, 0);
  will-change: transform;
}
.cursor-dot {
  width: 7px; height: 7px;
  background: var(--neon);
  box-shadow: 0 0 12px var(--neon);
}
.cursor-ring {
  width: 38px; height: 38px;
  margin: -15.5px 0 0 -15.5px;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease), margin 0.25s var(--ease);
}
.cursor-ring.is-active {
  width: 64px; height: 64px;
  margin: -28.5px 0 0 -28.5px;
  border-color: rgba(0, 229, 255, 0.8);
  background: rgba(0, 229, 255, 0.07);
}

/* Scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 3px;
  z-index: 9998;
  background: transparent;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
}

/* ---------- Scroll reveal base state ---------- */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: transform, opacity;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Respect reduced-motion users */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
