/* ========================================
   INTDESIGNER - Premium Animations
   GSAP-based cinematographic animations
   ======================================== */

/* ========================================
   Fade In Animations
   Note: Elements are visible by default, GSAP handles animation
   ======================================== */

.fade-in {
    /* Removed opacity: 0 - GSAP handles this */
}

.fade-in-left {
    /* Removed opacity: 0 - GSAP handles this */
}

.fade-in-right {
    /* Removed opacity: 0 - GSAP handles this */
}

/* ========================================
   Text Reveal Animation
   ======================================== */

.split-text {
    overflow: hidden;
}

.split-text .char {
    display: inline-block;
    /* Visible by default; GSAP handles transforms/opacity */
}

/* ========================================
   Mask Reveal
   ======================================== */

.mask-reveal {
    position: relative;
    overflow: hidden;
}

.mask-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
/* (Duplicate text-reveal/mask-reveal block removed - handled above) */
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* ========================================
   Smooth Scroll Animations
   ======================================== */

.pin-spacer {
    display: block !important;
}

/* ========================================
   Loading Animations
   ======================================== */

@keyframes loader-line {
    0% {
        transform: scaleX(0);
        transform-origin: left;
    }
    49% {
        transform: scaleX(1);
        transform-origin: left;
    }
    50% {
        transform: scaleX(1);
        transform-origin: right;
    }
    100% {
        transform: scaleX(0);
        transform-origin: right;
    }
}

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loader__logo {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 2rem;
}

.loader__line {
    width: 200px;
    height: 2px;
    background-color: var(--color-accent);
    animation: loader-line 1.5s ease-in-out infinite;
}

/* ========================================
   Hover Glow Effect
   ======================================== */

.glow-hover {
    position: relative;
    overflow: hidden;
}

.glow-hover::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 168, 106, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    pointer-events: none;
    z-index: 0;
}

.glow-hover:hover::before {
    width: 300px;
    height: 300px;
}

/* ========================================
   Floating Animation
   ======================================== */

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

/* ========================================
   Pulse Animation
   ======================================== */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 3s ease-in-out infinite;
}

/* ========================================
   Gradient Animation
   ======================================== */

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradient-shift 15s ease infinite;
}

/* ========================================
   Text Reveal Animation
   ======================================== */

/* Text reveal and mask helpers - visible by default; GSAP will animate */
.split-text {
    overflow: hidden;
}

.split-text .char {
    display: inline-block;
    /* Keep visible by default; transforms/opacity handled by JS animations */
}

/* Mask reveal element: decorative overlay used by JS/GSAP */
.mask-reveal {
    position: relative;
    overflow: hidden;
}

.mask-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.mask-reveal.active::after {
    left: 100%;
}

/* ========================================
   Counter Animation
   ======================================== */

.counter {
    display: inline-block;
}

/* ========================================
   Rotating Text
   ======================================== */

@keyframes rotate-text {
    0% {
        transform: rotateX(0deg);
    }
    100% {
        transform: rotateX(360deg);
    }
}

.rotate-text {
    display: inline-block;
    perspective: 1000px;
}

.rotate-text span {
    display: inline-block;
    transform-style: preserve-3d;
}

/* ========================================
   Shimmer Effect
   ======================================== */

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
}

/* ========================================
   Clip Path Animations
   ======================================== */

.clip-reveal-left {
    clip-path: inset(0 100% 0 0);
}

.clip-reveal-right {
    clip-path: inset(0 0 0 100%);
}

.clip-reveal-top {
    clip-path: inset(100% 0 0 0);
}

.clip-reveal-bottom {
    clip-path: inset(0 0 100% 0);
}

/* ========================================
    Blur In Effect
    Note: animation states handled by GSAP; keep content visible by default
    ======================================== */

.blur-in {
     /* Intentionally left visible; GSAP will animate blur/opacity when needed */
}

/* ========================================
    Scale Hover Effects
    ======================================== */

.scale-hover {
     transition: transform var(--transition-smooth);
}

/* ========================================
    Line Drawing Animation
    ======================================== */

@keyframes draw-line {
    to {
        stroke-dashoffset: 0;
    }
}

.draw-svg path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw-line 2s ease forwards;
}

/* ========================================
    Typewriter Effect
    ======================================== */

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--color-accent);
    }
}

.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--color-accent);
    white-space: nowrap;
    animation: 
        typewriter 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

/* ========================================
   Flip Card Effect
   ======================================== */

.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* ========================================
   Glitch Effect
   ======================================== */

@keyframes glitch {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0);
    }
}

.glitch {
    position: relative;
}

.glitch:hover {
    animation: glitch 0.3s ease;
}

/* ========================================
   Smooth Page Transitions
   ======================================== */

.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary);
    z-index: 9999;
    transform: translateY(-100%);
}

.page-transition.active {
    animation: page-slide 1s ease-in-out;
}

@keyframes page-slide {
    0% {
        transform: translateY(-100%);
    }
    50% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100%);
    }
}

/* ========================================
   Cursor Trail Effect
   ======================================== */

.cursor-trail {
    position: fixed;
    width: 4px;
    height: 4px;
    background-color: var(--color-accent);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    z-index: 9998;
}

/* ========================================
   3D Tilt Effect
   ======================================== */

.tilt-3d {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

/* ========================================
   Gradient Border Animation
   ======================================== */

@keyframes border-flow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-border {
    position: relative;
    background: linear-gradient(90deg, var(--color-accent), var(--color-primary), var(--color-accent));
    background-size: 200% 200%;
    animation: border-flow 3s ease infinite;
}

/* ========================================
   Morph Animation
   ======================================== */

@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

.morph {
    animation: morph 8s ease-in-out infinite;
}

/* ========================================
   Elastic Animation
   ======================================== */

@keyframes elastic {
    0% {
        transform: scale(1, 1);
    }
    10% {
        transform: scale(1.1, 0.9);
    }
    30% {
        transform: scale(0.9, 1.1);
    }
    50% {
        transform: scale(1.05, 0.95);
    }
    57% {
        transform: scale(1, 1);
    }
    64% {
        transform: scale(1, 1);
    }
    100% {
        transform: scale(1, 1);
    }
}

.elastic {
    animation: elastic 1s ease;
}

/* ========================================
   Fade Slide Animations
   Note: GSAP handles these states
   ======================================== */

.fade-slide-up {
    /* Visible by default */
}

.fade-slide-down {
    /* Visible by default */
}

/* ========================================
   Zoom In/Out Animations
   Note: GSAP handles these states
   ======================================== */

.zoom-in {
    /* Visible by default */
}

.zoom-out {
    /* Visible by default */
}

/* ========================================
   Rotate Animations
   ======================================== */

.rotate-in {
    /* Visible by default */
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 2s ease-in-out infinite;
}

/* ========================================
   Slide Reveal
   ======================================== */

.slide-reveal {
    position: relative;
    overflow: hidden;
}

.slide-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: var(--color-accent);
    z-index: 1;
}

/* ========================================
   Performance Optimization
   ======================================== */

.gpu-accelerate {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* ========================================
   Responsive Animation Adjustments
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    /* Reduce animation complexity on mobile */
    .parallax-slow,
    .parallax-medium,
    .parallax-fast {
        will-change: auto;
    }
    
    .floating,
    .pulse {
        animation: none;
    }
}
