/* ===== Hero: camera that slides down on scroll, video on its screen ===== */

/* Scroll track: gives the sticky hero room to animate */
.hero-scroll {
    position: relative;
    height: 400vh;          /* phase 1: camera slides down; phase 2: video opens to full screen */
}
.hero-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}
.hero-sticky .main-banner {
    height: 100vh;
    max-height: none;
    box-sizing: border-box;
}
.hero-copy {
    position: relative;
    z-index: 5;
    will-change: transform, opacity;
}

/* Camera rig = camera body + live screen layered exactly on top of the baked-in screen */
.camera-rig {
    position: absolute;
    right: 0;
    top: 30px;
    width: min(1233px, 66vw);
    aspect-ratio: 824 / 401;
    z-index: 2;
    transform-origin: 50% 50%;
    will-change: transform;
    pointer-events: none;
}
.camera-body {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
/* Screen rectangle inside camera-main.png: x 92, y 75, 470 x 267 of 824 x 401 */
.camera-screen {
    position: absolute;
    /* screen of camera-main.png (x 92, y 75, 470 x 267 of 824 x 401) + ~1.5px overscan so no baked-in photo peeks out */
    left: 11.0%;
    top: 18.45%;
    width: 57.4%;
    height: 67.35%;
    overflow: hidden;
    background: #0b0410;
    border-radius: 2px;
}
.camera-screen-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Viewfinder HUD */
.camera-hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    font: 600 clamp(9px, 0.9vw, 15px)/1 'Manrope', sans-serif;
    color: #fff;
    letter-spacing: .04em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
.camera-hud-rec {
    position: absolute;
    left: 4%;
    top: 6%;
    display: flex;
    align-items: center;
    gap: .45em;
}
.camera-hud-rec::before {
    content: "";
    width: .8em;
    height: .8em;
    border-radius: 50%;
    background: #ff2d55;
    box-shadow: 0 0 8px #ff2d55;
    animation: hud-blink 1.2s steps(2, start) infinite;
}
.camera-hud-time {
    position: absolute;
    right: 4%;
    top: 6%;
    font-variant-numeric: tabular-nums;
}
/* Rule-of-thirds grid */
.camera-hud-grid {
    position: absolute;
    inset: 9% 5%;
    opacity: .7;
    background:
        linear-gradient(#E63FD3, #E63FD3) 33.33% 0 / 1px 100% no-repeat,
        linear-gradient(#E63FD3, #E63FD3) 66.66% 0 / 1px 100% no-repeat,
        linear-gradient(#E63FD3, #E63FD3) 0 33.33% / 100% 1px no-repeat,
        linear-gradient(#E63FD3, #E63FD3) 0 66.66% / 100% 1px no-repeat;
    border: 1px solid #E63FD3;
}
@keyframes hud-blink {
    to { visibility: hidden; }
}

/* ===== Showreel that opens out of the camera screen ===== */
.reel {
    position: absolute;
    inset: 0;
    z-index: 4;
    overflow: hidden;
    background: #000;
    opacity: 0;
    pointer-events: none;
    clip-path: inset(50% 50% 50% 50%);
    will-change: clip-path;
}
.reel.is-on { opacity: 1; }
.reel.is-open { pointer-events: auto; cursor: none; }
.reel-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reel::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .2); pointer-events: none; }
.reel-ui { position: absolute; inset: 0; z-index: 1; opacity: 0; pointer-events: none; }
.reel .grid9 {
    position: absolute; inset: 2.5rem; border-radius: .75rem;
    display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
    border: 1px solid var(--line-pink, #ef11b1);
}
.reel .grid9 > i { border-right: 1px solid var(--line-pink, #ef11b1); border-bottom: 1px solid var(--line-pink, #ef11b1); }
.reel .grid9 > i:nth-child(3n) { border-right: 0; }
.reel .grid9 > i:nth-child(n+7) { border-bottom: 0; }
.reel-logo { position: absolute; right: 2.5rem; top: 2.25rem; width: 10.3rem; }
.reel-sun { position: absolute; left: 3.65rem; top: 50%; width: 2.8rem; transform: translateY(-50%); }

/* Very tall screens (4K etc.): keep the opened video landscape, centred vertically (desktop only) */
@media (min-width: 1001px) {
    .reel { top: 50%; bottom: auto; height: min(100%, 62rem); translate: 0 -50%; }
}

/* Mini screen that follows the cursor and plays the same video */
.reel-cursor {
    position: absolute; z-index: 2; left: 0; top: 0;
    width: 11.0625rem; padding: 0; border: 0; background: none; cursor: none;
    opacity: 0; pointer-events: none;
    transform: translate3d(var(--x, 70vw), var(--y, 40vh), 0) translate(-50%, -50%);
    will-change: transform;
}
.reel.is-open .reel-cursor { pointer-events: auto; }
.reel-cursor video { width: 100%; height: 6.25rem; object-fit: cover; display: block; }
.reel-cursor .btn { width: 100%; }

/* ===== Tablet / mobile: no sticky, camera in flow with a light parallax ===== */
@media (max-width: 1000px) {
    /* Phones/tablets: no camera and no scroll scene — just the headline, then the showreel block */
    .hero-scroll { height: auto; }
    .hero-sticky { position: relative; height: auto; overflow: visible; }
    .hero-sticky .main-banner { height: auto; padding-bottom: .5rem; }
    .hero-sticky .hero-menu { display: none; }
    .hero-sticky .camera-rig { display: none; }
    .reel {
        position: relative; inset: auto; z-index: 1; margin-top: 2.25rem;
        aspect-ratio: 4 / 5; max-height: 78vh; width: 100%;
        border-radius: 1.25rem; clip-path: none !important; pointer-events: auto;
        box-shadow: 0 0 2rem rgba(235, 21, 178, .22);
        opacity: 0; transform: translateY(2.5rem) scale(.97);
        transition: opacity .8s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
    }
    .reel.in { opacity: 1; transform: none; }
    .reel-video { transform: none !important; }
    .reel-ui { opacity: 1 !important; }
    .reel-cursor { display: none !important; }
    .reel .grid9 { inset: 1rem; border-radius: .6rem; }
    .reel-logo { width: 5.5rem; right: 1.4rem; top: 1.4rem; }
    .reel-sun { left: 1.8rem; width: 1.6rem; }
    .reel-ui::after {
        content: "▶  Смотреть шоурил"; position: absolute; left: 50%; bottom: 2rem; transform: translateX(-50%);
        padding: .75rem 1.25rem; border-radius: 999px; white-space: nowrap;
        font: 800 .875rem/1 'Manrope', sans-serif; color: #fff;
        background: var(--pink, #eb15b2); box-shadow: 0 0 1rem rgba(235, 21, 178, .6);
    }
    .hero-sticky .hero-feats {
        position: relative; left: auto; right: auto; bottom: auto; margin: 2rem 0 0;
        grid-template-columns: 1fr; gap: .7rem;
    }
}
@media (max-width: 1000px) and (prefers-reduced-motion: reduce) { .reel { opacity: 1; transform: none; transition: none; } }

/* Scroll arrow was only for the mobile scroll scene, which is gone */
.reel-arrow { display: none !important; }
@keyframes reel-arrow {
    0%, 100% { opacity: .25; transform: translateY(-4px) rotate(45deg); }
    50%      { opacity: 1;   transform: translateY(4px) rotate(45deg); }
}

/* ===== Reduced motion: the scroll effect stays (it follows the user's own scroll), only blinking stops ===== */
@media (prefers-reduced-motion: reduce) {
    .camera-hud-rec::before { animation: none; }
}
