/* Reset and element defaults. */

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

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

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: var(--fs-md);
    line-height: var(--lh);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure {
    margin: 0;
}

h1, h2, h3, h4 {
    line-height: var(--lh-tight);
    font-weight: 600;
    text-wrap: balance;
}

h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }

a {
    color: var(--accent-text);
    text-underline-offset: 2px;
}

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

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

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

button { cursor: pointer; }

table {
    border-collapse: collapse;
    width: 100%;
}

code, kbd, pre {
    font-family: var(--font-mono);
    font-size: 0.92em;
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: var(--r-sm);
}

[hidden] { display: none !important; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: var(--sp-3);
    top: -4rem;
    z-index: 100;
    padding: var(--sp-2) var(--sp-4);
    background: var(--accent);
    color: var(--text-inverse);
    border-radius: var(--r-md);
    transition: top var(--dur-fast);
}

.skip-link:focus { top: var(--sp-3); color: var(--text-inverse); }

/* Utilities kept deliberately few. */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: var(--fs-sm); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }
.cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
}
.grid-2 {
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
}
