/* Lightweight CSS-only 3D system — perspective/transform based, no WebGL.
   Cards sit at a permanent isometric tilt (not just on hover) so the 3D
   effect is visible immediately, not only on interaction. */

.tilt-scene,
.card-3d-stack {
    perspective: 1600px;
}

.tilt-card,
.card-3d-layer {
    transform-style: preserve-3d;
    will-change: transform;
}

.tilt-card {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Permanent isometric tilt — this is the actual "3D" look, always on */
.card-3d-tilt {
    transform: perspective(1200px) rotateX(12deg) rotateY(-22deg) rotateZ(2deg);
    transform-style: preserve-3d;
    box-shadow:
        1px 1px 0 1px rgba(0, 0, 0, 0.04),
        18px 22px 0 -6px rgba(16, 24, 40, 0.06),
        30px 38px 0 -10px rgba(16, 24, 40, 0.05),
        40px 55px 45px -20px rgba(16, 24, 40, 0.35);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease;
}

.card-3d-tilt:hover {
    transform: perspective(1200px) rotateX(4deg) rotateY(-8deg) rotateZ(0.5deg) translateY(-6px) scale(1.02);
    box-shadow:
        1px 1px 0 1px rgba(0, 0, 0, 0.04),
        10px 14px 0 -6px rgba(16, 24, 40, 0.07),
        20px 26px 0 -10px rgba(16, 24, 40, 0.06),
        30px 45px 55px -18px rgba(16, 24, 40, 0.4);
}

.card-3d-tilt-alt {
    transform: perspective(1200px) rotateX(10deg) rotateY(20deg) rotateZ(-2deg);
    transform-style: preserve-3d;
    box-shadow:
        -1px 1px 0 1px rgba(0, 0, 0, 0.04),
        -18px 22px 0 -6px rgba(16, 24, 40, 0.06),
        -30px 38px 0 -10px rgba(16, 24, 40, 0.05),
        -40px 55px 45px -20px rgba(16, 24, 40, 0.35);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease;
}

.card-3d-tilt-alt:hover {
    transform: perspective(1200px) rotateX(4deg) rotateY(8deg) rotateZ(-0.5deg) translateY(-6px) scale(1.02);
}

@media (prefers-reduced-motion: no-preference) {

    .float-3d {
        animation: float3d 5s ease-in-out infinite;
    }

    .float-3d-delay-1 { animation-delay: 0.7s; }
    .float-3d-delay-2 { animation-delay: 1.4s; }

    @keyframes float3d {
        0%, 100% { transform: perspective(1200px) rotateX(12deg) rotateY(-22deg) rotateZ(2deg) translate3d(0, 0, 0); }
        50% { transform: perspective(1200px) rotateX(8deg) rotateY(-26deg) rotateZ(1deg) translate3d(0, -18px, 30px); }
    }

    .float-3d.card-3d-tilt-alt {
        animation-name: float3d-alt;
    }

    @keyframes float3d-alt {
        0%, 100% { transform: perspective(1200px) rotateX(10deg) rotateY(20deg) rotateZ(-2deg) translate3d(0, 0, 0); }
        50% { transform: perspective(1200px) rotateX(6deg) rotateY(24deg) rotateZ(-1deg) translate3d(0, -18px, 30px); }
    }

    .spin-slow-3d {
        animation: spin3d 10s linear infinite;
        transform-style: preserve-3d;
    }

    @keyframes spin3d {
        0% { transform: perspective(600px) rotateY(0deg); }
        100% { transform: perspective(600px) rotateY(360deg); }
    }

    .reveal-3d {
        opacity: 0;
        transform: translate3d(0, 40px, -60px) rotateX(8deg);
    }
}

/* Reduced-motion / fallback: keep the static isometric tilt, drop animation only */
@media (prefers-reduced-motion: reduce) {
    .float-3d {
        animation: none !important;
    }
    .tilt-card {
        transition: none !important;
        transform: none !important;
    }
    .reveal-3d {
        opacity: 1;
        transform: none;
    }
}

/* Ad-mockup card shell used on the hero + workshop page */
.ad-mockup-card {
    border-radius: 1.25rem;
    backface-visibility: hidden;
}

.ad-mockup-card .mockup-chrome-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
}

/* ===== Interactive 3D Configurator stage =====
   Style per ui-ux-pro-max "Modern Dark (Cinema Mobile)":
   deep slate studio, glassmorphism UI, accent glow, Expo.out motion. */
.stage-3d {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.stage-3d-canvas {
    position: relative;
    width: 100%;
    height: 460px;
    border-radius: 24px;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 12%, rgba(124, 140, 248, 0.16) 0%, transparent 55%),
        radial-gradient(ellipse at 78% 82%, rgba(99, 102, 241, 0.10) 0%, transparent 58%),
        linear-gradient(160deg, #0a0a0a 0%, #000000 60%, #000000 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 30px 70px -25px rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.stage-3d-canvas canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    cursor: grab;
}

.stage-3d-canvas canvas:active {
    cursor: grabbing;
}

.stage-3d-hint {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: opacity 0.4s ease;
}

.stage-3d-hint.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.stage-3d-caption {
    margin: 1.15rem auto 0;
    max-width: 620px;
    text-align: center;
    font-size: 0.9rem;
    font-style: italic;
    color: rgba(226, 232, 240, 0.72);
}

.stage-3d-ui {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.7rem;
    margin-top: 1.35rem;
}

.stage-3d-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.72rem 1.4rem;
    min-height: 44px;
    font-size: 0.88rem;
    font-weight: 600;
    /* solid, high-contrast against black — glass alone washed these out */
    color: #f1f5f9;
    background: #1c1c1f;
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    border-radius: 9999px;
    cursor: pointer;
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.stage-3d-btn i {
    color: #A9B4FF;
    transition: color 0.25s ease;
}

.stage-3d-btn:hover {
    color: #fff;
    background: #26262b;
    border-color: #A9B4FF;
}

.stage-3d-btn:focus-visible {
    outline: 2px solid #A9B4FF;
    outline-offset: 3px;
}

.stage-3d-btn.is-active {
    color: #FFFFFF;
    background: linear-gradient(135deg, #7C8CF8 0%, #4E5DD4 100%);
    border-color: transparent;
    box-shadow: 0 8px 24px -6px rgba(124, 140, 248, 0.55);
}

.stage-3d-btn.is-active i {
    color: #FFFFFF;
}

@media (max-width: 640px) {
    .stage-3d-canvas { height: 340px; border-radius: 20px; }
    .stage-3d-btn { padding: 0.65rem 1.05rem; font-size: 0.82rem; }
}

@media (prefers-reduced-motion: reduce) {
    .stage-3d-hint { display: none; }
}

/* Small "New" pill used next to the Workshop nav link */
.nav-new-badge {
    font-size: 0.625rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.4rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    color: #fff;
    vertical-align: super;
    margin-left: 0.35rem;
}
