/* NouwaCore section horizon — styles for assets/js/section-surge.js.
   Everything is gated by html.nc-surge-on (added only when the script runs, never under reduced motion),
   so without it every dark section renders as before.
   The horizon is an ellipse whose top touches the section's top edge: wide-but-curved on arrival
   (--_rx ≈ 95vw), nearly flat by the time it lands (≈ 700vw); squared so the curve lingers early. */
.nc-surge-on .nc-surge {
  --enter: 1;
  --_open: calc(1 - var(--enter));
  --_rx: calc(max(95vw, 80vh) + var(--enter) * var(--enter) * 600vw);   /* never sharper than a wide arc on phones */
  --_ry: 130vh;
}
.nc-surge-on footer.nc-surge { position: relative; isolation: isolate; }

.nc-surge-on .nc-surge:not(.is-open) {
  clip-path: ellipse(var(--_rx) var(--_ry) at 50% var(--_ry));
}
/* content lifts out of the dark: only while arriving (a transform would trap fixed dialogs once open) */
.nc-surge-on .nc-surge:not(.is-open) > .ui-wrap {
  transform: translate3d(0, calc(var(--_open) * 80px), 0);
  opacity: calc(1 - max(0, var(--_open) - 0.3) * 1.1);
}
.nc-surge-on .nc-surge:not(.is-open) > .ui-wrap > :first-child {
  filter: blur(calc(max(0, var(--_open) - 0.45) * 18px));        /* sharp before it reaches mid-screen */
}

.nc-surge__fx { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.nc-surge__fx > * { position: absolute; pointer-events: none; }

/* the atmosphere along the horizon: a fine bright limb and a deep red glow beneath it */
.nc-surge__limb {
  left: 50%; top: 0;
  width: calc(var(--_rx) * 2); height: calc(var(--_ry) * 2);
  transform: translateX(-50%);
  border-radius: 50%;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 170, 176, 0.9),
    inset 0 10px 24px -6px rgba(255, 90, 102, 0.55),
    inset 0 60px 120px -30px rgba(161, 13, 24, 0.32);
  opacity: calc(var(--_open) * 1.6);
}
/* a soft light pool that sinks into the section as it arrives */
.nc-surge__haze {
  left: 0; right: 0; top: 0; height: 90vh;
  background: radial-gradient(60% 60% at 50% 0%, rgba(161, 13, 24, 0.22), rgba(161, 13, 24, 0.06) 45%, transparent 75%);
  transform: translate3d(0, calc(var(--_open) * -30vh), 0);
  opacity: calc(var(--_open) * 1.4);
}
/* the landing: one line of light drawn across the top edge, centre outwards */
.nc-surge__line {
  left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(161, 13, 24, 0.7) 22%, #FFD3D7 50%, rgba(161, 13, 24, 0.7) 78%, transparent);
  box-shadow: 0 0 18px 1px rgba(161, 13, 24, 0.6);
  transform: scaleX(0);
  opacity: 0;
}
.nc-surge.is-arrive .nc-surge__line { animation: nc-horizon-line 2100ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes nc-horizon-line {
  0%   { transform: scaleX(0); opacity: 0; }
  12%  { opacity: 1; }
  55%  { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* the exit: the bottom edge bends into a falling horizon as it rises; mirror of the arrival */
.nc-surge-on .nc-surge.is-open.is-leaving {
  --_lx: calc(max(95vw, 80vh) + (1 - var(--leave)) * (1 - var(--leave)) * 600vw);
  clip-path: ellipse(var(--_lx) var(--_ry) at 50% calc(100% - var(--_ry)));
}
.nc-surge__low {
  left: 50%; bottom: 0;
  width: calc(var(--_lx, 700vw) * 2); height: calc(var(--_ry) * 2);
  transform: translateX(-50%);
  border-radius: 50%;
  box-shadow:
    inset 0 -1px 0 0 rgba(255, 170, 176, 0.85),
    inset 0 -10px 24px -6px rgba(255, 90, 102, 0.45),
    inset 0 -60px 120px -30px rgba(161, 13, 24, 0.26);
  opacity: 0;
}
.nc-surge.is-open.is-leaving .nc-surge__low { opacity: calc(var(--leave) * 2.2); }

@media (prefers-reduced-motion: reduce) {
  .nc-surge__fx { display: none; }
  .nc-surge-on .nc-surge { clip-path: none !important; }
}
