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

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    background-color: var(--bg);
    background-image: var(--grid-dots);
    background-size: 28px 28px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: var(--text-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

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

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

form {
    margin: 0;
}

fieldset {
    border: 0;
    min-width: 0;
}

legend {
    display: block;
    padding: 0;
}

p {
    text-wrap: pretty;
}

h1,
h2,
h3 {
    font-family: var(--font-mono);
    font-weight: 700;
    line-height: 1.15;
}

code {
    font-family: var(--font-mono);
    font-size: 0.92em;
    color: var(--accent);
    background: var(--accent-wash);
    padding: 1px 5px;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.hidden {
    display: none;
}

/* Visually hidden but still read by screen readers (display:none is not). */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.mt-sm {
    margin-top: var(--sp-2);
}

.mt-md {
    margin-top: var(--sp-4);
}

.mt-lg {
    margin-top: var(--sp-6);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
