/* ==========================================================================
   3D Work Page – Industrial Showroom & Pedestal Viewport
   Scoped and optimized to avoid global page style conflicts
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Baumans&family=Comfortaa:wght@300;400;700&family=Rock+Salt&display=swap");

/* Remove top margin since the header is removed, full bleed alignment */
.wrapper-parallax--half {
    margin-top: 0 !important;
}

/* ==========================================================================
   1. Showroom Container (Heavy Riveted Industrial Steel Frame)
   ========================================================================== */
.showroom-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem 5vh 2rem;
    border-radius: 0;
    margin: 0;
    max-width: none;
    box-sizing: border-box;
    position: relative;
    background-color: #1a1a1a;
    /* Subtle grid pattern background */
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 30px 30px;

    /* Sleek Dark Beveled Steel Frame */
    border: 36px solid #2b2b2b;
    border-top-color: #3d3d3d;
    /* Light highlight (top-left) */
    border-left-color: #3d3d3d;
    border-bottom-color: #181818;
    /* Volumetric shadow (bottom-right) */
    border-right-color: #181818;

    box-shadow:
        /* Inner detail grooves */
        inset 0 0 0 2px #121212,
        inset 0 0 0 5px #444444,
        inset 0 0 25px rgba(0, 0, 0, 0.9),
        /* Outer volumetric shadows */
        0 0 0 2px #121212,
        0 0 0 8px #2b2b2b,
        0 0 0 10px #3d3d3d,
        0 15px 35px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   2. Brushed Steel Title Plate
   ========================================================================== */
.title-plate {
    position: relative;
    width: 90%;
    max-width: 650px;
    margin: 0 auto 3rem auto;
    text-align: center;
    z-index: 10;
    padding: 1.5rem 2.5rem;
    box-sizing: border-box;
    background: linear-gradient(135deg, #444 0%, #222 100%);
    /* Brushed metal texture simulation */
    background-image:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.01) 0px, rgba(255, 255, 255, 0.01) 1px, transparent 1px, transparent 10px),
        linear-gradient(135deg, #444 0%, #222 100%);
    border: 3px solid #555;
    border-top-color: #777;
    border-left-color: #777;
    border-bottom-color: #111;
    border-right-color: #111;
    border-radius: 4px;
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.title-plate h1 {
    margin: 0;
    font-family: 'Comfortaa', 'Baumans', sans-serif !important;
    font-size: clamp(1.4rem, 4vw, 2.5rem);
    color: #e0e0e0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
}

/* Rivets / Bolts in Corners */
.rivet,
.screw {
    position: absolute;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle at 4px 4px, #888, #333);
    border-radius: 50%;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8), inset -1px -1px 2px rgba(0, 0, 0, 0.6);
}

.rivet::after,
.screw::after {
    content: "";
    position: absolute;
    top: 5px;
    left: 2px;
    width: 8px;
    height: 2px;
    background-color: #111;
    transform: rotate(45deg);
}

.top-left {
    top: 10px;
    left: 10px;
}

.top-right {
    top: 10px;
    right: 10px;
}

.bottom-left {
    bottom: 10px;
    left: 10px;
}

.bottom-right {
    bottom: 10px;
    right: 10px;
}

/* ==========================================================================
   3. Main Showcase Viewport Stage
   ========================================================================== */
.stage-viewport {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 520px;
    border: 6px solid #282828;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2.5rem;
    /* Allow JS to handle horizontal swipes; browser handles vertical scroll */
    touch-action: pan-y;

    /* Frame bevel depth shadows */
    box-shadow:
        inset 0 0 40px rgba(0, 0, 0, 0.95),
        0 10px 25px rgba(0, 0, 0, 0.6);

    background-color: #0d0d0d;
}

.stage-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/concrete_podium.png');
    background-size: cover;
    background-position: center;
    z-index: 1;
    pointer-events: none;
}

/* 3D Holographic active-sculpt floating system */
.active-sculpt-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.active-sculpt-float {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80%;
    height: 62%;
    animation: float 5s ease-in-out infinite;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.85));
    
    position: relative;
    z-index: 2;
    
    /* Establish Container Query Context */
    container-type: size;
    container-name: floatContainer;
}

#active-sculpt-wrapper {
    position: relative;
    display: inline-block;
    /* Remove max-width/max-height to let it tightly shrink-wrap the image */
    background-color: #121212;
    border: 3px solid #333;
    border-radius: 6px;
    overflow: hidden;
    cursor: zoom-in;
    touch-action: manipulation;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    
    transition: opacity 0.3s ease-in-out, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* 3D Tilt Effect Variables */
    --rotateX: 0deg;
    --rotateY: 0deg;
    --glare-x: 50%;
    --glare-y: 50%;
    --glare-opacity: 0;

    transform-style: preserve-3d;
    transform: perspective(800px) rotateX(var(--rotateX)) rotateY(var(--rotateY));
    will-change: transform, box-shadow;
}

#active-sculpt-wrapper:hover {
    border-color: #cd7f32;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6), 0 8px 16px rgba(205, 127, 50, 0.3);
}

#active-sculpt-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at var(--glare-x) var(--glare-y),
        rgba(255, 255, 255, 0.45) 0%,
        rgba(255, 255, 255, 0) 60%
    );
    opacity: var(--glare-opacity);
    mix-blend-mode: overlay;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

#active-sculpt {
    display: block;
    width: auto;
    height: auto;
    
    /* Fallback sizing for older browsers */
    max-width: 720px;
    max-height: 322px;
}

/* Fallback Media Queries matching the stage viewport heights */
@media (max-width: 900px) {
    #active-sculpt { 
        max-width: 80vw;
        max-height: 235px; 
    }
}
@media (max-width: 600px) {
    #active-sculpt { 
        max-height: 161px; 
    }
}

/* Modern Sizing: Perfectly bounds the image to the float container */
@supports (container-type: size) {
    #active-sculpt {
        max-width: 100cqw;
        max-height: 100cqh;
    }
}

/* Floor Shadow on the Concrete Pedestal Stage */
.pedestal-shadow {
    position: absolute;
    bottom: 12%;
    /* Centered perfectly over the physical round concrete podium in the image */
    width: 140px;
    height: 24px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.85) 0%, transparent 70%);
    z-index: 1;
    border-radius: 50%;
    pointer-events: none;
    transform: scale(1);
    opacity: 0.9;
    animation: shadowScale 5s ease-in-out infinite;
}

/* Floating Animations */
@keyframes float {
    0% {
        transform: translateY(-8px);
    }

    50% {
        transform: translateY(12px);
    }

    100% {
        transform: translateY(-8px);
    }
}

@keyframes shadowScale {
    0% {
        transform: scale(0.9);
        opacity: 0.75;
        filter: blur(1px);
    }

    50% {
        transform: scale(1.15);
        opacity: 0.95;
        filter: blur(0px);
    }

    100% {
        transform: scale(0.9);
        opacity: 0.75;
        filter: blur(1px);
    }
}

/* ==========================================================================
   4. Museum Plaque / Information Placard
   ========================================================================== */
.museum-placard {
    position: relative;
    width: 90%;
    max-width: 750px;
    background: linear-gradient(135deg, #cd7f32 0%, #8b4513 100%);
    /* Metal bronze/brass surface */
    background-image:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0px, rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 4px),
        linear-gradient(135deg, #a05a2c 0%, #4a250b 100%);
    border: 4px solid #5a3014;
    border-top-color: #c77b47;
    border-left-color: #c77b47;
    border-bottom-color: #2b1304;
    border-right-color: #2b1304;
    padding: 2rem;
    box-sizing: border-box;
    border-radius: 4px;
    margin-bottom: 3rem;
    text-align: center;
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    z-index: 5;
}

.placard-contents {
    transition: opacity 0.3s ease-in-out;
}

.museum-placard h2 {
    margin: 0 0 0.8rem 0;
    font-family: 'Comfortaa', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: #f7e6d9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
    letter-spacing: 1px;
}

.tools-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.tool-badge {
    background-color: rgba(18, 9, 3, 0.7);
    color: #e6b89c;
    border: 1px solid #7d441e;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-family: 'Comfortaa', sans-serif;
    font-weight: bold;
    letter-spacing: 0.5px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.museum-placard p {
    font-family: 'Comfortaa', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #ebdcd0;
    margin: 0 0 1.5rem 0;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6);
}

.artstation-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, #333 0%, #151515 100%);
    color: #e0e0e0;
    border: 1.5px solid #555;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-family: 'Comfortaa', sans-serif;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.artstation-btn:hover {
    background: linear-gradient(180deg, #cd7f32 0%, #8b4513 100%);
    border-color: #f7e6d9;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   5. Interactive Grid Selector / Thumbnail Navigation
   ========================================================================== */
.thumbnail-selector {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.2rem;
    width: 100%;
    max-width: 900px;
    box-sizing: border-box;
    z-index: 5;
}

.thumb-card {
    position: relative;
    background-color: #121212;
    border: 3px solid #333;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);

    /* 3D Tilt Effect Variables */
    --rotateX: 0deg;
    --rotateY: 0deg;
    --translateY: 0px;
    --glare-x: 50%;
    --glare-y: 50%;
    --glare-opacity: 0;

    transform-style: preserve-3d;
    transform: perspective(800px) rotateX(var(--rotateX)) rotateY(var(--rotateY)) translateY(var(--translateY));
    will-change: transform, box-shadow;
}

/* Steam Trading Card Glare Overlay */
.thumb-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at var(--glare-x) var(--glare-y),
        rgba(255, 255, 255, 0.45) 0%,
        rgba(255, 255, 255, 0) 60%
    );
    opacity: var(--glare-opacity);
    mix-blend-mode: overlay;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.thumb-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.65;
    transition: all 0.3s ease;
}

.thumb-card .thumb-label {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(18, 18, 18, 0.85);
    color: #b0b0b0;
    font-family: 'Comfortaa', sans-serif;
    font-size: 0.75rem;
    text-align: center;
    padding: 6px 0;
    font-weight: bold;
    border-top: 1px solid #222;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cybernetic Neon Highlight Hover & Active states */
.thumb-card:hover {
    border-color: #cd7f32;
    --translateY: -5px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6), 0 8px 16px rgba(205, 127, 50, 0.3);
}

.thumb-card:hover img {
    opacity: 0.95;
    transform: scale(1.08);
}

.thumb-card:hover .thumb-label {
    background-color: rgba(205, 127, 50, 0.9);
    color: #fff;
}

.thumb-card.active {
    border-color: #ff9d3b;
    box-shadow: 0 0 18px rgba(255, 157, 59, 0.45);
    --translateY: -3px;
}

.thumb-card.active img {
    opacity: 1;
}

.thumb-card.active .thumb-label {
    background-color: #ff9d3b;
    color: #121212;
    border-top-color: #ff9d3b;
}

/* ==========================================================================
   Navigation Arrows for Viewport
   ========================================================================== */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(18, 18, 18, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #cdbcbc;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.prev-arrow {
    left: 25px;
}

.next-arrow {
    right: 25px;
}

.nav-arrow:hover {
    background: rgba(205, 127, 50, 0.9);
    border-color: #ff9d3b;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 15px rgba(255, 157, 59, 0.4);
}

.nav-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.nav-arrow:focus {
    outline: none;
}

/* ==========================================================================
   6. Responsive Adaptations
   ========================================================================== */

/* Swipe hint indicator — only shown on touch-capable devices */
.swipe-hint {
    display: none;
    text-align: center;
    font-family: 'Comfortaa', sans-serif;
    font-size: 0.75rem;
    color: rgba(205, 127, 50, 0.7);
    letter-spacing: 1px;
    margin-top: -1.2rem;
    margin-bottom: 1.5rem;
    pointer-events: none;
    animation: hintFade 2.5s ease-in-out 1s forwards;
    opacity: 0;
}

@keyframes hintFade {
    0%   { opacity: 0; }
    20%  { opacity: 1; }
    80%  { opacity: 1; }
    100% { opacity: 0; }
}

@media (hover: none) and (pointer: coarse) {
    /* Touch device: show the swipe hint */
    .swipe-hint {
        display: block;
    }
}

@media (max-width: 900px) {
    .showroom-container {
        padding: 2rem 1rem 3vh 1rem;
        border-width: 20px;
    }

    .stage-viewport {
        height: 380px;
    }

    .pedestal-shadow {
        width: 100px;
        height: 18px;
        bottom: 12%;
    }

    .thumbnail-selector {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .nav-arrow {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    .prev-arrow { left: 15px; }
    .next-arrow { right: 15px; }
}

@media (max-width: 600px) {
    /* Stack the showroom: viewport + placard on top, thumbnail grid below */
    .showroom-container {
        padding: 1.5rem 0.75rem 2vh 0.75rem;
        border-width: 12px;
    }

    .title-plate {
        width: 100%;
        padding: 1rem 1.5rem;
        margin-bottom: 1.5rem;
    }

    .title-plate h1 {
        font-size: clamp(1.1rem, 5vw, 1.6rem);
    }

    .stage-viewport {
        height: 260px;
        margin-bottom: 1rem;
    }

    .pedestal-shadow {
        width: 75px;
        height: 13px;
        bottom: 12%;
    }


    .nav-arrow {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    .prev-arrow { left: 8px; }
    .next-arrow { right: 8px; }

    .museum-placard {
        padding: 1rem 1rem 1.2rem 1rem;
        margin-bottom: 1.5rem;
    }

    .museum-placard h2 {
        font-size: 1.2rem;
        margin-bottom: 0.6rem;
    }

    .museum-placard p {
        font-size: 0.9rem;
    }

    /* Thumbnail grid: 3 columns on mobile for compact browsing */
    .thumbnail-selector {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
    }

    .thumb-card .thumb-label {
        font-size: 0.65rem;
        padding: 4px 0;
    }
}

@media (max-width: 380px) {
    /* Very small phones: drop to 2-column grid */
    .thumbnail-selector {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   7. Lightbox — Full-Resolution Image Viewer
   ========================================================================== */
#lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Hidden by default */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#lightbox-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* Dark blurred backdrop */
#lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: zoom-out;
}

/* Close button */
#lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10001;
    width: 44px;
    height: 44px;
    background: rgba(40, 40, 40, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #e0e0e0;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

#lightbox-close:hover {
    background: rgba(205, 127, 50, 0.9);
    border-color: #ff9d3b;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 14px rgba(255, 157, 59, 0.5);
}

/* Image container with spring scale-in animation */
#lightbox-content {
    position: relative;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 92vw;
    max-height: 88vh;
    transform: scale(0.85);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#lightbox-overlay.open #lightbox-content {
    transform: scale(1);
}

#lightbox-img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 30px 60px rgba(0, 0, 0, 0.8);
    display: block;
    /* Image fades in after loading */
    opacity: 0;
    transition: opacity 0.25s ease;
}

#lightbox-img.loaded {
    opacity: 1;
}

/* Loading spinner shown while image fetches */
#lightbox-spinner {
    position: absolute;
    color: #cd7f32;
    font-size: 2rem;
    opacity: 1;
    transition: opacity 0.2s ease;
}

#lightbox-spinner.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Caption below the image */
#lightbox-caption {
    position: relative;
    z-index: 10000;
    margin-top: 1rem;
    font-family: 'Comfortaa', sans-serif;
    font-size: 0.9rem;
    color: rgba(224, 224, 224, 0.75);
    letter-spacing: 0.5px;
    text-align: center;
    max-width: 92vw;
}