/* =============================================================================
   2. RESET & BASE STYLES — BULLETPROOF FOUNDATION & ACCESSIBILITY
   ============================================================================= */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    height: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg-app);
    color: var(--color-text-main);
    line-height: var(--lh-relaxed);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    transition: background-color var(--dur-norm) var(--ease-out), color var(--dur-norm) var(--ease-out);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* --- TEXT WRAP & SELECTION --- */
h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
}

p, span, li {
    text-wrap: pretty;
}

::selection {
    background-color: var(--color-primary-sub);
    color: var(--color-primary);
}

/* --- BUTTON & LINK INTERACTION --- */
button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

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

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* --- FORM CONTROLS --- */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    border: none;
    background: none;
    outline: none;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: none;
}

a {
    color: inherit;
    text-decoration: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

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

/* --- ACCESSIBILITY HELPER --- */
.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;
}
