/* Loaded only on the home page. Keep decoration behind all page content. */
.home-page {
    isolation: isolate;
    padding-bottom: 64px;
}

.waves-background {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 800ms ease;
}

.waves-background.is-visible {
    /* Even a black video frame leaves a light backdrop for the dark text. */
    opacity: 0.22;
}

.waves-background video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Keep the breaking waves and sandy shore in view as the frame is cropped. */
    object-position: 80% center;
}

.waves-toggle {
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #d2d7e1;
    border-radius: 50%;
    background: #f8f8f8;
    color: #344d8d;
    box-shadow: 0 2px 8px rgba(38, 56, 103, 0.06);
    cursor: pointer;
    transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.waves-toggle[hidden] {
    display: none;
}

.waves-toggle:hover {
    border-color: #344d8d;
}

.waves-toggle:focus-visible {
    outline: 2px solid #344d8d;
    outline-offset: 4px;
}

.waves-toggle[aria-pressed="true"] {
    background: #344d8d;
    border-color: #344d8d;
    color: #ffffff;
}

.waves-toggle[aria-busy="true"] svg {
    opacity: 0.5;
}

.waves-status {
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: calc(max(20px, env(safe-area-inset-bottom)) + 52px);
    z-index: 2;
    max-width: min(280px, 80vw);
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #d2d7e1;
    border-radius: 8px;
    background: #f8f8f8;
    font-size: 13px;
}

.waves-status:empty {
    display: none;
}

@media (max-aspect-ratio: 3/4) {
    .waves-background video {
        object-position: 85% center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .waves-background,
    .waves-toggle {
        transition: none;
    }
}
