/* ============================================================
   Base — Reset, Typography, Global Elements
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-charcoal);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    letter-spacing: -0.01em;
}

h1 { font-size: var(--text-hero); letter-spacing: -0.02em; }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); font-weight: var(--weight-semibold); }
h4 { font-size: var(--text-h4); font-weight: var(--weight-semibold); }

p {
    margin-bottom: var(--space-4);
    line-height: var(--leading-normal);
}

.text-lg {
    font-size: var(--text-lg);
    line-height: var(--leading-loose);
}

.text-sm {
    font-size: var(--text-sm);
}

.text-xs {
    font-size: var(--text-xs);
}

.text-muted {
    color: var(--color-text-secondary);
}

.text-center { text-align: center; }

.subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: var(--space-4) auto 0;
    line-height: var(--leading-loose);
}

/* ── Links ── */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
    color: var(--color-primary-dark);
}

/* ── Images ── */
img, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ── Lists ── */
ul, ol {
    list-style: none;
}

/* ── Form Elements ── */
input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

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

/* ── Misc ── */
::selection {
    background-color: var(--color-primary-light);
    color: var(--color-primary-darker);
}

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

hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-8) 0;
}

/* ── Utility: visually hidden (a11y) ── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
