/*
  ----------------------------------------------------------------------------
  © 2026 Mehdi Dimyadi
  Roozegaar Projects Collection
  All rights reserved.

  Author: Mehdi Dimyadi
  GitHub: https://github.com/MEHDIMYADI

  Description:
  This file is part of the Roozegaar Projects, including web, JSON,
  CSS, and JavaScript files. You may use, modify, and distribute this code
  in accordance with the project license.

  ----------------------------------------------------------------------------

  animations.css: keyframes and motion shared across every page.
*/

/* ========================================================================== */
/* Keyframes                                                                  */
/* ========================================================================== */
@keyframes heroFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes textFlow {
  to { background-position: -250% 0; }
}
@keyframes spineFlow {
  to { background-position: 0 -300%; }
}
@keyframes blink {
  50% { opacity: 0.4; }
}
@keyframes dotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 211, 110, 0.65); }
  70%  { box-shadow: 0 0 0 10px rgba(255, 211, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 211, 110, 0); }
}
@keyframes dotPulseGreen {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.65); }
  70%  { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
@keyframes nodeRing {
  0%   { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.9); opacity: 0; }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
@keyframes shimmer {
  to { transform: translateX(100%); }
}
@keyframes rippleAnim {
  to { transform: scale(3.4); opacity: 0; }
}
@keyframes waveSlide {
  to { transform: translateX(-50%); }
}
@keyframes ambientA {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(8vw, 6vh, 0) scale(1.15); }
}
@keyframes ambientB {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.05); }
  50%      { transform: translate3d(-9vw, -7vh, 0) scale(0.92); }
}

/* ========================================================================== */
/* Living gradients                                                           */
/* ========================================================================== */
.hero { animation: heroFlow 22s ease-in-out infinite; }
.site-footer { animation: heroFlow 26s ease-in-out infinite; }

/* Staggered entrance of hero content */
.hero-content > * {
  opacity: 0;
  animation: riseIn 0.9s var(--ease) forwards;
}
.hero-content > :nth-child(1) { animation-delay: 0.10s; }
.hero-content > :nth-child(2) { animation-delay: 0.22s; }
.hero-content > :nth-child(3) { animation-delay: 0.34s; }
.hero-content > :nth-child(4) { animation-delay: 0.46s; }
.hero-content > :nth-child(5) { animation-delay: 0.58s; }

/* ========================================================================== */
/* Ambient page background                                                    */
/* ========================================================================== */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.ambient i {
  position: absolute;
  width: 55vmax;
  height: 55vmax;
  border-radius: 50%;
  opacity: 0.5;
  will-change: transform;
}
.ambient i:nth-child(1) {
  inset-block-start: -18vmax;
  inset-inline-start: -14vmax;
  background: radial-gradient(closest-side, rgba(15, 163, 154, 0.2), transparent);
  animation: ambientA 26s ease-in-out infinite;
}
.ambient i:nth-child(2) {
  inset-block-end: -20vmax;
  inset-inline-end: -16vmax;
  background: radial-gradient(closest-side, rgba(242, 169, 59, 0.18), transparent);
  animation: ambientB 32s ease-in-out infinite;
}
[data-theme="dark"] .ambient i { opacity: 0.55; }

/* ========================================================================== */
/* Waves at the bottom of every hero                                          */
/* ========================================================================== */
.waves {
  position: absolute;
  inset-inline: 0;
  inset-block-end: -1px;
  z-index: 3;
  height: var(--wave-h);
  overflow: hidden;
  direction: ltr;
  pointer-events: none;
}
.waves svg {
  position: absolute;
  inset-block-end: 0;
  left: 0;
  width: 200%;
  height: 100%;
  will-change: transform;
}
.waves svg:nth-child(1) { animation: waveSlide 46s linear infinite; }
.waves svg:nth-child(2) { animation: waveSlide 32s linear infinite reverse; }
.waves svg:nth-child(3) { animation: waveSlide 22s linear infinite; }
.wave { fill: var(--bg); transition: fill 0.3s ease; }
.wave.w1 { opacity: 0.28; }
.wave.w2 { opacity: 0.52; }
.wave.w3 { opacity: 1; }

/* ========================================================================== */
/* Scroll reveal (driven by enhance.js)                                       */
/* ========================================================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
  transition-delay: calc(var(--d, 0) * 80ms);
}
[data-reveal="fade"] { transform: none; }
[data-reveal].in-view { opacity: 1; transform: none; }
/* Content stays visible when the enhancement script is unavailable */
html:not(.js-ready) [data-reveal] { opacity: 1; transform: none; }

/* Timeline items slide in from the side their card sits on */
.tl-item.side-a { --slide: -46px; }
.tl-item.side-b { --slide: 46px; }
[dir="rtl"] .tl-item.side-a { --slide: 46px; }
[dir="rtl"] .tl-item.side-b { --slide: -46px; }
.tl-item[data-reveal] { transform: translateX(var(--slide, 0)); }
.tl-item[data-reveal].in-view { transform: none; }
html:not(.js-ready) .tl-item[data-reveal] { transform: none; }
@media (max-width: 860px) {
  .tl-item[data-reveal] { transform: translateY(28px); }
  .tl-item[data-reveal].in-view { transform: none; }
}

/* ========================================================================== */
/* Button ripple                                                              */
/* ========================================================================== */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: rippleAnim 0.65s ease-out;
  pointer-events: none;
}
.btn-light .ripple, .btn-outline .ripple { background: rgba(11, 127, 120, 0.25); }

/* ========================================================================== */
/* Theme switch: circular reveal (View Transitions API)                       */
/* ========================================================================== */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

/* ========================================================================== */
/* Paused state: set while the hero is off-screen                             */
/* ========================================================================== */
.hero.is-paused *, .hero.is-paused { animation-play-state: paused !important; }

/* ========================================================================== */
/* Reduced motion                                                             */
/* ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-content > * { opacity: 1; }
  [data-reveal] { opacity: 1; transform: none; }
}
