/* Home page only: underwater motion on a pure-black Aesthetic grid.
   No teal/blue tint or depth color. Shirts stay sharp and slowly drift, clickable. */

body.index-page .hero-section {
    position: relative;
    z-index: 2;
    background: #000;
}

/*
 * The hard edge was the slightly-gray hero bottom (reflection + 55% veil)
 * cutting off against the grid's pure black. The hero's last stretch is
 * solid #000 (no horizon line). Scroll-linked veils handle fade in/out.
 */
body.index-page .hero-horizon {
    opacity: 0;
    background: none;
    box-shadow: none;
}

body.index-page .hero-bottom-fade {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--hero-horizon);
    bottom: 0;
    height: auto;
    pointer-events: none;
    z-index: 6;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.12) 16%,
        rgba(0, 0, 0, 0.35) 30%,
        rgba(0, 0, 0, 0.68) 46%,
        rgba(0, 0, 0, 0.92) 58%,
        #000 70%,
        #000 100%
    );
}

body.index-page .hero-scroll-veil,
body.index-page .index-grid-scroll-veil {
    position: absolute;
    inset: 0;
    background: #000;
    pointer-events: none;
}

body.index-page .hero-scroll-veil {
    z-index: 8;
    opacity: 0;
}

body.index-page .index-grid-scroll-veil {
    z-index: 12;
    opacity: 0;
}

/* Extra dissolve inside the water layer, in case anything peeks under the veil. */
body.index-page .hero-water::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 62%;
    pointer-events: none;
    z-index: 5;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.2) 18%,
        rgba(0, 0, 0, 0.5) 40%,
        rgba(0, 0, 0, 0.85) 62%,
        #000 78%,
        #000 100%
    );
}

body.index-page #index-explore-grid {
    position: relative;
    overflow: visible;
    isolation: isolate;
    background: #000;
    margin-top: -18vh;
    padding-top: 28vh;
}

/* Solid black cap over the hero overlap so the seam cannot go gray. */
body.index-page #index-explore-grid::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 28vh;
    z-index: 8;
    pointer-events: none;
    background: #000;
}

@media (max-width: 768px) {
    body.index-page #index-explore-grid {
        margin-top: -20vh;
        padding-top: 32vh;
    }
    body.index-page #index-explore-grid::before {
        height: 32vh;
    }
    body.index-page .hero-bottom-fade {
        height: auto;
    }
}

body.index-page #index-explore-grid .explore-products,
body.index-page #exploreProducts,
body.index-page #index-explore-grid .explore-hero-section,
body.index-page #index-explore-grid .explore-hero-section:hover,
body.index-page #index-explore-grid .explore-grid-placeholder {
    background-color: #000;
    background: #000;
}

body.index-page #index-explore-grid .explore-products,
body.index-page #exploreProducts {
    position: relative;
    z-index: 1;
}

/* No dream blur on the home grid — shirts, cards, and text stay sharp. */
body.index-page #index-explore-grid .explore-hero-section,
body.index-page #index-explore-grid .explore-grid-placeholder,
body.index-page #index-explore-grid .explore-hero-section:hover,
body.index-page #index-explore-grid .explore-grid-placeholder:hover,
body.index-page #index-explore-grid .explore-hero-section.is-dream-focus,
body.index-page #index-explore-grid .explore-grid-placeholder.is-dream-focus {
    filter: none;
    will-change: auto;
}

/* Weightless, slow-motion drift — shirts hang in the water, not on a rigid grid. */
body.index-page #index-explore-grid .explore-hero-section,
body.index-page #index-explore-grid .explore-grid-placeholder {
    --float-dur: 36s;
    --float-delay: 0s;
}
body.index-page #index-explore-grid #first-product { --float-dur: 34s; --float-delay: -6s; }
body.index-page #index-explore-grid #second-product { --float-dur: 40s; --float-delay: -18s; }
body.index-page #index-explore-grid #third-product { --float-dur: 36s; --float-delay: -10s; }
body.index-page #index-explore-grid #fourth-product { --float-dur: 42s; --float-delay: -24s; }
body.index-page #index-explore-grid #fifth-product { --float-dur: 35s; --float-delay: -3s; }
body.index-page #index-explore-grid .explore-grid-placeholder { --float-dur: 38s; --float-delay: -16s; }

body.index-page #index-explore-grid .explore-hero-img,
body.index-page #index-explore-grid .explore-grid-placeholder-img,
body.index-page #index-explore-grid .explore-hero-info {
    animation: index-grid-float var(--float-dur, 14s) var(--float-delay, 0s) ease-in-out infinite;
    animation-play-state: paused;
    will-change: transform;
}

body.index-page #index-explore-grid.is-water-active .explore-hero-img,
body.index-page #index-explore-grid.is-water-active .explore-grid-placeholder-img,
body.index-page #index-explore-grid.is-water-active .explore-hero-info {
    animation-play-state: running;
}

body.index-page #index-explore-grid:has(.password-overlay.active) .explore-hero-img,
body.index-page #index-explore-grid:has(.password-overlay.active) .explore-grid-placeholder-img,
body.index-page #index-explore-grid:has(.password-overlay.active) .explore-hero-info {
    animation-play-state: paused;
}

/* JS buoyancy owns the transform. Keep the CSS drift only as a no-JS fallback. */
body.index-page #index-explore-grid.is-float-physics .explore-hero-img,
body.index-page #index-explore-grid.is-float-physics .explore-grid-placeholder-img,
body.index-page #index-explore-grid.is-float-physics .explore-hero-info {
    animation: none;
}

@keyframes index-grid-float {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(-0.12deg); }
    25% { transform: translate3d(2px, -5px, 0) rotate(0.16deg); }
    50% { transform: translate3d(-1.5px, -2.5px, 0) rotate(-0.08deg); }
    75% { transform: translate3d(-2.5px, -6px, 0) rotate(0.12deg); }
}

.index-grid-water {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.index-grid-water-svg {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.index-grid-water-back,
.index-grid-water-front {
    position: absolute;
    inset: 0;
}

.index-grid-water-back {
    z-index: 0;
}

.index-grid-water-front {
    z-index: 6;
}

#index-explore-grid:has(.password-overlay.active) .index-grid-water-front {
    opacity: 0;
    visibility: hidden;
}

/* No color wash — the black canvas stays black. */
.index-grid-water-tint {
    display: none;
}


/* Neutralize the layers that were lifting the seam to dark gray.
   Markup stays in place; the area between hero and shirts stays #000. */
body.index-page .index-grid-water-surface,
body.index-page .index-grid-water-caustics,
body.index-page .index-grid-water-rays {
    opacity: 0;
    visibility: hidden;
    animation: none;
}

/* Soft light falling from the surface above the shirts. Neutral / warm-white only. */
.index-grid-water-surface {
    position: absolute;
    left: -8%;
    right: -8%;
    top: 0;
    height: 78%;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.85;
    background:
        radial-gradient(ellipse 70% 42% at 50% 0%, rgba(255, 250, 240, 0.2), transparent 68%),
        radial-gradient(ellipse 36% 28% at 28% 8%, rgba(255, 252, 245, 0.1), transparent 70%),
        radial-gradient(ellipse 32% 24% at 74% 6%, rgba(255, 248, 235, 0.08), transparent 72%),
        linear-gradient(to bottom, rgba(255, 250, 240, 0.07) 0%, rgba(255, 250, 240, 0.03) 36%, transparent 72%);
}

.index-grid-water-caustics {
    position: absolute;
    left: -12%;
    right: -12%;
    top: -8%;
    height: 85%;
    opacity: 0.16;
    mix-blend-mode: screen;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.35) 14%, rgba(0, 0, 0, 0.8) 34%, rgba(0, 0, 0, 0.4) 72%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.35) 14%, rgba(0, 0, 0, 0.8) 34%, rgba(0, 0, 0, 0.4) 72%, transparent 100%);
    background-image:
        radial-gradient(ellipse 42% 22% at 18% 8%, rgba(255, 252, 245, 0.4), transparent 62%),
        radial-gradient(ellipse 34% 18% at 72% 4%, rgba(255, 250, 240, 0.3), transparent 60%),
        radial-gradient(ellipse 50% 26% at 48% 22%, rgba(255, 250, 240, 0.18), transparent 70%),
        radial-gradient(ellipse 28% 16% at 86% 30%, rgba(255, 250, 240, 0.18), transparent 64%),
        radial-gradient(ellipse 36% 20% at 30% 40%, rgba(255, 248, 235, 0.14), transparent 68%);
    background-repeat: no-repeat;
    filter: blur(18px);
    transform: translate3d(0, 0, 0);
    animation: index-grid-caustics 22s ease-in-out infinite alternate;
    animation-play-state: paused;
}

.index-grid-water-caustics--sheen {
    height: 100%;
    opacity: 0.06;
    filter: blur(22px);
    animation-duration: 28s;
    animation-direction: alternate-reverse;
}

.index-grid-water-rays {
    position: absolute;
    inset: 0;
    opacity: 0.42;
    mix-blend-mode: screen;
    background:
        repeating-linear-gradient(
            106deg,
            transparent 0,
            transparent 46px,
            rgba(255, 250, 240, 0.03) 54px,
            rgba(255, 252, 245, 0.09) 66px,
            rgba(255, 250, 240, 0.035) 80px,
            transparent 108px,
            transparent 150px
        ),
        repeating-linear-gradient(
            98deg,
            transparent 0,
            transparent 90px,
            rgba(255, 248, 235, 0.025) 102px,
            rgba(255, 252, 245, 0.07) 114px,
            rgba(255, 250, 240, 0.02) 128px,
            transparent 160px,
            transparent 210px
        );
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.62) 18%, rgba(0, 0, 0, 0.32) 58%, transparent 90%);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.62) 18%, rgba(0, 0, 0, 0.32) 58%, transparent 90%);
    animation: index-grid-rays 32s linear infinite;
    animation-play-state: paused;
}

.index-grid-water-bubbles span {
    position: absolute;
    bottom: -8%;
    left: var(--x, 50%);
    width: var(--size, 6px);
    height: var(--size, 6px);
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.14) 46%, transparent 72%);
    box-shadow: 0 0 8px rgba(255, 250, 240, 0.18);
    animation: index-grid-bubble var(--dur, 16s) var(--delay, 0s) linear infinite;
    animation-play-state: paused;
    will-change: transform, opacity;
}

.index-grid-water-sparkles span {
    position: absolute;
    left: var(--x, 50%);
    top: var(--y, 50%);
    width: var(--size, 2px);
    height: var(--size, 2px);
    border-radius: 50%;
    background: rgba(255, 252, 245, 0.95);
    box-shadow: 0 0 6px 1px rgba(255, 250, 240, 0.65), 0 0 1px rgba(255, 255, 255, 0.9);
    animation: index-grid-glint var(--dur, 6s) var(--delay, 0s) ease-in-out infinite;
    animation-play-state: paused;
    opacity: 0;
    will-change: transform, opacity;
    pointer-events: none;
}

#index-explore-grid.is-water-active .index-grid-water-caustics,
#index-explore-grid.is-water-active .index-grid-water-rays,
#index-explore-grid.is-water-active .index-grid-water-bubbles span,
#index-explore-grid.is-water-active .index-grid-water-sparkles span {
    animation-play-state: running;
}

@keyframes index-grid-caustics {
    from { transform: translate3d(-2.5%, 0, 0) scale(1); }
    to { transform: translate3d(3%, 2%, 0) scale(1.06); }
}

@keyframes index-grid-rays {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-90px, 0, 0); }
}

@keyframes index-grid-bubble {
    0% {
        transform: translate3d(0, 0, 0) scale(0.65);
        opacity: 0;
    }
    8% { opacity: 0.65; }
    75% { opacity: 0.35; }
    100% {
        transform: translate3d(var(--drift, 12px), -125vh, 0) scale(1.05);
        opacity: 0;
    }
}

@keyframes index-grid-glint {
    0%, 100% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(0.45);
    }
    18% {
        opacity: 0.95;
        transform: translate3d(calc(var(--drift, 8px) * 0.25), -8px, 0) scale(1);
    }
    42% {
        opacity: 0.12;
        transform: translate3d(calc(var(--drift, 8px) * 0.55), -16px, 0) scale(0.6);
    }
    68% {
        opacity: 0.8;
        transform: translate3d(var(--drift, 8px), -26px, 0) scale(1.2);
    }
    88% {
        opacity: 0.05;
        transform: translate3d(calc(var(--drift, 8px) * 1.15), -34px, 0) scale(0.4);
    }
}

/* Gentle ripple on shirts and glitch text — same SVG turbulence idea as the hero water. */
body.index-page #index-explore-grid .explore-hero-img,
body.index-page #index-explore-grid .explore-grid-placeholder-img {
    filter: none;
}

body.index-page #index-explore-grid .explore-hero-text-fill {
    filter: url(#indexGridWaterRipple);
}

@media (max-width: 768px) {
    body.index-page #index-explore-grid .explore-hero-img,
    body.index-page #index-explore-grid .explore-grid-placeholder-img {
        filter: none;
    }
    body.index-page #index-explore-grid .explore-hero-text-fill {
        filter: none;
    }
    .index-grid-water-caustics {
        opacity: 0.12;
        filter: blur(20px);
        animation-duration: 30s;
    }
    .index-grid-water-caustics--sheen {
        display: none;
    }
    .index-grid-water-rays {
        opacity: 0.3;
        animation-duration: 48s;
    }
    .index-grid-water-bubbles span:nth-child(n+6) {
        display: none;
    }
    .index-grid-water-sparkles span:nth-child(n+10) {
        display: none;
    }
    body.index-page #index-explore-grid .explore-hero-img,
    body.index-page #index-explore-grid .explore-grid-placeholder-img,
    body.index-page #index-explore-grid .explore-hero-info {
        animation-name: index-grid-float-mobile;
    }
    @keyframes index-grid-float-mobile {
        0%, 100% { transform: translate3d(0, 0, 0) rotate(-0.1deg); }
        25% { transform: translate3d(1.5px, -4px, 0) rotate(0.12deg); }
        50% { transform: translate3d(-1px, -2px, 0) rotate(-0.06deg); }
        75% { transform: translate3d(-2px, -5px, 0) rotate(0.1deg); }
    }
}

@media (prefers-reduced-motion: reduce) {
    .index-grid-water-caustics,
    .index-grid-water-caustics--sheen,
    .index-grid-water-rays,
    .index-grid-water-bubbles span,
    .index-grid-water-sparkles span,
    body.index-page #index-explore-grid .explore-hero-img,
    body.index-page #index-explore-grid .explore-grid-placeholder-img,
    body.index-page #index-explore-grid .explore-hero-info {
        animation: none !important;
    }
    .index-grid-water-bubbles,
    .index-grid-water-sparkles {
        display: none;
    }
    body.index-page #index-explore-grid .explore-hero-img,
    body.index-page #index-explore-grid .explore-grid-placeholder-img {
        filter: none;
    }
    body.index-page #index-explore-grid .explore-hero-text-fill {
        filter: none;
    }
}


/* Hide glitch lines and product name/RUNWAY labels on the home grid only.
   Markup and the Aesthetic page stay intact. Clicks still hit the card. */
body.index-page #index-explore-grid .explore-hero-text-fill,
body.index-page #index-explore-grid .explore-hero-info {
    display: none;
}

/* 3D tumble + cloth canvas overlay (JS wraps each shirt image).
   Perspective stays on the card, but we flatten (no preserve-3d) so a
   rotated shirt is composited as a 2D layer and cannot slip behind the
   card's black background. The wrap sits above the glitch text. */
body.index-page #index-explore-grid .explore-hero-section,
body.index-page #index-explore-grid .explore-grid-placeholder {
    perspective: 1100px;
    transform-style: flat;
    overflow: visible;
}

body.index-page #index-explore-grid .index-shirt-cloth {
    position: relative;
    z-index: 2;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
    transform-origin: 50% 55%;
    backface-visibility: visible;
}

/* Keep the original <img> visible until the cloth canvas has a real frame.
   No glow or rim — shirts sit on pure black. */
body.index-page #index-explore-grid .index-shirt-cloth .explore-hero-img,
body.index-page #index-explore-grid .index-shirt-cloth .explore-grid-placeholder-img {
    opacity: 1;
    filter: none;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

body.index-page #index-explore-grid .index-shirt-cloth-canvas {
    position: absolute;
    left: -18%;
    top: -18%;
    width: 136%;
    height: 136%;
    display: block;
    pointer-events: none;
    opacity: 0;
    backface-visibility: visible;
    filter: none;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

body.index-page #index-explore-grid .index-shirt-cloth.is-cloth-live .explore-hero-img,
body.index-page #index-explore-grid .index-shirt-cloth.is-cloth-live .explore-grid-placeholder-img {
    opacity: 0;
    filter: none;
}

body.index-page #index-explore-grid .index-shirt-cloth.is-cloth-live .index-shirt-cloth-canvas {
    opacity: 1;
}

@media (max-width: 768px) {
    body.index-page #index-explore-grid .index-shirt-cloth .explore-hero-img,
    body.index-page #index-explore-grid .index-shirt-cloth .explore-grid-placeholder-img,
    body.index-page #index-explore-grid .index-shirt-cloth-canvas {
        filter: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.index-page #index-explore-grid .index-shirt-cloth .explore-hero-img,
    body.index-page #index-explore-grid .index-shirt-cloth .explore-grid-placeholder-img {
        opacity: 1;
    }
    body.index-page #index-explore-grid .index-shirt-cloth-canvas {
        display: none;
    }
}

/* Keep the hero corner box, but hide the shirt inside it.
   Frame, zoom icon, and scroll arrows stay visible and working. */
body.index-page .hero-gone-mini-wrapper {
    background: #000;
}
body.index-page .hero-gone-mini-wrapper .hero-gone-extra-image,
body.index-page .hero-gone-mini-wrapper .hero-gone-image-mini {
    visibility: hidden;
}
body.index-page .hero-gone-mini-wrapper .hero-gone-extra-image-button {
    height: 140px;
}
body.index-page .hero-gone-mini-wrapper .hero-gone-zoom-icon {
    opacity: 1;
    background: transparent;
}
@media (max-width: 768px) {
    body.index-page .hero-gone-mini-wrapper .hero-gone-extra-image-button {
        height: 100px;
    }
}

