@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src:
        local('Inter'),
        url('/fonts/Inter/static/Inter_18pt-SemiBold.ttf') format('truetype');
}

:root {
    --color-bg: #002e6a;
    --color-bg-transparent: #002e6acc;
    --color-bg-card: #002e6acc;
    --color-text: #fff;
    --color-border-gold: #e0bf78;
    --color-border-orange: #e07c3e;
    --shadow-card: 0 0 24px rgba(0, 0, 0, 0.4);
    --shadow-card-hover: 0 8px 15px rgba(0, 0, 0, 0.4);
    --radius-card: 8px;
    --channels-gap: clamp(6px, calc(0.5vw + 4px), 18px);
    --footer-gap: 1.3em;
    --grid-cols-desktop: 4;
    --grid-rows-desktop: 3;
    --grid-max-w: 80vw;
    --transition-card: transform 0.3s ease, box-shadow 0.3s ease;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    background: var(--color-bg);
}
body {
    font-family: 'Inter', Arial, sans-serif;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: transparent;
    color: var(--color-text);
}

html, body {
  overscroll-behavior-y: none; /* отключает оттягивание страницы вверх/вниз */
}

/* Header */
.header {
    padding: 25px 0 20px;
    text-align: center;
    border-bottom: 2px solid var(--color-border-gold);
    background: var(--color-bg-transparent);
}

.logo {
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
}

.logo img {
    width: 70vw;
    height: auto;
}

/* Main */
.main {
    flex: 1 1 auto;
    min-height: 0;
    padding: 7.5vw 4vw;
    position: relative;
    overflow: hidden;
    border-top: 3px solid var(--color-border-orange);
    border-bottom: 3px solid var(--color-border-orange);
    display: flex;
    flex-direction: column;
}

.main::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    /* inset: 0; */
    background: url('/images/bg-phone.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: -1;
}

.channels-grid-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.channels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--channels-gap);
    margin-inline: auto;
    position: relative;
    z-index: 1;
    width: 100%;
}

/* Channel card (link) */
.channel-card {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    min-width: 0;
    min-height: 0;
    padding: 6vw;
    border: 0;
    border-radius: var(--radius-card);
    background: var(--color-bg-card);
    box-shadow: var(--shadow-card);
    color: inherit;
    text-decoration: none;
    transition: var(--transition-card);
}

.channel-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card-hover);
}

.channel-card:focus-visible {
    outline: 2px solid var(--color-border-gold);
    outline-offset: 3px;
}

.channel-card img {
    display: block;
    flex: 0 1 auto;
    align-self: center;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Channel logo sizing */
.ch-bober img {
    padding: 1vw;
}

.ch-o img,
.ch-telecafe img {
    padding: 5vw;
}

.ch-katyusha img {
    padding: 2vw;
}

/* Footer */
.footer {
    padding: 20px 15px;
    background: var(--color-bg-transparent);
}

.footer-content {
    max-width: 1200px;
    margin-inline: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--footer-gap);
    text-align: center;
}

.footer-section__title {
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: normal;
    text-transform: uppercase;
    opacity: 0.9;
}

.footer-section p {
    font-size: 11px;
    margin: 5px 0;
    opacity: 0.8;
}

.footer-section a {
    color: var(--color-text);
    text-decoration: underline;
}

.footer-section a:hover {
    opacity: 1;
}

.footer-section a:focus-visible {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .channel-card {
        transition: box-shadow 0.3s ease;
    }

    .channel-card:hover {
        transform: none;
    }
}

/* --- Media queries (mobile first) --- */

@media (min-width: 481px) {
    .main {
        padding: 45px;
    }
}

@media (min-width: 769px) {
    body {
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
    }

    .header {
        flex-shrink: 0;
        padding: clamp(12px, 2.5dvh, 25px) 0 clamp(10px, 2dvh, 20px);
    }

    .main {
        padding: clamp(12px, 2dvh, 5.1vw) 4vw;
    }

    .main::before {
        background-image: url('/images/bg-desktop.svg');
    }

    .logo img {
        width: 35vw;
        max-height: 12dvh;
        object-fit: contain;
    }

    .channels-grid-wrapper {
        container-type: size;
    }

    .channels-grid {
        --cell-size: min(
            calc((min(var(--grid-max-w), 100cqw) - (var(--grid-cols-desktop) - 1) * var(--channels-gap)) / var(--grid-cols-desktop)),
            calc((100cqh - (var(--grid-rows-desktop) - 1) * var(--channels-gap)) / var(--grid-rows-desktop))
        );
        grid-template-columns: repeat(4, var(--cell-size));
        grid-template-rows: repeat(3, var(--cell-size));
        gap: var(--channels-gap);
        width: calc(var(--cell-size) * var(--grid-cols-desktop) + var(--channels-gap) * (var(--grid-cols-desktop) - 1));
        height: calc(var(--cell-size) * var(--grid-rows-desktop) + var(--channels-gap) * (var(--grid-rows-desktop) - 1));
        max-width: var(--grid-max-w);
        max-height: 100cqh;
        align-self: center;
    }

    .channel-card {
        aspect-ratio: 1 / 1;
        place-self: center;
        width: 100%;
        height: 100%;
        padding: 12%;
    }

    .ch-o img,
    .ch-telecafe img {
        padding: 0;
        max-width: 62%;
        max-height: 62%;
    }

    .ch-katyusha img {
        padding: 0;
        max-width: 78%;
        max-height: 78%;
    }

    .footer {
        flex-shrink: 0;
        padding: clamp(16px, 2.5dvh, 30px) 20px;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
        text-align: left;
    }

    .footer-section__title {
        font-size: 15px;
    }

    .footer-section p {
        font-size: 15px;
    }
}

@media (min-width: 1200px) {
    .logo img {
        width: 30vw;
        max-height: 10dvh;
    }

    .channels-grid {
        --grid-max-w: 70vw;
    }
}


@supports not (width: clamp(1px, 1%, 2px)) {
    :root {
        --channels-gap: 10px;
    }
}

@supports not (min-height: 100dvh) {
    body {
        min-height: 100vh;
    }
}

@supports not (aspect-ratio: 1 / 1) {
    .channel-card {
        display: block;
        position: relative;
        height: 0;
        padding-bottom: 100%;
        overflow: hidden;
    }

    .channel-card img {
        position: absolute;
        top: 6vw;
        right: 6vw;
        bottom: 6vw;
        left: 6vw;
        width: auto;
        height: auto;
        max-width: calc(100% - 12vw);
        max-height: calc(100% - 12vw);
        margin: auto;
    }
}

@supports not selector(:focus-visible) {
    .channel-card:focus-visible {
        outline: none;
    }

    .channel-card:focus {
        outline: 2px solid var(--color-border-gold);
        outline-offset: 3px;
    }

    .footer-section a:focus-visible {
        opacity: 0.8;
    }

    .footer-section a:focus {
        opacity: 1;
    }
}

@media (min-width: 769px) {
    @supports not (height: 100dvh) {
        body {
            height: 100vh;
            max-height: 100vh;
        }
    }

    @supports not (width: clamp(1px, 1%, 2px)) {
        .header {
            padding: 18px 0 14px;
        }

        .main {
            padding: 3vw 4vw;
        }

        .footer {
            padding: 22px 20px;
        }
    }

    @supports not (height: 1dvh) {
        .header {
            padding: clamp(12px, 2.5vh, 25px) 0 clamp(10px, 2vh, 20px);
        }

        .main {
            padding: clamp(12px, 2vh, 5.1vw) 4vw;
        }

        .footer {
            padding: clamp(16px, 2.5vh, 30px) 20px;
        }

        .logo img {
            max-height: 12vh;
        }
    }

    @supports not (container-type: size) {
        .channels-grid-wrapper {
            container-type: normal;
        }

        .channels-grid {
            grid-template-columns: repeat(4, 1fr);
            grid-template-rows: repeat(3, 1fr);
            aspect-ratio: 4 / 3;
            width: 100%;
            height: auto;
            max-width: var(--grid-max-w);
            max-height: 100%;
        }

        .channel-card {
            width: 100%;
            height: auto;
            max-width: 100%;
            max-height: 100%;
            place-self: center;
        }
    }

    @supports not ((container-type: size) or (aspect-ratio: 1 / 1)) {
        .channel-card {
            display: block;
            height: 0;
            padding-bottom: 100%;
        }

        .channel-card img {
            top: 12%;
            right: 12%;
            bottom: 12%;
            left: 12%;
            max-width: 76%;
            max-height: 76%;
        }
    }
}

@media (min-width: 1200px) {
    @supports not (height: 1dvh) {
        .logo img {
            max-height: 10vh;
        }
    }
}
