/* ==========================================================================
   Base: reset, document rhythm, typography, native form controls.
   Element selectors only — no component classes live in this file.
   ========================================================================== */

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

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

body {
    margin: 0;
    background: var(--c-paper);
    color: var(--c-ink);
    font-family: var(--f-body);
    font-size: var(--t-base);
    line-height: var(--lh-body);
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

/* --- Headings ---------------------------------------------------------- */

h1, h2, h3, h4 {
    font-family: var(--f-display);
    color: var(--c-ink);
    font-weight: 600;
    line-height: var(--lh-tight);
    margin: 0 0 var(--s-4);
    letter-spacing: 0;
}

h1 { font-size: var(--t-2xl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-md); line-height: var(--lh-snug); }
h4 { font-size: var(--t-base); line-height: var(--lh-snug); }

p  { margin: 0 0 var(--s-4); max-width: var(--w-text); }
p:last-child { margin-bottom: 0; }

small { font-size: var(--t-sm); }

strong { font-weight: 700; }

hr {
    border: 0;
    border-top: var(--border);
    margin: var(--s-6) 0;
}

/* --- Links ------------------------------------------------------------- */

a {
    color: var(--c-oxide);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

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

/* --- Focus: visible on every interactive element ----------------------- */

:focus-visible {
    outline: 2px solid var(--c-focus);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

/* --- Media ------------------------------------------------------------- */

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

/* --- Lists ------------------------------------------------------------- */

ul, ol { padding-left: var(--s-5); margin: 0 0 var(--s-4); }
li { margin-bottom: var(--s-2); }

/* --- Native form controls ---------------------------------------------- */

label {
    display: block;
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--c-ink);
    margin-bottom: var(--s-2);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="search"],
input[type="url"],
input[type="file"],
select,
textarea {
    display: block;
    width: 100%;
    padding: var(--s-3) var(--s-4);
    font-family: var(--f-body);
    font-size: var(--t-base);
    color: var(--c-ink);
    background: var(--c-white);
    border: 1px solid var(--c-rule);
    border-radius: var(--r-md);
    margin-bottom: var(--s-5);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

textarea { min-height: 8rem; resize: vertical; line-height: var(--lh-body); }

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%235c4f45' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--s-4) center;
    background-size: 12px 8px;
    padding-right: var(--s-7);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--c-glaze);
    box-shadow: 0 0 0 3px var(--c-glaze-tint);
    outline: none;
}

input::placeholder,
textarea::placeholder { color: var(--c-ink-faint); }

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin: 0 var(--s-2) 0 0;
    accent-color: var(--c-oxide);
}

fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 var(--s-5);
}

legend {
    font-family: var(--f-display);
    font-size: var(--t-lg);
    font-weight: 600;
    padding: 0;
    margin-bottom: var(--s-5);
}

/* --- Tables ------------------------------------------------------------ */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--t-sm);
}

th, td {
    text-align: left;
    padding: var(--s-3) var(--s-4);
    border-bottom: var(--border);
    vertical-align: top;
}

th {
    font-weight: 700;
    color: var(--c-ink-soft);
    background: var(--c-raised);
    white-space: nowrap;
}

/* --- Motion preference ------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
