/* ============================================================
   3D SCROLL HERO  — fullscreen Three.js canvas, pinned on scroll
   ------------------------------------------------------------
   Markup contract (see index.html):

     <section.hero3d>              ← ~350vh tall, supplies scroll distance
        <div.hero3d__stage>        ← position:sticky, 100vh, the "pinned" frame
           <canvas.hero3d__canvas> ← WebGL surface, fills the stage
           <div.hero3d__overlay>   ← headline / CTA copy over the 3D scene
        </div>
     </section>

   Why sticky (not position:fixed) for the pin:
   the stage sticks to the top of the viewport for the entire scroll of
   the 350vh section, then releases on its own when the next section
   arrives — no manual show/hide bookkeeping, and it cooperates with the
   Lenis smooth-scroll (which drives real scrollTop) far better than a
   fixed element. It is also RTL-safe: only top/inset are used, never
   left/right.
   ============================================================ */

.hero3d {
    position: relative;
    height: 300vh;            /* scroll length that the 3D timeline maps onto (3 acts) */
    margin-top: -80px;        /* slide the canvas up under the translucent header */
    z-index: 2;
}

/* The pinned, full-viewport frame */
.hero3d__stage {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    isolation: isolate;
    background: #ffffff;       /* brand white backdrop */
}

/* WebGL canvas fills the pinned stage */
.hero3d__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
    opacity: 0;                /* revealed once the first GLB has loaded */
    transition: opacity 0.9s ease;
}

.hero3d__canvas.is-ready {
    opacity: 1;
}

/* Copy layer sits above the canvas but stays click-through,
   so wheel/touch scroll reaches the page normally */
.hero3d__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    pointer-events: none;
    will-change: opacity, transform;
}

.hero3d__content {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;   /* RTL: flex-start hugs the right edge */
    text-align: right;
}

.hero3d__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--purple);
    margin-bottom: 18px;
    padding: 7px 16px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.16);
    backdrop-filter: blur(6px);
}

.hero3d__title {
    font-size: clamp(2.3rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.12;
    color: #1e0b2f;
    margin: 0 0 20px;
    max-width: 18ch;
}

.hero3d__title span {
    color: var(--purple);
}

.hero3d__subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #4a5568;
    line-height: 1.8;
    max-width: 46ch;
    margin: 0 0 30px;
}

.hero3d__actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    pointer-events: auto;      /* re-enable interaction for the buttons */
}

/* Scroll cue — minimal vertical track + travelling dot */
.hero3d__cue {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: rgba(124, 58, 237, 0.75);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    pointer-events: none;
}

.hero3d__cue-line {
    position: relative;
    width: 1px;
    height: 42px;
    background: linear-gradient(to bottom, transparent, rgba(124, 58, 237, 0.45));
    overflow: hidden;
}

.hero3d__cue-line::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: var(--purple);
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.5);
    animation: hero3dCue 2.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes hero3dCue {
    0%   { top: -6px;  opacity: 0; }
    20%  { opacity: 1; }
    80%  { opacity: 1; }
    100% { top: 42px;  opacity: 0; }
}

/* ---- Dark mode: keep the brand purple lighting, swap the white ---- */
body.dark-mode .hero3d__stage {
    background: var(--dark-bg-primary);
}

body.dark-mode .hero3d__title {
    color: var(--dark-text-primary);
}

body.dark-mode .hero3d__subtitle {
    color: var(--dark-text-secondary);
}

/* ---- Mobile / tablet ---- */
@media (max-width: 768px) {
    .hero3d {
        height: 240vh;          /* slightly shorter timeline on small screens */
    }

    .hero3d__content {
        align-items: center;
        text-align: center;
    }

    .hero3d__actions {
        justify-content: center;
    }
}

/* ---- Accessibility: no scroll-driven 3D for reduced-motion users ---- */
@media (prefers-reduced-motion: reduce) {
    .hero3d {
        height: 100vh;          /* collapse the scroll timeline to one screen */
    }

    .hero3d__stage {
        position: relative;     /* nothing to pin — render statically */
    }

    .hero3d__cue {
        display: none;
    }
}

/* ============================================================
   SCENE 2  — Web development services
   Opacity is driven by JS (laptopK 0→1 at 35–45% scroll).
   Cards float via CSS; no entrance animation needed since the
   parent overlay itself fades in.
   ============================================================ */

.hero3d__overlay.scene2 {
    opacity: 0;
    pointer-events: none;
}

/* Heading — mirrors scene1 title layout */
.scene2__heading {
    position: absolute;
    top: max(92px, 10vh);
    left: 50%;
    width: 100%;
    max-width: 760px;
    padding: 0 24px;
    text-align: center;
    transform: translateX(-50%);
}

.scene2__title {
    font-family: 'Vazirmatn', sans-serif;
    font-size: clamp(1.55rem, 3.4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.4;
    color: #7c3aed;
    margin: 0;
}

/* Metric cards — tucked into the empty corners, clear of the screenshots */
.scene2__metrics {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.metric-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    background: #ffffff;
    border: 1px solid rgba(124, 58, 237, 0.18);
    border-radius: 14px;
    box-shadow: 0 14px 32px rgba(124, 58, 237, 0.15);
    white-space: nowrap;
    animation: scene2CardFloat 5s ease-in-out infinite;
    animation-delay: calc(var(--i) * -1.7s);
    will-change: transform;
}

/* سرعت stays in the top-left corner; the other two sit in the inner band,
   between the flank screenshots and the centered laptop. */
.metric-card:nth-child(1) { top: 15%; left:  3%; }    /* ⚡ سرعت — top-left      */
.metric-card:nth-child(2) { top: 44%; left:  22%; }   /* 🎨 دیزاین حرفه‌ای — inner-left  */
.metric-card:nth-child(3) { top: 36%; right: 22%; }   /* 🔍 سئو — inner-right    */

@keyframes scene2CardFloat {
    0%, 100% { transform: translateY(-6px); }
    50%       { transform: translateY( 6px); }
}

.metric-card__icon {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(124, 58, 237, 0.10);
    color: #7c3aed;
    font-size: 0.9rem;
}

.metric-card__label {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #7c3aed;
}

/* CTAs — reuse scene1 button styles, anchor to bottom */
.scene2__actions {
    position: absolute;
    bottom: 3.5%;
    left: 50%;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    pointer-events: auto;
    transform: translateX(-50%);
}

@media (max-width: 768px) {
    .metric-card { display: none; }   /* cards clutter on small screens */
    .scene2__title { font-size: clamp(1.3rem, 5vw, 1.8rem); }
}

/* ============================================================
   SCENE 3  — Marketing campaigns / sales growth
   Overlay over the centered 3D bar chart. Same white + #7c3aed
   palette and float pattern as scene 2.
   ============================================================ */

.hero3d__overlay.scene3 {
    opacity: 0;
    pointer-events: none;
}

/* Heading — mirrors scene1/scene2 title layout */
.scene3__heading {
    position: absolute;
    top: max(92px, 10vh);
    left: 50%;
    width: 100%;
    max-width: 760px;
    padding: 0 24px;
    text-align: center;
    transform: translateX(-50%);
}

.scene3__title {
    font-family: 'Vazirmatn', sans-serif;
    font-size: clamp(1.55rem, 3.4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.4;
    color: #7c3aed;
    margin: 0;
}

/* Result badge — a small green "sales up" chip near the bars */
.scene3__badge {
    position: absolute;
    top: 30%;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: #ffffff;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 999px;
    box-shadow: 0 14px 32px rgba(34, 197, 94, 0.18);
    color: #16a34a;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    white-space: nowrap;
    transform: translateX(-50%);
    animation: scene2CardFloat 5s ease-in-out infinite;
}

/* Floating campaign cards — scoped so nth-child won't hit scene2 cards */
.scene3__campaigns {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.scene3__campaigns .campaign-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    background: #ffffff;
    border: 1px solid rgba(124, 58, 237, 0.18);
    border-radius: 14px;
    box-shadow: 0 14px 32px rgba(124, 58, 237, 0.15);
    white-space: nowrap;
    animation: scene2CardFloat 5s ease-in-out infinite;
    animation-delay: calc(var(--i) * -1.5s);
    will-change: transform;
}

.scene3__campaigns .campaign-card:nth-child(1) { top: 32%;    left:  7%; }  /* 📢 کمپین */
.scene3__campaigns .campaign-card:nth-child(2) { bottom: 26%; left:  9%; }  /* 🎯 هدف‌گیری */
.scene3__campaigns .campaign-card:nth-child(3) { top: 30%;    right: 7%; }  /* 📈 رشد فروش */
.scene3__campaigns .campaign-card:nth-child(4) { bottom: 26%; right: 9%; }  /* 👥 مشتری جدید */

.campaign-card__icon {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(124, 58, 237, 0.10);
    color: #7c3aed;
    font-size: 0.9rem;
}

.campaign-card__label {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #7c3aed;
}

/* CTAs — reuse scene1 button styles, anchor to bottom */
.scene3__actions {
    position: absolute;
    bottom: 3.5%;
    left: 50%;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    pointer-events: auto;
    transform: translateX(-50%);
}

@media (max-width: 768px) {
    .scene3__campaigns .campaign-card { display: none; }
    .scene3__title { font-size: clamp(1.3rem, 5vw, 1.8rem); }
    .scene3__badge { font-size: 0.85rem; top: 26%; }
}

/* ============================================================
   SCENE 1  — Instagram growth services
   HTML/CSS overlay over the centered 3D phone. Palette is strictly
   white + #7c3aed. All motion is pure CSS (transform/opacity only)
   so it stays GPU-cheap and never touches the JS render loop.
   ============================================================ */

.hero3d__overlay.scene1 {
    display: block;             /* children are absolutely positioned */
}

/* --- Orbiting service cards ------------------------------------------- */
.scene1__orbit {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;        /* orbit pivots on screen/phone center */
    /* match the phone's downward nudge so cards stay centered on it */
    transform: translateY(60px);
    pointer-events: none;
}

.orbit-card {
    /* radius scales with the viewport so it stays clear of the phone */
    --r: clamp(135px, 25vw, 240px);
    position: absolute;
    /* Outer ring spins; 4 cards offset by -9s each → even 90° spacing */
    animation: scene1Orbit 36s linear infinite;
    animation-delay: calc(var(--i) * -9s);
    will-change: transform;
}

/* Ring rotates, then counter-rotates the card so its text stays upright */
@keyframes scene1Orbit {
    from { transform: rotate(0deg)    translateX(var(--r)) rotate(0deg); }
    to   { transform: rotate(-360deg) translateX(var(--r)) rotate(360deg); }
}

.orbit-card__inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    background: #ffffff;
    border: 1px solid rgba(124, 58, 237, 0.18);
    border-radius: 14px;
    box-shadow: 0 14px 32px rgba(124, 58, 237, 0.18);
    white-space: nowrap;
    opacity: 0;                 /* revealed by the fade-in below */
    /* Two non-conflicting tracks: fade-in = opacity only, float = transform only */
    animation:
        scene1CardIn 0.8s ease forwards,
        scene1CardFloat 5s ease-in-out infinite;
    animation-delay:
        calc(0.4s + var(--i) * 0.15s),
        calc(var(--i) * -1.3s);
    will-change: transform, opacity;
}

@keyframes scene1CardIn { to { opacity: 1; } }

@keyframes scene1CardFloat {
    0%, 100% { transform: translateY(-6px); }
    50%      { transform: translateY(6px); }
}

.orbit-card__icon {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(124, 58, 237, 0.10);
    color: #7c3aed;
    font-size: 0.9rem;
}

.orbit-card__label {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #7c3aed;
}

/* --- Heading (top) ---------------------------------------------------- */
.scene1__heading {
    position: absolute;
    /* Clear the sticky header (~70px) but sit close to it. */
    top: max(92px, 10vh);
    left: 50%;
    width: 100%;
    max-width: 760px;
    padding: 0 24px;
    text-align: center;
    opacity: 0;
    transform: translateX(-50%);
    animation: scene1FadeUp 0.9s ease 0.2s forwards;
}

.scene1__title {
    font-family: 'Vazirmatn', sans-serif;
    font-size: clamp(1.55rem, 3.4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.35;
    color: #7c3aed;
    margin: 0 0 12px;
}

.scene1__subtitle {
    font-family: 'Vazirmatn', sans-serif;
    font-size: clamp(0.95rem, 1.7vw, 1.2rem);
    font-weight: 500;
    color: #7c3aed;
    opacity: 0.72;
    margin: 0;
}

/* --- CTAs (bottom) ---------------------------------------------------- */
.scene1__actions {
    position: absolute;
    bottom: 3.5%;
    left: 50%;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    pointer-events: auto;       /* buttons clickable; rest of overlay is not */
    opacity: 0;
    transform: translateX(-50%);
    animation: scene1FadeUp 0.9s ease 0.45s forwards;
}

.scene1__btn {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 13px 30px;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.scene1__btn:hover { transform: translateY(-2px); }

.scene1__btn--primary {
    background: #7c3aed;
    color: #ffffff;
    border: 2px solid #7c3aed;
}

.scene1__btn--primary:hover {
    background: #ffffff;
    color: #7c3aed;
}

.scene1__btn--ghost {
    background: transparent;
    color: #7c3aed;
    border: 2px solid #7c3aed;
}

.scene1__btn--ghost:hover {
    background: #7c3aed;
    color: #ffffff;
}

@keyframes scene1FadeUp {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* --- Mobile: tighter cards ------------------------------------------- */
@media (max-width: 768px) {
    .orbit-card__inner {
        padding: 9px 13px;
    }

    .orbit-card__icon {
        width: 26px;
        height: 26px;
    }

    .orbit-card__label {
        font-size: 0.8rem;
    }
}

/* --- Accessibility: hold cards still, keep them readable -------------- */
@media (prefers-reduced-motion: reduce) {
    .orbit-card,
    .orbit-card__inner {
        animation: none;
    }

    .orbit-card__inner {
        opacity: 1;
    }
}

/* --- Engagement stream: like / comment / follow bubbles --------------- */
.scene1__stream {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, calc(-50% + 80px)); /* centered on the phone */
    width: 160px;
    height: 340px;
    pointer-events: none;
    z-index: 0;
}

.stream-bubble {
    position: absolute;
    bottom: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    will-change: transform, opacity;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

/* Like — red, leftmost, first to appear */
.stream-bubble--like {
    background: #ef4444;
    color: #ffffff;
    left: 0;
    animation: streamRise 2s ease-in infinite;
    animation-delay: 0s;
}

/* Comment — white, appears beside the like */
.stream-bubble--comment {
    background: #ffffff;
    color: #374151;
    left: 56px;
    animation: streamRise 2s ease-in infinite;
    animation-delay: 0.3s;
}

/* Follow — blue */
.stream-bubble--follow {
    background: #3b82f6;
    color: #ffffff;
    left: 28px;
    animation: streamRise 2s ease-in infinite;
    animation-delay: 0.6s;
}

@keyframes streamRise {
    0%   { transform: translateY(0)      scale(0.6); opacity: 0; }
    12%  { transform: translateY(-20px)  scale(1);   opacity: 1; }
    80%  { opacity: 0.9; }
    100% { transform: translateY(-310px) scale(0.9); opacity: 0; }
}

/* --- Static growth accent chip ---------------------------------------- */
.scene1__growth {
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -250px;        /* sit to the left of the phone */
    margin-top: -150px;         /* and a bit above centre */
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #ffffff;
    border: 1px solid rgba(124, 58, 237, 0.18);
    border-radius: 999px;
    box-shadow: 0 14px 30px rgba(124, 58, 237, 0.18);
    color: #7c3aed;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    z-index: 3;
    opacity: 0;
    animation:
        scene1CardIn 0.8s ease 0.6s forwards,
        scene1ChipFloat 5s ease-in-out infinite;
    will-change: transform, opacity;
}

@keyframes scene1ChipFloat {
    0%, 100% { transform: translateY(-5px); }
    50%      { transform: translateY(5px); }
}

@media (max-width: 768px) {
    .scene1__growth {
        margin-left: -150px;
        margin-top: -190px;
        font-size: 0.8rem;
        padding: 8px 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scene1__stream {
        display: none;
    }
    .scene1__growth {
        animation: none;
        opacity: 1;
    }
}

/* --- Portfolio shots: client screenshots rising from below ------------ */
.scene1__shots {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.shot {
    position: absolute;
    margin: 0;
    opacity: 0;
    /* rise up into place (figure handles the entrance) */
    animation: shotRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(0.3s + var(--i) * 0.16s);
    will-change: transform, opacity;
}

.shot img {
    display: block;
    width: 158px;
    height: 281px;
    object-fit: cover;
    border-radius: 16px;
    border: 3px solid #ffffff;
    box-shadow: 0 18px 40px rgba(124, 58, 237, 0.22);
    /* the img keeps the tilt and a gentle float (separate transform layer) */
    transform: rotate(var(--rot));
    animation: shotFloat 6s ease-in-out infinite;
    animation-delay: calc(var(--i) * -1.4s);
    will-change: transform;
}

/* Uneven placement — two on the left, three on the right, varied heights & tilts */
.shot--l1 { left: 7%;  top: 26%; }
.shot--l2 { left: 15%; top: 55%; }
.shot--r1 { right: 6%;  top: 18%; }
.shot--r2 { right: 14%; top: 48%; }
.shot--r3 { right: 3%;  top: 66%; }

/* >>> Scene-2 LAPTOP shots — DESKTOP. Independent of scene 1; edit these to
   move the website screenshots around the laptop. (l1=khaneroghan,
   l2=yadaknama, r1=carzanmotor, r2=mashinekhoob) <<< */
.scene2__shots .shot--l1 { left: 7%;  top: 26%; }
.scene2__shots .shot--l2 { left: 15%; top: 55%; }
.scene2__shots .shot--r1 { right: 6%;  top: 18%; }
.scene2__shots .shot--r2 { right: 14%; top: 48%; }

@keyframes shotRise {
    from { opacity: 0; transform: translateY(150px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes shotFloat {
    0%, 100% { transform: rotate(var(--rot)) translateY(-5px); }
    50%      { transform: rotate(var(--rot)) translateY(5px); }
}

@media (max-width: 768px) {
    .shot img {
        width: 102px;
        height: 181px;
        border-width: 2px;
    }
    .shot--l1 { left: 1%;  top: 28%; }
    .shot--l2 { left: 9%;  top: 56%; }
    .shot--r1 { right: 1%;  top: 22%; }
    .shot--r2 { right: 8%;  top: 50%; }
    .shot--r3 { right: 2%;  top: 72%; }

    /* >>> Scene-2 LAPTOP shots — TABLET. Edit these to move only the laptop
       screenshots at this size. <<< */
    .scene2__shots .shot--l1 { left: 1%;  top: 28%; }
    .scene2__shots .shot--l2 { left: 9%;  top: 56%; }
    .scene2__shots .shot--r1 { right: 1%;  top: 22%; }
    .scene2__shots .shot--r2 { right: 8%;  top: 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .shot { opacity: 1; animation: none; }
    .shot img { animation: none; }
}

/* --- Scene 2: real website screenshots beside the laptop -------------- */
.scene2__shots {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

/* Override the scene-1 on-load rise: these rise when Scene 2 enters (.is-in). */
.scene2__shots .shot {
    opacity: 0;
    animation: none;
    transform: translateY(110px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(var(--i) * 0.12s);
}

.scene2.is-in .scene2__shots .shot {
    opacity: 1;
    transform: translateY(0);
}

/* show each site's header (top of the tall screenshot), not the middle */
.scene2__shots .shot img {
    object-position: top;
}

/* the screenshots are clickable links → re-enable pointer events on them
   (the .scene1__shots / .scene2__shots layers are pointer-events:none) */
.shot a {
    display: block;
    pointer-events: auto;
    cursor: pointer;
}

/* Once a scene is scrolled past (faded out), its overlay is set inert by JS.
   The shot links / CTA buttons re-enable pointer-events:auto, which would
   otherwise keep the now-invisible Instagram/website links tappable over the
   next scene. visibility:hidden removes the whole layer (and every descendant
   link/button) from hit-testing — a child's pointer-events:auto cannot undo
   it, unlike a parent pointer-events:none. The layer is already opacity ~0
   when this kicks in, so nothing visibly changes. */
.hero3d__overlay.is-inert {
    visibility: hidden;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .scene2__shots .shot { transition: none; }
}

/* Float that preserves horizontal centring (used by the phone-only scene-2
   labels, which are translateX(-50%)-centred between the shots). */
@keyframes scene2CardFloatCentered {
    0%, 100% { transform: translateX(-50%) translateY(-6px); }
    50%      { transform: translateX(-50%) translateY( 6px); }
}

/* ====================================================================
   PHONE WIDTHS (<=480px) — keep every floating hero element VISIBLE,
   just shrink it and tuck it into a clear corner so nothing overlaps
   the centred 3D object, the heading band (top) or the CTA band
   (bottom). Pairs with the aspect-aware camera dolly in
   hero-3d-scene.js so the WebGL scene itself also fits in portrait.
   ==================================================================== */
@media (max-width: 480px) {
    /* Client / website screenshots — the shared .shot--* classes drive
       both scene 1 (5 shots) and scene 2 (4 shots). Scale with the
       viewport, capped, pinned to the edges clear of the centre. */
    .shot img {
        width: 21vw;
        height: 37vw;           /* keeps the 158:281 portrait ratio */
        max-width: 90px;
        max-height: 160px;
        border-width: 2px;
    }
    /* Pulled in toward the centred phone — overlapping the floating text
       labels is fine, the photos are the focal point. */
    .shot--l1 { left: 8%;  top: 28%; }
    .shot--l2 { left: 8%;  top: 58%; }
    .shot--r1 { right: 16%; top: 23%; }
    .shot--r2 { right: 8%; top: 42%; }
    .shot--r3 { right: 8%; top: 66%; }

    /* >>> Scene-2 LAPTOP shots — PHONE. Edit these to move only the laptop
       screenshots at this size. <<< */
    .scene2__shots .shot--l1 { left: 8%;  top: 18%; }
    .scene2__shots .shot--l2 { left: 8%;  top: 68%; }
    .scene2__shots .shot--r1 { right: 16%; top: 20%; }
    .scene2__shots .shot--r2 { right: 8%; top: 68%; }

    /* >>> Scene-2 LAPTOP labels — shown on phone, horizontally centred:
       سرعت بالا between the two TOP shots, دیزاین حرفه‌ای between the two
       BOTTOM shots (سئو stays hidden). Edit `top` to move them up/down. <<< */
    .scene2__metrics .metric-card:nth-child(1),
    .scene2__metrics .metric-card:nth-child(2) {
        display: flex;
        padding: 7px 11px;
        left: 50%;
        right: auto;
        animation-name: scene2CardFloatCentered;   /* keeps the float while centred */
    }
    .scene2__metrics .metric-card__icon { width: 22px; height: 22px; font-size: 0.74rem; }
    .scene2__metrics .metric-card__label { font-size: 0.72rem; }
    .scene2__metrics .metric-card:nth-child(1) { top: 26%; }   /* between the two TOP shots */
    .scene2__metrics .metric-card:nth-child(2) { top: 72%; }   /* between the two BOTTOM shots */

    /* Scene-1 orbiting service cards — tighten the ring and shrink the
       chips so they circle the phone inside the viewport. The ring is
       dropped to follow the phone's lower position on phones. */
    .scene1__orbit { transform: translateY(125px); }
    .orbit-card { --r: clamp(122px, 42vw, 168px); }
    .orbit-card__inner { padding: 6px 10px; gap: 6px; }
    .orbit-card__icon { width: 22px; height: 22px; font-size: 0.74rem; }
    .orbit-card__label { font-size: 0.7rem; }

    /* Scene-1 growth chip — smaller, tucked to the left, lowered to follow
       the phone. */
    .scene1__growth {
        margin-left: -34vw;
        margin-top: -85px;
        font-size: 0.7rem;
        padding: 6px 10px;
    }

    /* Scene-1 engagement bubbles — smaller; spawn point shifted to the
       phone's bottom-left and raised so they start appearing higher up. */
    .scene1__stream {
        width: 132px;
        height: 300px;
        left: 48%;
        transform: translate(-50%, calc(-50% + 60px));
    }
    .stream-bubble { width: 38px; height: 38px; font-size: 16px; }
    .stream-bubble--comment { left: 46px; }
    .stream-bubble--follow  { left: 23px; }

    /* CTA buttons — keep both on one row instead of wrapping/stacking. */
    .scene1__actions,
    .scene2__actions,
    .scene3__actions {
        flex-wrap: nowrap;
        width: max-content;
        max-width: 96vw;
    }
    .scene1__btn {
        padding: 11px 18px;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    /* >>> Scene-3 campaign labels — shown on phone, in the four corners
       around the sales chart (same as the laptop/desktop view, shrunk).
       Edit top/bottom/left/right to reposition. <<< */
    .scene3__campaigns .campaign-card {
        display: flex;
        padding: 7px 11px;
    }
    .scene3__campaigns .campaign-card__icon { width: 22px; height: 22px; font-size: 0.74rem; }
    .scene3__campaigns .campaign-card__label { font-size: 0.72rem; }
    .scene3__campaigns .campaign-card:nth-child(1) { top: 30%;    left:  4%; }  /* 📢 کمپین تبلیغاتی */
    .scene3__campaigns .campaign-card:nth-child(2) { bottom: 22%; left:  4%; }  /* 🎯 هدف‌گیری دقیق */
    .scene3__campaigns .campaign-card:nth-child(3) { top: 41%;    left:  4%; right: auto; }  /* 📈 رشد فروش — under کمپین تبلیغاتی */
    .scene3__campaigns .campaign-card:nth-child(4) { bottom: 22%; right: 4%; }  /* 👥 مشتری جدید */
}
