/* ==========================================================================
   Home hero — 3D stage (desktop only, ≥992px).
   The company message stays on the left; the right side is a dark studio where hero-3d.js draws a
   rubber-to-metal anti-vibration mount. Holding the mouse button down pulls the part into its
   layers, each with a label; scrolling presses it down. Phones and tablets keep the photo / video hero and never load three.js.
   ========================================================================== */

.hero-stage { display: none; }

@media (min-width: 992px) {
    .hero-3d .hero-bg {
        inset: 0; animation: none;
        background-image:
            radial-gradient(ellipse 30% 42% at 72% 48%, rgba(215, 25, 32, .2), transparent 70%),
            radial-gradient(ellipse 48% 60% at 72% 50%, rgba(255, 255, 255, .06), transparent 72%),
            repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 80px),
            repeating-linear-gradient(0deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 80px),
            linear-gradient(100deg, #0c0d10 0%, #121419 52%, #181a20 100%);
        background-size: auto, auto, 80px 80px, 80px 80px, auto; background-position: 0 0;
    }
    /* The studio replaces the photo, the video and the decorative diagonals on desktop. */
    .hero-3d::after, .hero-3d .hero-video, .hero-3d .hero-shade, .hero-3d .video-toggle, .hero-3d .hero-lines,
    .hero-3d .hero-scroll { display: none !important; }
    /* Tighter than the photo hero so the whole stage and the top of the stats bar fit on a laptop screen. */
    .hero-3d { min-height: 620px; padding: 3.5rem 0 7.5rem; }
    /* Text hugs the left screen edge like the stage hugs the right, leaving the gap in the middle on wide monitors. */
    .hero-3d .hero-content { text-shadow: none; max-width: none; padding-inline: clamp(2.5rem, 8vw, 11rem); }
    .hero-3d .hero-content > * { max-width: 46%; }
    .hero-3d .hero-title { font-size: clamp(2.5rem, 3.9vw, 4rem); margin-bottom: 1.25rem; }
    .hero-3d .hero-lead { margin-bottom: 2rem; }
    .hero-3d .hero-badges { margin-top: 2rem; }

    /* Bottom edge stops where the stats bar starts to overlap the hero. */
    .hero-stage { display: block; position: absolute; top: 0; right: 0; bottom: 5.5rem; width: 56%; z-index: 0; }
    .hero-stage-canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 1s ease; cursor: grab; }
    .hero-stage.is-ready .hero-stage-canvas { opacity: 1; }
    /* While three.js loads: a quiet ring where the part will appear. */
    .hero-stage::before {
        content: ""; position: absolute; left: 50%; top: 46%; width: 120px; height: 120px; margin: -60px 0 0 -60px;
        border: 1px solid rgba(255, 255, 255, .12); border-top-color: var(--ar-red); border-radius: 50%;
        animation: hero-stage-spin 1.2s linear infinite; transition: opacity .4s ease;
    }
    .hero-stage.is-ready::before, .hero-stage.is-failed::before { opacity: 0; animation: none; }
    /* No WebGL or the library could not load: show the facility photo behind the same diagonal cut the site uses. */
    .hero-stage.is-failed {
        background: linear-gradient(90deg, rgba(12, 13, 16, .5), transparent 40%), url("/images/hero-1920.jpg") 60% center / cover no-repeat;
        clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%);
    }
    .hero-stage.is-failed .hero-stage-canvas { display: none; }
}

/* Scroll press: the hero stays put for 60vh of scroll while hero-3d.js presses the mount down, then the page carries on as before. */
@media (min-width: 992px) and (prefers-reduced-motion: no-preference) {
    /* Fills the screen under the header while pinned, so tall monitors never show the empty scroll track below it. */
    .hero-track .hero-3d { position: sticky; top: var(--ar-header-height); min-height: max(620px, calc(100vh - var(--ar-header-height))); }
    .hero-track::after { content: ""; display: block; height: 60vh; }
}

@keyframes hero-stage-spin { to { transform: rotate(360deg); } }
