.home-hero {
    --cell-padding: clamp(10px, 10cqw, 20px);
    --murmuration-speed: 120s;

    container: homeHero / inline-size;
}

.home-hero__inner {
    --left-col: 35.75%;
    --darts-col: 7.1%;
    --film-col-gap: 3.5%;
    --cta-col: 30%;
    --cta-col-gap: 17.9%;

    --top-row: 44.25%;
    --darts-row: 12.5%;
    --cta-row-gap: 6.2%;

    width: 100%;
    display: grid;


    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, min-content);

    @media(min-width: 768px) {
        aspect-ratio: 4 / 3;
        grid-template-columns: var(--left-col) var(--darts-col) var(--film-col-gap) var(--cta-col-gap) var(--cta-col) calc(100% - var(--left-col) - var(--darts-col) - var(--film-col-gap) - var(--cta-col-gap) - var(--cta-col));
        grid-template-rows: var(--top-row) var(--darts-row) var(--cta-row-gap) calc(100% - var(--top-row) - var(--darts-row) - var(--cta-row-gap));
    }

    min-height: 0;
}

.home-hero__image {
    grid-column: 1 / -1;
    grid-row: 2 / -1;
    @media(min-width: 768px) {
        grid-row: 1 / -1;
    }
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    mix-blend-mode: multiply;
    animation: image_1_fade 15s ease-in-out infinite;
}

.home-hero__image_two {
    grid-column: 1 / -1;
    grid-row: 2 / -1;
    @media(min-width: 768px) {
        grid-row: 1 / -1;
    }
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    mix-blend-mode: multiply;
    animation: image_2_fade 15s ease-in-out infinite;
}

.home-hero__title {
    font-size: clamp(0px, 3.5cqw, 34px) !important;
    text-wrap: balance;
}

/* --------------------------------- */
/* BLOCKS */

.home-hero__intro {
    grid-row: 1;
    grid-column: 1 / -1;
    @media(min-width: 768px) {
        grid-column: 1;
        max-width: 360px;
    }

    background-color: var(--sl-beige);
    padding: 0 1rem 1rem 0;
    place-self: start;
    z-index: 10;

    h2 {
        font-size: 24px;
        margin: 0 0 0.5em 0;
    }
    p {
        margin: 0;
    }
}

.home-hero__darts {
    display:none;
    @media(min-width: 768px) {
        display: unset;
        animation: murmuration-up var(--murmuration-speed) linear reverse infinite;
        background-image: url('../../assets/darts-up.svg');
        background-size: calc(100% / 6) auto;
        background-position: top left;
        background-repeat: repeat;
        grid-column: 2;;
        grid-row: 2;
        width: 100%;
        height: auto;
        z-index: 3;
    }

}

.home-hero__film {
    display: none;
    @media(min-width: 768px) {
        display: unset;
        grid-column: 4 / -2;
        grid-row: 3 / -1;
        clip-path: polygon(0% 0%, 37.4% 0%, 37.4% 43.3%, 100% 43.3%, 100% 100%, 0% 100%);
        z-index: 1;

        video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            filter: grayscale(100%);
            mix-blend-mode: multiply
        }
    }
}

.home-hero__cta-link {
    font-weight: bold;
    transition: opacity 0.15s ease;
    &:hover {
        color: inherit !important;
        opacity: 0.8;
    }
}

.home-hero__cta-link_wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: max-content;
    gap: 0.5em;
    padding-top: 1.5rem;
}

.home-hero__cta {
    grid-column: 1 / -1;
    z-index: 4;

    @media(min-width: 768px) {
        grid-column: 5;
        grid-row: 4;
    }
}

.home-hero__title {
    text-decoration: none;
}

.home-hero__cta-copy {
    height: 0;
    overflow: hidden;
    transition: all 1s ease-in-out;
    opacity: 0;
    text-decoration: none !important;
    grid-column: 1 / -1;

    &.visible {
        opacity: 1;
        height: auto;
        margin-top: 1em
    }
}

.home-hero__cta-content {
    display: grid;
    grid-template-columns: 1fr max-content;
    background: var(--sl-black);
    color: var(--sl-beige) !important;
    padding: 1rem;
    text-decoration: none !important;

    @media(min-width: 768px) {
        max-width: 400px;
    }

    h3 {
        font-size: 24px;
        margin: 0 0 0.25em;
        text-decoration: none !important;
    }
    a {
        color: inherit;
        &:hover {
            color: inherit;
        }
    }
}
.home-hero__cta-link {
    text-decoration: underline !important;
}

.home_hero__credit {
    font-size: 12px;
    display: block;
    margin-top: 1em;
}

/* --------------------------------- */
/* ANIMATIONS */
@keyframes murmuration-left {
    from {
        background-position-x: 0%;
    }
    to {
        background-position-x: 1000%;
    }
}

@keyframes murmuration-up {
    from {
        background-position-y: 0%;
    }
    to {
        background-position-y: -1000%;
    }
}

/* Image 1: visible 0–50%, crossfade out 50–53% (with image 2), hidden 53–97%, crossfade in 97–100% */
@keyframes image_1_fade {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    53% {
        opacity: 0;
    }
    97% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Image 2: hidden 0–50%, crossfade in 50–53% (with image 1), visible 53–97%, crossfade out 97–100% */
@keyframes image_2_fade {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 0;
    }
    53% {
        opacity: 1;
    }
    97% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}