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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    background: var(--bg);
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

body {
    font-family: var(--font-ui);
    font-size: var(--fs-body);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: var(--text);
}

h1 { font-size: var(--fs-display-lg); }
h2 { font-size: var(--fs-display-md); }
h3 { font-size: var(--fs-title); }
h4 { font-size: var(--fs-body-lg); }

p { margin-bottom: var(--space-4); color: var(--text); }
p:last-child { margin-bottom: 0; }

a {
    color: var(--accent-text);
    text-decoration: none;
    text-underline-offset: 3px;
}
a:hover { text-decoration: underline; }

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

/* Mono numerals everywhere they appear */
.mono, code, kbd {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100px;
    left: var(--space-4);
    padding: var(--space-2) var(--space-4);
    background: var(--btn-primary-bg);
    color: var(--btn-primary-fg);
    font-weight: 600;
    border-radius: var(--radius-sm);
    z-index: 1000;
    transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: var(--space-4); }

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Selection */
::selection {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-fg);
}

/* Containers */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-5);
}
.container-narrow {
    max-width: var(--max-width-narrow);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

/* Section spacing */
.section {
    padding: var(--space-section) 0;
}
.section-tight { padding: var(--space-7) 0; }

/* Eyebrow label */
.eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: var(--fs-micro);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-text);
    margin-bottom: var(--space-3);
}

/* Display heading uses serif */
.display {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -0.02em;
}

[id] { scroll-margin-top: var(--nav-offset); }
