/* =========================================================
   TIMBER LINE - Animations
   ========================================================= */

/* =========================================================
   GLOBAL ANIMATION CLASSES (GSAP-driven visibility)
   ========================================================= */
[data-animate] {
    opacity: 0;
    will-change: transform, opacity;
}

[data-animate="fade-up"] {
    transform: translateY(60px);
}

[data-animate="fade-down"] {
    transform: translateY(-40px);
}

[data-animate="fade-right"] {
    transform: translateX(-60px);
}

[data-animate="fade-left"] {
    transform: translateX(60px);
}

[data-animate="scale-in"] {
    transform: scale(0.85);
}

[data-animate="reveal-up"] {
    transform: translateY(80px);
}

[data-animate="process-reveal"] {
    transform: translateY(40px);
}

/* =========================================================
   PARTICLE EFFECTS
   ========================================================= */
.timber-particle {
    position: absolute;
    pointer-events: none;
    will-change: transform, opacity;
}

/* =========================================================
   FLOATING EFFECTS
   ========================================================= */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25%      { transform: translateY(-10px) rotate(1deg); }
    75%      { transform: translateY(5px) rotate(-0.5deg); }
}

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

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

.float-anim {
    animation: float 6s ease-in-out infinite;
}

.float-slow {
    animation: floatSlow 8s ease-in-out infinite;
}

/* =========================================================
   GRAIN OVERLAY
   ========================================================= */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px;
}

/* =========================================================
   SMOOTH SECTION TRANSITIONS
   ========================================================= */
.section::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    height: 120px;
    pointer-events: none;
}

/* =========================================================
   PRODUCT CARD 3D HOVER
   ========================================================= */
.product-card-inner {
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.product-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(26, 14, 5, 0.6));
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 1;
}

.product-card:hover .product-image::after {
    opacity: 1;
}

/* =========================================================
   COUNTER ANIMATION
   ========================================================= */
.stat-number {
    transition: color 0.5s var(--ease-out);
}

/* =========================================================
   NAV LINK HOVER FX
   ========================================================= */
.nav-links a {
    position: relative;
}

/* =========================================================
   PROCESS TIMELINE ANIMATION
   ========================================================= */
.process-step {
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.process-step.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   SCROLL PROGRESS BAR
   ========================================================= */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--wood-warm), var(--wood-light));
    z-index: 10001;
    transition: width 0.1s linear;
}

/* =========================================================
   REVEAL CLIP ANIMATION
   ========================================================= */
.reveal-clip {
    clip-path: inset(100% 0 0 0);
    transition: clip-path 1s var(--ease-out);
}

.reveal-clip.revealed {
    clip-path: inset(0 0 0 0);
}

/* =========================================================
   TEXT SHIMMER
   ========================================================= */
@keyframes textShimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.shimmer-text {
    background: linear-gradient(90deg,
        var(--wood-lightest) 0%,
        var(--wood-light) 25%,
        var(--white) 50%,
        var(--wood-light) 75%,
        var(--wood-lightest) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShimmer 4s linear infinite;
}

/* =========================================================
   BUTTON RIPPLE
   ========================================================= */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s, opacity 0.6s;
    opacity: 0;
}

.btn:active::after {
    width: 300px;
    height: 300px;
    opacity: 0;
}

/* =========================================================
   CUSTOM CURSOR EFFECT (Desktop only)
   ========================================================= */
@media (pointer: fine) {
    .cursor-glow {
        position: fixed;
        width: 300px;
        height: 300px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(139, 105, 20, 0.06) 0%, transparent 70%);
        pointer-events: none;
        z-index: 9998;
        transform: translate(-50%, -50%);
        transition: opacity 0.3s;
        opacity: 0;
    }

    body:hover .cursor-glow {
        opacity: 1;
    }
}

/* =========================================================
   STAGGER CHILDREN
   ========================================================= */
.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
}

.stagger-children.animated > * {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.stagger-children.animated > *:nth-child(1) { transition-delay: 0s; }
.stagger-children.animated > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.animated > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-children.animated > *:nth-child(4) { transition-delay: 0.3s; }
.stagger-children.animated > *:nth-child(5) { transition-delay: 0.4s; }

/* Hero divider animation */
.hero-divider {
    transform-origin: center;
}
