/* ==========================================================================
   Velox World — design system
   Dark, instrument-panel aesthetic: near-black blue ground, hairline rules,
   mono HUD labels, one cool accent per project.
   No external fonts or libraries; everything here is self-contained.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* ground */
  --bg: #04060b;
  --bg-1: #070a11;
  --bg-2: #0b0f19;
  --bg-3: #111827;

  /* rules + text */
  --line: rgba(148, 170, 215, 0.13);
  --line-2: rgba(148, 170, 215, 0.26);
  --text: #eaeef7;
  --text-2: #a5afc3;
  --text-3: #6d788f;

  /* palette */
  --cyan: #52e0ff;
  --violet: #8c7bff;
  --amber: #ffa347;
  --blue: #4f8cff;
  --green: #5af0b0;

  /* per-page accent (overridden by body[data-theme]) */
  --accent: var(--cyan);
  --accent-2: var(--violet);
  --accent-ink: #021018;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --r: 14px;
  --r-lg: 22px;
  --wrap: 1200px;
  --nav-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

body[data-theme="velox"] {
  --accent: var(--cyan);
  --accent-2: var(--violet);
  --accent-ink: #021018;
}
body[data-theme="rpo"] {
  --accent: var(--amber);
  --accent-2: var(--blue);
  --accent-ink: #1a0d00;
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal; font-optical-sizing: auto;
  overflow-x: hidden;
}

/* fine film grain over everything: keeps big dark fields from banding */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.018em; line-height: 1.12; }
::selection { background: color-mix(in srgb, var(--accent) 38%, transparent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 1000;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 10px; font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip:focus { top: 12px; }

/* scroll progress hairline */
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 80;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  pointer-events: none;
}

/* ---------- navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 70;
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav.scrolled {
  background: rgba(4, 6, 11, 0.7);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border-color: var(--line);
}
.nav-in { height: var(--nav-h); display: flex; align-items: center; gap: 24px; }

.brand {
  display: inline-flex; align-items: center; gap: 11px;
  font-weight: 700; font-size: 12.5px; letter-spacing: 0.24em; text-transform: uppercase;
  white-space: nowrap;
}
.brand svg { width: 26px; height: 26px; flex: none; }
.brand span { color: var(--text-2); font-weight: 500; }

.nav-links { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav-links a {
  position: relative;
  padding: 8px 13px; border-radius: 9px;
  font-size: 14px; color: var(--text-2);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 2px; height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.nav-links .sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 8px; }
.nav-links a.proj { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em; }

/* ---------- type atoms ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 11.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-2);
}
.eyebrow i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent), 0 0 18px var(--accent);
}
.eyebrow.live i { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent, 0 0 24px var(--accent); } }

.grad {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  /* tight (negative) letter-spacing pulls the box in from the last glyph, and a text-clipped
     background stops at the box edge; pad the end back out and cancel it with a negative margin */
  padding-inline-end: 0.16em; margin-inline-end: -0.16em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.6; color: var(--text-2); max-width: 46em; }
.lead b, .lead strong { color: var(--text); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  --h: 46px;
  display: inline-flex; align-items: center; gap: 10px;
  height: var(--h); padding: 0 20px; border-radius: 12px;
  font-size: 15px; font-weight: 600; letter-spacing: -0.005em;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--text);
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s, box-shadow 0.25s;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(190, 205, 240, 0.4); transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 100%, #fff 14%), var(--accent));
  color: var(--accent-ink); border-color: transparent;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 8px 30px -8px color-mix(in srgb, var(--accent) 60%, transparent);
}
.btn.primary:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset, 0 12px 40px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn .arr { transition: transform 0.25s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn[aria-disabled="true"] { opacity: 0.55; cursor: default; pointer-events: none; }
.btn .soon {
  font: 500 10px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); color: var(--text-2);
}

/* ---------- sections ---------- */
.section { position: relative; padding: clamp(80px, 11vw, 150px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.sec-head { display: grid; gap: 22px; max-width: 880px; margin-bottom: clamp(40px, 6vw, 72px); }
.sec-head h2 { font-size: clamp(32px, 4.4vw, 56px); letter-spacing: -0.026em; line-height: 1.08; text-wrap: balance; }
.sec-head .lead { margin-top: 2px; }

/* blueprint grid used as a quiet backdrop */
.blueprint {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 0%, transparent 75%);
  opacity: 0.55;
}

/* ---------- cards: gradient hairline + cursor spotlight ---------- */
.card {
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg-2), var(--bg-2)) padding-box,
    linear-gradient(140deg, color-mix(in srgb, var(--accent) 45%, transparent), rgba(148, 170, 215, 0.12) 38%, rgba(148, 170, 215, 0.06) 100%) border-box;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%);
  opacity: 0; transition: opacity 0.35s;
}
.card:hover::before { opacity: 1; }

/* ---------- reveal on scroll (only when JS is running) ---------- */
.js .rv { opacity: 0; transform: translateY(22px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0ms); }
.js .rv.in { opacity: 1; transform: none; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 56px 0 48px; color: var(--text-3); font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.foot h4 { font: 500 11.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); margin-bottom: 16px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.foot a:hover { color: var(--text); }
.foot .blurb { max-width: 30em; margin-top: 16px; line-height: 1.6; }
.foot-base { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; font-size: 12.5px; }

.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px;
  border-radius: 999px; font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(4, 6, 11, 0.66); border: 1px solid var(--line-2); color: var(--text-2);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.chip .d { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--accent)); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 980px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  :root { --nav-h: 58px; }
  .nav-links a:not(.keep) { display: none; }
  .nav-links .sep { display: none; }
}

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