/* ==========================================================================
   VectoNexus — Design System
   The Parallel Compute Bridge
   ========================================================================== */

:root {
  /* Core palette — derived from brand marks */
  --bg: #0a0e17;
  --bg-elevated: #10141f;
  --bg-elevated-2: #151a28;
  --bg-inset: #060810;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-accent: rgba(16, 185, 129, 0.35);

  --text-primary: #f3f5f7;
  --text-secondary: #9aa4b2;
  --text-tertiary: #626c7a;

  --accent: #10b981;
  --accent-soft: #d1fae5;
  --accent-dim: rgba(16, 185, 129, 0.14);
  --accent-line: rgba(16, 185, 129, 0.4);
  --accent-glow: rgba(16, 185, 129, 0.25);

  --gold: #c9a227;
  --gold-soft: rgba(201, 162, 39, 0.16);

  --danger: #f87171;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 999px;

  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --container: 1180px;
  --nav-h: 76px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; appearance: none; -webkit-appearance: none; }
input, textarea, select { font: inherit; color: inherit; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #04140d; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated-2); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ---------- Background field ---------- */
#vector-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 90%);
}

.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 2;
}

section { position: relative; z-index: 2; }

.section {
  padding: 120px 0;
  border-top: 1px solid var(--border);
}

.section--tight { padding: 80px 0; }

@media (max-width: 720px) {
  .section { padding: 76px 0; }
  .section--tight { padding: 56px 0; }
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  transform: rotate(45deg);
}

.h-display {
  font-size: clamp(2.6rem, 5.4vw, 4.6rem);
  line-height: 1.04;
}

.h-section {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1.12;
}

.h-card { font-size: 1.28rem; line-height: 1.3; }

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.65;
}

.body-text { color: var(--text-secondary); }

.text-accent { color: var(--accent); }
.text-gold { color: var(--gold); }
.mono { font-family: var(--font-mono); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 56px;
}

.section-head__meta { max-width: 480px; color: var(--text-secondary); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid transparent;
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--accent);
  color: #04140d;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.4), 0 8px 24px -8px rgba(16, 185, 129, 0.55);
}
.btn--primary:hover { box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.6), 0 10px 30px -6px rgba(16, 185, 129, 0.7); transform: translateY(-1px); }

.btn--ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn--ghost:hover { border-color: var(--accent-line); background: var(--accent-dim); transform: translateY(-1px); }

.btn--sm { padding: 9px 18px; font-size: 13px; }

.btn__arrow { transition: transform 0.25s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ---------- Badge / tag ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.tag--accent { border-color: var(--border-accent); color: var(--accent); background: var(--accent-dim); }
.tag--gold { border-color: rgba(201, 162, 39, 0.4); color: var(--gold); background: var(--gold-soft); }

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-elevated-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: border-color 0.3s ease, transform 0.3s var(--ease), box-shadow 0.3s ease;
}

.card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: 0 20px 48px -24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(16, 185, 129, 0.1);
}

.card__icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  margin-bottom: 22px;
}

.card__icon svg { width: 22px; height: 22px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

.nav.is-scrolled {
  background: rgba(10, 14, 23, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.nav__inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand__word { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand__word span { color: var(--accent); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__link {
  padding: 9px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-secondary);
  transition: color 0.2s ease, background 0.2s ease;
}
.nav__link:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.05); }
.nav__link.is-active { color: var(--accent); background: var(--accent-dim); }

.nav__actions { display: flex; align-items: center; gap: 10px; }

.nav__toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
}

.nav__toggle-icon { display: block; position: relative; width: 18px; height: 12px; }
.nav__toggle-icon i {
  position: absolute; left: 0; width: 100%; height: 1.5px; background: var(--text-primary);
  transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease;
}
.nav__toggle-icon i:nth-child(1) { top: 0; }
.nav__toggle-icon i:nth-child(2) { top: 5px; }
.nav__toggle-icon i:nth-child(3) { top: 10px; }

body.nav-open .nav__toggle-icon i:nth-child(1) { top: 5px; transform: rotate(45deg); }
body.nav-open .nav__toggle-icon i:nth-child(2) { opacity: 0; }
body.nav-open .nav__toggle-icon i:nth-child(3) { top: 5px; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: rgba(10, 14, 23, 0.98);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px 20px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s var(--ease), opacity 0.25s ease;
  }
  body.nav-open .nav__links { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav__link { padding: 13px 14px; }
  .nav__actions .btn--ghost { display: none; }
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 72px 0 32px;
  position: relative;
  z-index: 2;
}

.footer__top {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 48px;
  padding-bottom: 56px;
}

.footer__brand { max-width: 320px; }
.footer__desc { margin-top: 16px; color: var(--text-secondary); font-size: 14.5px; }

.footer__heading {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 18px;
}

.footer__links li { margin-bottom: 12px; }
.footer__links a { color: var(--text-secondary); font-size: 14.5px; transition: color 0.2s ease; }
.footer__links a:hover { color: var(--accent); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.footer__social { display: flex; gap: 14px; }
.footer__social a {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.footer__social a:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-dim); }
.footer__social svg { width: 16px; height: 16px; }

@media (max-width: 860px) {
  .footer__top { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .footer__brand { max-width: none; grid-column: 1 / -1; }
}

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { transition-delay: calc(var(--i, 0) * 80ms); }

/* ---------- Utilities ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 980px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.divider { height: 1px; background: var(--border); border: none; margin: 0; }

.center { text-align: center; margin-left: auto; margin-right: auto; }

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}
@media (max-width: 720px) {
  .stat { align-items: flex-start; text-align: left; }
}
.stat__num { font-family: var(--font-display); font-size: clamp(2rem, 3vw, 2.6rem); font-weight: 700; color: var(--text-primary); }
.stat__label { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.06em; color: var(--text-tertiary); text-transform: uppercase; white-space: nowrap; }

.code-frame {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.code-frame__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.code-frame__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.code-frame__title { margin-left: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); }
.code-frame pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: #c9d1d9;
}
.code-frame .c-key { color: #79c0ff; }
.code-frame .c-str { color: #a5d6ff; }
.code-frame .c-com { color: #6b7280; }
.code-frame .c-fn { color: var(--accent-soft); }
.code-frame .c-num { color: #d2a8ff; }

.link-underline {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
}
.link-underline::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 100%; height: 1px;
  background: var(--accent-line);
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.link-underline:hover::after { transform: scaleX(1); }

/* ---------- Hero mark (hexagon node/vector visual) ---------- */
.hero-mark {
  width: 100%;
  max-width: 380px;
  filter: drop-shadow(0 20px 50px rgba(16, 185, 129, 0.15));
}
.hero-mark__orbit {
  transform-origin: 200px 200px;
  animation: hero-orbit-spin 70s linear infinite;
}
@keyframes hero-orbit-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-mark__orbit { animation: none; }
}

/* Page hero padding to clear fixed nav */
.hero {
  padding-top: calc(var(--nav-h) + 88px);
  padding-bottom: 90px;
}

@media (max-width: 720px) {
  .hero { padding-top: calc(var(--nav-h) + 52px); padding-bottom: 56px; }
}

.page-hero {
  padding-top: calc(var(--nav-h) + 64px);
  padding-bottom: 64px;
  border-top: none;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr !important; }
  .hero-grid > div:last-child { order: -1; max-width: 280px; margin: 0 auto 12px; }
  .feature-grid { grid-template-columns: 1fr !important; }
  .feature-visual { border-left: none !important; border-top: 1px solid var(--border); }
  .split-grid { grid-template-columns: 1fr !important; }
  .split-grid--rev > div:first-child { order: 2; }
  .form-row { grid-template-columns: 1fr !important; }
}
