/* Commonate — a deliberately small stylesheet.
   No frameworks, no web fonts: the page paints on the first request. */

:root {
    --bg: #faf9f6;
    --bg-wash: rgba(138, 110, 72, 0.07);
    --ink: #1a1815;
    --ink-soft: #45413a;
    --muted: #78736a;
    --hairline: rgba(26, 24, 21, 0.12);
    --accent: #8a6e48;
    --surface: #ffffff;

    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Hoefler Text", Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;

    --measure: 64rem;
    --gutter: clamp(1.5rem, 6vw, 6rem);
    --section-gap: clamp(4.5rem, 11vw, 9rem);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e0d0c;
        --bg-wash: rgba(194, 160, 107, 0.08);
        --ink: #edeae3;
        --ink-soft: #cbc5ba;
        --muted: #948d82;
        --hairline: rgba(237, 234, 227, 0.14);
        --accent: #c2a06b;
        --surface: #161412;
    }
}

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

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

body {
    margin: 0;
    background:
        radial-gradient(60rem 40rem at 50% -12rem, var(--bg-wash), transparent 70%),
        var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ---------- shared layout ---------- */

main {
    flex: 1 0 auto;
    width: 100%;
    max-width: var(--measure);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

section {
    padding: var(--section-gap) 0;
}

.eyebrow {
    margin: 0 0 clamp(1.5rem, 3vw, 2.25rem);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--accent);
}

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

.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: min(76vh, 44rem);
    padding-top: clamp(2rem, 6vw, 4rem);
}

.hero h1 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.75rem, 8.2vw, 5.5rem);
    line-height: 1.04;
    letter-spacing: -0.022em;
    text-wrap: balance;
}

.hero h1 em {
    font-style: italic;
    color: var(--accent);
    /* Close the gap the italic's side bearing leaves before the full stop. */
    margin-right: -0.06em;
}

.lede {
    max-width: 34em;
    margin: clamp(1.75rem, 3.5vw, 2.5rem) 0 0;
    font-size: clamp(1.0625rem, 1rem + 0.45vw, 1.3125rem);
    line-height: 1.6;
    color: var(--ink-soft);
    text-wrap: pretty;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin: clamp(2.25rem, 4vw, 3rem) 0 0;
}

.button {
    display: inline-flex;
    align-items: center;
    padding: 0.8rem 1.6rem;
    border: 1px solid var(--ink);
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg);
    font-size: 0.9375rem;
    letter-spacing: 0.01em;
    transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.button:hover {
    transform: translateY(-1px);
    opacity: 0.88;
}

.hero-error {
    min-height: min(60vh, 34rem);
}

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

.site-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--hairline);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem 2rem;
    max-width: var(--measure);
    margin: 0 auto;
    padding: 2.25rem var(--gutter) 2.75rem;
}

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

/* ---------- responsive ---------- */

@media (max-width: 52rem) {
    /* On a phone the hero is already most of the screen - the vh floor would
       only add dead space under the buttons. */
    .hero {
        min-height: 0;
    }
}

/* ---------- entrance ---------- */

@media (prefers-reduced-motion: no-preference) {
    .hero > * {
        animation: rise 0.85s cubic-bezier(0.22, 0.68, 0.32, 1) both;
    }

    .hero > *:nth-child(2) { animation-delay: 0.07s; }
    .hero > *:nth-child(3) { animation-delay: 0.14s; }
    .hero > *:nth-child(4) { animation-delay: 0.21s; }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
