@charset "UTF-8";

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

*,
*::before,
*::after { -webkit-tap-highlight-color: transparent; }

a, button, select, label,
[role="button"],
input[type="checkbox"],
input[type="radio"],
input[type="submit"],
input[type="reset"] { touch-action: manipulation; }

html {
    font-size: clamp(16px, 1.042vw, 22px);
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: clip;

    scrollbar-gutter: stable;
}

body {
    margin: 0; padding: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-base), color var(--transition-base);
    overflow-x: clip;

    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.skip-link {
    position: absolute; top: -999px; left: 0;
    z-index: var(--z-lightbox);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-inverse); color: var(--text-inverse);
    font-size: var(--font-size-sm); font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus { top: 0; }

:focus { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
:target { scroll-margin-top: calc(var(--header-height) + var(--space-lg)); }

@media (min-width: 1600px) { html { font-size: 105%; } }
@media (min-width: 1920px) { html { font-size: 110%; } }
@media (min-width: 2560px) { html { font-size: 115%; } }

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

a { color: var(--text-link); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--text-link-hover); }

main a { text-decoration: underline; text-underline-offset: 2px; }
main a:hover { text-decoration: none; }
main a.btn, main a.btn:hover,
main a.collection-entry-btn, main a.collection-entry-btn:hover { text-decoration: none; }

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--space-md) 0;
    color: var(--text-primary); line-height: 1.3; font-weight: 700;
}
/* Единая шкала заголовков: те же значения, что были видны на страницах
   (прежние main h1..h4; глобальные 4xl/3xl/2xl/xl не применялись нигде). */
h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-base); }
h6 { font-size: var(--font-size-sm); }

p { margin: 0 0 var(--space-md) 0; }
hr { border: 0; border-top: 1px solid var(--border-color); margin: var(--space-lg) 0; }
