* {
    box-sizing: border-box;
}

html {
    --slide-height: 100vh;
}

@supports (height: 100dvh) {
    html {
        --slide-height: 100dvh;
    }
}

html,
body {
    height: 100%;
    overflow: hidden;
}

/* Snap within an explicit viewport, not Safari's root document scroller.
   Its native content inset can otherwise expose the preceding slide beneath
   the status bar. Fixed bounds include the safe area with viewport-fit=cover. */
#slide-scroller {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-padding: 0;
    scroll-behavior: smooth;
}

#slides {
    height: 100%;
}

body {
    margin: 0;
    background: #222;
    color: #fff;
    font-family: Roboto, Arial, sans-serif;
    font-weight: 300;
}

a {
    color: inherit;
}

a:hover {
    text-decoration: underline;
}

:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 4px;
}

[hidden] {
    display: none !important;
}

.viewport-diagnostics {
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    z-index: 40;
    width: min(360px, calc(100% - 16px));
    padding: 8px;
    background: #222;
    color: #fff;
    font: 14px/1.4 monospace;
}

.viewport-diagnostics textarea {
    display: block;
    width: 100%;
    height: 35vh;
    margin-top: 8px;
    font: inherit;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 30;
    padding: 12px;
    background: #222;
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 20;
    pointer-events: none;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    max-width: 1170px;
    min-height: 80px;
    margin: auto;
    padding: max(12px, env(safe-area-inset-top)) 0 12px;
}

.brand {
    font-size: 16px;
    letter-spacing: 8px;
    text-transform: uppercase;
    text-decoration: none;
    text-shadow: 0 1px 5px #333;
    pointer-events: auto;
}

.brand strong {
    font-weight: 500;
}

.menu-disclosure {
    pointer-events: auto;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 4px;
    background: rgb(0 0 0 / 20%);
    color: #fff;
    cursor: pointer;
    pointer-events: auto;
    list-style: none;
}

.menu-toggle::-webkit-details-marker {
    display: none;
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: currentColor;
}

.menu-disclosure[open] .menu-toggle span:first-child {
    transform: translateY(6px) rotate(45deg);
}

.menu-disclosure[open] .menu-toggle span:nth-child(2) {
    opacity: 0;
}

.menu-disclosure[open] .menu-toggle span:last-child {
    transform: translateY(-6px) rotate(-45deg);
}

.site-menu {
    position: absolute;
    top: 80px;
    right: max(24px, calc((100% - 1170px) / 2));
    width: min(320px, calc(100% - 48px));
    max-height: calc(100vh - 104px);
    max-height: calc(100svh - 104px);
    max-height: calc(100dvh - 104px);
    overflow-y: auto;
    padding: 12px 0;
    background: rgb(0 0 0 / 85%);
    pointer-events: auto;
}

.site-menu a {
    display: block;
    padding: 13px 24px;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
}

.site-menu a:hover,
.site-menu a[aria-current="location"] {
    background: rgb(255 255 255 / 12%);
    font-weight: 500;
}

/* Resolve height against the actual scroll container, including in Safari.
   A resize re-snaps the current section, and long content can still grow. */
.site-slide {
    --content-top: calc(var(--slide-height) * 0.30);
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 100%;
    padding: 130px 24px 96px;
    padding-top: max(96px, var(--content-top));
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
    background-size: cover;
    background-position: center;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* Anchor destinations receive focus, but a full-slide outline creates a seam. */
.site-slide:focus {
    outline: none;
}

.slide-content {
    width: 100%;
    max-width: 1170px;
    margin: 0 auto;
}

.slide-content h1,
.slide-content h2 {
    margin: 0 0 18px;
    font-size: clamp(34px, 4.5vw, 80px);
    line-height: 1.1;
    font-weight: 100;
    overflow-wrap: break-word;
}

.slide-content strong {
    font-weight: 500;
}

.slide-content p {
    max-width: 680px;
    margin: 0 0 20px;
    font-size: clamp(18px, 1.5vw, 26px);
    line-height: 1.4;
}

.slide--home {
    background-image: url('../images/slider_smaller/slide1_bg.jpg');
}

.slide--mission {
    --content-top: calc(var(--slide-height) * 0.14);
    background-image: url('../images/slider_smaller/slide_mission.jpg');
}

.slide--vision {
    --content-top: calc(var(--slide-height) * 0.14);
    background-image: url('../images/slider_smaller/slide_vision.jpg');
}

.slide--development {
    background-image: url('../images/slider_smaller/slide_dev.jpg');
}

.slide--lead {
    --content-top: calc(var(--slide-height) * 0.22);
    background-image: url('../images/slider_smaller/slide_lead.jpg');
}

.slide--projects {
    --content-top: calc(var(--slide-height) * 0.10);
    background-image: url('../images/slider_smaller/slide_project.jpg');
    background-position: bottom right;
    color: darkslategrey;
}

.slide--architecture {
    --content-top: calc(var(--slide-height) * 0.10);
    background-image: url('../images/slider_smaller/slide_arch.jpg');
    color: darkslategrey;
}

.slide--vr {
    --content-top: calc(var(--slide-height) * 0.55);
    background-image: linear-gradient(transparent 50%, rgb(0 0 0 / 60%) 50%), url('../images/slider_smaller/slide_vr.jpg');
}

.game-link {
    display: inline-block;
    max-width: 100%;
}

.game-link img {
    display: block;
    max-width: 100%;
    height: auto;
}

.slide--contact {
    --content-top: calc(var(--slide-height) * 0.36);
    background-image: url('../images/slider_smaller/slide_contact.jpg');
}

.contact-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 24px;
    margin: auto -24px -12px;
    padding: 18px 24px;
    background: rgb(0 0 0 / 35%);
    font-size: 16px;
}

.scroll-hint {
    position: absolute;
    bottom: max(18px, env(safe-area-inset-bottom));
    left: 50%;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    transform: translateX(-50%);
    text-decoration: none;
}

.scroll-hint:hover {
    text-decoration: none;
}

.scroll-hint svg {
    width: 24px;
    height: 16px;
    animation: scroll-hint-bounce 650ms ease-in-out 1s 2;
}

@keyframes scroll-hint-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(8px);
    }
}

.slide-dots {
    position: fixed;
    top: 50%;
    right: max(18px, env(safe-area-inset-right));
    z-index: 15;
    display: flex;
    flex-direction: column;
    padding: 8px 4px;
    border-radius: 30px;
    background: rgb(0 0 0 / 25%);
    transform: translateY(-50%);
}

.slide-dots a {
    display: grid;
    place-items: center;
    width: 28px;
    height: 32px;
    border-radius: 50%;
}

.slide-dots a::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.slide-dots a[aria-current="location"]::before {
    background: #333;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@media (max-width: 1220px) {
    .header-content {
        padding-left: max(24px, env(safe-area-inset-left));
        padding-right: max(24px, env(safe-area-inset-right));
    }
}

@media (max-width: 600px) {
    .slide-dots {
        display: none;
    }

    .brand {
        font-size: 11px;
        letter-spacing: 3px;
    }

    .header-content {
        gap: 8px;
    }

    .site-slide {
        padding-bottom: 100px;
    }

    .slide--vr {
        --content-top: calc(var(--slide-height) * 0.46);
        background-image: linear-gradient(transparent 40%, rgb(0 0 0 / 65%) 40%), url('../images/slider_smaller/slide_vr.jpg');
    }

    .contact-details {
        flex-direction: column;
        align-items: center;
        margin-top: 48px;
    }
}

@media (max-height: 500px) {
    .site-slide {
        --content-top: 96px;
    }

    .slide--vr {
        background-image: linear-gradient(rgb(0 0 0 / 40%), rgb(0 0 0 / 60%)), url('../images/slider_smaller/slide_vr.jpg');
    }
}

@media (prefers-reduced-motion: reduce) {
    #slide-scroller {
        scroll-behavior: auto;
    }

    .scroll-hint svg {
        animation: none;
    }
}
