/* ============================================
   V3 PORTFOLIO — ANIMATIONS
   Keyframes & Motion Effects
   ============================================ */

/* ========== Text Reveal ========== */
@keyframes textRevealUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.text-reveal {
    overflow: hidden;
    display: inline-block;
}

.text-reveal > * {
    display: inline-block;
    animation: textRevealUp 0.8s var(--ease-out) forwards;
    animation-delay: var(--delay, 0s);
}

/* ========== Fade Animations ========== */
@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(-30px); }
    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 fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ========== Magnetic Button Effect ========== */
.magnetic-btn {
    position: relative;
    transition: transform 0.4s var(--ease-out);
}

.magnetic-btn .btn-text {
    position: relative;
    z-index: 2;
    transition: transform 0.4s var(--ease-out);
}

/* ========== Stagger Children ========== */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s var(--ease-out);
}

.stagger-children.animate > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: translateY(0); }
.stagger-children.animate > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-children.animate > *:nth-child(3) { transition-delay: 0.15s; opacity: 1; transform: translateY(0); }
.stagger-children.animate > *:nth-child(4) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-children.animate > *:nth-child(5) { transition-delay: 0.25s; opacity: 1; transform: translateY(0); }
.stagger-children.animate > *:nth-child(6) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger-children.animate > *:nth-child(7) { transition-delay: 0.35s; opacity: 1; transform: translateY(0); }
.stagger-children.animate > *:nth-child(8) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.stagger-children.animate > *:nth-child(9) { transition-delay: 0.45s; opacity: 1; transform: translateY(0); }
.stagger-children.animate > *:nth-child(10) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }
.stagger-children.animate > *:nth-child(11) { transition-delay: 0.55s; opacity: 1; transform: translateY(0); }
.stagger-children.animate > *:nth-child(12) { transition-delay: 0.6s; opacity: 1; transform: translateY(0); }

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

.shimmer {
    background: linear-gradient(90deg, 
        var(--color-navy) 0%, 
        var(--color-terracotta) 50%, 
        var(--color-navy) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

/* ========== Breathing Glow ========== */
@keyframes breathe {
    0%, 100% { box-shadow: 0 0 20px rgba(201, 120, 77, 0.1); }
    50% { box-shadow: 0 0 40px rgba(201, 120, 77, 0.25); }
}

.breathing-glow {
    animation: breathe 4s ease-in-out infinite;
}

/* ========== Gradient Move ========== */
@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animated-gradient {
    background-size: 200% 200%;
    animation: gradientMove 6s ease infinite;
}

/* ========== Parallax Layer ========== */
.parallax-layer {
    transition: transform 0.1s linear;
    will-change: transform;
}

/* ========== Line Draw ========== */
@keyframes lineDraw {
    from { width: 0; }
    to { width: 100%; }
}

.line-draw {
    position: relative;
}

.line-draw::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    height: 2px;
    background: var(--color-terracotta);
    width: 0;
    transition: width 0.8s var(--ease-out);
}

.line-draw.animate::after { width: 100%; }

/* ========== Counter Pop ========== */
@keyframes counterPop {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* ========== Hover Underline ========== */
.hover-underline {
    position: relative;
}

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

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

/* ========== Card Tilt ========== */
.tilt-card {
    transition: transform 0.5s var(--ease-out);
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* ========== Blob Morphing ========== */
@keyframes blobMorph {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    25% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    50% { border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%; }
    75% { border-radius: 60% 40% 60% 30% / 70% 30% 50% 60%; }
}

.blob { animation: blobMorph 8s ease-in-out infinite; }

/* ========== Smooth Entrance Classes ========== */
[data-animate] {
    opacity: 0;
    transition: all 0.7s var(--ease-out);
}

[data-animate="fade-up"] { transform: translateY(40px); }
[data-animate="fade-down"] { transform: translateY(-40px); }
[data-animate="fade-left"] { transform: translateX(-40px); }
[data-animate="fade-right"] { transform: translateX(40px); }
[data-animate="scale"] { transform: scale(0.9); }
[data-animate="rotate"] { transform: rotate(-5deg) scale(0.95); }

[data-animate].animated {
    opacity: 1;
    transform: none;
}

/* ========== Ripple Effect ========== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.6s, opacity 0.6s;
}

.ripple:active::after {
    transform: scale(2.5);
    opacity: 1;
    transition: 0s;
}

/* ========== Smooth Scroll Indicator ========== */
@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

.scroll-cue {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.scroll-cue-dot {
    width: 6px;
    height: 6px;
    background: var(--color-terracotta);
    border-radius: 50%;
    animation: scrollBounce 2s ease-in-out infinite;
}

.scroll-cue-text {
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-text-muted);
}
