/* ── Hop cinematic Earth transition ────────────────────────────────────────
   Every selector is namespaced with #earth-transition-overlay or .et- so the
   rest of the site is untouched. The overlay is display:none until a Hop
   actually starts; when idle it costs nothing and intercepts nothing.

   The clouds are NOT in this file. They are volumetric camera-facing billboards
   rendered in the 3D scene (cloud-field.js), so they have real depth, parallax
   and perspective. What lives here is the dark sky behind the canvas, the grain
   that hides gradient banding, and the CSS cover used when WebGL or motion is
   unavailable. */

:root {
  --et-curtain: url('/assets/img/earth-transition/cloud-deck.c68f60c0.webp');
  --et-curtain-soft: url('/assets/img/earth-transition/cloud-deck-soft.fe186f9e.webp');
}

#earth-transition-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 9000;
  display: none;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
  isolation: isolate;
  contain: strict;
}

#earth-transition-overlay.is-active {
  display: block;
  pointer-events: auto;
  touch-action: none;
}

/* the page underneath must not scroll while the transition is up */
html.et-lock,
html.et-lock body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

/* Dark sky. Transparent during the departure so the live page still shows
   through the gaps between puffs; it only comes up once the cloud bank is dense,
   which is what replaces the page without a visible cut. */
#earth-transition-overlay .et-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0;
  will-change: opacity;
  background: radial-gradient(120% 90% at 50% 44%, #0b1626 0%, #060a12 48%, #02040a 100%);
}

/* Fine noise: 8-bit radial gradients band into concentric rings on large dark
   areas, and the grain hides it. Sits under the canvas, never over the globe. */
#earth-transition-overlay .et-grain {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  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='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* No WebGL, or reduced motion: a soft opaque cover so the page is still hidden
   while the hop resolves. Never used on the volumetric path. */
#earth-transition-overlay .et-fallback {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(120% 95% at 40% 22%, #e8eff7 0%, #c9d6e5 42%, #93a7bc 100%);
}

#earth-transition-overlay .et-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#earth-transition-overlay .et-vignette {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(115% 100% at 50% 50%, rgba(0, 0, 0, 0) 55%, rgba(6, 11, 20, 0.42) 100%);
  will-change: opacity;
}

/* Arrival cover: rendered by shell.php on /hop when a transition hands the
   frame over from /explore and the navigation fell back to a full page load.
   It must match the dark hold frame the globe ends on — a light cover here reads
   as a white flash between the flight and the panorama. */
.et-arrive {
  position: fixed;
  inset: 0;
  z-index: 9001;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 44%, #0b1626 0%, #060a12 48%, #02040a 100%);
}

.et-arrive-layer {
  position: absolute;
  inset: -12%;
  background-image: var(--et-curtain-soft);
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: auto 128%;
  opacity: .92;
  /* The curtain art is a daylight cloud deck; the hold frame is night-side
     cloud, so it is dimmed into the same register instead of glowing white. */
  filter: brightness(.34) saturate(.85);
  transition: opacity .62s ease;
}

.et-arrive-front {
  background-image: var(--et-curtain);
  background-size: auto 188%;
  filter: brightness(.26) saturate(.9);
}

.et-arrive.is-out .et-arrive-layer {
  opacity: 0;
}
