:root {
  --bg-0: #030711;
  --bg-1: #07172a;
  --bg-2: #0b2f3a;
  --ink: #ecf6ff;
  --ink-soft: #c4dcec;
  --line: rgba(158, 227, 255, 0.24);
  --glass: rgba(7, 25, 41, 0.62);
  --accent: #68e2ff;
  --accent-2: #6af8b0;
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
  --radius: 20px;
  --mx: 50%;
  --my: 50%;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

/* Base gradient lives on <html> so the fixed animated canvas (z-index:-2)
   and aurora (z-index:-1) remain visible above it. */
html {
  background: radial-gradient(circle at 20% 10%, #0d2238 0%, var(--bg-0) 35%, #02040a 100%);
  background-attachment: fixed;
}

body {
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: transparent;
  overflow-x: hidden;
}

#space-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.aurora {
  position: fixed;
  inset: -20vh -20vw;
  z-index: -1;
  background:
    radial-gradient(ellipse at calc(var(--mx) * 1) calc(var(--my) * 1), rgba(97, 234, 255, 0.13), transparent 40%),
    radial-gradient(circle at 82% 20%, rgba(106, 248, 176, 0.14), transparent 35%),
    radial-gradient(circle at 8% 78%, rgba(86, 124, 255, 0.13), transparent 45%);
  filter: blur(26px) saturate(120%);
  animation: breathe 10s ease-in-out infinite;
  pointer-events: none;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1) translateY(0);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.03) translateY(-1.2vh);
    opacity: 1;
  }
}

.site-header {
  position: sticky;
  top: 0.75rem;
  width: min(1100px, calc(100% - 2rem));
  margin: 0.75rem auto 0;
  padding: 0.9rem 1rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 20;
}

.brand {
  font-family: "Orbitron", "Eurostile", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-header nav {
  display: flex;
  gap: 1rem;
}

.site-header a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.92rem;
}

.site-header a:hover,
.site-header a:focus-visible {
  color: var(--ink);
}

.cta-mini {
  border: 1px solid var(--line);
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(104, 226, 255, 0.15);
  text-decoration: none;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.cta-mini:hover,
.cta-mini:focus-visible {
  background: rgba(104, 226, 255, 0.3);
  box-shadow: 0 0 24px rgba(104, 226, 255, 0.35);
}

/* Scroll progress rail */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 30;
  background: rgba(255, 255, 255, 0.05);
}

.scroll-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 16px rgba(104, 226, 255, 0.6);
  transition: width 0.1s linear;
}

main {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding-bottom: 5rem;
}

/* Each scene gets cinematic breathing room for scroll-driven scenes */
.scene {
  min-height: 96vh;
  display: grid;
  align-content: center;
}

.panel {
  position: relative;
  margin: 3.5rem 0;
  padding: 2rem;
}

/* Parallax layer shifted by scroll + pointer via JS custom props */
.parallax {
  display: grid;
  gap: 1rem;
  will-change: transform;
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
}

.hero {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 1rem;
}

.card-index,
.flow-step {
  display: inline-block;
  font-family: "Orbitron", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  opacity: 0.75;
}

.scroll-hint {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scroll-hint i {
  width: 20px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 12px;
  position: relative;
}

.scroll-hint i::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 3px;
  height: 6px;
  border-radius: 3px;
  background: var(--accent);
  transform: translateX(-50%);
  animation: scrollDot 1.6s ease-in-out infinite;
}

@keyframes scrollDot {
  0%,
  100% {
    opacity: 0;
    transform: translate(-50%, 0);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, 10px);
  }
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
}

h1,
h2 {
  font-family: "Orbitron", "Eurostile", sans-serif;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 6vw, 4.1rem);
  max-width: 14ch;
}

h2 {
  font-size: clamp(1.4rem, 4.1vw, 2.5rem);
  max-width: 20ch;
}

h3 {
  font-size: 1.03rem;
}

.lead {
  color: var(--ink-soft);
  max-width: 60ch;
  line-height: 1.6;
}

.hero-metrics,
.grid {
  margin-top: 1.4rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(12, 1fr);
}

.metric,
.card,
.flow li,
.contact-grid {
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric,
.card,
.flow li {
  padding: 1rem;
  transform-style: preserve-3d;
  transition: transform 0.35s ease, border-color 0.3s ease, background 0.3s ease;
}

.metric:hover,
.card:hover,
.flow li:hover,
.metric:focus-visible,
.card:focus-visible,
.flow li:focus-visible {
  transform: translateY(-6px) rotateX(3deg) rotateY(-3deg);
  border-color: rgba(106, 248, 176, 0.6);
  background: rgba(10, 33, 55, 0.8);
}

.metric h2 {
  font-size: clamp(1.2rem, 2.6vw, 2rem);
}

.metric:nth-child(1),
.metric:nth-child(2),
.metric:nth-child(3) {
  grid-column: span 4;
}

.card {
  grid-column: span 6;
  min-height: 150px;
}

.flow {
  margin: 1.3rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.9rem;
}

.flow li {
  display: grid;
  gap: 0.5rem;
}

.glass {
  border: 1px solid var(--line);
  background: rgba(3, 14, 28, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.contact {
  padding-bottom: 1rem;
}

.contact-grid {
  margin-top: 1.2rem;
  padding: 1rem;
  display: grid;
  gap: 0.45rem;
}

a {
  color: var(--accent);
}

.site-footer {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 900px) {
  .metric:nth-child(1),
  .metric:nth-child(2),
  .metric:nth-child(3),
  .card {
    grid-column: span 12;
  }

  .site-header {
    border-radius: 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    row-gap: 0.4rem;
  }

  .site-header nav {
    grid-column: span 2;
    order: 3;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }
}

@media (max-width: 520px) {
  .panel {
    padding: 1rem 0.2rem;
    margin: 2.4rem 0;
  }

  .hero {
    min-height: 62vh;
  }
}

/* Foldable postures */
@media (spanning: single-fold-vertical) {
  main {
    width: min(1280px, calc(100% - 2rem));
  }

  .grid {
    grid-template-columns: repeat(24, 1fr);
  }

  .card {
    grid-column: span 12;
  }
}

@media (spanning: single-fold-horizontal) {
  .site-header {
    position: static;
  }

  .hero {
    min-height: 52vh;
  }
}

@media (min-width: 1500px) {
  main,
  .site-header,
  .site-footer {
    width: min(1320px, calc(100% - 4rem));
  }

  .panel {
    margin: 4.5rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
