/* ============================================================
 * animations.css — Goodmans Animation Layer
 * ============================================================ */


/* ── Hero Title — Mouse-driven gradient position shift ──────
 *
 * background-size is made 3× larger so the gradient has
 * range to shift through. JS then moves background-position
 * based on mouse X/Y — exactly like the reference approach.
 *
 * Only background-size is added here. The gradient colours
 * in main.css are untouched.
 * ────────────────────────────────────────────────────────── */
/*.hero-section {
    background: linear-gradient(180deg, rgba(233, 228, 216, 0.25) 50%, rgba(238, 211, 181, 0.25) 100%) !important;
}*/

.hero-section .container {
    position: relative;
    z-index: 1;
    /* ensures buttons remain fully clickable above the canvas background */
}

.hero-dots-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.hero-title {
    background-size: 300%;
    transform-style: preserve-3d;
    will-change: transform;
    display: inline-block;
    /* required for 3D perspective to apply correctly */
}


/* ============================================================
 * Scroll Reveal Utilities
 *
 * Usage: add class "fade-left" or "fade-right" to any element.
 * JS IntersectionObserver fires .is-visible when it enters
 * the viewport — CSS transition handles the rest.
 *
 * .fade-left   — slides in from the LEFT
 * .fade-right  — slides in from the RIGHT
 * ============================================================ */

.fade-left,
.fade-right,
.fade-up,
.fade-down {
    opacity: 0;
    transition:
        opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        transform 1s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.fade-left {
    transform: translateX(-60px);
}

.fade-right {
    transform: translateX(60px);
}

.fade-up {
    transform: translateY(60px);
}

.fade-down {
    transform: translateY(-60px);
}

/* Triggered by JS when element enters the viewport */
.fade-left.is-visible,
.fade-right.is-visible,
.fade-up.is-visible,
.fade-down.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}


/* ============================================================
 * Random Character Stagger Reveal (.random-chars)
 *
 * Splits text into words and individual characters. Each char
 * starts shifted down and transparent, with a randomized delay
 * assigned by JS. Entering viewport adds .is-visible.
 * ============================================================ */

.random-word {
    display: inline-block;
    white-space: nowrap;
}

.random-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

/* Fix for .hero-title: inline-block child spans inherit transparent text color,
   so they must also explicitly inherit the background gradient and clipping */
.hero-title .random-char {
    background: inherit;
    background-size: inherit;
    background-position: inherit;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.random-chars.is-visible .random-char {
    opacity: 1;
    transform: translateY(0);
}


/* ============================================================
 * Explore Range Section (.explore-section)
 *
 * Entrance: Staggered scale + translateY reveal when scrolled.
 * Hover:    3D tilt + dynamic cursor glare effect.
 * ============================================================ */

/* --- Entrance Reveal --- */
.explore-section .category-card {
    opacity: 0;
    transform: translateY(50px) scale(0.94);
    transition:
        opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.explore-section.is-visible .category-card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Stagger delays for the 4 grid cards */
.explore-section.is-visible .explore-card-1 {
    transition-delay: 0.05s;
}

.explore-section.is-visible .explore-card-2 {
    transition-delay: 0.20s;
}

.explore-section.is-visible .explore-card-3 {
    transition-delay: 0.35s;
}

.explore-section.is-visible .explore-card-4 {
    transition-delay: 0.50s;
}


/* --- 3D Hover & Glare Effect --- */
.explore-section .category-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 30px;
    background: radial-gradient(circle 320px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 230, 200, 0.22), transparent 75%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 3;
}

.explore-section .category-card:hover::after {
    opacity: 1;
}


/* ============================================================
 * Instagram Section (.instagram-section)
 *
 * Entrance: Staggered pop-in wave when scrolled into view.
 * Hover:    Gallery Spotlight mode (unhovered posts dim).
 * ============================================================ */

/* --- Entrance Reveal --- */
.instagram-section .insta-post {
    opacity: 0;
    transform: scale(0.85) translateY(35px);
    transition:
        opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.instagram-section.is-visible .insta-post {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Stagger delays for the 8 posts */
.instagram-section.is-visible .col-6:nth-child(1) .insta-post {
    transition-delay: 0.05s;
}

.instagram-section.is-visible .col-6:nth-child(2) .insta-post {
    transition-delay: 0.10s;
}

.instagram-section.is-visible .col-6:nth-child(3) .insta-post {
    transition-delay: 0.15s;
}

.instagram-section.is-visible .col-6:nth-child(4) .insta-post {
    transition-delay: 0.20s;
}

.instagram-section.is-visible .col-6:nth-child(5) .insta-post {
    transition-delay: 0.25s;
}

.instagram-section.is-visible .col-6:nth-child(6) .insta-post {
    transition-delay: 0.30s;
}

.instagram-section.is-visible .col-6:nth-child(7) .insta-post {
    transition-delay: 0.35s;
}

.instagram-section.is-visible .col-6:nth-child(8) .insta-post {
    transition-delay: 0.40s;
}