:root {
  --color-bg: #05070C;
  --color-surface: #0E1526;
  --color-surface-alt: #131C33;
  --color-border: rgba(255, 255, 255, 0.09);
  --color-text: #E8ECF5;
  --color-text-muted: #9AA3B8;
  --color-accent: #3646FF;
  --color-accent-text: #AEB8FF;
  --color-accent-contrast: #FFFFFF;
  --grid-line: rgba(130, 150, 255, 0.05);
  --font-heading: 'Archivo', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --container-width: 1160px;
  --radius: 2px;
  --header-height: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Blueprint grid texture — fixed atmospheric layer behind all content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}
p { margin: 0 0 16px; color: var(--color-text-muted); }

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

section[id], footer[id] { scroll-margin-top: 96px; }

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  color: var(--color-accent-text);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  margin-bottom: 20px;
}
.eyebrow::before,
.eyebrow::after { content: "/"; color: var(--color-border); }

/* .fade-in carries no CSS state of its own: motion.js animates it with    */
/* GSAP .from()/.set() at runtime. If the GSAP script never loads, nothing */
/* ever hides this content — the page is simply static, never blank.      */

@keyframes grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 96px 48px, 48px 96px; }
}
body::before { animation: grid-drift 50s linear infinite; }

@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;
  }
}

/* Preloader — hides itself via CSS animation alone, never depends on JS */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  animation: preloader-out 1.05s ease forwards;
  animation-delay: 0.15s;
}
.preloader-word {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--color-accent-text);
}
@keyframes preloader-out {
  0%, 55% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}

/* Custom cursor — only takes over once motion.js confirms a fine pointer */
.cursor-dot,
.cursor-ring { display: none; }
html.has-custom-cursor .cursor-dot,
html.has-custom-cursor .cursor-ring {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
html.has-custom-cursor .cursor-dot,
html.has-custom-cursor .cursor-ring {
  opacity: 0;
}
html.has-custom-cursor .cursor-dot.is-ready,
html.has-custom-cursor .cursor-ring.is-ready {
  opacity: 1;
}
html.has-custom-cursor .cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--color-accent-text);
  transition: opacity 0.2s ease;
}
html.has-custom-cursor .cursor-ring {
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-accent-text);
  transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
}
html.has-custom-cursor .cursor-ring.is-ready { opacity: 0.6; }
html.has-custom-cursor .cursor-ring.is-active {
  width: 52px;
  height: 52px;
  opacity: 1;
}
html.has-custom-cursor,
html.has-custom-cursor a,
html.has-custom-cursor button {
  cursor: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 60;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}
.site-header.is-scrolled {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}
.logo img { height: 34px; }
.nav { display: flex; gap: 36px; }
.nav a {
  position: relative;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text);
  padding: 8px 0;
  transition: color 0.2s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 4px;
  height: 2px;
  background: var(--color-accent);
  transition: right 0.25s ease;
}
.nav a:hover { color: var(--color-accent-text); }
.nav a:hover::after { right: 0; }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--color-text); display: block; }

@media (max-width: 768px) {
  .nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.25s ease, visibility 0s linear 0.25s;
  }
  .nav.is-open {
    max-height: 240px;
    visibility: visible;
    transition: max-height 0.25s ease, visibility 0s linear 0s;
  }
  .nav a { padding: 16px 24px; border-bottom: 1px solid var(--color-border); }
  .nav-toggle { display: flex; }
}

/* Hero */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  padding: 132px 0 96px;
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}
.hero-spotlight {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(
    620px circle at var(--x, 50%) var(--y, 30%),
    rgba(54, 70, 255, 0.16),
    transparent 60%
  );
}
.hero:hover .hero-spotlight { opacity: 1; }
.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}
.hero-content { flex: 1 1 420px; min-width: 0; max-width: 620px; }
.hero h1 {
  font-size: clamp(36px, 5.4vw, 66px);
  max-width: 680px;
  margin-bottom: 24px;
}
.word-mask { display: inline-block; overflow: hidden; vertical-align: top; }
.word-inner { display: inline-block; }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 1;
  transform: translateX(-50%);
}
.scroll-cue span {
  display: block;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
  animation: scroll-cue-bounce 1.8s ease-in-out infinite;
}
@keyframes scroll-cue-bounce {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50% { transform: rotate(45deg) translate(6px, 6px); }
}
@media (max-width: 600px) {
  .hero { min-height: auto; }
  .scroll-cue { display: none; }
}

.hero-lead { max-width: 560px; font-size: 18px; }

/* Hero 3D orb — a rotating wireframe octahedron of glowing nodes, one
   per product, rendered on canvas so it shares the same glow language
   as the background network. */
.hero-orb {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 340px;
  height: 340px;
}
.hero-orb canvas { width: 100%; height: 100%; display: block; }

@media (max-width: 960px) {
  .hero-orb { display: none; }
}

/* About */
.about { padding: 96px 0; border-bottom: 1px solid var(--color-border); }
.about-inner {
  max-width: 960px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 64px;
  align-items: center;
}
.about h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 32px;
  margin-bottom: 24px;
}
.about h2::before,
.products h2::before,
.footer-contact h3::before {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent-text);
  box-shadow: 0 0 12px 3px rgba(174, 184, 255, 0.55);
}

/* About visual — the labeled values orb floats directly on the page
   background, no card/box around it, matching how the hero orb has
   no boxed background of its own either. */
.about-visual {
  position: relative;
  aspect-ratio: 1 / 1;
}
.about-visual canvas { width: 100%; height: 100%; display: block; }

@media (max-width: 800px) {
  .about-inner { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 600px) {
  .hero { padding: 96px 0 64px; }
  .about { padding: 64px 0; }
}

/* Products */
.products { padding: 96px 0; border-bottom: 1px solid var(--color-border); }
.products h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 32px;
  margin-bottom: 12px;
}
.section-lead { max-width: 560px; margin-bottom: 48px; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.product-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 24px 48px -32px rgba(54, 70, 255, 0.28);
  transition: border-color 0.2s ease, transform 0.35s ease, box-shadow 0.3s ease;
  will-change: transform;
}
.card-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: radial-gradient(
    220px circle at var(--x, 50%) var(--y, 50%),
    rgba(174, 184, 255, 0.12),
    transparent 70%
  );
}
.product-card > *:not(.card-glow) { position: relative; z-index: 1; }
.product-card::before,
.product-card::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--color-border);
  transition: border-color 0.2s ease;
}
.product-card::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.product-card::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }
.product-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-4px);
  box-shadow: 0 32px 56px -28px rgba(54, 70, 255, 0.48);
}
.product-card:hover::before,
.product-card:hover::after { border-color: var(--color-accent-text); }
.product-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent-text);
}
.product-tag::before { content: "[ "; }
.product-tag::after { content: " ]"; }
.product-card h3 { font-size: 20px; margin-bottom: 4px; }
.product-card p { flex-grow: 1; font-size: 15px; }
.product-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
  margin-top: 8px;
  transition: color 0.2s ease;
}
.product-link::after {
  content: "→";
  display: inline-block;
  transition: transform 0.2s ease;
}
.product-link:hover { color: var(--color-accent-text); }
.product-link:hover::after { transform: translateX(4px); }
.product-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-top: 8px;
  width: fit-content;
}

@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
  .product-grid { grid-template-columns: 1fr; }
  .products { padding: 64px 0; }
}

/* Footer */
.site-footer {
  position: relative;
  padding-top: 64px;
  background: var(--color-surface-alt);
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -140px;
  right: -100px;
  width: 460px;
  height: 460px;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgba(54, 70, 255, 0.16), transparent 70%);
}
.footer-watermark {
  position: absolute;
  left: 50%;
  bottom: -8vw;
  transform: translateX(-50%);
  z-index: 0;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(90px, 18vw, 220px);
  line-height: 1;
  color: var(--color-border);
  white-space: nowrap;
  pointer-events: none;
}
.footer-inner, .footer-bottom { position: relative; z-index: 1; }
.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--color-border);
}
.footer-brand img { height: 30px; margin-bottom: 20px; }
.footer-brand p { max-width: 320px; }
.footer-contact h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  color: var(--color-text);
}
.footer-contact p { margin-bottom: 8px; font-size: 15px; }
.footer-contact a:hover { color: var(--color-accent-text); }
.footer-bottom { padding: 24px 0; }
.footer-bottom p {
  margin: 0;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}

@media (max-width: 600px) {
  .footer-inner { grid-template-columns: 1fr; }
}
