/* 234 Native's page frame for its legal pages (234-native, src/components/marketing/landing/landing.css):
   the top, the column of text and the footer. The values are the same, so change them in step with it.
   tokens.css and text-flow.css are unchanged copies from 234-design-system/css. */
@layer base, components;

:root {
    --fg: var(--color-text-neutral);
    --fg-2: var(--color-text-secondary-neutral);
    --fg-3: var(--color-text-tertiary-neutral);
    --bg: var(--color-background-primary);
    --line: var(--color-border-neutral);
    --fill: var(--color-background-secondary);
    --ring: var(--color-text-emphasized-info);
    --glass: color-mix(in srgb, var(--bg) 74%, transparent);
    --display: var(--font-l);
    --text: var(--font-m);
    --ease-std: cubic-bezier(0.4, 0, 0.2, 1);
    --fast: 150ms;
    --mid: 250ms;
    --max: 75rem;
    --pad: clamp(1.25rem, 4vw, 3rem);
    --room: clamp(5.5rem, 11vw, 10rem);
    color-scheme: light;
}
.dark {
    --line: #1d1e20; /* The dividers in dark mode, as in 234 Native */
    --glass: color-mix(in srgb, var(--bg) 70%, transparent);
    color-scheme: dark;
}

@layer base {
    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    body,
    h1,
    h2,
    h3,
    p,
    ul {
        margin: 0;
    }
    ul {
        padding: 0;
        list-style: none;
    }
    a {
        color: inherit;
        text-decoration: none;
    }
    img,
    svg {
        display: block;
        flex: none;
        max-width: 100%;
    }
    button {
        padding: 0;
        border: 0;
        background: none;
        color: inherit;
        font: inherit;
        cursor: pointer;
    }
    :where(a, button):focus-visible {
        outline: 2px solid var(--ring);
        outline-offset: 3px;
    }
}

body {
    min-height: 100dvh;
    background: var(--bg);
    color: var(--fg);
    font: 400 1.0625rem/1.45 var(--text); /* Body */
    -webkit-font-smoothing: antialiased;
}
main:focus {
    outline: none;
}
.wrap {
    max-width: calc(var(--max) + var(--pad) * 2);
    margin-inline: auto;
    padding-inline: var(--pad);
}

/* The first thing the keyboard reaches, hidden until then */
.skip {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 50;
    padding: 0.625rem 1rem;
    border-radius: 999px;
    background: var(--fg);
    color: var(--bg);
    font: 500 0.875rem/1 var(--text);
    translate: 0 -200%;
}
.skip:focus-visible {
    translate: 0 0;
}

/* ---- The logo: the app's icon and name, 32 tall as 234 Native's ---- */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    font: 600 1.25rem/1 var(--display);
    letter-spacing: 0.01em;
    color: var(--fg);
}
.logo img {
    width: 2rem;
    height: 2rem;
}

/* ---- The top: 64 tall, glass once the page has moved ---- */
.head {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 4rem;
    transition:
        background-color var(--mid) var(--ease-std),
        box-shadow var(--mid) var(--ease-std);
}
.head[data-scrolled] {
    background: var(--glass);
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
    backdrop-filter: saturate(1.6) blur(16px);
    box-shadow: 0 1px 0 var(--line);
}
.head-in {
    display: flex;
    align-items: center;
    height: 100%;
}

/* ---- The text ---- */
.subpage {
    max-width: calc(46rem + var(--pad) * 2);
    padding-block: clamp(3rem, 8vw, 6rem) var(--room);
}
.subpage > .text-flow > h1 {
    font: 400 clamp(2.25rem, 1.5rem + 3vw, 3.5rem) / 1.1 var(--display); /* Display 3 */
    text-wrap: balance;
}
.subpage > .text-flow > .text-flow-meta {
    margin-top: 1rem;
}

/* ---- The footer ---- */
.foot {
    padding-block: 3.5rem 2.5rem;
    border-top: 1px solid var(--line);
    font-size: 0.875rem;
    color: var(--fg-3);
}
.foot-columns {
    display: grid;
    grid-template-columns: 3fr repeat(2, minmax(0, 1fr));
    gap: 2rem;
}
.foot-columns .logo {
    justify-self: start;
    align-self: start;
}
.foot-head {
    margin-bottom: 0.875rem;
    font: 500 0.875rem/1 var(--text);
    color: var(--fg);
}
.foot-column li {
    padding: 0.3125rem 0;
}
.foot a {
    transition: color var(--fast) var(--ease-std);
}
.foot-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 3rem;
}
.foot-legal {
    display: grid;
    gap: 0.375rem;
}
.foot-legal p:first-child {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}
.theme-switch {
    display: inline-flex;
    padding: 0.1875rem;
    border: 1px solid var(--line);
    border-radius: 999px;
}
.theme-switch button {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 1.75rem;
    border-radius: 999px;
    color: var(--fg-3);
    transition:
        background-color var(--fast) var(--ease-std),
        color var(--fast) var(--ease-std);
}
.theme-switch svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}
.theme-switch button[aria-pressed="true"] {
    background: var(--fill);
    color: var(--fg);
}
/* Shown once the script that runs it has loaded */
.theme-switch[hidden] {
    display: none;
}
@media (hover: hover) and (pointer: fine) {
    .foot a:hover,
    .theme-switch button:hover {
        color: var(--fg);
    }
}
@media (max-width: 48rem) {
    .foot-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .foot-columns .logo {
        grid-column: 1 / -1;
    }
}

/* ---- The theme fades from one to the other ---- */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 250ms;
    animation-timing-function: ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
    }
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
}
