/* =====================================================================
   Nexa Aurora motion layer (shared by the landing page and Studio).
   Built for phones: no CSS blur filters, only transform + opacity
   animations, which run on the GPU compositor.
   ===================================================================== */

.aurora { contain: strict; --sy: 0; --mx: 50vw; --my: 30vh; --spot: 0; }

/* Soft light pools: the softness is baked into the gradient instead of a costly blur */
.aurora i { filter: none !important; transform: translate3d(0, 0, 0); backface-visibility: hidden; }
.aurora .a1 { background: radial-gradient(closest-side, rgba(30,220,135,.7), rgba(30,220,135,.3) 40%, rgba(30,220,135,.08) 70%, transparent) !important; opacity: calc(.75 - var(--sy) * .35) !important; }
.aurora .a2 { background: radial-gradient(closest-side, rgba(85,242,184,.6), rgba(85,242,184,.25) 42%, rgba(85,242,184,.07) 70%, transparent) !important; opacity: calc(.5 + var(--sy) * .25) !important; }
.aurora .a3 { background: radial-gradient(closest-side, rgba(115,85,215,.5), rgba(115,85,215,.2) 42%, rgba(115,85,215,.05) 70%, transparent) !important; opacity: calc(.3 + var(--sy) * .4) !important; }
.aurora .a4 { background: radial-gradient(closest-side, rgba(25,158,158,.6), rgba(25,158,158,.24) 42%, rgba(25,158,158,.07) 70%, transparent) !important; opacity: .45 !important; }

/* Northern-light curtains: bands of colour with fine light rays, swaying slowly */
.aurora .ribbon {
  position: absolute; left: -25vw; width: 150vw; height: 46vh; top: -6vh;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.055) 0 2px, transparent 2px 15px),
    linear-gradient(90deg, transparent 4%, rgba(30,220,135,.5) 26%, rgba(85,242,184,.5) 52%, rgba(115,85,215,.3) 78%, transparent 94%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 38%, #000 52%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 38%, #000 52%, transparent);
  transform-origin: 50% 0;
  will-change: transform, opacity;
  animation: curtain 19s ease-in-out infinite alternate, breathe 7s ease-in-out infinite;
  mix-blend-mode: screen;
}
.aurora .ribbon.r2 {
  top: 4vh; height: 38vh; opacity: .7;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.045) 0 1px, transparent 1px 11px),
    linear-gradient(90deg, transparent 8%, rgba(25,158,158,.45) 30%, rgba(30,220,135,.45) 58%, transparent 90%);
  animation: curtain2 24s ease-in-out infinite alternate, breathe 9s ease-in-out -3s infinite;
}
.aurora .ribbon.r3 {
  top: auto; bottom: -10vh; height: 34vh; opacity: .45;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 2px, transparent 2px 18px),
    linear-gradient(90deg, transparent 10%, rgba(115,85,215,.32) 40%, rgba(30,220,135,.35) 70%, transparent 95%);
  transform-origin: 50% 100%;
  animation: curtain3 27s ease-in-out infinite alternate, breathe 11s ease-in-out -5s infinite;
}
@keyframes curtain {
  0%   { transform: translate3d(-6vw, 0, 0) rotate(-9deg) skewX(-14deg) scaleY(.9); }
  50%  { transform: translate3d(3vw, 2vh, 0) rotate(-4deg) skewX(8deg) scaleY(1.15); }
  100% { transform: translate3d(8vw, -1vh, 0) rotate(-11deg) skewX(-6deg) scaleY(1); }
}
@keyframes curtain2 {
  0%   { transform: translate3d(8vw, 0, 0) rotate(6deg) skewX(12deg) scaleY(1); }
  100% { transform: translate3d(-8vw, 3vh, 0) rotate(2deg) skewX(-10deg) scaleY(1.25); }
}
@keyframes curtain3 {
  0%   { transform: translate3d(-4vw, 0, 0) rotate(4deg) skewX(-10deg) scaleY(1.1); }
  100% { transform: translate3d(6vw, -2vh, 0) rotate(-3deg) skewX(10deg) scaleY(.85); }
}
@keyframes breathe { 0%, 100% { opacity: var(--ro, .85); } 50% { opacity: calc(var(--ro, .85) * .45); } }
.aurora .ribbon { --ro: .85; } .aurora .ribbon.r2 { --ro: .7; } .aurora .ribbon.r3 { --ro: .45; }

/* Scroll moves the curtains a little (parallax), so each section feels different */
.aurora .ribbons { position: absolute; inset: 0; transform: translate3d(0, calc(var(--sy) * -12vh), 0); will-change: transform; }

/* Cursor light on computers */
.aurora .spot { position: absolute; width: 46vmax; height: 46vmax; left: 0; top: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(85,242,184,.22), rgba(30,220,135,.08) 55%, transparent);
  transform: translate3d(calc(var(--mx) - 23vmax), calc(var(--my) - 23vmax), 0); opacity: var(--spot); transition: opacity .6s; mix-blend-mode: screen; will-change: transform; }

/* Light themes (Studio light mode) */
:root[data-theme="light"] .aurora .ribbon { mix-blend-mode: multiply; --ro: .32; }
:root[data-theme="light"] .aurora .ribbon.r2 { --ro: .26; }
:root[data-theme="light"] .aurora .ribbon.r3 { --ro: .2; }
:root[data-theme="light"] .aurora .ribbon { background-blend-mode: normal; }
:root[data-theme="light"] .aurora .spot { mix-blend-mode: multiply; opacity: calc(var(--spot) * .5); }

/* Phones: fewer layers, no blend modes, same feel */
@media (max-width: 820px), (pointer: coarse) {
  .aurora .a4, .aurora .ribbon.r3, .aurora .spot { display: none; }
  .aurora .ribbon, .aurora .spot { mix-blend-mode: normal; }
  .aurora .ribbon { height: 40vh; --ro: .75; }
  .aurora .ribbon.r2 { --ro: .55; }
  .aurora .grain { display: none; }
}

/* Paused when the page is not visible, and off for people who prefer less motion */
.aurora.paused i, .aurora.paused .ribbon { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .aurora i, .aurora .ribbon { animation: none !important; }
  .aurora .ribbons { transform: none; }
}

/* The older blurred glows are replaced by the curtains on phones */
@media (max-width: 820px), (pointer: coarse) {
  .chat-view::before, .final::before { display: none !important; }
}

/* WebGL aurora: when it runs, it replaces the CSS layers */
.aurora-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.aurora.gl > i, .aurora.gl .ribbons, .aurora.gl .spot, .aurora.gl .grain { display: none !important; }
.aurora.gl ~ .app .chat-view::before, .aurora.gl ~ main .final::before { display: none !important; }
