/**
 * emadbrz – Full-viewport staggered hero (same composition across breakpoints)
 */

.emadbrz-hero {
    --hero-bg: #050507;
    --hero-border: rgba(255, 255, 255, 0.16);
    --hero-accent: #9b98f5;
    --hero-btn-radius: 14px;
    --hero-pad-x: clamp(0.85rem, 3.5vw, 4rem);
    --hero-header-offset: calc(var(--hdr-bar-h, 72px) + var(--hdr-topbar-h, 36px) + 0.65rem);
    --hero-front-size: min(34vw, 620px);
    --hero-safe-bottom: env(safe-area-inset-bottom, 0px);

    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--hero-bg);
    color: #f5f5f5;
    isolation: isolate;
}

.emadbrz-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.emadbrz-hero__bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.42;
    filter: blur(10px) saturate(0.9);
    transform: scale(1.08);
    transition: opacity 0.35s ease;
}

.emadbrz-hero__bg-shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(70% 55% at 50% 45%, rgba(0, 0, 0, 0.08), rgba(5, 5, 7, 0.78) 72%),
        linear-gradient(180deg, rgba(5, 5, 7, 0.55) 0%, rgba(5, 5, 7, 0.35) 35%, rgba(5, 5, 7, 0.9) 100%);
}

.emadbrz-hero__stage {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(0.95rem, 2.6vh, 1.85rem);
    width: 100%;
    height: 100%;
    min-height: inherit;
    padding:
        var(--hero-header-offset)
        0
        calc(clamp(1rem, 3vh, 2.25rem) + var(--hero-safe-bottom));
    box-sizing: border-box;
}

.emadbrz-hero__slider {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    padding-inline: var(--hero-pad-x);
    box-sizing: border-box;
    touch-action: pan-y;
}

.emadbrz-hero__slider-track {
    position: relative;
    width: 100%;
    height: var(--hero-front-size);
    max-height: min(58vh, calc(100% - 0.25rem));
    opacity: 0;
    margin-inline: auto;
}

.emadbrz-hero__slider-track.is-ready {
    opacity: 1;
    transition: opacity 0.45s ease;
}

.emadbrz-hero.is-ready .emadbrz-hero__slider-track {
    opacity: 1;
}

.emadbrz-hero__slide {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    overflow: hidden;
    border-radius: clamp(12px, 1.6vw, 18px);
    border: 1px solid var(--hero-border);
    background: #0a0a0c;
    cursor: pointer;
    transform-style: preserve-3d;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
    transition: box-shadow 0.35s ease, border-color 0.35s ease;
    will-change: transform, left, right, width, height;
    -webkit-tap-highlight-color: transparent;
}

.emadbrz-hero__slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.28) 100%);
    pointer-events: none;
    z-index: 2;
}

.emadbrz-hero__slide[data-slot='0'] {
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow:
        0 28px 70px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.06);
}

@media (hover: hover) and (pointer: fine) {
    .emadbrz-hero__slide:hover {
        border-color: rgba(255, 255, 255, 0.32);
    }
}

.emadbrz-hero__slide:active {
    border-color: rgba(255, 255, 255, 0.36);
}

.emadbrz-hero__slide-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform-origin: left center;
    pointer-events: none;
    user-select: none;
}

.emadbrz-hero__empty {
    width: 100%;
    height: min(50vh, 420px);
    border-radius: 18px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.03);
}

/* Legacy mobile stack removed – keep hidden if markup still present. */
.emadbrz-hero__slider-mobile {
    display: none !important;
}

.emadbrz-hero__actions {
    position: relative;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.65rem 0.85rem;
    width: 100%;
    padding-inline: var(--hero-pad-x);
}

.emadbrz-hero__actions.is-scroll-pulse {
    animation: emadbrz-hero-actions-pulse 1.1s ease;
}

@keyframes emadbrz-hero-actions-pulse {
    0% {
        filter: brightness(1);
        transform: translateY(0);
    }
    35% {
        filter: brightness(1.12);
        transform: translateY(-4px);
    }
    100% {
        filter: brightness(1);
        transform: translateY(0);
    }
}

.emadbrz-hero__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 52px;
    padding: 0 1.5rem;
    border-radius: var(--hero-btn-radius);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.emadbrz-hero--rtl .emadbrz-hero__btn {
    font-family: 'ModamWeb', sans-serif;
}

.emadbrz-hero--ltr .emadbrz-hero__btn {
    font-family: 'DM Sans', 'ModamWeb', sans-serif;
}

.emadbrz-hero__btn--primary {
    color: #fff;
    background: linear-gradient(135deg, #5b58f2 0%, #7c79f5 100%);
    box-shadow: 0 14px 36px rgba(91, 88, 242, 0.35);
}

.emadbrz-hero__btn--secondary {
    color: #f5f5f5;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

@media (hover: hover) and (pointer: fine) {
    .emadbrz-hero__btn--primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 18px 42px rgba(91, 88, 242, 0.42);
    }

    .emadbrz-hero__btn--secondary:hover {
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.34);
        transform: translateY(-2px);
    }
}

.emadbrz-hero__btn:active {
    transform: scale(0.985);
}

.emadbrz-hero__btn:focus-visible {
    outline: 2px solid var(--hero-accent);
    outline-offset: 3px;
}

.emadbrz-hero__btn-icon {
    display: inline-flex;
}

/* —— Tablet —— */
@media (max-width: 1023px) {
    .emadbrz-hero {
        --hero-pad-x: clamp(0.9rem, 3.2vw, 2rem);
        --hero-header-offset: calc(var(--hdr-bar-h, 64px) + var(--hdr-topbar-h, 34px) + 0.55rem);
    }

    .emadbrz-hero__stage {
        justify-content: center;
        gap: clamp(1rem, 2.4vh, 1.5rem);
    }

    .emadbrz-hero__slider-track {
        max-height: min(52vh, calc(100% - 0.25rem));
    }

    .emadbrz-hero__btn {
        min-height: 50px;
        padding: 0 1.3rem;
        font-size: 0.9rem;
    }
}

/* —— Mobile: same staggered composition, tightened scale —— */
@media (max-width: 767px) {
    .emadbrz-hero {
        --hero-pad-x: clamp(0.7rem, 3.8vw, 1.1rem);
        --hero-header-offset: calc(var(--hdr-bar-h, 60px) + var(--hdr-topbar-h, 32px) + 0.35rem);
        --hero-btn-radius: 13px;
    }

    .emadbrz-hero__stage {
        justify-content: center;
        gap: 1rem;
        padding-bottom: calc(1.1rem + var(--hero-safe-bottom));
    }

    .emadbrz-hero__slider {
        /* Slight optical lift so the fan sits like desktop */
        transform: translateY(clamp(-6px, -1.2vh, 0px));
    }

    .emadbrz-hero__slider-track {
        max-height: min(48vh, calc(100dvh - var(--hero-header-offset) - 7.5rem));
    }

    .emadbrz-hero__slide {
        box-shadow: 0 14px 36px rgba(0, 0, 0, 0.48);
    }

    .emadbrz-hero__slide[data-slot='0'] {
        box-shadow:
            0 20px 48px rgba(0, 0, 0, 0.58),
            0 0 0 1px rgba(255, 255, 255, 0.08);
    }

    .emadbrz-hero__actions {
        gap: 0.55rem 0.65rem;
    }

    .emadbrz-hero__btn {
        flex: 0 1 auto;
        min-width: 0;
        min-height: 48px;
        padding: 0 1.15rem;
        font-size: 0.875rem;
    }

    .emadbrz-hero__bg-img {
        filter: blur(8px) saturate(0.95);
        opacity: 0.38;
    }
}

/* —— Small phones —— */
@media (max-width: 479px) {
    .emadbrz-hero {
        --hero-pad-x: 0.65rem;
    }

    .emadbrz-hero__stage {
        gap: 0.85rem;
    }

    .emadbrz-hero__slider-track {
        max-height: min(46vh, calc(100dvh - var(--hero-header-offset) - 7rem));
    }

    .emadbrz-hero__actions {
        /* Keep side-by-side like desktop when space allows */
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .emadbrz-hero__btn {
        flex: 1 1 0;
        min-height: 46px;
        padding: 0 0.75rem;
        font-size: 0.8125rem;
        white-space: nowrap;
    }

    .emadbrz-hero__btn-icon {
        display: none;
    }
}

/* —— Very narrow —— */
@media (max-width: 359px) {
    .emadbrz-hero__actions {
        flex-wrap: wrap;
    }

    .emadbrz-hero__btn {
        flex: 1 1 calc(50% - 0.35rem);
        white-space: normal;
        text-align: center;
        line-height: 1.25;
        padding: 0.55rem 0.65rem;
    }
}

/* —— Short / landscape phones: preserve full-bleed stagger —— */
@media (max-height: 520px) and (orientation: landscape) {
    .emadbrz-hero {
        --hero-header-offset: calc(var(--hdr-bar-h, 52px) + 0.25rem);
        --hero-pad-x: clamp(0.65rem, 2.5vw, 1.5rem);
    }

    .emadbrz-hero__stage {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.85rem;
        padding-block: 0.65rem;
        padding-inline: var(--hero-pad-x);
    }

    .emadbrz-hero__slider {
        flex: 1 1 auto;
        min-width: 0;
        padding-inline: 0;
        transform: none;
    }

    .emadbrz-hero__slider-track {
        max-height: min(72vh, calc(100dvh - 1.5rem));
    }

    .emadbrz-hero__actions {
        flex: 0 0 auto;
        flex-direction: column;
        align-items: stretch;
        width: min(11.5rem, 34vw);
        padding-inline: 0;
        gap: 0.5rem;
    }

    .emadbrz-hero__btn {
        width: 100%;
        min-height: 42px;
        font-size: 0.8125rem;
        padding: 0 0.85rem;
    }
}

@media (max-height: 520px) and (orientation: landscape) and (max-width: 700px) {
    .emadbrz-hero__stage {
        flex-direction: column;
        justify-content: center;
    }

    .emadbrz-hero__actions {
        flex-direction: row;
        width: 100%;
    }

    .emadbrz-hero__btn {
        flex: 1 1 0;
        width: auto;
    }
}

/* —— Tall phones: give the stagger more breathing room —— */
@media (min-height: 780px) and (max-width: 767px) {
    .emadbrz-hero__slider-track {
        max-height: min(50vh, calc(100dvh - var(--hero-header-offset) - 8rem));
    }

    .emadbrz-hero__stage {
        gap: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .emadbrz-hero__btn,
    .emadbrz-hero__slider-track,
    .emadbrz-hero__bg-img,
    .emadbrz-hero__actions.is-scroll-pulse {
        transition: none;
        animation: none;
    }
}
