:root {
    --background: #f6f4ee;
    --text: #1c2420;
    --muted: #55615a;
    --accent: #2f7d4f;
    --line: #dcd8cc;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: #141a17;
        --text: #eef1ec;
        --muted: #a7b3ab;
        --accent: #6fcf93;
        --line: #2b352f;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0 clamp(1.5rem, 6vw, 5rem);
    overflow-x: hidden;
    background: var(--background);
    color: var(--text);
    font: 1.125rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 44rem;
    margin: 0 auto;
    padding: 3rem 0 2rem;
}

/* The field runs edge to edge, outside the body padding. */
.field {
    margin: 0 calc(-1 * clamp(1.5rem, 6vw, 5rem));
}

.field[hidden] {
    display: none;
}

canvas {
    display: block;
    width: 100%;
    image-rendering: pixelated;
    cursor: crosshair;
    touch-action: manipulation;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--muted);
    font-size: 0.875rem;
}

button {
    padding: 0.4rem 0.9rem;
    border: 2px solid var(--accent);
    background: transparent;
    color: var(--text);
    font: 700 0.875rem ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
    cursor: pointer;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    font: 700 1.5rem/1 ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
}

h1 {
    margin-bottom: 1.5rem;
    font-size: clamp(2.25rem, 7vw, 4rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.lead {
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 4px solid var(--accent);
}

.note {
    color: var(--muted);
}

footer {
    width: 100%;
    max-width: 44rem;
    margin: 0 auto;
    padding: 1.5rem 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.875rem;
}
