/*CSS for home page*/
html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
}

body {
    background: linear-gradient(to bottom, #403c38 0%, #403c38 35%, #000 100%);
    overflow: hidden;
    font-family: Arial, sans-serif;
}

.landing {
    width: 100vw;
    height: 100vh;
    display: grid;
    place-items: center;
}

.monitor-scene {
    position: relative;
    display: inline-grid;
    place-items: center;
    height: 100vh;
}

.screen-reveal {
    position: absolute;
    z-index: 0;
    overflow: hidden;
    width: 80%;
    height: 80%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #000;
}

.bliss-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(0);
    transform-origin: center center;
    opacity: 0;
    transition: transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 250ms ease;
}

body.is-started .bliss-image {
    transform: scale(1);
    opacity: 1;
}

.app-dock {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(20px, 3vw, 40px);
    transform: translateY(calc(-10% + 10px));
    opacity: 0;
    transition: opacity 300ms ease 500ms, transform 300ms ease 500ms;
    pointer-events: none;
}

body.is-started .app-dock {
    opacity: 1;
    transform: translateY(-10%);
    pointer-events: auto;
}

.app-icon {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: clamp(112px, 14vw, 176px);
    text-decoration: none;
    padding: 10px 8px;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 12px;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.app-icon:hover,
.app-icon:focus-visible {
    background-color: rgba(0, 0, 0, 0.25); /* 10% opacity */
    border-color: rgba(0, 0, 0, 0.45);
    outline: none;
}

.app-icon img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.app-label {
    color: #f3f3f3;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    font-weight: 600;
    text-align: center;
    line-height: 1.1;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.85), 0 0 8px rgba(0, 0, 0, 0.55);
    user-select: none;
}

.monitor-button {
    position: relative;
    z-index: 1;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    line-height: 0;
}

body.is-started .monitor-button {
    pointer-events: none;
}


.monitor-image {
    display: block;
    height: 100vh;
    width: auto;
    max-width: 100vw;
    object-fit: contain;
}

.start-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a9aaab;
    font-size: clamp(1.2rem, 2vw, 2rem);
    font-weight: 600;
    text-align: center;
    user-select: none;
    pointer-events: none;
    z-index: 2;
    transition: opacity 250ms ease;
}

body.is-started .start-text {
    opacity: 0;
}

.language-switcher {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 20;
}

#language-select {
    background: rgba(0, 0, 0, 0.65);
    color: #f3f3f3;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.9rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    border: 0;
    clip: rect(0, 0, 0, 0);
}

.mobile-home {
    display: none;
}

/* Full-page transition overlay (index only) */
.page-transition {
    position: fixed;
    inset: 0;
    background: #fff;
    opacity: 1;
    pointer-events: auto;
    z-index: 9999;
    transition: opacity 360ms ease;
}

body.is-page-ready .page-transition {
    opacity: 0;
    pointer-events: none;
}

body.is-transitioning .page-transition {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 839px) {
    body {
        background: linear-gradient(to bottom, #ffffff 0%, #f2f8ff 55%, #d9ebff 100%);
        overflow: hidden;
    }

    .landing {
        display: none;
    }

    .language-switcher {
        z-index: 30;
        top: 12px;
        right: 12px;
    }

    .mobile-home {
        --mobile-gap: clamp(10px, 2vh, 18px);
        --mobile-pad-top: max(12px, env(safe-area-inset-top));
        --mobile-pad-bottom: max(12px, env(safe-area-inset-bottom));
        --mobile-footer-space: clamp(34px, 8vh, 60px);
        height: 100dvh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: var(--mobile-gap);
        padding: var(--mobile-pad-top) 16px var(--mobile-pad-bottom);
        box-sizing: border-box;
        overflow: hidden;
    }

    .mobile-app-button {
        --size-by-height: calc(
                (100dvh - var(--mobile-pad-top) - var(--mobile-pad-bottom) - var(--mobile-footer-space) - (2 * var(--mobile-gap))) / 3
        );
        width: min(72vw, 240px, var(--size-by-height));
        height: min(72vw, 240px, var(--size-by-height));
        flex: 0 0 auto;

        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 18px;
        border: 1px solid rgba(0, 0, 0, 0.35);
        text-decoration: none;
        background: url("../images/bliss.png") center / cover no-repeat;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    }

    .mobile-app-label {
        color: #fff;
        font-size: clamp(1.4rem, 6vw, 2rem);
        font-weight: 800;
        text-align: center;
        line-height: 1.1;
        padding: 0 12px;
        text-shadow: 0 2px 2px rgba(0, 0, 0, 0.85), 0 0 8px rgba(0, 0, 0, 0.55);
    }

    .mobile-footer {
        position: fixed;
        left: 50%;
        bottom: calc(10px + env(safe-area-inset-bottom));
        transform: translateX(-50%);
        margin: 0;
        width: min(92vw, 420px);
        text-align: center;
        color: #333;
        font-size: clamp(0.78rem, 3.2vw, 0.95rem);
        line-height: 1.25;
    }
}
