/* ============================================================
   REGNA VITA STUDIOS — Animations
   Phase 1: CSS Keyframes & Transition Utilities
   (Scroll-triggered IntersectionObserver classes — Phase 3)
   ============================================================ */

/* ---- @keyframes ---- */

/* Pulsing green dot in status badge */
@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.7);
  }
}

/* Ambient gold glow behind hero app icon */
@keyframes glow-breathe {
  from {
    opacity: 0.5;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1.08);
  }
}

/* Periodic shimmer on "In Dev" gold badge */
@keyframes badge-shimmer {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(201, 168, 76, 0);
  }
  45% {
    box-shadow: 0 0 0 0 rgba(201, 168, 76, 0);
  }
  55% {
    box-shadow: 0 0 14px 4px rgba(201, 168, 76, 0.45);
  }
  65% {
    box-shadow: 0 0 0 0 rgba(201, 168, 76, 0);
  }
}

/* Fade-up entrance — triggered by IntersectionObserver (Phase 3 JS) */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Scroll-reveal utility classes ----
   Phase 3's IntersectionObserver will add .is-visible to these elements.
   Defined here so Phase 3 only needs JS — no CSS changes required.
   Elements without Phase 3 JS are still visible (no opacity:0 by default). */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 550ms ease, transform 550ms ease;
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for sibling reveal elements */
.reveal:nth-child(1) { transition-delay:   0ms; }
.reveal:nth-child(2) { transition-delay:  80ms; }
.reveal:nth-child(3) { transition-delay: 160ms; }
.reveal:nth-child(4) { transition-delay: 240ms; }

/* ---- Hover micro-transitions (augments styles.css transitions) ---- */

/* Scale-up on interactive elements */
.hover-lift {
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.hover-lift:hover {
  transform: translateY(-3px);
}

/* ============================================================
   Phase 3 Additions
   ============================================================ */

/* ---- Hero Entrance Animation ----
   Plays immediately on page load — no JS needed.
   `animation-fill-mode: both` keeps opacity:0 before delay fires,
   preventing a flash of content before the animation starts.     */

@keyframes hero-entrance {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered cascade: badge → title → subtitle → visual */
.hero__badge {
  animation: hero-entrance 640ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 160ms;
}

.hero__title {
  animation: hero-entrance 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 300ms;
}

.hero__subtitle {
  animation: hero-entrance 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 440ms;
}

.hero__visual {
  animation: hero-entrance 800ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 580ms;
}

/* ---- Globe Button: rotate when menu is open ---- */
.lang-btn svg {
  transition: transform var(--ease-base);
}

.lang-btn[aria-expanded="true"] svg {
  /* Slight tilt signals the open state visually */
  transform: rotate(18deg) scale(1.08);
}

/* ---- Parallax hint: promote watermark to its own GPU layer ---- */
.hero__watermark {
  will-change: transform; /* Scoped tightly — only this element promoted */
}

/* ---- Scroll-reveal: override for elements entering viewport ----
   The `.reveal` + `.is-visible` pattern is defined above.
   These overrides ensure clean entry without layout shift.        */
.focus-card.reveal,
.app-card.reveal,
.pipeline-header.reveal {
  /* Slightly longer travel distance for cards — more dramatic entry */
  transform: translateY(28px);
}

.focus-card.reveal.is-visible,
.app-card.reveal.is-visible,
.pipeline-header.reveal.is-visible {
  transform: translateY(0);
}

