*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--space);
}

html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--grey);
  background: radial-gradient(120% 80% at 70% 0%, var(--midnight) 0%, var(--midnight-deep) 45%, var(--space) 100%) fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--white);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 8px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.page-veil {
  position: fixed;
  inset: 0;
  z-index: 40; /* under the nav so it stays visible */
  background: var(--space);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease-out);
}
.page-veil.is-on {
  opacity: 1;
  transition-duration: 0.25s;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--cyan);
  color: var(--midnight);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  position: relative;
  padding: var(--section-y) 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--grey);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.section-head {
  display: grid;
  gap: 18px;
  max-width: 720px;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.section-head h2 {
  font-size: var(--fs-h2);
}
.section-head p {
  font-size: var(--fs-lead);
  color: var(--grey);
}
.section-head--center {
  margin-inline: auto;
  text-align: center;
  justify-items: center;
}

.accent {
  color: var(--cyan);
}
.accent-glow {
  color: var(--cyan);
  text-shadow: 0 0 32px rgba(17, 197, 255, 0.55);
}

/* 3D canvas layer */
#webgl {
  position: fixed;
  inset: 0;
  z-index: 0;
  /* inset: 0 tracks the real visible viewport; 100vh on mobile is the
     toolbar-hidden height and stretched the render vertically */
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.no-webgl #webgl {
  display: none;
}
.webgl-fallback {
  display: none;
}
.no-webgl .webgl-fallback {
  display: block;
  position: fixed;
  top: 50%;
  right: -8vw;
  width: min(60vw, 640px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #7fe3ff 12%, #2f6bff 38%, #8b5cf6 60%, #ff4fa3 80%, #ff9a3c 100%);
  filter: blur(2px) saturate(1.2);
  opacity: 0.55;
  z-index: 0;
}

.no-webgl .orb-overlay {
  display: none;
}

/* Hidden until fonts load and the intro timeline takes over */
.intro-pending .hero__copy,
.intro-pending .hero__stage,
.intro-pending .orb-overlay {
  opacity: 0;
}

main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* Vignette to keep text readable over the 3D scene */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(2, 8, 23, 0.7) 100%);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
