/*
 * The whole site's styling.
 *
 * One stylesheet, no build step, no framework. There are a handful of pages
 * and they need to still be editable in a plain text editor years from now
 * without installing a toolchain first.
 *
 * Colours match the Pathfinder desktop application, so the site and the
 * application look like they came from the same place.
 */

:root {
    color-scheme: light dark;

    --bg: #fafaf9;
    --panel: #ffffff;
    --ink: #1c1917;
    --muted: #57534e;
    --line: #e7e5e4;
    --accent: #c2410c;
    --accent-ink: #ffffff;

    --measure: 68ch;
    --gap: 24px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #18181b;
        --panel: #27272a;
        --ink: #f4f4f5;
        --muted: #a1a1aa;
        --line: #3f3f46;
        --accent: #ea580c;
        --accent-ink: #ffffff;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    /* Long words and URLs should wrap rather than force a sideways scroll on
       a narrow phone. */
    overflow-wrap: break-word;
}

.wrap {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 0 var(--gap);
}

/* --- Header ------------------------------------------------------------ */

header.site {
    border-bottom: 1px solid var(--line);
    padding: 20px 0;
    margin-bottom: 48px;
}

header.site .wrap {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

header.site a.home {
    font-weight: 700;
    font-size: 18px;
    color: var(--ink);
    text-decoration: none;
}

header.site nav a {
    color: var(--muted);
    text-decoration: none;
    margin-left: 18px;
    font-size: 15px;
}

header.site nav a:hover,
header.site a.home:hover { color: var(--accent); }

/* --- Type -------------------------------------------------------------- */

h1 { font-size: 34px; line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 22px; margin: 44px 0 12px; }
h3 { font-size: 17px; margin: 28px 0 8px; }

p { margin: 0 0 16px; }

.lede {
    font-size: 19px;
    color: var(--muted);
    margin-bottom: 36px;
}

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

/* --- Project cards ----------------------------------------------------- */

/*
 * The home page is a list of projects, and there will be more of them. A grid
 * that reflows means adding one is a copied block, not a layout change.
 */
.projects {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    padding: 0;
    margin: 0 0 32px;
    list-style: none;
}

.card {
    display: block;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    text-decoration: none;
    color: inherit;
}

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

.card h3 { margin: 0 0 6px; color: var(--accent); }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

/* --- Buttons ----------------------------------------------------------- */

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0 8px;
}

.button {
    display: inline-block;
    padding: 11px 20px;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-ink);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--accent);
}

.button.secondary {
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
}

/*
 * Something that will exist but does not yet. Styled as plainly unavailable
 * rather than left as a link that goes nowhere: a dead link looks like a bug,
 * and someone will report it.
 */
.button.pending {
    background: transparent;
    color: var(--muted);
    border-style: dashed;
    border-color: var(--line);
    cursor: default;
}

.note {
    font-size: 14px;
    color: var(--muted);
    margin-top: 10px;
}

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

footer.site {
    border-top: 1px solid var(--line);
    margin-top: 72px;
    padding: 24px 0 48px;
    color: var(--muted);
    font-size: 14px;
}

/* --- Small screens ----------------------------------------------------- */

@media (max-width: 480px) {
    body { font-size: 16px; }
    h1 { font-size: 27px; }
    .actions .button { width: 100%; text-align: center; }
}
