/**
 * base.css
 * Global resets, box model, and typography foundation.
 * Depends on variables.css. No component or layout styles—only document-level defaults.
 * Ensures consistent baseline across all pages.
 */

/* ========== CSS Reset ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

/* ========== Box-sizing rule ========== */
/* Applied above; ensures padding/border don't add to width/height. */

/* ========== Root & body ========== */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text-primary);
    background-color: var(--color-white);
    min-height: 100vh;
}

/* ========== Typography: headings ========== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
}

h1 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--color-text-primary);
}

p:last-child {
    margin-bottom: 0;
}

/* Small / secondary text */
small,
.text-small {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: var(--line-height-base);
}

/* ========== Links & lists ========== */
a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

/* ========== Form elements inherit font ========== */
input, button, textarea, select {
    font: inherit;
    color: inherit;
}

/* ========== Default image behavior ========== */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

img {
    vertical-align: middle;
}

/* ========== Container width (global) ========== */
/* Container class lives in layout.css; max-width token is in variables.css (--container-max). */

/* ========== Global section padding ========== */
/* Section padding uses --section-padding-y and .section in layout.css. */

/* ========== Focus & accessibility ========== */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ========== Selection ========== */
::selection {
    background-color: var(--color-primary);
    color: var(--color-white);
}
