@layer content, effects;

:root {
    --overlay-gradient: linear-gradient(
        to bottom,
        rgb(0 0 0 / 0) 0%,
        rgb(0 0 0 / 50%) 50%,
        rgb(0 0 0 / 75%) 75%
    );

    --primary-color: #fff;
    --secondary-color: #000;
    --tertiary-color: color-mix(in srgb, var(--secondary-color) 65%, white); /* #555 */
    --font-weight-extra-light: 200;
    --font-weight-medium: 500;
    --font-weight-extra-bold: 800;
}


@layer content {
    /* ysabeau-infant-200 - cyrillic_latin */
    @font-face {
    font-display: swap;
    font-family: 'Ysabeau Infant';
    font-style: normal;
    font-weight: 200;
    src: url('fonts/ysabeau-infant-v4-cyrillic_latin-200.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
    }
    /* ysabeau-infant-regular - cyrillic_latin */
    @font-face {
    font-display: swap;
    font-family: 'Ysabeau Infant';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/ysabeau-infant-v4-cyrillic_latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
    }
    /* ysabeau-infant-500 - cyrillic_latin */
    @font-face {
    font-display: swap;
    font-family: 'Ysabeau Infant';
    font-style: normal;
    font-weight: 500;
    src: url('fonts/ysabeau-infant-v4-cyrillic_latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
    }
    /* ysabeau-infant-700 - cyrillic_latin */
    @font-face {
    font-display: swap;
    font-family: 'Ysabeau Infant';
    font-style: normal;
    font-weight: 700;
    src: url('fonts/ysabeau-infant-v4-cyrillic_latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
    }
    /* ysabeau-infant-800 - cyrillic_latin */
    @font-face {
    font-display: swap;
    font-family: 'Ysabeau Infant';
    font-style: normal;
    font-weight: 800;
    src: url('fonts/ysabeau-infant-v4-cyrillic_latin-800.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
    }


    * {
        box-sizing: border-box;
    }

    html {
        font-size: 100%;
        font-family: "Ysabeau Infant", sans-serif;
    }

    body {
        margin: 0 auto;
        max-width: 30rem;
        scrollbar-width: none;
        -webkit-font-smoothing: antialiased;
        background-color: var(--secondary-color);
        color: var(--primary-color);
    }

    a {
        text-decoration: none;
        color: inherit;
    }

    address {
        font-style: normal;
    }

    ::-webkit-scrollbar { 
        display: none;  /* Older Safari and Chromium */
    }


    .appbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 1rem;    
        background-color: rgb(from var(--secondary-color) r g b / 50%);
    }

    .slide-row {
        margin: 0 -1.25rem 1.75rem;
        padding: 0;
        display: flex;
        gap: 1rem;
        height: 100%;
        scroll-snap-type: x mandatory;
        overflow-x: auto;
        list-style: none;
    }

    .slide {
        display: flex;
        flex-direction: column;
        width: 80%;
        align-content: flex-end;
        scroll-snap-align: center;
        scroll-snap-stop: always;
        flex-shrink: 0;
        transition: opacity 500ms ease;

        p {
            margin: 0 0 1.5rem;
        }

        &:first-child {
            margin-inline-start: 1.25rem;
        }

        &:last-child {
            margin-inline-end: 1.25rem;
        }
    }

    .card {
        height: 100%;
        align-content: end;
        border-radius: 1rem;

        p {
            padding: 0 1.5rem 2rem;
            margin: 0;
        }
    }

    .background-image {
        background-image: var(--overlay-gradient), var(--bg-image);
        background-size: cover;
        background-position: center;
    }

    .header-xlarge {
        font-size: 2rem;
        line-height: 1.2;
        font-weight: var(--font-weight-extra-bold);
        box-shadow: 0.125rem -0.125rem rgb(var(--secondary-color));
        margin-block: 0 1em;

        .hero-screen__header & {
            margin-block: 0;
        }
    }

    .headline {
        font-weight: normal;
        line-height: 3rem;
    }

    .header-large {
        font-size: 1.625rem;
        line-height: 1.25;
        font-weight: bold;
        margin-block: 0 2rem;
    }

    p,
    summary,
    li {
        font-size: 1.25rem;
        line-height: 1.3;
    }

    .cta-button {
        display: block;
        border: thin solid currentColor;
        font-size: 1.25rem;
        line-height: 1.15;
        padding: 0.6em 1.5em 0.8em;
        border-radius: 2em;
        text-decoration: none;
        width: fit-content;
        margin: 0 auto;

        &:active {
            background-color: var(--primary-color);
            color: var(--secondary-color);
            border: transparent;
        }
    }

    h3 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: var(--font-weight-medium);
        margin-bottom: 1.5rem;
    }


    section {
        margin: 1.75rem 1.25rem;
    }

    .for-whom {
        display: flex;
        flex-direction: column;
        height: 100svh;
    }

    .preloader {
        width: 100%;
        height: 100svh;
        z-index: 100;
        display: flex;
        justify-content: center;
        align-items: center;
        position: sticky;
        top: 0;
        left: 0;
        background-color: var(--secondary-color);
        pointer-events: none;
    }
    
    .hero-screen {
        height: 100svh;
        position: relative;
        margin: 0;
        transition: opacity 500ms ease;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        background-image: var(--overlay-gradient), var(--bg-image);
        background-size: cover;
        background-position: center;

        &::after {
            content: "";
            width: 100%;
            height: 100%;
            position: absolute;
            background-color: rgba(0 0 0 / 20%);
            z-index: -1;
        }

        .hero-screen__header {
            padding: 1.25rem;
        }

        a:has(.arrow) {
            text-align: center;
        }
    }

    .know-more {
        padding: 1.75rem 1.25rem;
        display: flex;
        font-size: 1.25rem;
        justify-content: space-between;
        align-items: center;
    }

    .coach-photo {
        width: 100%;
        position: sticky;
        top: 5.75rem;
        aspect-ratio: 1 / 1.5;
        object-fit: cover;
        border-radius: 1rem;
    }

    .contact-page {
        height: 100dvh;
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: center;
        justify-items: center;
        gap: 2.5rem;
        text-align: center;
        align-items: center;
        margin: 0 1.25rem;
    }


    [data-background-image="hero-image"] {
        --bg-image: image-set(
            url("/images/hero-image-asmanov-mx.avif") type("image/avif"),
            url("/images/hero-image-asmanov-mx.webp") type("image/webp")
        );
    }

    [data-background-image="for-motocrossmen"] {
        --bg-image: image-set(
            url('/images/motocross-for-motocrossmen-asmanov-mx.avif') type("image/avif"),
            url('/images/motocross-for-motocrossmen-asmanov-mx.webp') type("image/webp")
        );
    }
    
    [data-background-image="for-enduro-riders"] {
        --bg-image: image-set(
            url('/images/motocross-for-enduro-riders-asmanov-mx.avif') type("image/avif"),
            url('/images/motocross-for-enduro-riders-asmanov-mx.webp') type("image/webp")
        );
    }
    
    [data-background-image="for-beginners"] {
        --bg-image: image-set(
            url('/images/motocross-for-beginners-asmanov-mx.avif') type("image/avif"),
            url('/images/motocross-for-beginners-asmanov-mx.webp') type("image/webp")
        );
    }

    [data-background-image="for-city-riders"] {
        --bg-image: image-set(
            url('/images/motocross-for-city-riders-asmanov-mx.avif') type("image/avif"),
            url('/images/motocross-for-city-riders-asmanov-mx.webp') type("image/webp")
        );
    }

    .our-coaches {
        padding-top: 0;

        h2 {
            margin: 0;
            padding: 1.75rem 0 2rem;
            z-index: 10;
            background-color: var(--secondary-color);
            position: sticky;
            top: 0;
        }

        figure {
            margin: 1.75rem 0 2rem;
            padding: 1.25rem;
            background-color: rgb(from white r g b / 13%);
            font-size: 1.25rem;
            line-height: 1.3;
            border-radius: 0 2.75rem 2.75rem 2.75rem;
        }

        blockquote {
            margin: 0 0 0.5rem;
            font-style: italic;
        }

        figcaption {
            text-align: right;
        }

        .coach-info {
            position: relative;
            background-color: var(--secondary-color);
            padding-block: 1rem;

            p {
                margin: 0;
                margin-bottom: 1rem;
            }
        }
    }

    .questions-answers {
        margin-block: -1rem 2rem;
    }

    .social-icons {
        display: flex;
        align-items: anchor-center;
        gap: 1rem;
        justify-content: center;
        margin-block-start: 1rem;
        opacity: 80%;
    }

    .social-media {
        position: absolute;
        bottom: 2rem;
    }

    .about-us {

        margin-top: 0;

        h2 {
            padding: 2rem 0 1.75rem;
            position: sticky;
            top: 0;
            background-color: var(--secondary-color);
            margin: 0;
        }

        ul {
            padding: 0;
            margin: 0;

            li {
                list-style: none;
                display: grid;
                grid-template-columns: min(2rem);
                grid-template-areas:
                    "icon header"
                    "icon description";
                column-gap: 1.25rem;
                padding: 1rem 0 2rem;

                border-bottom: thin solid var(--tertiary-color);

                position: sticky;
                top: 6rem;
                background-color: var(--secondary-color);
            }

            li:last-child {
                border-bottom: none;
            }

            h3 {
                grid-area: header;
            }

            p {
                grid-area: description;
                font-weight: var(--font-weight-extra-light);
            }

            .icon {
                grid-area: icon;
            }
        }

        p {
            margin: 0;
        }
    }

    details {
        border-bottom: thin solid var(--tertiary-color);

        summary {
            font-weight: var(--font-weight-medium);
            cursor: pointer;
            margin-block-end: 0;
            padding-block: 1.75rem;
            list-style: none;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
        }

        &[open] {
            padding-block-end: 1.75rem;

            p {
                margin: 0;
                font-weight: var(--font-weight-extra-light);
            }
        }

        &[open] summary {
            padding-block-end: 1.25rem;

            svg {
                transform: scale(-1, -1);
            }
        }
    }
}


@layer effects {
    html {
        scroll-behavior: smooth;
    }

    .logo {
        view-transition-name: logo;
    }

    .hidden {
        display: none;
        pointer-events: none;
    }

    @keyframes blurIn {
        from  {
            filter: blur(0.25rem);
            opacity: 50%;
        }
        
        to {
            filter: blur(0);
            opacity: 1
        }
    }

    .swipe-transition {
        animation: blurIn linear, blurIn linear reverse;
        animation-timeline: view(inline), view(inline);
        animation-range: entry 0% cover 50%, exit 0% exit 100%;
    }
}
