/* box1.app — one stylesheet, no build step, no dependencies.
 *
 * THE SITE IS DEPLOYED AS STATIC FILES AND MUST STAY THAT WAY. Its whole reason
 * to exist is serving three things that a page builder cannot: the AASA file at
 * the apex with a JSON content type, a privacy policy at a stable URL, and a
 * Universal Link target. A framework buys none of that and adds a build to CI.
 */

:root {
    color-scheme: light dark;

    --bg: #fbfbfd;
    --surface: #ffffff;
    --text: #16161a;
    --muted: #5c5c68;
    --rule: #e3e3e9;
    /* **THE APP'S ACCENT, NOT A NEW RED.** `box1/Assets.xcassets/AccentColor.colorset`
     * is sRGB(0.6, 0, 0) light and sRGB(0.8, 0, 0) dark — i.e. #990000 / #CC0000.
     * An earlier draft here invented #d5423f "desaturated enough to read as UI",
     * which is a second brand colour nobody would remember to update. If the app's
     * accent changes, change it here too; there is no shared token and cannot be
     * one across SwiftUI and CSS. */
    --accent: #990000; /* 8.63:1 on --bg */
    --radius: 14px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #101014;
        --surface: #191920;
        --text: #f2f2f5;
        --muted: #a0a0ad;
        --rule: #2c2c36;
        /* **DELIBERATELY NOT THE APP'S #CC0000, AND THIS IS THE ONE PLACE THE TWO
         * MUST DIVERGE.** #CC0000 on this background is 3.22:1 — under the 4.5:1
         * WCAG AA floor for body text, and every use of --accent here is inline
         * link text. #e8534d is the closest lightening of the same brand red that
         * clears it. iOS gets away with #CC0000 because SwiftUI draws it on a
         * lighter dark surface and mostly at larger sizes. Re-check the ratio
         * before nudging this value. */
        --accent: #e8534d; /* 5.22:1 on --bg */
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 46rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---- header ------------------------------------------------------------- */

header.site {
    border-bottom: 1px solid var(--rule);
}

header.site .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.wordmark {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}

nav.site a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.95rem;
    margin-left: 1.25rem;
}

nav.site a:hover {
    color: var(--text);
}

/* ---- hero --------------------------------------------------------------- */

.hero {
    padding: 4.5rem 0 3.5rem;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2.25rem, 7vw, 3.25rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin: 0 0 1rem;
}

.hero p.lede {
    font-size: 1.2rem;
    color: var(--muted);
    max-width: 34rem;
    margin: 0 auto 2rem;
}

.badge {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--rule);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--muted);
    background: var(--surface);
}

/* ---- feature grid ------------------------------------------------------- */

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1rem;
    padding: 1rem 0 3rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 1.4rem;
}

.card h3 {
    margin: 0 0 0.4rem;
    font-size: 1.02rem;
}

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

/* ---- prose (privacy, support) ------------------------------------------- */

main.prose {
    padding: 3rem 0 4rem;
}

main.prose h1 {
    font-size: 2.1rem;
    letter-spacing: -0.02em;
    margin: 0 0 0.35rem;
}

main.prose h2 {
    font-size: 1.25rem;
    margin: 2.5rem 0 0.6rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
}

main.prose h2:first-of-type {
    border-top: 0;
    padding-top: 0;
}

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

main.prose ul {
    padding-left: 1.15rem;
}

main.prose li {
    margin-bottom: 0.5rem;
}

a {
    color: var(--accent);
}

/* **THE WRAPPER SCROLLS, NOT THE TABLE.** `display: block` on a <table> is the
 * shorter way to get horizontal overflow and it silently costs accessibility:
 * Safari and VoiceOver stop exposing rows and headers as a table once `display`
 * leaves `table`, so the cells lose their header association. The wrapper keeps
 * both. `:focus-visible` is there because the container is focusable — a
 * keyboard user must be able to see what they have focused in order to scroll it. */
.scroll-x {
    overflow-x: auto;
    margin: 1rem 0;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th,
td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
}

th {
    font-weight: 600;
}

/* ---- footer ------------------------------------------------------------- */

footer.site {
    border-top: 1px solid var(--rule);
    padding: 2rem 0 3rem;
    color: var(--muted);
    font-size: 0.85rem;
}

footer.site p {
    margin: 0 0 0.6rem;
}

footer.site a {
    color: var(--muted);
}
