:root {
    --flucks-mobile-body-ink: #f5f4fa;
}

@font-face {
    font-family: FlucksLegal;
    src: url("/design-inputs/17-canonical-home/assets/Montserrat-variable.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

.legal-static,
.site-legal {
    isolation: isolate;
    background: #020309;
}

.legal-static {
    box-sizing: border-box;
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
}

.legal-static::before,
.site-legal::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 48% 38%, #02030940, #020309a8),
        url("/design-inputs/10-flight-styleframe/assets/space-backdrop-v1.png") center / cover no-repeat;
}

.legal-page {
    box-sizing: border-box;
    width: min(100%, 542px);
    height: min(796px, calc(100dvh - 48px));
    display: flex;
    flex-direction: column;
    isolation: isolate;
    overflow: hidden;
    border-radius: 32px;
    background: #fafafa;
    color: #020202;
    color-scheme: light;
    box-shadow: 2px 4px 10px #0003;
}

.legal-header {
    position: relative;
    flex: none;
    display: grid;
    justify-items: center;
    padding: 48px 32px 0;
}

.legal-header::after {
    content: "";
    display: block;
    width: 100%;
    height: 1px;
    margin-top: 32px;
    background: #0202021a;
}

.legal-brand img {
    display: block;
    width: 103px;
    height: 98px;
    object-fit: contain;
}

.legal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
}

.legal-close img {
    transform: rotate(45deg);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .legal-close img { transition: transform .16s ease; }
    .legal-close:hover img { transform: rotate(45deg) scale(1.12); }
}

.legal-content {
    --flucks-legal-font: FlucksLegal, Montserrat, system-ui, sans-serif;
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 16px 32px 32px;
    scrollbar-width: thin;
    scrollbar-color: #858585 transparent;
    color: #202020;
    font: 400 16px/1.5 var(--flucks-legal-font);
}

.legal-content h1 {
    margin: 0 0 20px;
    color: #020202;
    font: 500 26px/1.25 var(--flucks-legal-font);
}

.legal-content h2 {
    margin: 24px 0 8px;
    color: #020202;
    font: 600 18px/1.4 var(--flucks-legal-font);
}

.legal-content p {
    margin: 0 0 20px;
    overflow-wrap: anywhere;
}

.legal-effective {
    margin-bottom: 24px;
    color: #5c5c5c;
    font-size: 13px;
}

.legal-content a {
    color: #5a38cb;
    text-underline-offset: 3px;
}

.legal-page a:focus-visible {
    outline: 2px solid #9b64f5;
    outline-offset: 4px;
}

@media (max-height: 650px) {
    .legal-header { padding-top: 30px; }
    .legal-header::after { margin-top: 20px; }
}

@media (max-width: 47.99rem), (max-width: 60rem) and (max-height: 37.5rem) and (orientation: landscape) {
    @font-face {
        font-family: FlucksLegalPhone;
        src: url("/design-inputs/17-canonical-home/assets/Montserrat-static-400.woff2") format("woff2");
        font-weight: 400;
        font-display: swap;
    }
    @font-face {
        font-family: FlucksLegalPhone;
        src: url("/design-inputs/17-canonical-home/assets/Montserrat-static-500.woff2") format("woff2");
        font-weight: 500;
        font-display: swap;
    }
    @font-face {
        font-family: FlucksLegalPhone;
        src: url("/design-inputs/17-canonical-home/assets/Montserrat-static-600.woff2") format("woff2");
        font-weight: 600;
        font-display: swap;
    }

    .legal-static {
        display: block;
        padding: 0;
    }

    .legal-static,
    .site-legal {
        --legal-phone-sky:
            linear-gradient(#02030975, #020309d6),
            url("/design-inputs/10-flight-styleframe/assets/space-backdrop-mobile.webp") center / cover no-repeat;
    }

    .legal-static::before,
    .site-legal::before {
        bottom: auto;
        height: 100lvh;
        background: var(--legal-phone-sky);
    }

    .site-legal .site-header {
        --mobile-header-sky: var(--legal-phone-sky);
    }

    .legal-page {
        display: block;
        width: min(100%, 42rem);
        height: auto;
        margin: 0 auto;
        overflow: visible;
        border-radius: 0;
        background: transparent;
        color: #fafafa;
        color-scheme: dark;
        box-shadow: none;
    }

    .legal-header {
        justify-items: start;
        padding: max(12px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
    }

    .legal-header::after {
        margin-top: 15px;
        background: #fafafa33;
    }

    .legal-brand img { width: 50px; height: 48px; }
    .legal-close { display: none; }

    .legal-content {
        --flucks-legal-font: FlucksLegalPhone, Montserrat, system-ui, sans-serif;
        overflow: visible;
        padding: 32px max(20px, env(safe-area-inset-right)) max(36px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
        color: var(--flucks-mobile-body-ink);
        line-height: 1.65;
    }

    .legal-content h1 { color: #fff; font-size: clamp(28px, 8vw, 36px); }
    .legal-content h2 { color: #fff; }
    .legal-effective { color: #d5cce7; }
    .legal-content a { color: #d8baff; }
}


.site-legal .desktop-shell[hidden] { display: none; }

.legal-page--in-site {
    margin: var(--mobile-header-height, 24px) auto 0;
}
