* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
}

html {
    background-color: #353029;
    min-height: 100%;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    background-color: #353029;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

/* Hero img: keep layer behind UI — no transform on this fixed layer (Chrome can paint it above siblings). */
.home-bg-layer {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: 100svh;
    z-index: 0;
    pointer-events: none;
    background-color: #353029;
}

/* Wraps all home UI so z-index stacks above .home-bg-layer (see index.html). */
.home-foreground {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
}

[data-home] .site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 4;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 11px;
    line-height: 1.45;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.42);
    text-align: center;
    padding: 12px 16px 20px;
    pointer-events: none;
}

.home-bg-layer .home-bg-layer-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

.logo {
    position: absolute;
    z-index: 10;
    top: var(--logo-inset-top);
    left: 0;
    padding: 0 20px 0 20px;
    display: flex;
    align-items: flex-start;
    height: var(--header-bar-height);
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    outline: none;
}

.logo img {
    height: var(--logo-height);
    width: auto;
    display: block;
    object-fit: contain;
    object-position: top center;
    filter: brightness(0) invert(1);
}

.menu-button {
    position: absolute;
    top: var(--logo-inset-top);
    right: 0;
    padding: 0 20px 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    height: var(--header-bar-height);
    cursor: pointer;
    z-index: 100;
    transition: transform 0.3s ease;
}

.menu-button span {
    width: 24px;
    height: 1px;
    background-color: #ffffff;
    display: block;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.menu-button:hover span {
    opacity: 1;
}

.menu-button.active span {
    background-color: #ffffff;
}

.menu-button.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-button.active span:nth-child(2) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.home-announcement {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--header-stack-height) + 12px);
    z-index: 50;
    text-align: center;
    pointer-events: none;
    padding: 0 clamp(16px, 4vw, 32px);
}

.home-announcement-line {
    font-family: 'Montserrat', sans-serif;
    font-weight: 200;
    font-size: clamp(12px, 2vw, 15px);
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: 0.06em;
    line-height: 1.45;
}

.home-announcement-line:first-of-type {
    font-size: clamp(14px, 2.5vw, 18px);
    font-weight: 500;
}

.home-announcement-line + .home-announcement-line {
    margin-top: 0.25em;
}

.menu-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #353029;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-popup.active {
    opacity: 1;
    visibility: visible;
}

.menu-popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.menu-popup-item {
    font-family: 'Montserrat', sans-serif;
    font-weight: 200;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.05em;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(20px);
}

.menu-popup.active .menu-popup-item {
    transform: translateY(0);
}

.menu-popup-item:nth-child(1) { transition-delay: 0.05s; }
.menu-popup-item:nth-child(2) { transition-delay: 0.1s; }
.menu-popup-item:nth-child(3) { transition-delay: 0.15s; }
.menu-popup-item:nth-child(4) { transition-delay: 0.2s; }
.menu-popup-item:nth-child(5) { transition-delay: 0.25s; }

.menu-popup-item:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .menu-popup-item {
        font-size: 20px;
        gap: 25px;
    }
}

.button-titles {
    position: absolute;
    z-index: 5;
    inset: 0;
    width: 100%;
    display: flex;
    justify-content: center !important;
    align-items: center;
    gap: clamp(24px, 8vw, 110px);
    padding: 0 clamp(10px, 2vw, 20px);
    transform: translate(0, -100px);
    pointer-events: none;
    margin: 0 auto;
}

.title-item {
    position: static;
    font-family: 'Montserrat', sans-serif;
    font-weight: 200;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.05em;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    pointer-events: auto;
    text-decoration: none;
    display: block;
}

.title-item:hover {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Avoid html/body position:fixed + JS height — that combo often blanks the compositor on iOS/WebKit */
    html {
        min-height: 100%;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
        width: 100%;
        overflow-x: hidden;
    }

    body {
        min-height: 100%;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
        background-color: #353029;
        width: 100%;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .home-bg-layer {
        min-height: -webkit-fill-available;
    }

    .button-titles {
        gap: clamp(10px, 3vw, 40px);
        padding: 0 clamp(5px, 1.5vw, 15px);
        transform: translate(0, -70px);
    }
    
    .title-item {
        font-size: clamp(18px, 4.8vw, 24px);
        font-weight: 400;
    }
}

@media (max-width: 480px) {
    .button-titles {
        gap: clamp(5px, 2vw, 20px);
        padding: 0 clamp(5px, 1vw, 10px);
        transform: translate(0, -85px);
    }
    
    .title-item {
        font-size: clamp(17px, 5.4vw, 22px);
        font-weight: 400;
    }
}
