/* =========================================================
   MomentMint — signature motion & atmosphere
   Everything here degrades to static, visible UI when motion
   is reduced or JavaScript is unavailable.
   ========================================================= */

/* ---------- Ambient background ---------- */
.aurora {
  position: absolute;
  inset: -18% -10%;
  z-index: -1;
  pointer-events: none;
  filter: blur(68px);
  opacity: 0.72;
}
.aurora i {
  position: absolute;
  display: block;
  border-radius: 50%;
  will-change: transform;
}
.aurora i:nth-child(1) {
  width: 56vw; height: 56vw; max-width: 720px; max-height: 720px;
  right: -8%; top: -18%;
  background: radial-gradient(circle, rgba(159, 227, 189, 0.75), rgba(159, 227, 189, 0) 68%);
  animation: auroraA 19s var(--ease) infinite alternate;
}
.aurora i:nth-child(2) {
  width: 44vw; height: 44vw; max-width: 560px; max-height: 560px;
  left: -10%; bottom: -22%;
  background: radial-gradient(circle, rgba(215, 240, 122, 0.42), rgba(215, 240, 122, 0) 68%);
  animation: auroraB 23s var(--ease) infinite alternate;
}
.aurora i:nth-child(3) {
  width: 30vw; height: 30vw; max-width: 420px; max-height: 420px;
  right: 26%; bottom: -18%;
  background: radial-gradient(circle, rgba(90, 79, 176, 0.18), rgba(90, 79, 176, 0) 70%);
  animation: auroraC 27s var(--ease) infinite alternate;
}
@keyframes auroraA { to { transform: translate3d(-9%, 8%, 0) scale(1.16); } }
@keyframes auroraB { to { transform: translate3d(12%, -10%, 0) scale(1.1); } }
@keyframes auroraC { to { transform: translate3d(-14%, -6%, 0) scale(1.2); } }

.noise-layer { position: relative; isolation: isolate; }
.noise-layer::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Scroll progress + route flash ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 90;
  height: 2px; width: 100%;
  background: linear-gradient(90deg, var(--mint), var(--brand));
  transform: scaleX(0); transform-origin: 0 50%;
  pointer-events: none;
  transition: transform 90ms linear;
  box-shadow: 0 0 14px rgba(159, 227, 189, 0.6);
}
.route-flash {
  position: fixed; inset: 0 auto auto 0; z-index: 95;
  height: 100%; width: 100%; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, rgba(159, 227, 189, 0.1) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: routeFlash 620ms var(--ease-out) both;
}
@keyframes routeFlash { to { transform: translateX(100%); } }

/* ---------- Editorial headline ---------- */
.title-line { display: block; overflow: hidden; padding: 0 0 0.09em; margin-bottom: -0.09em; }
.title-line > span {
  display: block;
  transform-origin: 0 100%;
  animation: lineRise 1s var(--ease-out) both;
}
.title-line:nth-child(2) > span { animation-delay: 110ms; }
@keyframes lineRise {
  from { opacity: 0; transform: translate3d(0, 112%, 0) rotate(2.5deg); filter: blur(7px); }
  to { opacity: 1; transform: none; filter: none; }
}
.display em { position: relative; white-space: nowrap; }
.display em::after {
  content: ""; position: absolute; left: 2%; right: 2%; bottom: 0.02em; height: 0.1em;
  border-radius: 99px; background: var(--mint); opacity: 0.52;
  transform: scaleX(0); transform-origin: 0 50%;
  animation: underlineGrow 900ms var(--ease-out) 520ms both;
}
@keyframes underlineGrow { to { transform: scaleX(1); } }

.eyebrow .pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }

/* ---------- Scroll reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translate3d(0, 26px, 0) scale(0.985);
  filter: blur(6px);
  transition: opacity 780ms var(--ease-out), transform 780ms var(--ease-out), filter 780ms var(--ease-out);
  transition-delay: calc(var(--d, 0) * 85ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; filter: none; }

/* ---------- Pointer-reactive surfaces ---------- */
.glow-card { position: relative; isolation: isolate; }
.glow-card::before {
  content: ""; position: absolute; inset: -1px; z-index: -1;
  border-radius: inherit; pointer-events: none;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 20%), rgba(159, 227, 189, 0.42), transparent 62%);
  opacity: 0; transition: opacity 360ms var(--ease);
}
.glow-card:hover::before { opacity: 1; }

.btn { isolation: isolate; }
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 28%, rgba(255, 255, 255, 0.22) 50%, transparent 72%);
  transform: translateX(-120%);
  transition: transform 620ms var(--ease-out);
}
.btn:hover::after { transform: translateX(120%); }
.btn-primary::after { background: linear-gradient(105deg, transparent 28%, rgba(215, 240, 122, 0.28) 50%, transparent 72%); }
.btn:active { filter: brightness(0.97); }

/* ---------- Hero clip stack ---------- */
.hero-visual { display: grid; place-items: center; }
.clip-stack { position: relative; perspective: 1200px; width: min(100%, 330px); aspect-ratio: 9 / 16; margin-inline: auto; }
.clip-stack .stack-card {
  position: absolute; inset: 0; border-radius: 30px;
  background: var(--surface); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
  transition: transform 700ms var(--ease-out), opacity 500ms var(--ease-out);
  will-change: transform;
}
.clip-stack .stack-card:nth-child(1) { transform: translate3d(22px, -18px, -60px) rotate(7deg); opacity: 0.7; }
.clip-stack .stack-card:nth-child(2) { transform: translate3d(-20px, 14px, -30px) rotate(-6deg); opacity: 0.85; }
.clip-stack .stack-card:nth-child(3) { transform: none; }
.clip-stack:hover .stack-card:nth-child(1) { transform: translate3d(48px, -38px, -60px) rotate(11deg); }
.clip-stack:hover .stack-card:nth-child(2) { transform: translate3d(-42px, 30px, -30px) rotate(-10deg); }
.clip-stack:hover .stack-card:nth-child(3) { transform: translate3d(0, -6px, 40px) rotate(0.6deg); }
.stack-float { animation: stackFloat 7s var(--ease) infinite alternate; }
@keyframes stackFloat { to { transform: translateY(-10px) rotate(-0.8deg); } }

.phone-glow {
  position: absolute; inset: 12% -6%; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgba(159, 227, 189, 0.5), transparent 66%);
  filter: blur(28px); animation: glowBreath 4.5s var(--ease) infinite alternate;
}
@keyframes glowBreath { to { transform: scale(1.12); opacity: 0.7; } }

/* ---------- Analysis scanner ---------- */
.scanning { position: relative; overflow: hidden; }
.scan-grid {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: linear-gradient(rgba(159, 227, 189, 0.13) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(159, 227, 189, 0.13) 1px, transparent 1px);
  background-size: 28px 28px;
  animation: gridDrift 7s linear infinite;
}
@keyframes gridDrift { to { background-position: 28px 28px; } }
.scan-beam {
  position: absolute; z-index: 2; left: 0; right: 0; top: -38%; height: 38%;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(159, 227, 189, 0.34) 70%, rgba(215, 240, 122, 0.5));
  box-shadow: 0 12px 40px rgba(159, 227, 189, 0.28);
  animation: scanBeam 2.6s var(--ease) infinite;
}
@keyframes scanBeam { to { top: 108%; } }
.scan-ring {
  position: absolute; z-index: 2; width: 120px; height: 120px; margin: auto;
  inset: 0; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(159, 227, 189, 0.6);
  animation: scanRing 2.8s var(--ease-out) infinite;
}
.scan-ring:nth-of-type(2) { animation-delay: 1.4s; }
@keyframes scanRing {
  from { transform: scale(0.35); opacity: 0.9; }
  to { transform: scale(2.6); opacity: 0; }
}
.scan-corner {
  position: absolute; z-index: 3; width: 26px; height: 26px;
  border-color: var(--mint); border-style: solid; opacity: 0.9;
}
.scan-corner.tl { top: 12px; left: 12px; border-width: 2px 0 0 2px; border-radius: 6px 0 0 0; }
.scan-corner.tr { top: 12px; right: 12px; border-width: 2px 2px 0 0; border-radius: 0 6px 0 0; }
.scan-corner.bl { bottom: 12px; left: 12px; border-width: 0 0 2px 2px; border-radius: 0 0 0 6px; }
.scan-corner.br { bottom: 12px; right: 12px; border-width: 0 2px 2px 0; border-radius: 0 0 6px 0; }

.orbital { position: relative; width: 64px; height: 64px; flex: none; }
.orbital i {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(16, 88, 74, 0.18);
  border-top-color: var(--brand);
  animation: orbit 2.4s linear infinite;
}
.orbital i:nth-child(2) { inset: 9px; border-top-color: transparent; border-left-color: var(--brand); animation-duration: 1.7s; animation-direction: reverse; }
.orbital i:nth-child(3) {
  inset: 25px; background: var(--brand); border: 0;
  box-shadow: 0 0 0 5px var(--brand-3); animation: orbitPulse 1.9s var(--ease) infinite;
}
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes orbitPulse { 50% { transform: scale(0.7); opacity: 0.7; } }

/* ---------- Clip cards & previews ---------- */
.clip-grid .clip-card { animation: cardArrive 820ms var(--ease-out) both; }
@keyframes cardArrive {
  from { opacity: 0; transform: translate3d(0, 30px, 0) scale(0.965); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}
.clip-card .video-frame video,
.clip-card .video-poster { transition: transform 900ms var(--ease-out), filter 500ms var(--ease); }
.clip-card:hover .video-frame video,
.clip-card:hover .video-poster { transform: scale(1.045); }
.video-frame::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(120deg, transparent 40%, rgba(255,255,255,0.09) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 900ms var(--ease-out);
}
.clip-card:hover .video-frame::after { transform: translateX(100%); }
.video-play { backdrop-filter: blur(6px); }
.video-frame:hover .video-play { box-shadow: 0 0 0 8px rgba(255,255,255,0.14), 0 12px 34px rgba(0,0,0,0.34); }

/* ---------- Waveform ---------- */
.waveform {
  display: flex; align-items: center; gap: 2px; height: 42px;
  padding: 0 2px; overflow: hidden;
  border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line);
}
.waveform i {
  flex: 1; min-width: 2px; border-radius: 99px;
  background: linear-gradient(180deg, var(--brand), var(--mint));
  opacity: 0.5;
  transform-origin: center;
  animation: waveBreathe 2.8s var(--ease) infinite alternate;
  animation-delay: calc(var(--w, 0) * -70ms);
}
.waveform i.in-window { opacity: 1; }
@keyframes waveBreathe { to { transform: scaleY(0.72); } }
.waveform .wave-playhead {
  position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink);
  box-shadow: 0 0 8px rgba(16, 88, 74, 0.5);
  animation: playhead 6s linear infinite;
}
@keyframes playhead { from { left: 0; } to { left: 100%; } }

/* ---------- Editor finesse ---------- */
.editor-stage .video-frame { animation: editorPop 620ms var(--ease-out) both; }
@keyframes editorPop {
  from { opacity: 0; transform: translateY(18px) scale(0.95) rotateX(5deg); filter: blur(9px); }
  to { opacity: 1; transform: none; filter: none; }
}
.editor-stage::after {
  content: ""; position: absolute; inset: auto -20% -40% -20%; height: 60%;
  background: radial-gradient(ellipse, rgba(159, 227, 189, 0.18), transparent 68%);
  pointer-events: none;
}
.editor-tabs button { position: relative; }
.editor-tabs button::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  border-radius: 99px; background: var(--brand);
  transform: scaleX(0); transition: transform 300ms var(--ease-out);
}
.editor-tabs button[aria-selected="true"]::after { transform: scaleX(1); }
.tab-panel { animation: panelSwap 360ms var(--ease-out) both; }
@keyframes panelSwap { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Modal, toast, progress ---------- */
.modal-backdrop { animation: backdropIn 300ms var(--ease-out) both; }
@keyframes backdropIn { from { opacity: 0; backdrop-filter: blur(0); } to { opacity: 1; backdrop-filter: blur(5px); } }
.modal { animation: modalSpring 460ms var(--ease-out) both; }
@keyframes modalSpring {
  0% { opacity: 0; transform: translateY(22px) scale(0.94); }
  62% { opacity: 1; transform: translateY(-3px) scale(1.008); }
  100% { transform: none; }
}
.toast { animation: toastSpring 460ms var(--ease-out) both; }
@keyframes toastSpring {
  0% { opacity: 0; transform: translateX(28px) scale(0.94); }
  65% { opacity: 1; transform: translateX(-3px) scale(1.005); }
  100% { transform: none; }
}
.progress-fill { box-shadow: 0 0 16px rgba(159, 227, 189, 0.75); }
.progress-pct { transition: transform 300ms var(--ease-out); }
.progress-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.progress-title .orbital { width: 46px; height: 46px; }
.progress-title .orbital i:nth-child(3) { inset: 18px; }
.stage.is-active { box-shadow: inset 3px 0 0 var(--brand); }
.stage.is-active .stage-icon { box-shadow: 0 0 0 5px rgba(159, 227, 189, 0.4); }

/* ---------- Dark spotlight band ---------- */
.spotlight {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0d1a17, #132b23 58%, #0d1a17);
  color: #fff; border-radius: var(--r-xl);
  padding: clamp(30px, 5vw, 58px);
}
.spotlight::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(159, 227, 189, 0.22) 0.8px, transparent 0.8px);
  background-size: 22px 22px; opacity: 0.4;
  mask-image: linear-gradient(90deg, #000, transparent 75%);
}
.spotlight::after {
  content: ""; position: absolute; width: 480px; height: 480px; right: -180px; top: -280px;
  border-radius: 50%; background: radial-gradient(circle, rgba(215, 240, 122, 0.2), transparent 68%);
}
.spotlight h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.9rem, 3.4vw, 2.8rem); position: relative; z-index: 1; }
.spotlight p { color: rgba(255,255,255,0.66); font-size: var(--fs-sm); margin-top: 8px; max-width: 52ch; position: relative; z-index: 1; }
.spotlight-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 30px; position: relative; z-index: 1; }
.spotlight-stat { border-left: 1px solid rgba(159,227,189,0.28); padding-left: 16px; }
.spotlight-stat b { display: block; font-size: 2rem; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; }
.spotlight-stat span { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.12em; color: rgba(159,227,189,0.8); font-weight: 800; }

/* ---------- Count-up ---------- */
[data-count] { font-variant-numeric: tabular-nums; }

/* ---------- Reduced motion: show everything, move nothing ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1 !important; transform: none !important; filter: none !important; }
  .aurora i, .scan-beam, .scan-grid, .scan-ring, .orbital i, .stack-float,
  .phone-glow, .waveform i, .waveform .wave-playhead, .video-frame::after,
  .route-flash, .title-line > span, .display em::after { animation: none !important; }
  .video-frame::after { display: none; }
  .clip-stack .stack-card { transform: none; }
  .clip-stack .stack-card:nth-child(1), .clip-stack .stack-card:nth-child(2) { opacity: 0.35; }
}

@media (max-width: 760px) {
  .aurora { inset: -10% -30%; }
  .spotlight-stats { grid-template-columns: 1fr; gap: 18px; }
  .clip-stack .stack-card:nth-child(1), .clip-stack .stack-card:nth-child(2) { display: none; }
}
