html {
  background: var(--color-bg);
  /* Guard against any stray element pushing document width past the
     viewport. `clip` (where supported) behaves like `hidden` but keeps
     scroll-restoration well-behaved on iOS; `hidden` is the safe
     fallback everywhere else. This masks nothing intentional — any
     real overflow source found during the responsive pass is fixed at
     its origin, not papered over here. */
  overflow-x: hidden;
}

@supports (overflow-x: clip) {
  html {
    overflow-x: clip;
  }
}

body {
  position: relative;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  overflow-x: inherit;
}

main {
  position: relative;
  z-index: var(--z-main);
}

img {
  border-style: none;
}

button {
  font-family: var(--font-mono);
}

a {
  text-decoration: none;
}

/* Global page canvas — one continuous element spanning the full document
   height. Hero and assembly sit transparently on top of it, so there is
   no per-section background to seam at their boundary. */
@keyframes lutPulse {
  0%, 100% { opacity: .4; }
  50% { opacity: 1; }
}
@keyframes lutBloom1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-26px, 28px) scale(1.06); }
}
@keyframes lutBloom2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(32px, -22px) scale(1.05); }
}

.site-bg {
  position: absolute;
  inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
  overflow: hidden;
}

.bg-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bg-atmosphere {
  background:
    radial-gradient(90% 40% at 75% 3%, var(--glow-accent-soft), transparent 60%),
    radial-gradient(70% 30% at 8% 5%, rgba(150, 170, 150, .05), transparent 65%),
    linear-gradient(to bottom, #131318 0%, #0a0a0c 10%, var(--color-bg) 22%, var(--color-bg) 100%);
}

.bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: 34px 34px;
}

.bg-grid--accent {
  background-image:
    linear-gradient(rgba(200, 255, 46, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 255, 46, .05) 1px, transparent 1px);
  background-size: 170px 170px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 20%, transparent 50%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 20%, transparent 50%);
}

.bg-noise {
  mix-blend-mode: overlay;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.bg-vignette {
  box-shadow: inset 0 0 160px rgba(0, 0, 0, .4);
}

.bg-glow {
  position: absolute;
  filter: blur(var(--glow-blur-lg));
  pointer-events: none;
}

/* Glow blobs distributed down the full page height — one shared set
   instead of a separate cluster per section. */
.site-bg__glow--a {
  width: 640px;
  height: 640px;
  right: -6%;
  top: 2%;
  background: radial-gradient(circle, var(--glow-accent), transparent 62%);
  animation: lutBloom1 24s ease-in-out infinite;
}

.site-bg__glow--b {
  width: 600px;
  height: 600px;
  left: -9%;
  top: 21%;
  background: radial-gradient(circle, var(--glow-muted), transparent 64%);
  filter: blur(var(--glow-blur-xl));
  animation: lutBloom2 30s ease-in-out infinite;
}

.site-bg__glow--c {
  width: 520px;
  height: 520px;
  right: -4%;
  top: 55%;
  background: radial-gradient(circle, rgba(200, 255, 46, .08), transparent 60%);
  animation: lutBloom1 26s ease-in-out infinite reverse;
}

/* Global cursor halo — lives above the canvas, below page content,
   never blocks clicks. */
.site-halo {
  position: fixed;
  left: 0;
  top: 0;
  width: 480px;
  height: 480px;
  margin: -240px 0 0 -240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 255, 46, .15), rgba(200, 255, 46, .05) 42%, transparent 68%);
  filter: blur(14px);
  opacity: 0;
  transition: opacity .55s ease;
  mix-blend-mode: plus-lighter;
  pointer-events: none;
  z-index: var(--z-halo);
  will-change: transform;
}

/* Section edge utilities — align an absolutely-positioned element to the
   same content edge as the centered .hero__container/.assembly__container
   (max-width container + section padding) without needing a wrapper.
   Use on children of any full-width, position:relative section. */
.section-edge-left {
  left: max(var(--section-padding), calc((100% - var(--container-max)) / 2 + var(--section-padding)));
}

.section-edge-right {
  right: max(var(--section-padding), calc((100% - var(--container-max)) / 2 + var(--section-padding)));
}

/* Scroll reveal — lightweight, reusable across sections. Applied via
   IntersectionObserver in main.js (see initReveal). */
.reveal,
.reveal-up {
  opacity: 0;
}

.reveal-up {
  transform: translateY(26px);
  filter: blur(4px);
}

.reveal {
  transition: opacity .8s var(--ease-rise);
}

.reveal-up {
  transition: opacity .8s var(--ease-rise), transform .8s var(--ease-rise), filter .8s var(--ease-rise);
}

.reveal.is-revealed,
.reveal-up.is-revealed {
  opacity: 1;
  transform: none;
  filter: none;
}

.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-up {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}

/* Branded native scrollbar — no JS scrollbar, just the two standard
   styling hooks. Firefox reads scrollbar-color/-width; Chromium/Safari
   read the ::-webkit-scrollbar rules. macOS may still hide it at rest
   per the user's system setting and only reveal it on scroll — that's
   expected, not a bug. */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 255, 46, .35) #08080a;
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: #08080a;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(200, 255, 46, .35);
  border-radius: 8px;
  border: 2px solid #08080a;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(200, 255, 46, .75);
}
