/* Сброс, типографика и элементы форм. Компоненты — в components.css (S20). */

@layer reset, base;

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

    body,
    h1, h2, h3, h4,
    p, figure, ul, ol {
        margin: 0;
    }

    ul, ol {
        padding: 0;
        list-style: none;
    }

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

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

@layer base {
    html {
        -webkit-text-size-adjust: 100%;
    }

    body {
        background: var(--bg);
        color: var(--text);
        font-family: var(--font-body);
        font-size: 16px;
        line-height: 1.6;
        -webkit-font-smoothing: antialiased;
    }

    h1, h2, h3 {
        font-family: var(--font-display);
        font-weight: 500;
        line-height: 1.05;
        text-wrap: balance;
    }

    a {
        color: var(--accent);
        text-decoration: none;
    }

    a:hover {
        color: #fff;
    }

    :focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }

    /* Ссылка для клавиатуры: видна только при фокусе. */
    .skip-link {
        position: absolute;
        left: -9999px;
    }

    .skip-link:focus {
        position: static;
        display: inline-block;
        padding: var(--space-3) var(--space-4);
        background: var(--accent);
        color: var(--accent-ink);
    }

    button,
    [role="button"],
    input[type="submit"] {
        min-height: var(--tap);
        cursor: pointer;
    }

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

    /* Временная заглушка главной и страниц ошибок. Уйдёт вместе с S12. */
    .stub,
    .page-error main {
        max-width: 640px;
        margin: 0 auto;
        padding: var(--space-9) var(--space-5);
    }

    .stub__eyebrow {
        font-family: var(--font-display);
        font-size: 13px;
        letter-spacing: .22em;
        text-transform: uppercase;
        color: var(--muted);
    }

    .stub__title {
        font-size: 64px;
        letter-spacing: .12em;
        text-transform: uppercase;
        margin: var(--space-4) 0 var(--space-5);
    }

    .stub__text {
        color: var(--muted);
        margin-bottom: var(--space-3);
    }
}
