/* ==================================================================
   .ns-liquid
   ================================================================== */

.ns-liquid {
  --ns-cream: #f3ead8;
  --ns-paper: #faf4e8;
  --ns-blush: #ecc7c0;
  --ns-coral: #f6c8c3;
  --ns-coral-deep: #e9a89f;
  --ns-gold: #c9a35b;
  --ns-clay: #b6917a;
  --ns-olive: #6e7a68;
  --ns-ink: #f3ead8;
  --ns-ink-soft: rgba(243, 234, 216, 0.7);
  --ns-ink-muted: rgba(243, 234, 216, 0.46);
  --ns-line: rgba(243, 234, 216, 0.12);
  --ns-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --step-progress: 0;
  --final-progress: 0;

  position: relative;
  /* 1400vh: the camera now travels ~150 units of z (vs the original
     60), divided into 7 segments of roughly equal length. Each segment
     gets ~1.4 viewport-heights of scroll which mirrors the pacing of
     the original main-orb → decision-orb dive — a long glide through
     cosmos, then a beat to read the orb at the end of each segment. */
  height: 1400vh;
  isolation: isolate;
  background:
    radial-gradient(ellipse 60vw 50vh at 18% 14%, rgba(220, 220, 230, 0.08), transparent 65%),
    radial-gradient(ellipse 55vw 45vh at 86% 22%, rgba(180, 180, 195, 0.06), transparent 64%),
    linear-gradient(180deg, #18191c 0%, #14151a 55%, #0e0f12 100%);
  /* Explicit solid colour so the adaptive header probe (which reads
     getComputedStyle().backgroundColor — not gradients) treats this
     section as dark. */
  background-color: #14151a;
  color: var(--ns-ink);
}

.ns-liquid__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Stage canvas ---------- */

.ns-liquid__stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ---------- Head ---------- */

.ns-liquid__head {
  position: absolute;
  z-index: 5;
  left: clamp(1.4rem, 5vw, 4rem);
  right: clamp(1.4rem, 5vw, 4rem);
  top: clamp(1.6rem, 4vh, 3rem);
  pointer-events: none;
  transition: opacity 0.6s var(--ns-ease), transform 0.6s var(--ns-ease);
}

.ns-liquid[data-phase="final"] .ns-liquid__head {
  opacity: 0.32;
}

.ns-liquid__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 0.9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ns-clay);
}

.ns-liquid__eyebrow em { font-style: normal; opacity: 0.45; }

.ns-liquid__eyebrow-rule {
  width: 2.2rem;
  height: 1px;
  background: currentColor;
}

.ns-liquid__title {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(1.8rem, 3.4vw, 3.2rem);
  line-height: 0.98;
  letter-spacing: -0.022em;
  font-weight: 500;
  color: var(--ns-ink);
}

.ns-liquid__title em {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: var(--ns-coral-deep);
}

/* ==================================================================
   Floating panes — leak + AI fix together, no card look, real 3D
   ================================================================== */

.ns-liquid__panes,
.ns-liquid__halo {
  display: none !important;
}

/* ==================================================================
   Halo — Human Decision wrapping around the sphere
   ================================================================== */

.ns-liquid__halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(70vh, 70vmin);
  aspect-ratio: 1;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.7s var(--ns-ease);
  overflow: visible;
}

.ns-liquid__halo-text {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 22px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  fill: rgba(42, 39, 36, 0.78);
}

.ns-liquid.is-revealing .ns-liquid__halo {
  opacity: 1;
  animation: ns-halo-spin 42s linear infinite;
}

@keyframes ns-halo-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ==================================================================
   Progress rail
   ================================================================== */

.ns-liquid__rail {
  position: absolute;
  z-index: 5;
  left: clamp(1.4rem, 5vw, 4rem);
  right: clamp(1.4rem, 5vw, 4rem);
  bottom: clamp(1.6rem, 3.5vh, 2.5rem);
  pointer-events: none;
  transition: opacity 0.4s var(--ns-ease);
}

.ns-liquid[data-phase="final"] .ns-liquid__rail { opacity: 0.3; }

.ns-liquid__rail-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0 0 0.7rem;
  padding: 0;
}

.ns-liquid__rail-steps li {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-right: 0.6rem;
  border-left: 1px solid rgba(42, 39, 36, 0.1);
  padding-left: 0.6rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ns-ink-muted);
  transition: color 0.4s var(--ns-ease);
}

.ns-liquid__rail-steps li:first-child {
  border-left: 0;
  padding-left: 0;
}

.ns-liquid__rail-steps li.is-active { color: var(--ns-ink); }

.ns-liquid__rail-steps i {
  font-style: normal;
  font-size: 0.6rem;
  color: var(--ns-clay);
  transition: color 0.4s var(--ns-ease);
}

.ns-liquid__rail-steps li.is-active i { color: var(--ns-coral-deep); }

.ns-liquid__rail-track {
  position: relative;
  height: 2px;
  background: rgba(42, 39, 36, 0.1);
  overflow: hidden;
}

.ns-liquid__rail-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--step-progress) * 100%);
  background: linear-gradient(90deg, var(--ns-coral-deep), var(--ns-gold));
  transition: width 0.45s var(--ns-ease);
}

/* ==================================================================
   Responsive
   ================================================================== */

/* Mobile uses the same 480vh sticky-pin choreography as desktop, by
   intent — the user wants the AI Automation Brain to behave identically
   on every viewport. The desktop rules above already render fluidly on
   small viewports because the title font-size, head padding, and stage
   inset all use clamp/vw units. Do not add a mobile breakpoint here. */

@media (prefers-reduced-motion: reduce) {
  .ns-liquid__pane {
    transition: opacity 0.2s linear;
  }
  .ns-liquid__halo {
    animation: none !important;
  }
}
