/* =========================================================
   Главная страница
   ========================================================= */

/* ---------- Первый экран (сцена) ---------- */

.hero {
    position: relative;
    width: 100%;
    height: 800px;
    overflow: hidden;
    isolation: isolate;
}

/* Сцена собрана из слоёв: так каждый можно анимировать отдельно (см. «Появление сцены» ниже) */
.hero__layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-repeat: no-repeat;
}

.hero__layer--back { background-image: url("../assets/scene/header-back.webp"); background-position: center; }
.hero__layer--smoke { background-image: url("../assets/scene/smoke.webp"); background-position: center; }
.hero__layer--text { background-image: url("../assets/scene/header-text.svg"); background-position: center top 63%; }
.hero__layer--light { background-image: url("../assets/scene/header-light.webp"); background-position: center top -2px; }
.hero__layer--micro { background-image: url("../assets/scene/header-micro.webp"); background-size: 1920px 800px; background-position: center; }
.hero__layer--edges { background-image: linear-gradient(90deg, var(--c-black) 2%, transparent 20%, transparent 80%, var(--c-black) 98%); }

/* Есть только на планшете и телефоне */
.hero__layer--bar,
.hero__layer--logo,
.hero__layer--camera,
.hero__layer--monitors {
    display: none;
}

/* Три копии слоя света, каждая под маской своего прожектора — так их можно включать по очереди.
   Маски с мягкими краями в сумме дают 1, а plus-lighter внутри изолированной группы складывает
   копии без потерь: когда все три включены, картинка в точности равна исходной. */
.hero {
    --beam-split: 205px;
    --beam-feather: 90px;
}

.hero__lights {
    position: absolute;
    inset: 0;
    isolation: isolate;
    pointer-events: none;
}

.hero__lights .hero__layer--light {
    mix-blend-mode: plus-lighter;
}

.hero__layer--beam-left {
    mask-image: linear-gradient(90deg, #000 calc(50% - var(--beam-split) - var(--beam-feather)), transparent calc(50% - var(--beam-split) + var(--beam-feather)));
}

.hero__layer--beam-center {
    mask-image: linear-gradient(90deg,
        transparent calc(50% - var(--beam-split) - var(--beam-feather)),
        #000 calc(50% - var(--beam-split) + var(--beam-feather)),
        #000 calc(50% + var(--beam-split) - var(--beam-feather)),
        transparent calc(50% + var(--beam-split) + var(--beam-feather)));
}

.hero__layer--beam-right {
    mask-image: linear-gradient(90deg, transparent calc(50% + var(--beam-split) - var(--beam-feather)), #000 calc(50% + var(--beam-split) + var(--beam-feather)));
}

.hero__nav {
    display: flex;
    flex-flow: column wrap;
    align-items: flex-end;
    column-gap: 32px;
    width: fit-content;
    height: 105px;
    position: relative;
    top: calc(57% - 5px);
    left: calc(50% - 385px);
    transform: translate(-50%, -50%);

    a {
        display: flex;
        justify-content: center;
        align-items: center;
        width: fit-content;
        padding: 8px 12px;
        color: var(--c-white-50);
        font-family: var(--font-display);
        font-size: 14px;
        text-align: right;
        text-decoration: none;
    }

    a:hover {
        color: var(--c-white);
    }
}

.hero__logo {
    position: relative;
    top: 8px;
    width: 213px;
    height: 84px;
    background: url("../assets/brand/logo.svg") left top / 213px 84px no-repeat;
}

/* ---------- Основной контент ---------- */

.home {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-top: 96px;
}

.home > .section-head {
    width: 100%;
}

/* ---------- Ивенты: баннеры направлений ----------
   Фото во всю карточку, снизу затемнение под текст — текст читается всегда.
   При наведении карточка «попадает в луч»: фото проявляется в цвете, сверху загорается свет. */

.events-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: min(1200px, 100% - 48px);
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.event-banner {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: 4 / 5;
    padding: 32px;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid rgba(248, 248, 255, 0.08);
    background: #111218;
    transition: border-color 0.7s var(--ease), box-shadow 0.7s var(--ease);

    /* затемнение под текстом */
    &::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: linear-gradient(180deg, rgba(10, 11, 15, 0) 25%, rgba(10, 11, 15, 0.78) 58%, rgba(10, 11, 15, 0.96) 100%);
        pointer-events: none;
    }

    /* луч прожектора сверху */
    &::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background:
            radial-gradient(55% 45% at 50% 0%, rgba(255, 79, 216, 0.38), transparent 75%),
            radial-gradient(35% 60% at 50% 0%, rgba(248, 248, 255, 0.18), transparent 80%);
        opacity: 0;
        transition: opacity 0.7s var(--ease);
        pointer-events: none;
    }

    h2 {
        margin-bottom: 12px;
        color: var(--c-white);
        font-family: var(--font-display);
        font-size: var(--text-2xl);
        font-weight: 700;
        line-height: var(--lh-2xl);
        text-transform: uppercase;
        text-wrap: balance;
    }

    p {
        margin-bottom: 24px;
        color: #D2D3D9;
        font-size: var(--text-sm);
        line-height: var(--lh-sm);
    }
}

.event-banner__photo {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) brightness(0.75);
    transform: scale(1.02);
    transition: filter 0.9s var(--ease), transform 1.2s var(--ease);
}

/* У частных мероприятий своих фото пока нет — вместо фото луч сцены */
.event-banner--stage {
    background:
        url("../assets/scene/event-spotlight.webp") center bottom 30% / 70% auto no-repeat,
        radial-gradient(70% 55% at 50% 0%, rgba(163, 112, 255, 0.28), transparent 75%),
        #111218;
}

.event-banner--stage .event-banner__photo {
    object-fit: contain;
    object-position: center -40px;
    filter: none;
    opacity: 0.85;
}

.event-banner__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
}

.event-banner__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--c-white);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color 0.5s var(--ease);
}

.event-banner__link:hover {
    color: var(--c-rose);
}

.event-banner:is(:hover, :focus-within) {
    border-color: rgba(255, 79, 216, 0.45);
    box-shadow: 0 0 48px rgba(255, 79, 216, 0.14);

    &::after { opacity: 1; }

    .event-banner__photo {
        filter: none;
        transform: scale(1.06);
    }

    &.event-banner--stage .event-banner__photo {
        opacity: 0.9;
        transform: none;
    }
}

/* Устройства без наведения: фото сразу цветные */
@media (hover: none) {
    .event-banner__photo {
        filter: brightness(0.85);
    }
}

@media (prefers-reduced-motion: reduce) {
    .event-banner,
    .event-banner::after,
    .event-banner__photo {
        transition: none;
    }

    .event-banner:is(:hover, :focus-within) .event-banner__photo {
        transform: scale(1.02);
    }
}

@media (min-width: 768px) and (max-width: 1279px) {
    .events-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Телефон: баннеры листаются пальцем, край следующего виден */
@media (max-width: 767px) {
    .events-grid {
        grid-auto-flow: column;
        grid-template-columns: none;
        grid-auto-columns: 84%;
        gap: 16px;
        width: 100%;
        padding: 0 16px;
        box-sizing: border-box;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 16px;
        scrollbar-width: none;
    }

    .events-grid::-webkit-scrollbar {
        display: none;
    }

    .event-banner {
        padding: 24px;
        scroll-snap-align: start;

        &::before {
            background: linear-gradient(180deg, rgba(10, 11, 15, 0.15) 0%, rgba(10, 11, 15, 0.82) 38%, rgba(10, 11, 15, 0.96) 100%);
        }

        h2 {
            font-size: var(--text-xl);
            line-height: var(--lh-xl);
        }
    }
}

.home__divider {
    margin-bottom: 64px;
}

/* ---------- Проекты: FLAT WHITE и шоу-бэнд ---------- */

.projects {
    display: flex;
    gap: 64px;
    width: 100%;
    max-width: 1280px;
    margin: 100px auto 64px;
}

.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100vw;
    min-width: 360px;
    /* Карточка целиком помещается в экран под верхним меню, но не вытягивается на высоких мониторах */
    height: clamp(480px, calc(100vh - 128px), 720px);
    height: clamp(480px, calc(100svh - 128px), 720px);
    overflow: hidden;
    background: var(--fw-black);
}

.project-card__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--fw-black);
}

.project-card__shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(270deg, var(--fw-black) 0%, rgba(13, 13, 13, 0) 49.94%, var(--fw-black) 99.88%),
        linear-gradient(180deg, rgba(13, 13, 13, 0) 80.88%, var(--fw-black) 100%),
        radial-gradient(106.63% 142.04% at 100% 0%, rgba(204, 109, 242, 0.20) 0%, rgba(204, 109, 242, 0) 100%),
        radial-gradient(36.62% 98.13% at 60.57% 67.11%, rgba(99, 80, 217, 0.20) 0%, rgba(99, 80, 217, 0) 100%);
}

.project-card__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card__center {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
}

.project-card__title {
    margin-bottom: 16px;
    color: var(--c-white);
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 700;
    line-height: var(--lh-4xl);
    text-align: center;
    text-transform: uppercase;
}

.project-card__desc {
    width: 480px;
    max-width: calc(100% - 32px);
    margin: 0 auto 32px;
    color: var(--fw-gray-100);
    font-size: var(--text-lg);
    font-weight: 400;
    line-height: var(--lh-lg);
    text-align: center;
}

.project-card .btn {
    align-self: center;
    margin-bottom: 24px;
}

/* ---------- Команда ---------- */

.team {
    display: flex;
    flex-flow: column wrap;
    column-gap: 64px;
    width: 1200px;
    height: 576px;

    p, li {
        color: var(--c-white);
        font-size: var(--text-base);
        line-height: var(--lh-base);
        overflow-wrap: break-word;
    }

    h2 {
        margin-bottom: 12px;
        color: var(--c-rose);
        font-family: var(--font-display);
        font-size: var(--text-3xl);
        font-weight: 700;
        line-height: var(--lh-3xl);
        text-transform: uppercase;
    }

    h3 {
        margin-bottom: 16px;
        color: var(--c-gray);
        font-size: var(--text-sm);
        font-weight: 500;
        line-height: var(--lh-sm);
    }

    ul {
        display: flex;
        flex-direction: column;
        gap: 12px;
        list-style: none;
    }
}

.team__photo {
    flex-basis: 100%;
    width: 264px;
    height: 576px;
    border: 1px solid var(--c-black);
    box-sizing: border-box;
    background: url("../assets/home/director-photo.webp") center / cover no-repeat;
    mix-blend-mode: lighten;
}

.team__director {
    flex-basis: 33%;
}

/* Пустой блок под будущих участников команды — держит сетку */
.team__spacer {
    flex-basis: calc(66% - 1px);
    margin-top: auto;
    border-top: 1px solid var(--c-line);
}

.team__column {
    display: flex;
    flex-basis: 100%;
    flex-direction: column;
    justify-content: space-between;
}

.team-block {
    padding-left: 24px;
    background-repeat: no-repeat;
}

.team-block--tech { background-image: url("../assets/icons/team-tech.svg"); }
.team-block--scene { background-image: url("../assets/icons/team-scene.svg"); }
.team-block--media { background-image: url("../assets/icons/team-media.svg"); }
.team-block--decor { background-image: url("../assets/icons/team-decor.svg"); }
.team-block--training { background-image: url("../assets/icons/team-training.svg"); }

.text-short {
    display: none;
}

/* =========================================================
   Планшет
   ========================================================= */

@media (min-width: 768px) and (max-width: 1279px) {
    .hero {
        height: 700px;
        --beam-split: 130px;
        --beam-feather: 70px;
    }

    .hero__layer--micro { background-size: cover; background-position: center; }
    .hero__layer--logo { display: block; background-image: url("../assets/brand/logo.svg"); background-size: 96px 38px; background-position: top calc(50% + 115px) right calc(50% - 115px); }
    .hero__layer--light { background-image: url("../assets/scene/header-light-tablet.webp"); background-position: center top 25px; }
    .hero__layer--text { background-image: url("../assets/scene/header-text-tablet.svg"); background-size: 328px 418px; background-position: center top 56%; }
    .hero__layer--smoke { background-size: cover; }
    .hero__layer--bar { display: block; background-image: url("../assets/scene/bar-tablet.webp"); background-size: 1242px 64px; background-position: top; }
    .hero__layer--back { background-image: url("../assets/scene/header-back-tablet.webp"); background-size: cover; }

    .project-card {
        width: 50%;
        min-width: 0;
    }
}

@media (max-width: 1279px) {
    /* Меню первого экрана — строкой вверху, логотип уже нарисован на фоне */
    .hero__nav {
        position: absolute;
        top: 0;
        left: 50%;
        flex-flow: row nowrap;
        column-gap: 0;
        height: 40px;
        transform: translate(-50%, 0);

        a {
            width: 84px;
            font-size: var(--text-xs);
        }
    }

    .hero__logo {
        display: none;
    }

    .text-full { display: none; }
    .text-short { display: inline; }

    .projects {
        flex-direction: row;
        gap: 24px;
        margin-top: 0;
        padding: 0 16px;
        box-sizing: border-box;
    }

    .project-card__title { font-size: var(--text-2xl); line-height: var(--lh-2xl); }

    .project-card__desc {
        width: 328px;
        font-size: var(--text-sm);
        line-height: var(--lh-sm);
    }

    .team {
        h2 { margin-bottom: 8px; font-size: var(--text-xl); line-height: var(--lh-xl); }
        h3 { margin-bottom: 12px; padding-left: 16px; font-size: var(--text-xs); }
        ul { gap: 8px; }
        p, li { font-size: var(--text-sm); line-height: var(--lh-sm); }
    }

    .team__column {
        justify-content: space-between;
    }

    /* Группы команды не слипаются со списком над ними */
    .team-block + .team-block {
        margin-top: 24px;
    }

    .team-block {
        padding-left: 0;
        background-size: 10px 10px;
        background-position: 0 1px;
    }
}

@media (min-width: 768px) and (max-width: 1279px) {
    /* Планшет: сетка без фиксированной высоты — списки не выталкивают колонки за край экрана */
    .team {
        display: grid;
        grid-template-columns: 180px minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "photo director director"
            "photo col1     col2";
        align-items: start;
        gap: 24px 32px;
        width: min(736px, 100% - 48px);
        height: auto;
    }

    .team__photo {
        grid-area: photo;
        width: 180px;
        height: 390px;
    }

    .team__director { grid-area: director; }
    .team__spacer { display: none; }
    .team__column--1 { grid-area: col1; }
    .team__column--2 { grid-area: col2; }

    .team__column {
        justify-content: flex-start;
    }
}

/* =========================================================
   Мобильный
   ========================================================= */

@media (max-width: 767px) {
    .home {
        padding-top: 64px;
    }

    .hero {
        width: 100vw;
        height: 700px;
        --beam-split: 62px;
        --beam-feather: 40px;
    }

    .hero__layer--edges { display: none; }
    .hero__layer--micro { background-image: url("../assets/scene/header-micro-mobile.webp"); background-size: 124px 319px; background-position: center bottom; }
    .hero__layer--camera { display: block; background-image: url("../assets/scene/header-camera-mobile.webp"); background-size: 330px 254px; background-position: top calc(50% - 96px) left calc(50% - 215px); }
    .hero__layer--monitors { display: block; background-image: url("../assets/scene/header-monitors-mobile.webp"); background-size: 428px 72px; background-position: center bottom; }
    .hero__layer--light { background-image: url("../assets/scene/header-light-mobile.webp"); background-size: cover; background-position: top 18px center; }
    .hero__layer--logo { display: block; background-image: url("../assets/brand/logo.svg"); background-size: 96px 38px; background-position: top calc(50% + 115px) right calc(50% - 115px); }
    .hero__layer--text { background-image: url("../assets/scene/header-text-tablet.svg"); background-size: 328px 418px; background-position: center top 56%; }
    .hero__layer--smoke { background-size: cover; }
    .hero__layer--bar { display: block; background-image: url("../assets/scene/bar-tablet.webp"); background-size: 1242px 64px; background-position: top; }
    .hero__layer--back { background-image: url("../assets/scene/header-back-tablet.webp"); background-size: cover; }

    .divider-bar {
        background-size: cover;
    }

    .projects {
        flex-direction: column;
        gap: 32px;
    }

    .project-card {
        width: 100%;
        min-width: 0;
        height: clamp(440px, calc(100svh - 96px), 640px);
    }

    .team {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 2fr 402px;
        column-gap: 16px;
        width: fit-content;
        min-width: 328px;
        max-width: 448px;
        height: fit-content;
        padding: 0 16px;
    }

    .team__photo {
        grid-column: 1 / 2;
        grid-row: 1 / 3;
        width: 164px;
        height: 356px;
        background-size: contain;
    }

    .team__director {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
        padding-top: 16px;
    }

    .team__spacer {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        margin: 12px 0 24px;
    }

    .team__column {
        margin-top: 24px;
    }

}

/* Дым на первом экране медленно покачивается */
@media (prefers-reduced-motion: no-preference) {
    .hero__layer--smoke {
        animation: hero-smoke 14s ease-in-out infinite alternate;
    }
}

@keyframes hero-smoke {
    from { transform: translateX(-2%) scale(1.04); }
    to { transform: translateX(2%) scale(1.04); }
}
