/* ============================================
   Jelly Cafe - Animation Stylesheet
   ============================================ */

/* 1. EXPRESSIVE TYPOGRAPHY ANIMATIONS */
.split-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.6em);
    transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.split-word.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* 2. AMBIENT BACKGROUND MOTION */
@keyframes float-slow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(30px, -20px) scale(1.05); }
    50%      { transform: translate(-15px, -40px) scale(0.95); }
    75%      { transform: translate(-25px, 10px) scale(1.02); }
}

@keyframes float-wide {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(50px, -30px) scale(1.08); }
    66%      { transform: translate(-40px, 25px) scale(0.93); }
}

@keyframes float-pulse {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(20px, -25px) scale(1.12); }
}

.float-slow  { animation: float-slow  12s ease-in-out infinite; }
.float-wide  { animation: float-wide  15s ease-in-out infinite; }
.float-pulse { animation: float-pulse 10s ease-in-out infinite; }

/* 3. SELF-DRAWING ANIMATION EFFECTS */
@keyframes draw-stroke {
    to { stroke-dashoffset: 0; }
}
.self-draw.draw path,
.self-draw.draw circle,
.self-draw.draw rect,
.self-draw.draw line {
    animation: draw-stroke 1.8s ease forwards;
}
.self-draw.draw path:nth-child(2),
.self-draw.draw circle:nth-child(2),
.self-draw.draw line:nth-child(2) { animation-delay: 0.3s; }
.self-draw.draw path:nth-child(3),
.self-draw.draw circle:nth-child(3),
.self-draw.draw line:nth-child(3) { animation-delay: 0.5s; }
.self-draw.draw path:nth-child(4),
.self-draw.draw circle:nth-child(4),
.self-draw.draw line:nth-child(4) { animation-delay: 0.7s; }

/* 4. MORPHING ANIMATION EFFECTS */
@keyframes morph-blob {
    0%   { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; transform: rotate(0deg); }
    25%  { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    50%  { border-radius: 40% 60% 40% 60% / 60% 40% 60% 40%; transform: rotate(180deg); }
    75%  { border-radius: 70% 30% 50% 50% / 40% 50% 60% 50%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; transform: rotate(360deg); }
}
.morph-blob {
    animation: morph-blob 12s ease-in-out infinite;
}

.btn-morph {
    transition: border-radius 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.btn-morph:hover {
    border-radius: 1rem;
}

/* 5. ANIMATED ICONS */
.icon-interact {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.icon-interact:hover {
    transform: scale(1.3);
}
.icon-interact:active {
    transform: scale(0.8);
}

.icon-spin {
    transition: transform 0.25s ease;
}
.icon-spin:hover {
    transform: rotate(90deg);
}

.icon-bounce {
    transition: transform 0.2s ease;
}
.icon-bounce:hover {
    animation: icon-pop 0.35s ease;
}
@keyframes icon-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.social-icon {
    transition: transform 0.2s ease, color 0.3s ease;
}
.social-icon:hover {
    transform: translateY(-3px) scale(1.15);
}

/* 6. MICROINTERACTIONS / UI ANIMATION */

/* Button ripple */
.btn-ripple {
    position: relative;
    overflow: hidden;
}
.btn-ripple::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.btn-ripple:active::after {
    opacity: 1;
    transition: opacity 0s;
}

/* Card hover enhanced */
.card-lift {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s ease;
}
.card-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
}

/* Link underline reveal */
.link-underline {
    position: relative;
    text-decoration: none;
}
.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: currentColor;
    transition: width 0.3s ease;
}
.link-underline:hover::after {
    width: 100%;
}

/* Form focus animation */
.input-focus {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.input-focus:focus {
    box-shadow: 0 4px 12px rgba(109, 76, 65, 0.15);
}

/* 7. THREE.JS CANVAS */
#hero-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.35;
}

/* 8. 3D TILT */
.tilt-container {
    perspective: 800px;
    transform-style: preserve-3d;
}
.tilt-item {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}
