/* ==========================================================================
   BASE — Reset, Typography, Global Styles
   ========================================================================== */

/* ── Reset ──────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: var(--fw-regular);
    line-height: var(--lh-normal);
    color: var(--text-primary);
    background-color: var(--surface-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img,
picture,
video,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--color-primary-600);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
    color: var(--color-primary-700);
}

ul,
ol {
    list-style: none;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
    border: none;
    outline: none;
    background: none;
}

button {
    cursor: pointer;
}

/* ── Typography ─────────────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
    color: var(--color-gray-900);
}

h1 {
    font-size: var(--fs-hero);
    line-height: var(--lh-tight);
}

h2 {
    font-size: var(--fs-2xl);
}

h3 {
    font-size: var(--fs-xl);
}

h4 {
    font-size: var(--fs-lg);
}

p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
}

p:last-child {
    margin-bottom: 0;
}

strong {
    font-weight: var(--fw-semibold);
}

small {
    font-size: var(--fs-sm);
}

/* ── Layout Utilities ───────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

.container--narrow {
    max-width: var(--max-width-narrow);
}

.container--wide {
    max-width: var(--max-width-wide);
}

.section {
    padding-block: var(--space-16);
}

.section--sm {
    padding-block: var(--space-10);
}

.section--lg {
    padding-block: var(--space-24);
}

.section--alt {
    background-color: var(--surface-secondary);
}

/* ── Visibility ─────────────────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Selection ──────────────────────────────────────────────────────── */
::selection {
    background-color: var(--color-primary-100);
    color: var(--color-primary-800);
}

/* ── Focus ──────────────────────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}