/* =====================================================================
   Базові стилі та скидання
   ===================================================================== */

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* Липкі шапка й панель дій не повинні перекривати поле,
       до якого перейшов фокус або якір */
    scroll-padding-top: 76px;
    scroll-padding-bottom: 104px;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg-base);
    color: var(--text);
    font-family: var(--font);
    font-size: var(--t-md);
    line-height: 1.55;
    font-feature-settings: 'cv05' 1, 'ss03' 1, 'tnum' 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
    margin: 0;
    font-weight: 550;
    letter-spacing: -0.015em;
    line-height: 1.25;
    color: var(--text);
}

h1 { font-size: var(--t-3xl); letter-spacing: -0.025em; }
h2 { font-size: var(--t-2xl); letter-spacing: -0.02em; }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-lg); }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--fast) var(--ease);
}

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

button, input, select, textarea {
    font: inherit;
    color: inherit;
    margin: 0;
}

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

ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
ul:last-child, ol:last-child { margin-bottom: 0; }

hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 24px 0;
}

::selection {
    background: var(--accent-soft);
    color: var(--text);
}

:focus-visible {
    outline: 2px solid var(--accent-line);
    outline-offset: 2px;
    border-radius: var(--r-xs);
}

/* --- Прокрутка ------------------------------------------------------- */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--tint-bold) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--tint-bold);
    border-radius: var(--r-full);
}
*::-webkit-scrollbar-thumb:hover { background: var(--tint-bold); }

/* --- Утиліти --------------------------------------------------------- */
.u-hidden { display: none !important; }
.u-sr {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.u-muted { color: var(--text-muted); }
.u-soft { color: var(--text-soft); }
.u-nowrap { white-space: nowrap; }
.u-mono { font-family: var(--font-mono); font-size: var(--t-sm); }

.u-label {
    font-size: var(--t-xs);
    font-weight: 500;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.u-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.u-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.u-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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