/*
 * Clarity: the app's default theme, worn by the website.
 *
 * ThemePreset.clarity in the macOS app is a light appearance, the navy accent, and
 * Atkinson Hyperlegible Next. Light is the whole theme, so this stylesheet has no dark
 * palette; a visitor in dark mode sees the app's default look, deliberately.
 */

@font-face {
    font-family: "Atkinson Hyperlegible Next";
    /* One variable file covering weight 200 to 800, the same face the app ships. */
    src: url("fonts/AtkinsonHyperlegibleNext.woff2") format("woff2-variations");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Atkinson Hyperlegible Next";
    src: url("fonts/AtkinsonHyperlegibleNext-Italic.woff2") format("woff2-variations");
    font-weight: 200 800;
    font-style: italic;
    font-display: swap;
}

:root {
    color-scheme: light;

    /* ThemeAccent.navy, Color(red: 0.16, green: 0.26, blue: 0.58). */
    --accent: #294294;
    --accent-hover: #1e3273;
    --on-accent: #ffffff;

    --bg: #f2f3f5;
    --surface: #ffffff;
    --border: #dfe2e8;
    --text: #15181d;
    --muted: #565d68;

    --radius: 14px;
    --measure: 46rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0 1.5rem;
    background: var(--bg);
    color: var(--text);
    font-family: "Atkinson Hyperlegible Next", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-underline-offset: 0.2em;
}

code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 0.86em;
    padding: 0.1em 0.36em;
    border-radius: 5px;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--text);
    white-space: nowrap;
}

.page {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 4.5rem 0 3rem;
}

/* --- Hero ------------------------------------------------------------------ */

.hero {
    text-align: center;
}

.hero-icon {
    width: 176px;
    height: 176px;
    filter: drop-shadow(0 12px 26px rgb(21 24 29 / 0.18));
}

h1 {
    margin: 1.5rem 0 0;
    font-size: 3rem;
    line-height: 1.1;
    letter-spacing: -0.025em;
}

.tagline {
    margin: 0.75rem 0 0;
    font-size: 1.3rem;
    line-height: 1.35;
    letter-spacing: -0.012em;
    color: var(--text);
}

.lede {
    margin: 1rem auto 0;
    max-width: 34rem;
    color: var(--muted);
}

/* --- Download -------------------------------------------------------------- */

.download {
    margin-top: 2.25rem;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
}

.button:hover {
    background: var(--accent-hover);
}

.button:active {
    transform: translateY(1px);
}

.button:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

/* Stands in for the button before the first release is published. */
.coming-soon {
    display: inline-block;
    margin: 0;
    padding: 0.85rem 1.6rem;
    border: 1px dashed var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 1.05rem;
    font-weight: 600;
}

.download-meta {
    margin: 0.9rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

/* --- Privacy strip --------------------------------------------------------- */

.strip {
    margin: 4rem 0 0;
    padding: 1.4rem 1.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.strip p {
    margin: 0;
    color: var(--muted);
}

.strip strong {
    color: var(--text);
}

/* --- Features -------------------------------------------------------------- */

.features {
    margin-top: 4rem;
}

h2 {
    margin: 0 0 1.75rem;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 1.25rem;
}

.grid article {
    padding: 1.35rem 1.4rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.grid h3 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.5rem;
    font-size: 1rem;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--accent);
}

.grid h3 svg {
    flex: none;
    width: 20px;
    height: 20px;
}

.grid p {
    margin: 0;
    font-size: 0.96rem;
    color: var(--muted);
}

/* Screenshots are off for now. Uncomment this block and the <img> in index.php to
   put a screenshot beside a feature's text.

(* A card with a screenshot spans both columns, so the image gets room to read. *)
.grid .has-shot {
    grid-column: 1 / -1;
}

.shot {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 1.1rem;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg);
}

@media (min-width: 46rem) {
    .grid .has-shot {
        display: grid;
        grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
        (* The third row soaks up whatever height the image adds, so the text
           stays together at the top instead of being spread down the card. *)
        grid-template-rows: auto auto 1fr;
        gap: 0 1.6rem;
    }

    .grid .has-shot h3 {
        grid-area: 1 / 1;
    }

    .grid .has-shot p {
        grid-area: 2 / 1;
    }

    .grid .has-shot .shot {
        grid-area: 1 / 2 / 4 / 3;
        margin-top: 0.15rem;
        align-self: start;
    }
}
*/

/* --- Follow ---------------------------------------------------------------- */

.follow {
    margin-top: 4rem;
}

.socials {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.socials a {
    /* Mark and network name on the first line, handle across the full width on the
       second. Three across is too narrow to keep a long handle beside the mark. */
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.1rem 0.6rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    text-decoration: none;
    transition: border-color 0.15s ease;
}

.socials a:hover {
    border-color: var(--accent);
}

.brand {
    grid-area: 1 / 1;
    width: 22px;
    height: 22px;
    color: var(--text);
}

.socials a:hover .brand {
    color: var(--accent);
}

.network {
    grid-area: 1 / 2;
    font-weight: 600;
    color: var(--text);
}

.handle {
    grid-column: 1 / -1;
    font-size: 0.82rem;
    color: var(--muted);
    overflow-wrap: anywhere;
}

/* --- Footer ---------------------------------------------------------------- */

footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--muted);
    text-align: center;
}

footer p {
    margin: 0;
}

@media (max-width: 34rem) {
    .socials {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 30rem) {
    .page {
        padding-top: 3rem;
    }

    h1 {
        font-size: 2.4rem;
    }

    .tagline {
        font-size: 1.15rem;
    }

    .hero-icon {
        width: 132px;
        height: 132px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
