/*
 * 962 News — opening loader: the logo is put together piece by piece (the same animation as the app).
 * "96" rises in, the globe spins into its place, the gold "2" drops in, the arrow draws itself,
 * the name fades in; then the loader lifts away once the page is ready (nw-loader.js).
 */
#nw-loader {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  background: #ffffff;
  transition: opacity 0.38s cubic-bezier(0.55, 0, 1, 0.45);
}
html[data-nw-theme="dark"] #nw-loader { background: #081329; }

#nw-loader .nwl-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.38s cubic-bezier(0.55, 0, 1, 0.45);
}
#nw-loader.is-out { opacity: 0; pointer-events: none; }
#nw-loader.is-out .nwl-stage { transform: scale(1.12); }

/* The logo: four pieces of the same size, stacked */
#nw-loader .nwl-logo {
  position: relative;
  width: min(62vw, 320px);
  aspect-ratio: 1400 / 915;
  direction: ltr;
}
#nw-loader .nwl-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
#nw-loader .nwl-logo img.nwl-dark { display: none; }
html[data-nw-theme="dark"] #nw-loader .nwl-logo img.nwl-dark { display: block; }
html[data-nw-theme="dark"] #nw-loader .nwl-logo img.nwl-day { display: none; }

/* 96: rises in */
#nw-loader .nwl-body {
  opacity: 0;
  animation: nwl-rise 0.52s cubic-bezier(0.33, 1, 0.68, 1) 0.12s forwards;
}
@keyframes nwl-rise {
  from { opacity: 0; transform: translateY(18%) scale(0.9); }
  to { opacity: 1; transform: none; }
}

/* the globe: spins into the hole of the 9 */
#nw-loader .nwl-globe {
  opacity: 0;
  transform-origin: 20.72% 32.18%;
  animation: nwl-spin 0.62s cubic-bezier(0.34, 1.56, 0.64, 1) 0.38s forwards;
}
@keyframes nwl-spin {
  from { opacity: 0; transform: rotate(-200deg) scale(0.2); }
  to { opacity: 1; transform: none; }
}

/* the gold 2: drops in with a little bounce */
#nw-loader .nwl-two {
  opacity: 0;
  animation: nwl-drop 0.7s cubic-bezier(0.34, 1.45, 0.64, 1) 0.54s forwards;
}
@keyframes nwl-drop {
  0% { opacity: 0; transform: translateY(-55%); }
  30% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}

/* the arrow: draws itself from left to right */
#nw-loader .nwl-arrow {
  clip-path: inset(0 100% 0 0);
  animation: nwl-wipe 0.48s cubic-bezier(0.65, 0, 0.35, 1) 0.94s forwards;
}
@keyframes nwl-wipe {
  to { clip-path: inset(0 0 0 0); }
}

/* the name */
#nw-loader .nwl-name {
  margin-top: 22px;
  font: 800 22px/1.6 "Noto Kufi Arabic", "IBM Plex Sans Arabic", system-ui, sans-serif;
  color: #0e1a2f;
  opacity: 0;
  animation: nwl-name 0.38s cubic-bezier(0.33, 1, 0.68, 1) 1.22s forwards;
}
html[data-nw-theme="dark"] #nw-loader .nwl-name { color: #f2f5fb; }
@keyframes nwl-name {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* People who asked for less motion: the whole logo at once */
@media (prefers-reduced-motion: reduce) {
  #nw-loader .nwl-logo img, #nw-loader .nwl-name { animation: none !important; opacity: 1 !important; transform: none !important; clip-path: none !important; }
}
