:root {
  --bg: #000;
  --fg: #f4f5f7;
  --muted: #9097a3;
  --line: rgba(255, 255, 255, .12);
  --accent: #3b5bff;
  --accent-soft: #8ea0ff;
  --card: rgba(12, 13, 18, .78);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }

/* ───────── Nav ───────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 32px;
  padding: 16px clamp(18px, 4vw, 48px);
  background: linear-gradient(#000c, #0000);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 500; letter-spacing: -.01em; text-decoration: none;
}
.brand b { font-weight: 700; }
.brand-mark { width: 24px; height: 24px; }
.nav-links { display: flex; gap: 28px; margin-left: auto; }
.nav-links a { font-size: 14px; color: var(--muted); text-decoration: none; transition: color .2s; }
.nav-links a:hover { color: var(--fg); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: transparent; color: var(--fg);
  font: 500 15px/1 var(--font); text-decoration: none; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .2s;
}
.btn:hover { border-color: #fff; transform: translateY(-1px); }
.btn-solid { background: #fff; color: #000; border-color: #fff; }
.btn-solid:hover { background: #dfe4ff; }
.btn-small { padding: 9px 16px; font-size: 13px; }

.eyebrow {
  font: 500 12px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent-soft);
}

/* ───────── Stage ───────── */
.stage-track { position: relative; height: 300vh; }
.stage {
  --W: min(86vw, 1500px);        /* width of a rendered frame; the unit fills about 85% of it */
  position: sticky; top: 0; height: 100vh; height: 100svh;
  overflow: hidden;
}
.stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.glow {
  position: absolute; left: 50%; top: 60%;
  width: 120vmax; height: 70vmax; transform: translate(-50%, -50%);
  background:
    radial-gradient(closest-side, rgba(59, 91, 255, .22), transparent 70%);
  pointer-events: none;
}

.hero {
  position: absolute; inset: 15vh 0 auto 0; z-index: 3;
  padding: 0 24px; text-align: center;
  will-change: opacity, transform;
}
.hero h1 {
  margin-top: 18px;
  font-size: clamp(34px, 5.6vw, 76px); line-height: 1.04; letter-spacing: -.035em; font-weight: 600;
}
.hero h1 span {
  background: linear-gradient(100deg, #fff 10%, #9fb0ff 55%, #5670ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin-top: 20px; color: var(--muted); font-size: clamp(15px, 1.4vw, 19px); }

/* ───────── Rack: pre-rendered frames scrubbed by scroll (see render/rack.py) ───────── */
.scene {
  position: absolute; left: 50%; top: 62%; z-index: 2;
  width: var(--W); aspect-ratio: 2400 / 1091;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}
.rack-frames {
  display: block; width: 100%; height: 100%;
  opacity: 0; transition: opacity .6s ease;
  /* the frames are opaque black around the unit; fade their edges so the starfield resumes without a seam */
  -webkit-mask-image: radial-gradient(closest-side, #000 86%, transparent);
  mask-image: radial-gradient(closest-side, #000 86%, transparent);
}
.rack-frames.ready { opacity: 1; }

/* ───────── Feature popups ───────── */
.features { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.feature {
  position: absolute; width: min(360px, 86vw);
  padding: 22px 24px 24px;
  background: var(--card);
  border: 1px solid var(--line); border-radius: 18px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06);
  opacity: 0; visibility: hidden;
  will-change: opacity, transform;
}
.feature-n { font: 500 12px/1 var(--mono); letter-spacing: .18em; color: var(--accent-soft); }
.feature h2 { margin: 12px 0 8px; font-size: 22px; line-height: 1.2; letter-spacing: -.02em; font-weight: 600; }
.feature p { color: #b6bcc7; font-size: 15px; }
.feature[data-pos="tl"] { left: max(5vw, calc(50% - 600px)); top: 11vh; }
.feature[data-pos="tr"] { right: max(5vw, calc(50% - 600px)); top: 11vh; }
.feature[data-pos="bl"] { left: max(5vw, calc(50% - 600px)); bottom: 4vh; }
.feature[data-pos="br"] { right: max(5vw, calc(50% - 600px)); bottom: 4vh; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font: 500 11px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
}
.scroll-hint span { width: 1px; height: 34px; background: linear-gradient(transparent, #fff); animation: drip 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, .06); z-index: 5; }
.progress i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), #b3bfff); transform-origin: left; transform: scaleX(0); }

/* ───────── Sections ───────── */
.section {
  position: relative; z-index: 6; background: var(--bg);
  max-width: 1120px; margin: 0 auto;
  padding: clamp(80px, 12vh, 140px) clamp(20px, 4vw, 40px);
  scroll-margin-top: 40px;
}
.section-title { margin-top: 16px; font-size: clamp(30px, 4.2vw, 52px); line-height: 1.08; letter-spacing: -.03em; font-weight: 600; }
.section-lead { margin-top: 16px; max-width: 56ch; color: var(--muted); font-size: 18px; }

.products { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 48px; }
.product {
  display: flex; flex-direction: column; gap: 14px;
  padding: 36px; border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #101116, #07080b);
  transition: border-color .3s, transform .3s;
}
.product:hover { border-color: rgba(255, 255, 255, .3); transform: translateY(-4px); }
.product-alt { background: linear-gradient(160deg, #111634, #07080b 70%); border-color: rgba(110, 135, 255, .35); }
.product-icon svg { width: 64px; height: 40px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.product h3 { margin-top: 8px; font-size: 28px; letter-spacing: -.02em; font-weight: 600; }
.product-tag { font: 500 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent-soft); }
.product > p:not(.product-tag) { color: #b6bcc7; }
.product ul { list-style: none; margin: 8px 0 20px; padding: 0; display: grid; gap: 10px; color: #d5d9e0; font-size: 15px; }
.product li { position: relative; padding-left: 24px; }
.product li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 10px; height: 5px; border-left: 2px solid var(--accent-soft); border-bottom: 2px solid var(--accent-soft); transform: rotate(-45deg) translateY(-2px); }
.product > p.product-price { margin-bottom: 20px; color: var(--muted); font-size: 15px; }
.product-price b { color: var(--fg); font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.product .btn { margin-top: auto; align-self: flex-start; }

.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 44px; max-width: 760px; }
.contact label { display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.contact .full { grid-column: 1 / -1; }
.contact input, .contact select, .contact textarea {
  width: 100%; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: #0a0b0f; color: var(--fg);
  font: 400 16px/1.4 var(--font);
  transition: border-color .2s, box-shadow .2s;
}
.contact textarea { resize: vertical; }
.contact input:focus, .contact select:focus, .contact textarea:focus { outline: none; border-color: var(--accent-soft); box-shadow: 0 0 0 3px rgba(59, 91, 255, .25); }
.contact-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.contact-note { font-size: 13px; color: var(--muted); }
.contact-note.ok { color: #7ee2a8; }
.contact-note.err { color: #ff9c9c; }
.contact .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }   /* honeypot for bots */
.contact button[disabled] { opacity: .6; cursor: progress; }

.faq { margin-top: 40px; max-width: 820px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 22px 0; cursor: pointer; list-style: none;
  font-size: 19px; font-weight: 500; letter-spacing: -.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 300 26px/1 var(--font); color: var(--accent-soft); transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 40px 24px 0; color: #b6bcc7; }

.footer {
  position: relative; z-index: 6; background: var(--bg);
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 32px clamp(20px, 4vw, 48px); border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}
.footer .brand { color: var(--fg); }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--fg); }

/* ───────── Text pages ───────── */
.page { padding-top: clamp(120px, 18vh, 180px); }
.prose { margin-top: 24px; max-width: 760px; color: #b6bcc7; font-size: 17px; }
.prose h2 { margin-top: 56px; color: var(--fg); font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.prose p, .prose ul { margin-top: 18px; }
.prose ul { padding-left: 20px; }
.prose li { margin-top: 10px; }
.prose li::marker { color: var(--accent-soft); }
.prose a { color: var(--fg); text-decoration-color: var(--accent-soft); text-underline-offset: 3px; }
.prose-note { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }

:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; }

/* ───────── Small screens ───────── */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav .btn { margin-left: auto; }
  .stage { --W: 112vw; }
  .scene { top: 56%; }
  .hero { inset: 13vh 0 auto 0; }
  .feature { left: 50% !important; right: auto !important; margin-left: calc(min(360px, 86vw) / -2); padding: 18px 20px 20px; }
  .feature h2 { font-size: 19px; }
  .feature[data-pos^="t"] { top: 11vh; }
  .feature[data-pos^="b"] { bottom: 7vh; }
  .products, .contact { grid-template-columns: 1fr; }
  .product { padding: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .led.blink i, .scroll-hint span { animation: none; }
}
