/*
 * Colours, the font and the motion values are copied by hand from the app's
 * frontend/src/styles/theme.ts and motion.ts; the comment next to each names
 * its token.
 */

/* Geist ships with the app as @fontsource-variable/geist 5.3.0; this is its
   latin, normal-style file. The licence is fonts/LICENSE. */
@font-face {
    font-family: 'Geist Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url(fonts/geist-latin-wght-normal.woff2) format('woff2-variations');
}

:root {
    /* colors.light */
    --bg: #FCFCFC;
    --text: #000000;
    --muted: #525252;
}

/* colors.dark: the system's choice, as Match system does. */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0A0A0A;
        --text: #FFFFFF;
        --muted: #A4A4A4;
    }
}

body {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: 'Geist Variable', system-ui, sans-serif; /* fonts.sans */
    color: var(--text);
    background: var(--bg);
    /* As the app's GlobalStyle: macOS draws Geist thinner, as in Protocol. */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* The extra space under the block lifts it a little above the true middle,
   where a centred block reads as centred rather than sinking. */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px calc(40px + 4vh);
    text-align: center;
}

/* The GIF is the ring on a square of near-`bg`; the radial fade lets the
   square's edge vanish into the page. 120 px is half the GIF's 240, so it
   stays sharp on a 2x screen. */
img {
    display: block;
    width: 120px;
    height: 120px;
    mask-image: radial-gradient(closest-side, #000 75%, transparent);
}

/* A phone's screen is 3x, where 120 px would stretch the GIF; 96 px keeps
   the stretch small and the ring in step with the smaller name. */
@media (max-width: 600px) {
    img {
        width: 96px;
        height: 96px;
    }
}

h1 {
    margin: 20px 0 0;
    font-size: clamp(48px, 4.5vw + 26px, 72px);
    line-height: 1;
    font-weight: 600;
    /* Large Geist wants tight tracking. */
    letter-spacing: -0.035em;
}

/* 30em, about 60 characters a line, balances the sentence over two lines on
   a desktop. */
p {
    max-width: 30em;
    margin: 20px 0 0;
    font-size: clamp(17px, 0.5vw + 15px, 20px);
    line-height: 1.5;
    letter-spacing: -0.011em;
    color: var(--muted);
    text-wrap: balance;
}

footer {
    display: flex;
    justify-content: center;
    padding: 0 24px 24px;
}

/* The padding is the link's hit target, larger under a finger. */
a {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 20px;
    color: var(--muted);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
    /* motion.duration.fast, motion.easing.standard */
    transition: color 120ms cubic-bezier(0.2, 0, 0, 1),
        text-decoration-color 120ms cubic-bezier(0.2, 0, 0, 1);
}

@media (pointer: coarse) {
    a {
        padding: 12px 16px;
    }
}

/* Only where there is a pointer to hover with: a tap would leave the hover
   colour stuck on the link. */
@media (hover: hover) {
    a:hover {
        color: var(--text);
        text-decoration-color: currentColor;
    }
}

a:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}
