/* mirentia — native motion. No JS frameworks. */

/* ---- Reveal on scroll (fallback-safe via .is-visible) ---- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Hero stagger on load ---- */
.hero-stagger > * {
  opacity: 0;
  transform: translateY(14px);
  animation: hero-enter 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-stagger > *:nth-child(1) { animation-delay: 60ms; }
.hero-stagger > *:nth-child(2) { animation-delay: 160ms; }
.hero-stagger > *:nth-child(3) { animation-delay: 260ms; }
.hero-stagger > *:nth-child(4) { animation-delay: 360ms; }
.hero-stagger > *:nth-child(5) { animation-delay: 460ms; }

@keyframes hero-enter {
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Cross-document view transitions (Chromium only; degrades gracefully) ---- */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 320ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Reduced motion: kill switch ---- */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .hero-stagger > * {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

/* ---- Custom cursor (gold dot, mix-blend-mode for visibility on any bg) ---- */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  background: var(--gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transform: translate3d(-50%, -50%, 0);
  opacity: 0;
  transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
  will-change: transform;
}
.cursor-dot.is-visible { opacity: 1; }
.cursor-dot.is-hover {
  width: 36px;
  height: 36px;
}
@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cursor-dot { display: none; }
}

/* ---- Word-by-word reveal ---- */
.word-stagger .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(50%);
  animation: word-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  margin-right: 0.18em;
}
.word-stagger .word:last-child { margin-right: 0; }
.word-stagger .word--accent { color: var(--gold); }
@keyframes word-up {
  to { opacity: 1; transform: translateY(0); }
}
/* .hero-stagger > .word-stagger sits as first item and inherits .hero-stagger > * { opacity: 0 }.
   Override without important flag — selector specificity (0,2,0) beats .hero-stagger > * (0,1,0). */
.hero-stagger > .word-stagger {
  opacity: 1;
  transform: none;
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .word-stagger .word {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

/* ---- Brand wipe-in (clip-path reveal) ---- */
.brand-wipe {
  clip-path: inset(0 100% 0 0);
  animation: brand-wipe 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}
@keyframes brand-wipe {
  to { clip-path: inset(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-wipe {
    clip-path: none !important;
    animation: none !important;
  }
}

/* ---- Live pulse indicator on brand dot ---- */
.live-pulse {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  margin-left: 2px;
}
.live-pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--gold);
  animation: live-ring 1.8s ease-out infinite;
  z-index: -1;
}
@keyframes live-ring {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.8); opacity: 0; }
}
@keyframes live-core {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.live-pulse { animation: live-core 1.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .live-pulse, .live-pulse::after { animation: none !important; }
}

/* ---- Marquee (horizontal infinite scroll) ---- */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--bg-input);
  border-bottom: 1px solid var(--bg-input);
  padding: 18px 0;
  background: var(--bg-elev);
  position: relative;
}
.marquee::before,
.marquee::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(to right, var(--bg-elev), transparent); }
.marquee::after { right: 0; background: linear-gradient(to left, var(--bg-elev), transparent); }
.marquee-track {
  display: inline-flex;
  gap: 40px;
  animation: marquee-scroll 38s linear infinite;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
}
.marquee-track .dot-sep { color: var(--gold); }
.marquee-track .highlight { color: var(--gold); }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none !important; }
}

/* ---- Scroll progress bar ---- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
  z-index: 9999;
  pointer-events: none;
}

/* ---- Magnetic CTA pull ---- */
.cta.magnetic {
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* ---- FAQ accordion height animation ---- */
.faq-item details {
  overflow: hidden;
}
.faq-answer {
  overflow: hidden;
  transition: max-height 0.25s ease-out, opacity 0.2s ease;
  max-height: 0;
  opacity: 0;
  padding-top: 0;
}
.faq-item details[open] .faq-answer {
  max-height: 600px;
  opacity: 1;
  padding-top: 0;
}
@media (prefers-reduced-motion: reduce) {
  .faq-answer { transition: none; }
}

/* ---- Section fade-up ---- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.section-fade-up {
  opacity: 0;
  animation: fade-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@media (prefers-reduced-motion: reduce) {
  .section-fade-up { opacity: 1; animation: none; }
}