/* =========================================================
   OmniXOAR — Design tokens & base styles
   ========================================================= */
:root {
  /* Surfaces */
  --bg-abyss: #05070b;
  --bg-0: #07090d;
  --bg-1: #0b1220;
  --bg-2: #0f1624;
  --bg-3: #151c2b;
  --surface-raised: #121a28;
  --surface-glass: rgba(16, 24, 38, 0.62);
  --surface-glass-strong: rgba(12, 18, 30, 0.88);

  /* Borders / lines */
  --line-1: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.1);
  --line-3: rgba(255, 255, 255, 0.16);
  --line-accent: rgba(94, 224, 255, 0.28);

  /* Text */
  --fg-0: #f2f6ff;
  --fg-1: #d7deec;
  --fg-2: #9aa5bd;
  --fg-3: #6a7591;
  --fg-4: #495169;

  /* Accents */
  --cyan: #5ee0ff;
  --cyan-dim: #2aa8c8;
  --emerald: #34d399;
  --violet: #9a8cff;
  --amber: #f5b544;
  --rose: #ff6b8a;

  /* Signal glows */
  --glow-cyan: 0 0 0 1px rgba(94,224,255,0.35), 0 0 28px -6px rgba(94,224,255,0.45);
  --glow-emerald: 0 0 0 1px rgba(52,211,153,0.35), 0 0 24px -8px rgba(52,211,153,0.4);
  --glow-violet: 0 0 0 1px rgba(154,140,255,0.35), 0 0 26px -6px rgba(154,140,255,0.4);

  /* Radii */
  --r-xs: 4px;
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --r-xl: 24px;

  /* Type */
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

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

  /* Elevations */
  --el-1: 0 1px 0 rgba(255,255,255,0.04), 0 8px 24px -12px rgba(0,0,0,0.7);
  --el-2: 0 1px 0 rgba(255,255,255,0.06), 0 24px 60px -24px rgba(0,0,0,0.85);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg-abyss);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background: transparent;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: rgba(94,224,255,0.3); color: #fff; }

/* Grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.35;
  mix-blend-mode: overlay;
  z-index: 1;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--fg-0);
  letter-spacing: -0.02em;
  font-weight: 500;
  margin: 0;
}
h1 { font-size: clamp(44px, 6vw, 84px); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: clamp(32px, 3.6vw, 52px); line-height: 1.08; letter-spacing: -0.03em; }
h3 { font-size: clamp(22px, 2vw, 28px); line-height: 1.2; letter-spacing: -0.015em; }
h4 { font-size: 18px; line-height: 1.3; }
p { margin: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 500;
}

.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; }

/* Utility */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}
@media (max-width: 720px) { .container { padding: 0 20px; } }

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2) 20%, var(--line-2) 80%, transparent);
  margin: 0;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-radius: var(--r-s);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 180ms cubic-bezier(.2,.7,.2,1);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(180deg, #eafaff 0%, #c8f0ff 100%);
  color: #041018;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    0 10px 30px -10px rgba(94,224,255,0.4),
    0 0 0 1px rgba(94,224,255,0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.8),
    0 14px 36px -10px rgba(94,224,255,0.55),
    0 0 0 1px rgba(94,224,255,0.6);
}
.btn-secondary {
  background: rgba(255,255,255,0.02);
  color: var(--fg-0);
  border-color: var(--line-3);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.28);
}
.btn-ghost {
  background: transparent;
  color: var(--fg-1);
  padding: 8px 12px;
}
.btn-ghost:hover { color: var(--fg-0); }
.btn .arr { transition: transform 220ms; }
.btn:hover .arr { transform: translateX(3px); }

/* Pills / badges */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.02);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.pill .dot {
  width: 6px; height: 6px; border-radius: 999px; background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}
.pill.cyan .dot { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.pill.violet .dot { background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.pill.amber .dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }

/* Card */
.card {
  background: linear-gradient(180deg, rgba(18,26,40,0.75) 0%, rgba(10,15,24,0.85) 100%);
  border: 1px solid var(--line-2);
  border-radius: var(--r-l);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(600px 200px at 0% 0%, rgba(94,224,255,0.06), transparent 60%);
  pointer-events: none;
}

/* Section */
section { position: relative; z-index: 2; }
.section {
  padding: 120px 0;
}
@media (max-width: 720px) { .section { padding: 80px 0; } }

.section-header { max-width: 820px; margin: 0 0 56px; }
.section-header .eyebrow { display: block; margin-bottom: 16px; }
.section-header h2 { margin-bottom: 18px; }
.section-header p { color: var(--fg-2); font-size: 18px; max-width: 620px; }

/* Grid helpers */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Tweaks panel */
.tweaks {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 280px;
  background: var(--surface-glass-strong);
  border: 1px solid var(--line-3);
  border-radius: var(--r-l);
  padding: 16px;
  backdrop-filter: blur(14px);
  box-shadow: var(--el-2);
  z-index: 9999;
  display: none;
}
.tweaks.open { display: block; }
.tweaks h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-2);
  margin-bottom: 12px;
}
.tweaks label { display: block; font-size: 12px; color: var(--fg-2); margin-top: 10px; margin-bottom: 4px; font-family: var(--font-mono); }
.tweaks .opt-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tweaks .opt {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.02);
  color: var(--fg-1);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}
.tweaks .opt.active {
  background: rgba(94,224,255,0.12);
  border-color: var(--cyan);
  color: var(--cyan);
}

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translate3d(0, var(--reveal-y, 20px), 0);
  transition: opacity 900ms cubic-bezier(.2,.7,.2,1), transform 900ms cubic-bezier(.2,.7,.2,1);
  will-change: transform, opacity;
}
.reveal.in { opacity: 1; transform: translate3d(0, 0, 0); }

.parallax-layer { will-change: transform; }

/* Hero scroll transform helper */
.hero-visual-wrap { will-change: transform; }

/* Active step highlight (scrollytelling how-it-works) */
.how-step.active {
  background: rgba(94,224,255,0.05);
}
.how-step.active .hs-num { color: var(--fg-0); }
.how-step.active .hs-icon { opacity: 0.8; }

/* Pinned how-it-works layout */
.how-pinned {
  position: relative;
}
.how-pinned-sticky {
  position: sticky;
  top: 100px;
}

/* Background floater */
.bg-floater {
  position: absolute;
  pointer-events: none;
  opacity: 0.5;
  filter: blur(40px);
  border-radius: 50%;
}

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