/* ==============================
   HERO
   ============================== */

.hero {
    position: relative;
    width: 100%;
    /* Exactly one viewport tall; in-flow stack (content + gallery) flexes to fit. */
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100svh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Fixed header floats over the first viewport; absolute hero UI uses top:0 of this
       section — not the padded flow — so we reserve a band below the real header. */
    --hero-under-header: clamp(
        calc(5.85rem + env(safe-area-inset-top, 0px)),
        calc(5.1rem + env(safe-area-inset-top, 0px) + 3.5vw),
        calc(8.25rem + env(safe-area-inset-top, 0px))
    );
    padding: calc(var(--hero-under-header) + 2rem) 2rem max(4rem, calc(env(safe-area-inset-bottom, 0px) + 3.25rem));
    gap: clamp(0.35rem, 1.75vh, 1.75rem);
    background: transparent;
    color: #fff;
    contain: layout paint;
    direction: inherit;
}

/* ==============================
   TOP CENTER LABEL
   ============================== */

.hero__top-label {
    position: absolute;
    top: var(--hero-under-header);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.9s ease 0.1s;
    max-width: min(42vw, 14rem);
    text-align: center;
    pointer-events: none;
}

.hero__top-label--visible { opacity: 1; }

.hero__top-label-text {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.38em;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    line-height: 1.35;
}

.hero__top-label-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.hero__top-label-line {
    width: 1px;
    height: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent);
}

/* ==============================
   CORNERS (timer / volume)
   ============================== */

.hero__corner {
    position: absolute;
    top: var(--hero-under-header);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.9s ease 0.2s;
}

.hero__corner--visible { opacity: 1; }

.hero__corner--tl { left: max(1.25rem, env(safe-area-inset-left, 0px)); }
.hero__corner--tr { right: max(1.25rem, env(safe-area-inset-right, 0px)); }

.hero__corner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
    animation: hero-pulse-dot 2s ease-in-out infinite;
}

@keyframes hero-pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.7); }
}

.hero__corner-text {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
}

.hero__corner-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.hero__corner-bars i {
    display: block;
    width: 2px;
    background: rgba(255, 255, 255, 0.85);
    animation: hero-bar 1.1s ease-in-out infinite;
}

.hero__corner-bars i:nth-child(1) { height: 35%; animation-delay: 0s; }
.hero__corner-bars i:nth-child(2) { height: 60%; animation-delay: 0.15s; }
.hero__corner-bars i:nth-child(3) { height: 85%; animation-delay: 0.3s; }
.hero__corner-bars i:nth-child(4) { height: 55%; animation-delay: 0.45s; }
.hero__corner-bars i:nth-child(5) { height: 30%; animation-delay: 0.6s; }

@keyframes hero-bar {
    0%, 100% { transform: scaleY(0.4); }
    50%      { transform: scaleY(1); }
}

/* ==============================
   SIDE ROTATED LABELS
   ============================== */

.hero__side {
    position: absolute;
    top: 50%;
    z-index: 20;
    opacity: 0;
    transition: opacity 1s ease 0.3s;
}

.hero__side--visible { opacity: 1; }

.hero__side--left  { left: max(1.5rem, calc(env(safe-area-inset-left, 0px) + 0.75rem));  transform: translateY(-50%); }
.hero__side--right { right: max(1.5rem, calc(env(safe-area-inset-right, 0px) + 0.75rem)); transform: translateY(-50%); }

.hero__side span {
    display: inline-block;
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.5em;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    white-space: nowrap;
}

.hero__side--left  span { transform: rotate(-90deg); transform-origin: left top; }
.hero__side--right span { transform: rotate(90deg);  transform-origin: right top; }

/* ==============================
   CROSSHAIRS
   ============================== */

.hero__cross {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.35);
    z-index: 15;
    opacity: 0;
    transition: opacity 0.8s ease 0.4s;
}

.hero__cross--visible { opacity: 1; }
.hero__cross--left  { left: 6rem; }
.hero__cross--right { right: 6rem; }

/* ==============================
   CONTENT WRAPPER
   ============================== */

.hero__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 1 auto;
    min-height: 0;
    max-width: 100%;
}

/* ==============================
   NAME
   ============================== */

.hero__name {
    font-family: 'Anton', Impact, 'Bebas Neue', sans-serif;
    font-size: clamp(3.25rem, min(19vw, 20vh), 20rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 0.88;
    margin: 0;
    display: flex;
    gap: 0.02em;
    direction: ltr;
    unicode-bidi: isolate;
}

.hero__name-letter {
    display: inline-block;
    color: #ffffff;
    will-change: transform, opacity;
    transform: translate3d(0, 40px, 0) scale(0.92);
    transform-origin: 50% 100%;
    opacity: 0;
    transition:
        opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--i) * 80ms),
        transform 1.1s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--i) * 80ms);
}

.hero__name--visible .hero__name-letter {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.hero__name--settled .hero__name-letter {
    will-change: auto;
}

/* Whole name (Persian / Arabic — no per-letter split) */
.hero__name--whole {
    display: block;
    text-align: center;
    text-transform: none;
    letter-spacing: 0;
    unicode-bidi: plaintext;
}

.hero__name--whole .hero__name-text {
    display: inline-block;
    color: #ffffff;
    will-change: transform, opacity;
    transform: translate3d(0, 40px, 0) scale(0.96);
    transform-origin: 50% 100%;
    opacity: 0;
    transition:
        opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
        transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero__name--whole.hero__name--visible .hero__name-text {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.hero__name--whole.hero__name--settled .hero__name-text {
    will-change: auto;
}

/* ==============================
   TAGLINE
   ============================== */

.hero__tagline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    margin-top: clamp(0.85rem, 2.5vh, 3rem);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero__tagline--visible {
    opacity: 1;
    transform: translateY(0);
}

.hero__tagline-line {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: clamp(0.85rem, 1.4vw, 1.15rem);
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    line-height: 1.6;
}

/* ==============================
   WAVEFORM
   ============================== */

.hero__waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 28px;
    margin-top: clamp(0.65rem, 1.9vh, 2.6rem);
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero__waveform--visible { opacity: 1; }

.hero__waveform-bar {
    display: block;
    width: 2px;
    height: 20%;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 1px;
    transform-origin: center;
    animation: hero-wave 1.3s ease-in-out infinite;
    animation-delay: calc(var(--n) * 40ms);
}

@keyframes hero-wave {
    0%, 100% { transform: scaleY(0.3); }
    50%      { transform: scaleY(1.3); }
}

/* ==============================
   GALLERY - Fan Layout
   ============================== */

.hero__gallery {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-top: clamp(0.5rem, 2.2vh, 4.75rem);
    height: clamp(130px, min(28vh, 34vw), 320px);
    min-height: 110px;
    flex: 0 1 auto;
    width: 100%;
    max-width: 900px;
}

.hero__gallery-item {
    position: absolute;
    border-radius: 18px;
    overflow: hidden;
    background-color: #151515;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    opacity: 0;
    transform: translateY(120vh) scale(0.7);
    will-change: transform, opacity;
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero__gallery-item[data-index="2"] { width: 230px; height: 300px; z-index: 5; bottom: 0; }
.hero__gallery-item[data-index="1"] { width: 175px; height: 245px; z-index: 4; }
.hero__gallery-item[data-index="3"] { width: 175px; height: 245px; z-index: 4; }
.hero__gallery-item[data-index="0"] { width: 150px; height: 215px; z-index: 3; }
.hero__gallery-item[data-index="4"] { width: 150px; height: 215px; z-index: 3; }

.hero__gallery-item--arranged[data-index="2"] {
    opacity: 1;
    transform: translateX(0) translateY(0) rotate(0deg);
}
.hero__gallery-item--arranged[data-index="1"] {
    opacity: 1;
    transform: translateX(-200px) translateY(22px) rotate(-7deg);
}
.hero__gallery-item--arranged[data-index="3"] {
    opacity: 1;
    transform: translateX(200px) translateY(22px) rotate(7deg);
}
.hero__gallery-item--arranged[data-index="0"] {
    opacity: 1;
    transform: translateX(-360px) translateY(45px) rotate(-14deg);
}
.hero__gallery-item--arranged[data-index="4"] {
    opacity: 1;
    transform: translateX(360px) translateY(45px) rotate(14deg);
}

.hero__gallery-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero__gallery-placeholder {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 50% 60%, rgba(120, 120, 120, 0.35), transparent 65%),
        linear-gradient(160deg, #1a1a1a, #050505);
}

/* ==============================
   BOTTOM SCROLL
   ============================== */

.hero__scroll {
    position: absolute;
    bottom: 1.8rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    opacity: 0;
    transition: opacity 0.8s ease 0.3s;
    z-index: 10;
}

.hero__scroll--visible { opacity: 1; }

.hero__scroll-line {
    width: 1px;
    height: 22px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.5));
    animation: hero-scroll-pulse 2s ease-in-out infinite;
}

.hero__scroll-text {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.4em;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
}

.hero__scroll-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
}

@keyframes hero-scroll-pulse {
    0%, 100% { opacity: 0.4; transform: scaleY(1); }
    50%      { opacity: 1;   transform: scaleY(1.4); }
}

/* ==============================
   SOCIAL ICONS (bottom-left)
   ============================== */

.hero__socials {
    position: absolute;
    bottom: 1.8rem;
    left: 2.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.8s ease 0.4s;
}

.hero__socials--visible { opacity: 1; }

.hero__socials-link {
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
}

.hero__socials-link svg { width: 100%; height: 100%; }

.hero__socials-link:hover {
    color: #fff;
    transform: translateY(-2px);
}

/* ==============================
   PLAY INTRO (bottom-right)
   ============================== */

.hero__play-intro {
    position: absolute;
    bottom: 1.7rem;
    right: 2.2rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    font-family: 'Bebas Neue', Impact, sans-serif;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.8s ease 0.4s, color 0.3s ease;
    padding: 0;
}

.hero__play-intro--visible { opacity: 1; }
.hero__play-intro:hover { color: #fff; }

.hero__play-intro-text {
    font-size: 0.78rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
}

.hero__play-intro-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.55);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.hero__play-intro:hover .hero__play-intro-btn {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.hero__play-intro-icon {
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid currentColor;
    margin-left: 2px;
}

/* ==============================
   RESPONSIVE
   ============================== */

@media (max-width: 1280px) {
    .hero__cross { display: none; }
}

@media (max-width: 1024px) {
    .hero__gallery-item[data-index="2"] { width: 200px; height: 270px; }
    .hero__gallery-item[data-index="1"],
    .hero__gallery-item[data-index="3"] { width: 155px; height: 220px; }
    .hero__gallery-item[data-index="0"],
    .hero__gallery-item[data-index="4"] { width: 135px; height: 195px; }
    .hero__gallery-item--arranged[data-index="1"] { transform: translateX(-170px) translateY(20px) rotate(-8deg); }
    .hero__gallery-item--arranged[data-index="3"] { transform: translateX(170px)  translateY(20px) rotate(8deg); }
    .hero__gallery-item--arranged[data-index="0"] { transform: translateX(-300px) translateY(38px) rotate(-14deg); }
    .hero__gallery-item--arranged[data-index="4"] { transform: translateX(300px)  translateY(38px) rotate(14deg); }
}

@media (max-width: 768px) {
    .hero {
        --hero-under-header: clamp(
            calc(5.35rem + env(safe-area-inset-top, 0px)),
            calc(4.6rem + env(safe-area-inset-top, 0px) + 4vw),
            calc(6.85rem + env(safe-area-inset-top, 0px))
        );
        padding: calc(var(--hero-under-header) + 1.5rem) 1rem max(3.5rem, calc(env(safe-area-inset-bottom, 0px) + 2.75rem));
    }

    .hero__top-label-text,
    .hero__corner-text,
    .hero__scroll-text,
    .hero__play-intro-text { font-size: 0.6rem; letter-spacing: 0.28em; }

    .hero__corner--tl { left: max(0.85rem, env(safe-area-inset-left, 0px)); }
    .hero__corner--tr { right: max(0.85rem, env(safe-area-inset-right, 0px)); }

    .hero__top-label {
        display: flex;
        top: calc(var(--hero-under-header) + 2.5rem);
        max-width: min(88vw, 20rem);
        gap: 0.35rem;
    }

    .hero__top-label-line {
        height: 14px;
    }

    .hero__side { display: none; }

    .hero__gallery { height: clamp(120px, min(24vh, 42vw), 240px); margin-top: clamp(0.5rem, 1.8vh, 2.2rem); }

    .hero__gallery-item[data-index="2"] { width: 145px; height: 200px; }
    .hero__gallery-item[data-index="1"],
    .hero__gallery-item[data-index="3"] { width: 115px; height: 165px; }
    .hero__gallery-item[data-index="0"],
    .hero__gallery-item[data-index="4"] { width: 100px; height: 145px; }
    .hero__gallery-item--arranged[data-index="1"] { transform: translateX(-120px) translateY(18px) rotate(-7deg); }
    .hero__gallery-item--arranged[data-index="3"] { transform: translateX(120px)  translateY(18px) rotate(7deg); }
    .hero__gallery-item--arranged[data-index="0"] { transform: translateX(-208px) translateY(32px) rotate(-13deg); }
    .hero__gallery-item--arranged[data-index="4"] { transform: translateX(208px)  translateY(32px) rotate(13deg); }
    .hero__gallery-item { border-radius: 14px; }

    .hero__tagline { margin-top: clamp(0.65rem, 1.8vh, 1.2rem); }
    .hero__tagline-line { letter-spacing: 0.22em; font-size: 0.72rem; }

    .hero__waveform { height: 22px; }
    .hero__waveform-bar { width: 1.5px; }

    .hero__socials { left: 1.2rem; bottom: 1.2rem; gap: 0.75rem; }
    .hero__play-intro { right: 1.2rem; bottom: 1.2rem; }
}

@media (max-width: 480px) {
    .hero__gallery { height: clamp(108px, min(22vh, 48vw), 200px); margin-top: clamp(0.45rem, 1.6vh, 1.8rem); }

    .hero__gallery-item[data-index="2"] { width: 118px; height: 168px; }
    .hero__gallery-item[data-index="1"],
    .hero__gallery-item[data-index="3"] { width: 92px;  height: 132px; }
    .hero__gallery-item[data-index="0"],
    .hero__gallery-item[data-index="4"] { width: 78px;  height: 112px; }
    .hero__gallery-item--arranged[data-index="1"] { transform: translateX(-88px)  translateY(16px) rotate(-6deg); }
    .hero__gallery-item--arranged[data-index="3"] { transform: translateX(88px)   translateY(16px) rotate(6deg); }
    .hero__gallery-item--arranged[data-index="0"] { transform: translateX(-152px) translateY(28px) rotate(-12deg); }
    .hero__gallery-item--arranged[data-index="4"] { transform: translateX(152px)  translateY(28px) rotate(12deg); }
    .hero__gallery-item { border-radius: 12px; }

    .hero__waveform { gap: 2px; }

    .hero__play-intro-text { display: none; }
    .hero__socials { gap: 0.7rem; }
    .hero__socials-link { width: 16px; height: 16px; }
}

@media (min-width: 1920px) {
    .hero__gallery { height: clamp(280px, min(30vh, 32vw), 400px); max-width: 1100px; }
    .hero__gallery-item[data-index="2"] { width: 275px; height: 360px; }
    .hero__gallery-item[data-index="1"],
    .hero__gallery-item[data-index="3"] { width: 215px; height: 295px; }
    .hero__gallery-item[data-index="0"],
    .hero__gallery-item[data-index="4"] { width: 185px; height: 255px; }
    .hero__gallery-item--arranged[data-index="1"] { transform: translateX(-240px) translateY(26px) rotate(-8deg); }
    .hero__gallery-item--arranged[data-index="3"] { transform: translateX(240px)  translateY(26px) rotate(8deg); }
    .hero__gallery-item--arranged[data-index="0"] { transform: translateX(-430px) translateY(50px) rotate(-15deg); }
    .hero__gallery-item--arranged[data-index="4"] { transform: translateX(430px)  translateY(50px) rotate(15deg); }
    .hero__gallery-item { border-radius: 22px; }
    .hero__tagline-line { font-size: 1.25rem; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .hero__name-letter,
    .hero__corner-dot,
    .hero__corner-bars i,
    .hero__waveform-bar,
    .hero__scroll-line { animation: none; }
}
