:root {
  --bg: #030605;
  --text: #f4fff8;
  --muted: #9db2a8;
  --line: rgba(255, 255, 255, 0.1);
  --line-bright: rgba(75, 255, 170, 0.42);
  --accent: #45ff96;
  --accent-2: #45e5ff;
  --accent-3: #ff4fc1;
  --panel: rgba(4, 11, 9, 0.68);
  --max: 1180px;
  --radius: 8px;
  --shadow: 0 34px 90px rgba(0, 0, 0, 0.48);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    linear-gradient(rgba(69, 255, 150, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(69, 229, 255, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 20% 18%, rgba(69, 255, 150, 0.18), transparent 32%),
    radial-gradient(circle at 88% 48%, rgba(69, 229, 255, 0.15), transparent 34%),
    linear-gradient(135deg, #030605 0%, #07120f 52%, #020403 100%);
  background-size: 44px 44px, 44px 44px, auto, auto, auto;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.42;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 7px),
    linear-gradient(115deg, transparent 0 38%, rgba(69, 255, 150, 0.12) 49%, transparent 60%);
  animation: scanDrift 9s linear infinite;
}

a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 18px;
  max-width: 680px;
  font-size: clamp(2.35rem, 4.2vw, 3.85rem);
  line-height: 1.02;
  letter-spacing: 0;
}
h2 {
  margin-bottom: 16px;
  font-size: clamp(1.75rem, 2.8vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: 0;
}
h3 {
  margin-bottom: 10px;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
  line-height: 1.04;
}
p { color: var(--muted); }

.site-nav {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 20;
  width: min(var(--max), calc(100% - 32px));
  height: 74px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 850;
}
.brand img {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: 0 0 28px rgba(69, 255, 150, 0.28);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-links a,
.mini-link {
  color: rgba(244, 255, 248, 0.78);
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(18px);
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 0.92rem;
}
.nav-links a:hover,
.mini-link:hover {
  border-color: var(--line-bright);
  color: var(--text);
}
.scroll-meter {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 30;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
}
.scroll-meter span {
  display: block;
  width: calc(var(--scroll, 0) * 100%);
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  box-shadow: 0 0 22px rgba(69, 255, 150, 0.7);
}

.hero {
  min-height: auto;
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 116px 0 34px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: center;
}
.hero.compact {
  min-height: auto;
  grid-template-columns: 1fr;
  padding-bottom: 44px;
}
.hero-copy,
.section-head,
.scene-copy,
.work-copy {
  position: relative;
  z-index: 2;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 16px var(--accent);
}
.lead,
.hero-copy > p,
.section-head p,
.scene-copy p {
  max-width: 680px;
  font-size: clamp(1rem, 1.4vw, 1.12rem);
}
.hero-actions,
.inline-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  padding: 12px 18px;
  color: #021009;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 34px rgba(69, 255, 150, 0.24);
  font-weight: 900;
  text-decoration: none;
}
.button.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}
.button.ghost {
  color: var(--muted);
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.tech-stage,
.showcase-frame {
  position: relative;
  min-height: clamp(260px, 28vw, 340px);
  max-width: 380px;
  margin-left: auto;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)), rgba(3, 8, 7, 0.82);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.tech-stage::before,
.showcase-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3, 6, 5, 0.66), transparent 38%, rgba(3, 6, 5, 0.22)),
    linear-gradient(0deg, rgba(3, 6, 5, 0.72), transparent 42%, rgba(3, 6, 5, 0.12));
}
.tech-stage::after,
.showcase-frame::after {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.72;
  background: conic-gradient(from 160deg, transparent, rgba(69, 255, 150, 0.2), transparent, rgba(69, 229, 255, 0.18), transparent);
  mix-blend-mode: screen;
  animation: rotateField 14s linear infinite;
}
.stage-image,
.showcase-image {
  position: absolute;
  inset: 26px;
  z-index: 1;
  width: calc(100% - 52px);
  height: calc(100% - 52px);
  object-fit: contain;
  filter: saturate(1.18) contrast(1.1);
  transform: translate3d(calc(var(--mx, 0) * 10px), calc(var(--my, 0) * 8px), 0) scale(0.98);
}
.stage-hud,
.showcase-content {
  position: absolute;
  z-index: 4;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 12px;
}
.tech-stage .stage-hud {
  display: none;
}
.hud-panel,
.scene-index,
.data-tile,
.policy-block,
.feature,
.product-card,
.work-card,
.showcase-chip,
.showcase-kicker {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(4, 11, 9, 0.62);
  backdrop-filter: blur(18px);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.28);
}
.hud-panel,
.scene-index,
.data-tile,
.feature,
.policy-block,
.showcase-chip,
.showcase-kicker {
  padding: 18px;
}
.hud-panel strong,
.data-tile strong,
.showcase-chip strong {
  display: block;
  color: var(--text);
  font-size: 1.05rem;
}
.hud-panel span,
.data-tile span,
.showcase-chip span {
  color: var(--muted);
  font-size: 0.88rem;
}
.scene-index,
.showcase-kicker {
  display: grid;
  align-content: center;
  color: var(--accent);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pulse-ring {
  position: absolute;
  z-index: 4;
  width: 84px;
  height: 84px;
  right: 8%;
  top: 10%;
  border: 1px solid rgba(69, 255, 150, 0.36);
  border-radius: 50%;
  box-shadow: 0 0 34px rgba(69, 255, 150, 0.28), inset 0 0 42px rgba(69, 229, 255, 0.14);
  animation: pulseScale 3.8s ease-in-out infinite;
}
.pulse-ring::before,
.pulse-ring::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(69, 229, 255, 0.28);
  border-radius: 50%;
}
.pulse-ring::after {
  inset: 38px;
  background: rgba(69, 255, 150, 0.14);
  box-shadow: 0 0 28px rgba(69, 255, 150, 0.48);
}

.section {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
}
.section-head {
  max-width: 820px;
  margin-bottom: 36px;
}
.data-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.data-tile {
  min-height: 112px;
  display: grid;
  align-content: space-between;
}
.data-tile b {
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.story {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}
.chapter {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: clamp(24px, 3vw, 40px);
  align-items: center;
  padding: 38px 0;
}
.chapter.alt {
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
}
.chapter.alt .scene-copy { order: 2; }
.sticky-visual {
  position: relative;
  top: auto;
  min-height: clamp(220px, 26vw, 300px);
}
.scene-copy {
  max-width: 560px;
}
.scene-copy .number {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  color: #021009;
  background: var(--accent);
  font-weight: 900;
  box-shadow: 0 0 28px rgba(69, 255, 150, 0.22);
}
.image-fit {
  position: relative;
  min-height: clamp(220px, 26vw, 300px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: radial-gradient(circle at 28% 18%, rgba(69, 255, 150, 0.18), transparent 28%), linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
}
.image-fit img {
  position: absolute;
  inset: 22px;
  width: calc(100% - 44px);
  height: calc(100% - 44px);
  object-fit: contain;
  filter: saturate(1.16) contrast(1.06);
}
.image-fit::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0 30%, rgba(255, 255, 255, 0.11) 48%, transparent 64%), linear-gradient(0deg, rgba(2, 5, 4, 0.68), transparent 42%);
  animation: sweep 6.8s ease-in-out infinite;
}
.spec-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}
.spec-list span {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}
.matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.product-card {
  min-height: 250px;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  display: grid;
  grid-template-rows: 108px 1fr;
}
.product-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18px;
  background: #020504;
  border-bottom: 1px solid var(--line);
}
.product-copy {
  padding: 22px;
}
.tag {
  display: inline-flex;
  margin-bottom: 14px;
  border: 1px solid rgba(69, 255, 150, 0.28);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: 28px;
  align-items: center;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.feature p,
.policy-block p,
.policy-block li,
.product-copy p {
  color: var(--muted);
}
.policy-shell {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 90px;
}
.policy-block {
  margin-bottom: 14px;
}
.policy-block ul { padding-left: 20px; }
.footer {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.footer a {
  color: var(--muted);
  text-decoration: none;
}

body[data-scene="flux"] {
  --accent: #49e6ff;
  --accent-2: #ff4fc1;
  --line-bright: rgba(73, 230, 255, 0.42);
}
body[data-scene="studio"] {
  --accent: #f5ff70;
  --accent-2: #45ff96;
  --line-bright: rgba(245, 255, 112, 0.42);
}

@keyframes scanDrift {
  from { transform: translateY(-18px); }
  to { transform: translateY(18px); }
}
@keyframes rotateField {
  to { transform: rotate(360deg); }
}
@keyframes pulseScale {
  0%, 100% { transform: scale(0.92); opacity: 0.62; }
  50% { transform: scale(1.08); opacity: 1; }
}
@keyframes sweep {
  0%, 35% { transform: translateX(-120%); }
  70%, 100% { transform: translateX(120%); }
}

@media (max-width: 960px) {
  .hero,
  .chapter,
  .chapter.alt,
  .split {
    grid-template-columns: 1fr;
  }
  .chapter.alt .scene-copy { order: 0; }
  .sticky-visual { position: relative; top: auto; }
  .data-grid,
  .feature-grid,
  .matrix {
    grid-template-columns: 1fr;
  }
  .tech-stage,
  .image-fit {
    min-height: 280px;
    max-width: 100%;
    margin-left: 0;
  }
}
@media (max-width: 640px) {
  .site-nav {
    position: relative;
    left: auto;
    width: min(var(--max), calc(100% - 28px));
    height: auto;
    transform: none;
    padding: 16px 0;
    align-items: flex-start;
    flex-direction: column;
  }
  .nav-links { justify-content: flex-start; }
  .hero {
    min-height: auto;
    padding-top: 48px;
  }
  .tech-stage,
  .image-fit {
    min-height: 230px;
  }
  .stage-hud,
  .showcase-content {
    grid-template-columns: 1fr;
  }
  .button { width: 100%; }
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
