/* ============================================================
   WFCSI — Animations & Motion System
   ============================================================ */

/* ── Keyframes ───────────────────────────────────────────── */

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33%       { transform: translateY(-12px) rotate(2deg); }
    66%       { transform: translateY(-6px) rotate(-1deg); }
}

@keyframes ripple {
    0%   { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes typewriter {
    from { width: 0; }
    to   { width: 100%; }
}

@keyframes blinkCursor {
    from { border-right-color: var(--color-primary); }
    to   { border-right-color: transparent; }
}

@keyframes orbitSlow {
    from { transform: rotate(0deg) translateX(60px) rotate(0deg); }
    to   { transform: rotate(360deg) translateX(60px) rotate(-360deg); }
}

@keyframes heroPatternDrift {
    0%   { transform: translate(0, 0) rotate(0deg); }
    33%  { transform: translate(30px, -20px) rotate(120deg); }
    66%  { transform: translate(-20px, 15px) rotate(240deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

/* ── Utility Animation Classes ───────────────────────────── */

/* Scroll-triggered animation base */
.anim-on-scroll {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.anim-fade-up,
.anim-fade-down,
.anim-fade-left,
.anim-fade-right,
.anim-scale-in,
.anim-zoom-in { transform: none; }

.anim-on-scroll.visible {
    opacity: 1;
    transform: none;
}

/* Stagger delays for grid/list children */
.stagger-children > *:nth-child(1)  { transition-delay: 0.05s; }
.stagger-children > *:nth-child(2)  { transition-delay: 0.10s; }
.stagger-children > *:nth-child(3)  { transition-delay: 0.15s; }
.stagger-children > *:nth-child(4)  { transition-delay: 0.20s; }
.stagger-children > *:nth-child(5)  { transition-delay: 0.25s; }
.stagger-children > *:nth-child(6)  { transition-delay: 0.30s; }
.stagger-children > *:nth-child(7)  { transition-delay: 0.35s; }
.stagger-children > *:nth-child(8)  { transition-delay: 0.40s; }
.stagger-children > *:nth-child(9)  { transition-delay: 0.45s; }

/* ── Hero Decorative Shapes ──────────────────────────────── */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: float 8s ease-in-out infinite;
}

.hero-orb--1 {
    width: 500px;
    height: 500px;
    top: -15%;
    right: -10%;
    background: radial-gradient(circle, rgba(232,97,10,0.15) 0%, transparent 70%);
    animation-duration: 10s;
}

.hero-orb--2 {
    width: 300px;
    height: 300px;
    bottom: 5%;
    left: 5%;
    background: radial-gradient(circle, rgba(245,166,35,0.10) 0%, transparent 70%);
    animation-duration: 7s;
    animation-delay: -3s;
}

.hero-orb--3 {
    width: 200px;
    height: 200px;
    top: 40%;
    left: 35%;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    animation-duration: 12s;
    animation-delay: -5s;
}

/* ── Floating Label Animation ────────────────────────────── */
.float-label {
    position: relative;
}

.float-label input:focus ~ label,
.float-label input:not(:placeholder-shown) ~ label {
    transform: translateY(-125%) scale(0.85);
    color: var(--color-primary);
}

.float-label label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: transform var(--transition-base), color var(--transition-base);
    transform-origin: left center;
    color: var(--color-grey-400);
    font-size: var(--text-sm);
}

/* ── Loading Dots ────────────────────────────────────────── */
.loading-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: pulse 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ── Page Transition ─────────────────────────────────────── */
/* ── Hover Effect: Shine ─────────────────────────────────── */
.shine-on-hover {
    position: relative;
    overflow: hidden;
}

.shine-on-hover::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -75%;
    width: 50%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    transform: skewX(-20deg);
    transition: none;
}

.shine-on-hover:hover::after {
    animation: shinePass 0.5s ease forwards;
}

@keyframes shinePass {
    to { left: 125%; }
}

/* ── Reveal Line ─────────────────────────────────────────── */
.underline-reveal {
    position: relative;
    display: inline-block;
}

.underline-reveal::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

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

/* ── Respect Motion Preferences ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .anim-on-scroll {
        opacity: 1;
        transform: none;
    }
}
