/* 04-atmosphere.css · Page background (nebula, starfield, grid, vignette, grain) and the intro beam
   Part of the Lumen stylesheet, loaded in numeric order (the cascade depends on it). */

/* ══════════ ATMOSPHERE: nebula, starfield, survey grid, vignette, film grain ══════════ */
.atmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.atmos__layer {
  position: absolute;
  inset: -10rem;
  will-change: transform;
}
/* soft light pools: a radial gradient already shaped like a blurred disc (no filter: a 130px blur this size, animated,
   repaints on every frame). The padding gives the glow the room the blur used to spread into. */
.blob {
  position: absolute;
  box-sizing: content-box;
  margin: -16rem;
  padding: 16rem;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(var(--c) / var(--a)) 38%, rgb(var(--c) / calc(var(--a) * .62)) 56%, rgb(var(--c) / calc(var(--a) * .26)) 74%, rgb(var(--c) / calc(var(--a) * .07)) 88%, rgb(var(--c) / 0) 100%);
  animation: nebula 42s ease-in-out infinite alternate;
}
.blob--1 {
  top: 2%;
  left: 4%;
  width: 44rem;
  height: 44rem;
  --c: 37 99 235;
  --a: .2;
}
.blob--2 {
  top: 38%;
  right: 0;
  width: 36rem;
  height: 36rem;
  --c: 14 165 233;
  --a: .13;
  animation-duration: 50s;
}
.blob--3 {
  bottom: 2%;
  left: 24%;
  width: 38rem;
  height: 38rem;
  --c: 251 146 60;
  --a: .07;
  animation-duration: 46s;
}
@keyframes nebula {
  50% { transform: translate3d(4%, -3%, 0) scale(1.06); }
  100% { transform: translate3d(-3%, 2%, 0) scale(.97); }
}
.cosmos {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* Aura's survey grid: tall cells, faded out from the centre */
.atmos__grid {
  position: absolute;
  inset: 0;
  background-size: 96px 192px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .028) 1px, transparent 1px);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 100%);
}
.atmos__dust {
  position: absolute;
  inset: -12rem;
  will-change: transform;
}
.dust {
  position: absolute;
  border-radius: 50%;
  /* the gradient carries the softness (no blur filter) */
  background: radial-gradient(ellipse at 50% 50%, rgba(1, 2, 8, .9) 0%, rgba(1, 2, 8, .7) 30%, rgba(1, 2, 8, .32) 52%, rgba(1, 2, 8, .08) 66%, rgba(1, 2, 8, 0) 76%);
  animation: drift 64s ease-in-out infinite alternate;
}
.dust--1 {
  top: 4%;
  left: -4%;
  width: clamp(26rem, 58vw, 52rem);
  height: clamp(11rem, 24vw, 21rem);
  rotate: -16deg;
}
.dust--2 {
  top: 40%;
  right: -6%;
  width: clamp(24rem, 50vw, 44rem);
  height: clamp(10rem, 20vw, 18rem);
  rotate: 22deg;
  animation-duration: 74s;
}
.dust--3 {
  bottom: 4%;
  left: 12%;
  width: clamp(28rem, 62vw, 58rem);
  height: clamp(10rem, 22vw, 19rem);
  rotate: -5deg;
  animation-duration: 68s;
}
.dust--4 {
  top: 64%;
  left: -8%;
  width: clamp(16rem, 30vw, 27rem);
  height: clamp(8rem, 14vw, 13rem);
  rotate: 12deg;
  animation-duration: 56s;
}
@keyframes drift {
  to { translate: 4% -3%; }
}
.atmos__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(125% 92% at 50% 42%, transparent 40%, rgba(1, 3, 10, .52) 76%, rgba(0, 1, 6, .88) 100%),
    linear-gradient(to bottom, rgba(1, 2, 8, .45), transparent 16%, transparent 82%, rgba(1, 2, 8, .5));
}
.cursor-glow {
  position: absolute;
  left: 0;
  top: 0;
  width: 680px;
  height: 680px;
  margin: -340px 0 0 -340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, .07), rgba(37, 99, 235, .05) 40%, transparent 68%);
  opacity: 0;
  transition: opacity 1s;
  will-change: transform;
}
/* film grain: static and viewport-sized (an animated layer twice the screen recomposited the page on every frame) */
.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ══════════ INTRO (light beam) + TITLE-CARD TRANSITION ══════════ */
.intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  place-items: center;
  background: var(--bg);
}
.js:not(.no-intro) .intro {
  display: grid;
  animation: introFailsafe .01s 4.2s forwards;
}
.intro.is-done {
  opacity: 0;
  transition: opacity .9s var(--ease);
}
.intro__beam {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(56, 189, 248, .9) 35%, #fff 50%, rgba(56, 189, 248, .9) 65%, transparent);
  box-shadow: 0 0 22px 2px rgba(56, 189, 248, .4);
  transform: scaleY(0);
  animation: beam 1.2s var(--ease) .1s forwards;
}
.intro.is-done .intro__beam {
  transform: scaleY(1.4);
  opacity: 0;
  transition: transform 1s var(--ease), opacity .8s;
}
.intro__text {
  position: relative;
  display: grid;
  justify-items: center;
  gap: .6rem;
  padding: 1rem 1.75rem;
  background: var(--bg);
  text-align: center;
  opacity: 0;
  animation: introText 1s var(--ease) .75s forwards;
}
.intro__name {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -.03em;
  color: var(--white);
}
.intro__role {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .32em;
  margin-right: -.32em;
  text-transform: uppercase;
  color: var(--accent);
}
@keyframes beam {
  to { transform: scaleY(1); }
}
@keyframes introText {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
@keyframes introFailsafe {
  to {
    visibility: hidden;
    opacity: 0;
  }
}
/* on exit the name and its dark plate leave first, so the plate never lies over the title as it enters */
.intro.is-done .intro__text { animation: introTextOut .3s var(--ease) forwards; }
@keyframes introTextOut {
  from { opacity: 1; }
  to {
    opacity: 0;
    filter: blur(6px);
  }
}
.curtain {
  position: fixed;
  inset: 0;
  z-index: 150;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.1rem;
  padding-inline: var(--gutter);
  background: radial-gradient(120% 90% at 50% 50%, #0a1430, var(--bg) 70%);
  text-align: center;
}
/* the warp streaks run behind the title card (the curtain is its own stacking context) */
.curtain__warp {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}
.curtain__label, .curtain__title { text-shadow: 0 0 24px rgba(4, 6, 14, .9), 0 0 2px rgba(4, 6, 14, .8); }
.curtain__label {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .32em;
  margin-right: -.32em;
  text-transform: uppercase;
  color: var(--accent);
}
.curtain__title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2rem, 5.5vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -.04em;
  color: var(--white);
}
.curtain__line {
  width: min(22rem, 60vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sky), var(--accent), transparent);
  box-shadow: 0 0 14px rgba(56, 189, 248, .55);
  transform: scaleX(0);
}
