/* ============================================================
   ANIMATIONS — CSS keyframes and reusable motion utilities
   ============================================================ */

/* ── Fade In ──────────────────────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Slide up + fade ──────────────────────────────────────── */
@keyframes slide-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Slide left + fade ────────────────────────────────────── */
@keyframes slide-left {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Scale in ─────────────────────────────────────────────── */
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Scroll cue vertical bounce ──────────────────────────── */
@keyframes scroll-cue {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%       { transform: translateY(8px); opacity: 1; }
}

/* ── Pipeline flow ────────────────────────────────────────── */
@keyframes flow-right {
  0%   { stroke-dashoffset: 100; opacity: 0.3; }
  50%  { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0.3; }
}

/* ── Pulse ring ───────────────────────────────────────────── */
@keyframes pulse-ring {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ── Ticker stream ────────────────────────────────────────── */
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Line draw ────────────────────────────────────────────── */
@keyframes line-draw {
  from { width: 0; }
  to   { width: 100%; }
}

/* ── Dot appear ───────────────────────────────────────────── */
@keyframes dot-appear {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── Blink cursor ─────────────────────────────────────────── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Eco ring rotate ──────────────────────────────────────── */
@keyframes ring-rotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── Reusable animation classes ───────────────────────────── */

/* Apply via JS adding .is-visible class */
.anim-fade-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.anim-fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.anim-fade-in {
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.anim-fade-in.is-visible {
  opacity: 1;
}

/* Stagger delay utility */
.anim-delay-1 { transition-delay: 0.1s; }
.anim-delay-2 { transition-delay: 0.2s; }
.anim-delay-3 { transition-delay: 0.3s; }
.anim-delay-4 { transition-delay: 0.4s; }
.anim-delay-5 { transition-delay: 0.5s; }
.anim-delay-6 { transition-delay: 0.6s; }
.anim-delay-7 { transition-delay: 0.7s; }
.anim-delay-8 { transition-delay: 0.8s; }

/* ── Scroll-cue element ───────────────────────────────────── */
.opening__scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-16);
  animation: fade-in 1s ease 3.5s both;
}

.opening__scroll-line {
  width: 1px;
  height: 48px;
  background: rgba(242, 241, 238, 0.3);
  animation: scroll-cue 2s ease-in-out 3.5s infinite;
}

.opening__scroll-text {
  font-size: var(--text-2xs);
  letter-spacing: var(--ls-wider);
  color: rgba(242, 241, 238, 0.4);
  text-transform: uppercase;
}

/* ── Pulse animation for map nodes ───────────────────────── */
.project-node__pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--c-ink-mid);
  animation: pulse-ring 2.5s ease-out infinite;
}
