/* ============================================================
   Dant Upchaar — Motion: reveals, rotator, aurora, marquee.
   Premium, purposeful, reduced-motion honoured.
   All reveal-hiding is gated on html.js so no-JS users and
   crawlers always see full content.
   ============================================================ */

/* ---------- Scroll reveals ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity var(--t-enter) var(--ease-out),
              transform var(--t-enter) var(--ease-out);
}
html.js .reveal.visible { opacity: 1; transform: none; }

/* Stagger helpers (apply to siblings) */
html.js .reveal.d1 { transition-delay: 60ms; }
html.js .reveal.d2 { transition-delay: 120ms; }
html.js .reveal.d3 { transition-delay: 180ms; }
html.js .reveal.d4 { transition-delay: 240ms; }
html.js .reveal.d5 { transition-delay: 300ms; }

/* ---------- Hero entrance (pure CSS — runs with zero JS, ends visible) ---------- */
@keyframes du-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
.anim-up { animation: du-rise var(--t-enter) var(--ease-out) both; }
.anim-up.ad1 { animation-delay: 80ms; }
.anim-up.ad2 { animation-delay: 160ms; }
.anim-up.ad3 { animation-delay: 240ms; }
.anim-up.ad4 { animation-delay: 320ms; }

/* ---------- Phrase rotator — same-cell inline-grid stack ---------- */
.rotator {
  display: inline-grid;
  text-wrap: initial; /* don't inherit balance into the stack */
}
.rotator .phrase {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(0.35em);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
  will-change: opacity, transform;
}
.rotator .phrase.is-active { opacity: 1; transform: none; }
.rotator .phrase.is-exiting { opacity: 0; transform: translateY(-0.35em); }
/* No-JS: the first phrase stays visible */
html:not(.js) .rotator .phrase:first-child { opacity: 1; transform: none; }

/* ---------- Aurora backdrop (decoration only, contained) ---------- */
.aurora-host { position: relative; overflow: clip; }
.aurora {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.9;
}
.aurora .a1 {
  width: 46vw; height: 46vw;
  min-width: 340px; min-height: 340px;
  max-width: 720px; max-height: 720px;
  left: -8%; top: -18%;
  background: radial-gradient(circle at 35% 35%, var(--glow-a), transparent 65%);
  animation: aurora-drift-a 26s ease-in-out infinite alternate;
}
.aurora .a2 {
  width: 40vw; height: 40vw;
  min-width: 300px; min-height: 300px;
  max-width: 640px; max-height: 640px;
  right: -10%; top: 4%;
  background: radial-gradient(circle at 60% 40%, var(--glow-b), transparent 65%);
  animation: aurora-drift-b 32s ease-in-out infinite alternate;
}
@keyframes aurora-drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6vw, 5vh, 0) scale(1.12); }
}
@keyframes aurora-drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to   { transform: translate3d(-5vw, 7vh, 0) scale(0.96); }
}
.aurora-host > .container { position: relative; z-index: 1; }

/* Fine dotted lattice behind heroes — ultra subtle texture */
.lattice::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(currentColor 1px, transparent 1px);
  background-size: 26px 26px;
  color: var(--text-2);
  opacity: 0.08;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 35%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 35%, #000 0%, transparent 72%);
}

/* ---------- Marquee (value strip) ---------- */
.marquee {
  overflow: clip;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  gap: var(--s7);
  width: max-content;
  padding-block: var(--s2);
  animation: marquee-roll 34s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee-roll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
}
.marquee-item svg { width: 16px; height: 16px; color: var(--accent-text); }

/* ---------- Border beam: a light travelling around the frame ----------
   A conic arc rotates behind a ring mask drawn just inside the element's
   edge, so it works with overflow:clip hosts. Needs @property for smooth
   rotation; without it (or with reduced motion) the arc simply holds a
   gentle static highlight — never broken, never distracting. */
@property --beam-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.spotlight::after,
.cta-band::after,
.estimator::after,
.showcase::after,
.hero-kicker::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--beam-angle, 0deg),
      transparent 0deg,
      transparent 290deg,
      rgba(0, 184, 217, 0.0) 300deg,
      var(--beam-a) 330deg,
      var(--beam-b) 344deg,
      var(--beam-a) 352deg,
      transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
  animation: beam-spin 7s linear infinite;
}
.hero-kicker { position: relative; }
.hero-kicker::after { animation-duration: 4.5s; }
.cta-band::after { padding: 2px; animation-duration: 9s; }
.estimator { position: relative; }
@keyframes beam-spin {
  to { --beam-angle: 360deg; }
}

/* ---------- Gradient hairline divider ---------- */
.hairline {
  height: 1px;
  border: 0;
  margin: 0;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ---------- Reduced motion: show final states ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal,
  html.js .reveal.d1, html.js .reveal.d2, html.js .reveal.d3,
  html.js .reveal.d4, html.js .reveal.d5 {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .anim-up { animation: none !important; opacity: 1 !important; transform: none !important; }
  .aurora span, .marquee-track { animation: none !important; }
  .spotlight::after, .cta-band::after, .estimator::after,
  .showcase::after, .hero-kicker::after { animation: none !important; }
  .rotator .phrase { transition: none !important; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
