/* ================================================
   RAWNAQ — ANIMATIONS CSS
   Keyframes and animation utilities
   ================================================ */

/* ================================================
   KEYFRAMES
   ================================================ */

/* Loader pulse */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* Emerald dot blink */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Scroll line sweep */
@keyframes sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Slow rotation */
@keyframes rotate-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Float */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

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

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

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

/* Shimmer */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ================================================
   ANIMATION UTILITIES
   ================================================ */

.animate-pulse      { animation: pulse 2s ease-in-out infinite; }
.animate-blink      { animation: blink 1.2s ease-in-out infinite; }
.animate-float      { animation: float 4s ease-in-out infinite; }
.animate-rotate     { animation: rotate-slow 20s linear infinite; }
.animate-fade-in    { animation: fade-in 0.8s var(--ease-out-expo) both; }
.animate-slide-up   { animation: slide-up 0.8s var(--ease-out-expo) both; }

/* Animation delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* ================================================
   TRANSITION UTILITIES
   ================================================ */

.transition-fast    { transition: all 0.2s ease; }
.transition-base    { transition: all 0.4s var(--ease-out-expo); }
.transition-slow    { transition: all 0.8s var(--ease-out-expo); }

.transition-opacity { transition: opacity 0.4s ease; }
.transition-transform { transition: transform 0.6s var(--ease-out-expo); }

/* ================================================
   HOVER EFFECTS
   ================================================ */

/* Link underline from left */
.hover-underline {
  position: relative;
}

.hover-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.4s var(--ease-out-expo);
}

.hover-underline:hover::after {
  width: 100%;
}

/* Scale on hover */
.hover-scale {
  transition: transform 0.4s var(--ease-out-expo);
}

.hover-scale:hover {
  transform: scale(1.02);
}

/* Lift on hover */
.hover-lift {
  transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s ease;
}

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

/* ================================================
   ENTRANCE ANIMATIONS
   Used as GSAP start states
   ================================================ */

/* Mask reveal — parent must be overflow:hidden */
.mask-reveal {
  overflow: hidden;
}

.mask-reveal > * {
  transform: translateY(100%);
  opacity: 0;
}

/* Stagger containers */
.stagger-children > * {
  opacity: 0;
  transform: translateY(24px);
}

/* ================================================
   SCROLLBAR PROGRESS LINE
   Top of page
   ================================================ */
#scroll-line {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--c-emerald);
  z-index: calc(var(--z-nav) + 1);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.1s linear;
  pointer-events: none;
}

/* ================================================
   PAGE TRANSITION
   ================================================ */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--c-dark);
  z-index: calc(var(--z-loader) - 1);
  pointer-events: none;
  clip-path: inset(100% 0 0 0);
}

/* ================================================
   EMERALD GLOW EFFECT
   Used around key elements
   ================================================ */
.emerald-glow {
  position: relative;
}

.emerald-glow::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, var(--c-emerald-glow) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  border-radius: inherit;
}

.emerald-glow:hover::before {
  opacity: 1;
}

/* ================================================
   TEXT SHIMMER (For special use only)
   ================================================ */
.text-shimmer {
  background: linear-gradient(
    90deg,
    var(--c-light-3) 0%,
    var(--c-light) 30%,
    var(--c-emerald) 50%,
    var(--c-light) 70%,
    var(--c-light-3) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

/* ================================================
   GRAIN / NOISE ANIMATION
   ================================================ */
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10%       { transform: translate(-2%, -3%); }
  20%       { transform: translate(3%, 2%); }
  30%       { transform: translate(-1%, 4%); }
  40%       { transform: translate(4%, -1%); }
  50%       { transform: translate(-3%, 3%); }
  60%       { transform: translate(2%, -4%); }
  70%       { transform: translate(-4%, 1%); }
  80%       { transform: translate(1%, -2%); }
  90%       { transform: translate(-2%, 4%); }
}

.noise-overlay::before {
  content: '';
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background: inherit;
  animation: grain 0.5s steps(1) infinite;
}
