/* Scroll animation values are updated by motion.js. */
:root {
  --ambient-y: 0px;
  --ambient-rot: 0deg;
  --grid-y: 0px;
}
body {
  position: relative;
  isolation: isolate;
}
/* Dark glass header: overrides the base header in styles.css. */
header {
  background: rgba(7, 18, 31, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 38px rgba(1, 8, 16, 0.16);
  color: #eef4f7;
  transition:
    background-color 0.25s ease,
    box-shadow 0.25s ease;
}
header::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 42px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(7, 18, 31, 0.22), transparent);
}
header.is-scrolled {
  background: rgba(7, 18, 31, 0.93);
  box-shadow: 0 16px 42px rgba(1, 8, 16, 0.3);
}
header .logo img {
  filter: brightness(0) invert(1);
  opacity: 0.96;
}
header .links a:hover,
header .links a[aria-current="page"] {
  color: var(--lime);
  border-color: var(--lime);
}
header .nav-cta {
  background: var(--lime);
  color: var(--ink) !important;
}
/* Fixed ambient layer behind the page content. */
.ambient-motion {
  position: fixed;
  z-index: 0;
  inset: -18vh -10vw;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.9;
  transform: translate3d(0, var(--ambient-y), 0) rotate(var(--ambient-rot)) scale(1.08);
  transform-origin: center;
  will-change: transform;
  background:
    radial-gradient(circle at 16% 12%, rgba(214, 255, 95, 0.17), transparent 24%),
    radial-gradient(circle at 84% 33%, rgba(120, 201, 255, 0.15), transparent 25%),
    radial-gradient(circle at 47% 82%, rgba(65, 112, 170, 0.17), transparent 31%);
}
.ambient-motion::before {
  content: "";
  position: absolute;
  width: 34vw;
  height: 34vw;
  min-width: 360px;
  min-height: 360px;
  right: 5vw;
  top: 28vh;
  border: 1px solid rgba(214, 255, 95, 0.16);
  border-radius: 50%;
  box-shadow:
    0 0 100px rgba(120, 201, 255, 0.06),
    inset 0 0 80px rgba(214, 255, 95, 0.04);
}
.ambient-motion::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  transform: translate3d(0, var(--grid-y), 0);
  will-change: transform;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: linear-gradient(
    to bottom,
    transparent 4%,
    black 27%,
    black 72%,
    transparent 96%
  );
}
main,
footer {
  position: relative;
  z-index: 1;
}
@media (max-width: 940px) {
  header .menu summary {
    background: var(--lime);
    color: var(--ink);
  }
  header .menu nav {
    background: #0d2235;
    color: #eef4f7;
    border: 1px solid rgba(255, 255, 255, 0.12);
  }
  header .menu nav a:hover {
    background: rgba(255, 255, 255, 0.08);
  }
  .ambient-motion {
    opacity: 0.72;
  }
  .ambient-motion::before {
    right: -24vw;
  }
}
@media (prefers-reduced-motion: reduce) {
  header {
    transition: none;
  }
  .ambient-motion,
  .ambient-motion::after {
    transform: none !important;
    will-change: auto;
  }
}
