@media (min-width: 781px) {
    .hero,
    .media-block {
        grid-row: 2;
        grid-column: 1;
    }

    .media-block {
        position: relative;
        top: auto;
        right: auto;
        align-self: end;
        justify-self: end;
    }

    .site-footer {
        grid-row: 3;
    }

    body.has-cookie-bar .site-shell {
        padding-bottom: calc(var(--shell-pad-y) + 72px);
    }
}

@media (max-width: 1400px) and (min-width: 1101px) {
    .hero h1 {
        font-size: 62px;
    }
}

@media (max-width: 1100px) and (min-width: 781px) {
    .site-header {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .header-actions {
        min-width: 0;
        flex-wrap: nowrap;
    }

    .project-button {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .hero h1 {
        font-size: 48px;
    }
}

@media (max-width: 780px) {
    body {
        overflow: auto;
    }

    .site-shell {
        min-height: 100dvh;
        padding-bottom: var(--shell-pad-y);
    }

    .site-header {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .header-actions {
        min-width: 0;
        flex-wrap: nowrap;
        justify-content: flex-end;
    }

    .project-button {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .media-block {
        position: relative;
        top: auto;
        right: auto;
        justify-self: end;
        width: min(220px, 58vw);
        margin-top: 18px;
    }

    .hero {
        padding-top: 4vh;
    }

    .hero h1 {
        font-size: 34px;
        line-height: .98;
    }

    .site-footer {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .cookie-bar {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .pdf-dialog {
        width: 100vw;
        height: 100dvh;
        border: 0;
        border-radius: 0;
    }
}

@media (max-width: 600px), (max-height: 500px) and (pointer: coarse) {
    body:not(.is-game-mode) {
        overflow-x: hidden;
        overflow-y: auto;
    }

    body.is-mobile-menu-open {
        height: 100dvh;
        overflow: hidden;
        overscroll-behavior: none;
    }

    .site-shell {
        width: 100%;
        min-height: 100dvh;
        padding-bottom: var(--shell-pad-y);
        overflow-x: clip;
        align-content: space-between;
        grid-template-rows: auto auto auto auto auto;
        row-gap: 18px;
    }

    .site-header {
        z-index: 95;
        min-height: var(--control-circle-size);
        align-items: center;
        grid-row: 1;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .brand {
        align-self: center;
    }

    .header-actions {
        width: 100%;
        gap: 8px;
        justify-content: flex-end;
    }

    .header-actions > .project-button {
        display: none;
    }

    .mobile-menu-toggle {
        position: relative;
        display: grid;
        width: var(--control-circle-size);
        height: var(--control-circle-size);
        flex: 0 0 var(--control-circle-size);
        place-items: center;
        border: 1px solid var(--color-line);
        border-radius: 50%;
        background: transparent;
        color: #fff;
        cursor: pointer;
        transition: border-color .18s ease, background-color .18s ease, transform .2s ease;
    }

    .mobile-menu-toggle span {
        position: absolute;
        width: 14px;
        height: 1px;
        background: currentColor;
        transform-origin: center;
        transition: transform .2s cubic-bezier(.2, .8, .2, 1);
    }

    .mobile-menu-toggle span:first-child {
        transform: translateY(-3px);
    }

    .mobile-menu-toggle span:last-child {
        transform: translateY(3px);
    }

    .mobile-menu-toggle.is-open {
        border-color: var(--color-accent);
        background: var(--color-accent);
        transform: translateX(calc(var(--control-circle-size) + 8px));
        transition-delay: 0s, 0s, .1s;
    }

    .mobile-menu-toggle.is-open span:first-child {
        transform: translateY(0) rotate(45deg);
    }

    .mobile-menu-toggle.is-open span:last-child {
        transform: translateY(0) rotate(-45deg);
    }

    .locale-picker {
        transition: opacity .14s ease, transform .14s ease;
    }

    body.is-mobile-menu-open .locale-picker {
        opacity: 0;
        pointer-events: none;
        transform: scale(.82);
    }

    .hero {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        align-self: start;
        padding: 8px 0 0;
        grid-row: 2;
    }

    .hero h1 {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        font-size: 36px;
    }

    .media-block {
        width: min(230px, 66vw);
        margin: 0;
        align-self: center;
        justify-self: start;
        grid-row: 3;
    }

    .mobile-project-slot,
    .mobile-game-cta-slot {
        display: flex;
        width: 100%;
    }

    .mobile-project-slot {
        grid-row: 4;
    }

    .mobile-project-slot .project-button {
        display: inline-flex;
        width: 100%;
        transform: none;
    }

    .mobile-game-cta-slot {
        align-items: flex-start;
        grid-row: 5;
    }

    .mobile-game-cta-slot .footer-game-cta {
        display: grid;
        width: 100%;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        align-items: start;
    }

    .mobile-game-cta-slot .footer-game-cta__icon {
        transform: translateY(-7px);
    }

    .site-footer {
        position: fixed;
        z-index: 90;
        inset: 0;
        display: flex;
        width: 100%;
        height: 100dvh;
        min-height: 0;
        padding: calc(var(--shell-pad-y) + 58px) var(--shell-pad-x) var(--shell-pad-y);
        overflow-x: hidden;
        overflow-y: auto;
        flex-direction: column;
        gap: 34px;
        align-items: stretch;
        border: 0;
        background: transparent;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        opacity: 0;
        overscroll-behavior: contain;
        pointer-events: none;
        scrollbar-color: var(--color-accent) transparent;
        scrollbar-width: thin;
        transform: translateY(-8px);
        transition: opacity .2s ease, transform .24s ease, visibility 0s linear .24s;
        visibility: hidden;
    }

    .site-footer::-webkit-scrollbar {
        width: 6px;
    }

    .site-footer::-webkit-scrollbar-thumb {
        border-radius: 3px;
        background: var(--color-accent);
    }

    body.is-mobile-menu-open .site-footer {
        background: rgba(5, 5, 5, .7);
        -webkit-backdrop-filter: blur(24px) saturate(120%);
        backdrop-filter: blur(24px) saturate(120%);
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        transition-delay: 0s;
        visibility: visible;
    }

    body.is-game-mode .site-footer {
        display: none;
    }

    .site-footer .contact-links {
        order: 1;
    }

    .site-footer .footer-about {
        order: 2;
    }

    .site-footer .legal-links {
        order: 3;
    }

    .site-footer .footer-column {
        width: 100%;
        align-self: stretch;
    }

    .site-footer .footer-game-cta {
        display: none;
    }
}

@media (max-width: 600px) and (orientation: portrait) {
    .media-block {
        justify-self: start;
    }
}

@media (max-height: 500px) and (pointer: coarse) and (orientation: landscape) {
    .site-shell {
        row-gap: 6px;
    }

    .hero {
        padding-top: 0;
    }

    .hero h1 {
        font-size: 24px;
    }

    .media-block {
        width: 150px;
        justify-self: end;
    }
}

@media (max-height: 720px) and (min-width: 781px) {
    .hero h1 {
        font-size: 54px;
    }

    .footer-column {
        gap: 5px;
    }
}

@media (max-height: 720px) and (min-width: 781px) and (max-width: 1100px) {
    .hero h1 {
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 22px;
    }
}

@media (max-width: 620px) and (min-width: 481px) {
    .hero h1 {
        font-size: 30px;
    }
}

@media (max-width: 360px) {
    .hero h1 {
        font-size: 19px;
    }
}
