/* ==========================================================================
   Walden Design System — components.css (фирменный слой)
   Тёплая бумага #fbf9f5 · чернильный текст · Karla/Golos 16/28 · заголовки капсом с разрядкой ·
   работы в белом паспарту с подписью 13px · чёрные кнопки R2 с мягкой тенью · каменный подвал
   ========================================================================== */
body { font-size: 16px; line-height: 1.75; }
.container { max-width: calc(var(--container) + 2*var(--gutter)); }
.section { padding-block: var(--section-y); }
.title { font-size: var(--text-h1); line-height: 1.3; letter-spacing: .03em; font-weight: 400; text-transform: uppercase; margin: 0 0 18px; }
.title--sm { font-size: 1.25rem; }
.h-post { font-size: var(--text-h1); line-height: 1.3; font-weight: 400; margin: 0; }
.date { font-size: 14px; font-style: italic; color: var(--text-secondary); }
.eyebrow { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-warm); }
.prose { display: grid; gap: 22px; max-width: 720px; }
.prose p, .prose li { color: var(--text-secondary); }
.prose a, .lnk { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover, .lnk:hover { color: var(--muted-warm); }
.prose em { font-style: italic; }
.prose h2 { font-size: 1.25rem; letter-spacing: .02em; text-transform: uppercase; font-weight: 400; margin-top: 12px; }
.prose blockquote { margin: 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--text-primary); font-size: 18px; color: var(--text-primary); font-style: italic; }
.muted { color: var(--text-tertiary); }
.mono { font-family: var(--font-mono); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: var(--z-header); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.nav { max-width: calc(1296px + 2*var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav__links { display: none; align-items: center; gap: 30px; }
.nav__end { display: flex; align-items: center; gap: 12px; }
.nav__end > .theme-switch { display: none !important; }
@media (min-width: 1080px) { .nav__links { display: flex; } .nav__end > .theme-switch { display: inline-flex !important; } .nav .burger { display: none; } }
@media (max-width: 767px) { .nav { height: 72px; } }
.nav__item { position: relative; }
.nav__link { position: relative; display: inline-flex; align-items: center; height: 36px; font-size: 14px; color: var(--text-primary); white-space: nowrap; background: none; }
.nav__link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform var(--duration-base) var(--ease-out); }
.nav__link:hover::after, .nav__link[aria-current="page"]::after, .nav__link[aria-expanded="true"]::after { transform: scaleX(1); }
.dropdown { min-width: 240px; border-radius: var(--radius-sm); }
.logo { display: inline-flex; align-items: center; gap: 12px; color: var(--text-primary); }
.logo svg { width: 40px; height: 40px; }
.logo span { display: grid; font-size: 23px; font-weight: 700; letter-spacing: .26em; line-height: 1; }
.logo small { font-size: 10px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; margin-top: 6px; color: var(--muted-warm); }
@media (max-width: 767px) { .logo svg { width: 32px; height: 32px; } .logo span { font-size: 19px; } }
.mm-link { display: block; padding: 12px 2px; border-bottom: 1px solid var(--border); font-size: 22px; letter-spacing: .04em; text-transform: uppercase; }
.mm-sub { display: block; padding: 7px 2px 7px 14px; font-size: 15px; color: var(--text-tertiary); }

/* ---------- Buttons / chips ---------- */
.btn { --h: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 28px; border-radius: var(--radius-sm); background: transparent; color: var(--text-primary); font: 400 13px/1 var(--font-sans); letter-spacing: .04em; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--border-strong); transition: background var(--duration-fast), color var(--duration-fast), transform var(--duration-fast); }
.btn:hover { background: var(--surface-hover); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent-strong); color: var(--accent-fg); box-shadow: var(--shadow-btn); } .btn--primary:hover { background: var(--accent-strong-hover); }
.btn--ghost { box-shadow: none; } .btn--outline { box-shadow: inset 0 0 0 1px var(--text-primary); }
.btn--danger { box-shadow: none; background: var(--danger-bg); color: var(--danger); }
.btn--sm { --h: 38px; padding: 0 18px; } .btn--xs { --h: 28px; padding: 0 10px; font-size: 12px; } .btn--lg { --h: 56px; padding: 0 36px; font-size: 14px; }
.btn--block { width: 100%; } .btn--icon { width: var(--h); padding: 0; }
.arrows { display: flex; gap: 22px; } .arrows button { width: 44px; height: 30px; display: grid; place-items: center; color: var(--text-primary); } .arrows .icon { width: 40px; height: 20px; } .arrows button:hover { color: var(--muted-warm); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--radius-sm); background: var(--chip-bg); color: var(--chip-fg); font-size: 13px; white-space: nowrap; }
button.chip { box-shadow: inset 0 0 0 1px transparent; } button.chip:hover { box-shadow: inset 0 0 0 1px var(--border-strong); }
.chip[aria-pressed="true"] { background: var(--accent-strong); color: var(--accent-fg); }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--radius-sm); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; background: var(--chip-bg); color: var(--chip-fg); white-space: nowrap; }
.badge--success { background: var(--success-bg); color: var(--success); } .badge--warning { background: var(--warning-bg); color: var(--warning); } .badge--danger { background: var(--danger-bg); color: var(--danger); } .badge--info { background: var(--info-bg); color: var(--info); }
.input { background: var(--input-bg); border-color: transparent; border-radius: var(--radius-sm); }
.input:focus { border-color: var(--border-strong); }
.field__label { font-weight: 400; font-size: 14px; }

/* ---------- Artwork ---------- */
.art { display: block; width: 100%; height: auto; background: var(--paper-100); }
figure.work { margin: 0; display: grid; gap: 10px; }
.work__frame { background: var(--frame); padding: 0; }
.work--matted .work__frame { padding: clamp(12px, 3vw, 36px); box-shadow: var(--shadow-xs); }
figcaption, .caption { font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
figcaption i { font-style: italic; }
a.work:hover .art { filter: brightness(1.04); } a.work .work__frame { overflow: hidden; } a.work .art { transition: transform var(--duration-slow) var(--ease-out); } a.work:hover .art { transform: scale(1.02); }

/* ---------- Layouts ---------- */
.split { display: grid; gap: 40px; align-items: start; } @media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 24px 48px; } }
.split--wrap::after { content: ""; display: table; clear: both; }
.floatfig { margin: 0 0 24px; } @media (min-width: 900px) { .floatfig { float: right; width: 48%; margin: 6px 0 24px 48px; } }
.page { padding-block: 48px 96px; }
@media (max-width: 767px) { .page { padding-block: 24px 64px; } }
.g3 { display: grid; gap: 32px; } @media (min-width: 768px) { .g3 { grid-template-columns: repeat(3,minmax(0,1fr)); } }
.g4 { display: grid; gap: 28px; grid-template-columns: repeat(2,minmax(0,1fr)); } @media (min-width: 900px) { .g4 { grid-template-columns: repeat(4,minmax(0,1fr)); } }
.g2 { display: grid; gap: 32px; } @media (min-width: 768px) { .g2 { grid-template-columns: repeat(2,minmax(0,1fr)); } }

/* ---------- Slider ---------- */
.slider { background: var(--frame); padding: clamp(16px, 5vw, 56px) clamp(16px, 9vw, 120px) 32px; display: grid; gap: 18px; }
.slider__track { position: relative; }
.slider__slide { display: none; gap: 12px; } .slider__slide.is-active { display: grid; }
.slider .art { max-height: 520px; object-fit: cover; }
.slider__foot { display: flex; justify-content: space-between; align-items: center; }
.slider__count { font-family: var(--font-mono); font-size: 13px; color: var(--text-tertiary); }

/* ---------- News ---------- */
.feat3 { display: grid; gap: 28px; } @media (min-width: 768px) { .feat3 { grid-template-columns: repeat(3,minmax(0,1fr)); } }
.npost { display: grid; gap: 8px; align-content: start; font-size: 13px; line-height: 1.5; }
.npost h3 { font-size: 13px; font-weight: 700; line-height: 1.45; } .npost:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.npost time { color: var(--text-secondary); } .npost p { color: var(--text-secondary); }
.npost .more { color: var(--text-tertiary); }
.ncols { display: grid; gap: 30px 28px; border-top: 2px solid var(--text-primary); padding-top: 28px; margin-top: 40px; } @media (min-width: 768px) { .ncols { grid-template-columns: repeat(3,minmax(0,1fr)); } }
.ncols > div { display: grid; gap: 30px; align-content: start; }
.ncols h2 { font-size: 13px; font-weight: 700; }
.post-media { display: grid; gap: 28px; }
.pager { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); padding-top: 20px; margin-top: 56px; font-size: 14px; }
.pager a { display: grid; gap: 4px; max-width: 46%; } .pager a:last-child { text-align: right; } .pager small { color: var(--text-tertiary); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- People / contact ---------- */
.plist { display: grid; gap: 26px; } .plist h3 { font-size: 16px; font-weight: 700; } .plist ul { list-style: none; padding: 0; margin: 0; color: var(--text-secondary); }
.form { display: grid; gap: 18px; } .form .textarea { min-height: 120px; }
.form .btn { justify-self: start; }
.person { display: grid; gap: 10px; align-content: start; } .person .ph { aspect-ratio: 4/5; background: var(--paper-200); display: grid; place-items: center; font-size: 40px; letter-spacing: .1em; color: var(--muted-warm); filter: grayscale(1); }
.person b { font-weight: 700; font-size: 15px; } .person span { font-size: 13px; color: var(--text-tertiary); }

/* ---------- Catalogue ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border-block: 1px solid var(--border); padding-block: 14px; margin-bottom: 32px; }
.filters .input { height: 38px; width: auto; min-width: 0; }
.filters .search { flex: 1; min-width: 220px; }
.cgrid { display: grid; gap: 40px 28px; grid-template-columns: repeat(2,minmax(0,1fr)); } @media (min-width: 900px) { .cgrid { grid-template-columns: repeat(4,minmax(0,1fr)); } }
.cgrid figcaption b { display: block; font-weight: 400; font-style: italic; color: var(--text-primary); }
.cno { font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); }
.meta { display: grid; margin: 0; border-top: 1px solid var(--border); }
.meta > div { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.meta dt { color: var(--text-tertiary); } .meta dd { margin: 0; }
@media (max-width: 600px) { .meta > div { grid-template-columns: 1fr; gap: 2px; } }
.thumbs { display: flex; gap: 10px; } .thumbs button { width: 64px; opacity: .6; } .thumbs button[aria-pressed="true"] { opacity: 1; outline: 1px solid var(--text-primary); outline-offset: 2px; }

/* ---------- Timeline / exhibitions ---------- */
.tl { display: grid; gap: 0; border-left: 1px solid var(--border-strong); margin-left: 6px; }
.tl__item { position: relative; display: grid; gap: 6px; padding: 0 0 36px 32px; } @media (min-width: 768px) { .tl__item { grid-template-columns: 120px 1fr; gap: 32px; } }
.tl__item::before { content: ""; position: absolute; left: -5px; top: 9px; width: 9px; height: 9px; background: var(--text-primary); }
.tl__item time { font-size: 22px; letter-spacing: .04em; line-height: 1.3; }
.tl__item h3 { font-size: 16px; font-weight: 700; } .tl__item p { color: var(--text-secondary); }
.tl__item--era::before { width: 13px; height: 13px; left: -7px; background: var(--muted-warm); }
.exl { display: grid; border-top: 1px solid var(--text-primary); }
.ex { display: grid; gap: 16px; padding: 24px 0; border-bottom: 1px solid var(--border); align-items: center; } @media (min-width: 768px) { .ex { grid-template-columns: 160px 1fr 200px; gap: 32px; } }
.ex h3 { font-size: 18px; font-weight: 400; } .ex:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.ex p { font-size: 14px; color: var(--text-tertiary); }
.ex__img { width: 100%; }
.ex__dates { font-size: 14px; }
.hero-art { position: relative; }
.hero-art .art { max-height: 70vh; }

/* ---------- Book ---------- */
.book { aspect-ratio: 3/4; position: relative; overflow: hidden; background: #e9e5dc; display: grid; place-items: center; }
.book__cover { width: 62%; aspect-ratio: 2/3; position: relative; box-shadow: -14px 18px 30px rgba(0,0,0,.25), inset 3px 0 0 rgba(255,255,255,.2); overflow: hidden; transform: perspective(900px) rotateY(-18deg); }
.book__cover .art { width: 100%; height: 100%; }
.book__title { position: absolute; inset: 10% 8% auto; color: #fff; font-size: clamp(16px, 2.4vw, 30px); line-height: 1; font-weight: 700; letter-spacing: .02em; mix-blend-mode: difference; }
.biblio { list-style: none; padding: 0; margin: 0; display: grid; } .biblio li { padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 15px; display: grid; gap: 4px; } .biblio li span { color: var(--text-tertiary); font-size: 13px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); padding: 56px 0 48px; margin-top: 0; }
.footer__top { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.stripes { width: 280px; height: 120px; color: var(--text-primary); }
.footer__nav { display: grid; justify-items: end; gap: 2px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; } .footer__nav a:hover { text-decoration: underline; }
.footer__rule { border: 0; border-top: 1px solid var(--border-strong); margin: 14px 0 18px; }
.footer__bottom { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.newsletter { display: grid; gap: 12px; width: min(100%, 440px); } .newsletter__label { font-size: 13px; } .newsletter .btn { justify-self: start; }
.footer__legal { display: grid; justify-items: end; gap: 2px; font-size: 13px; text-align: right; } .footer__name { letter-spacing: .16em; color: var(--text-tertiary); }
.footer__sys { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; margin-top: 12px; font-size: 12px; color: var(--text-tertiary); } .footer__sys a:hover { color: var(--text-primary); }
@media (max-width: 767px) { .stripes { width: 180px; height: 78px; } .footer__nav { justify-items: start; } .footer__top { flex-direction: column; align-items: flex-start; } .footer__legal { justify-items: start; text-align: left; } .footer__sys { justify-content: flex-start; } }

/* ---------- 404 / search ---------- */
.nf { min-height: 50vh; display: grid; place-content: center; text-align: center; gap: 14px; justify-items: center; }
.nf b { font-size: clamp(72px, 14vw, 160px); line-height: 1; font-weight: 300; letter-spacing: .05em; }
.sres { display: grid; } .sres a { display: grid; grid-template-columns: 72px 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--border); align-items: center; } .sres a:hover h3 { text-decoration: underline; } .sres h3 { font-size: 16px; font-weight: 700; } .sres p { font-size: 14px; color: var(--text-tertiary); }
.sres mark { background: var(--warning-bg); color: inherit; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 24px; font-size: 13px; } .breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--border-strong); } .breadcrumbs [aria-current] { color: var(--text-secondary); }
.tabs-line { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin-bottom: 28px; overflow-x: auto; } .tabs-line button { padding: 10px 0; font-size: 14px; color: var(--text-tertiary); border-bottom: 1px solid transparent; margin-bottom: -1px; white-space: nowrap; } .tabs-line button[aria-pressed="true"] { color: var(--text-primary); border-color: var(--text-primary); }

/* ===== generic layer (dslib/generic.css): dropdown · theme switch · burger · mobile menu · forms · table · code · feedback · dashboard · docs · phone ===== */
.dropdown { position: absolute; top: calc(100% + 8px); left: -8px; min-width: 300px; padding: 6px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-float); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity var(--duration-fast), transform var(--duration-fast), visibility var(--duration-fast); z-index: var(--z-dropdown); }
.dropdown.is-open { opacity: 1; visibility: visible; transform: none; }
.dropdown--wide { display: grid; grid-template-columns: 1fr 1fr; min-width: 560px; gap: 2px; }
.dropdown__item { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: var(--radius-md); transition: background var(--duration-fast); }
.dropdown__item:hover, .dropdown__item:focus-visible { background: var(--surface-hover); }
.dropdown__title { display: block; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.dropdown__desc { display: block; font-size: 13px; color: var(--text-tertiary); line-height: 1.35; margin-top: 2px; }
.dropdown__foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; padding: 10px; margin-top: 4px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); }
.theme-switch { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-soft); }
.theme-switch button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--radius-sm); color: var(--text-tertiary); }
.theme-switch button:hover { color: var(--text-primary); }
.theme-switch button[aria-pressed="true"] { background: var(--surface-raised); color: var(--accent-text); box-shadow: var(--shadow-xs), 0 0 0 1px var(--border); }
.burger { display: inline-grid; place-items: center; align-content: center; gap: 5px; width: 36px; height: 36px; border-radius: var(--radius-md); border: 1px solid var(--border); }
.burger span { display: block; width: 16px; height: 1.5px; background: currentColor; border-radius: 2px; transition: transform var(--duration-base) var(--ease-out); }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }
@media (min-width: 1024px) { .burger { display: none; } }
.mobile-menu { position: fixed; inset: var(--header-h) 0 0; z-index: var(--z-overlay); background: var(--bg); overflow-y: auto; padding: 8px var(--gutter) 32px; display: flex; flex-direction: column; gap: 2px; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity var(--duration-base), transform var(--duration-base) var(--ease-out), visibility var(--duration-base); }
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: none; }
body.menu-open { overflow: hidden; }
.mobile-menu__foot { margin-top: auto; padding-top: 24px; display: grid; gap: 10px; }
@media (min-width: 1024px) { .mobile-menu { display: none; } }
/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field__label { font-size: 14px; font-weight: 600; color: var(--text-primary); display: flex; justify-content: space-between; gap: 8px; }
.field__label .mono-xs { color: var(--text-tertiary); }
.field__hint { font-size: 13px; color: var(--text-tertiary); }
.field__error { font-size: 13px; color: var(--danger); }
.input, .textarea, .select { width: 100%; height: 40px; padding: 0 12px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); color: var(--text-primary); font-size: 15px; transition: border-color var(--duration-fast), box-shadow var(--duration-fast); }
.input::placeholder, .textarea::placeholder { color: var(--text-tertiary); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--text-tertiary); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); border-radius: var(--radius-md); }
.input.is-invalid { border-color: var(--danger); }
.input--mono { font-family: var(--font-mono); font-size: 13px; }
.textarea { height: auto; min-height: 112px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2386827a' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group > .icon { position: absolute; left: 12px; color: var(--text-tertiary); pointer-events: none; }
.input-group > .input { padding-left: 36px; }
.input-group > .kbd { position: absolute; right: 8px; }
.input-group > .btn { position: absolute; right: 4px; }
.search--lg .input { height: 48px; font-size: 16px; border-radius: var(--radius-lg); }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; flex: none; border: 1px solid var(--border-strong); border-radius: var(--radius-xs); background: var(--surface); display: grid; place-items: center; transition: background var(--duration-fast), border-color var(--duration-fast); cursor: pointer; margin: 0; }
.check input[type="radio"] { border-radius: 50%; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ""; width: 10px; height: 10px; background: #fff; clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); }
.check input[type="radio"]:checked::after { width: 6px; height: 6px; border-radius: 50%; clip-path: none; }
.check input:focus-visible { box-shadow: var(--focus-ring); }
.check__count { margin-left: auto; font: 500 12px/1 var(--font-mono); color: var(--text-tertiary); }
.filter-group .check { display: flex; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; flex: none; cursor: pointer; transition: background var(--duration-fast); margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform var(--duration-base) var(--ease-out); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { box-shadow: var(--focus-ring); }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--val, 50%), var(--border) var(--val, 50%)); cursor: pointer; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow-xs); }
.range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.range:focus-visible { box-shadow: none; } .range:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus-ring); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-alt); max-width: 100%; overflow-x: auto; }
.segmented button { height: 30px; padding: 0 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.segmented button:hover { color: var(--text-primary); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-xs), 0 0 0 1px var(--border); }
.tabs__list { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs__list::-webkit-scrollbar { display: none; }
.tab { position: relative; height: 42px; padding: 0 12px; font-size: 15px; font-weight: 500; color: var(--text-tertiary); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; flex: none; }
.tab:hover { color: var(--text-primary); }
.tab[aria-selected="true"] { color: var(--text-primary); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.tab .count { font: 500 11px/1 var(--font-mono); color: var(--text-tertiary); }
.tabs--mono .tab { font: 600 11.5px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; height: 40px; }

/* ---------- Table ---------- */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.table { width: 100%; font-size: 14px; }
.table th { text-align: left; font: 600 11px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-tertiary); padding: 12px 16px; background: var(--bg-soft); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--bg-soft); }
.table .num { text-align: right; font-family: var(--font-mono); font-size: 13px; white-space: nowrap; }
.table .mono { font-size: 12.5px; }
.table__model { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.table__model .art { width: 36px; --ratio: 1; border-radius: var(--radius-sm); flex: none; }
.table__model b { font-weight: 600; display: block; }

/* ---------- Code block ---------- */
.code { border-radius: var(--radius-lg); background: var(--code-bg); color: var(--code-fg); overflow: hidden; }
.code__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px 0 4px; border-bottom: 1px solid var(--code-line); min-height: 42px; }
.code__head .tabs__list { border: 0; min-width: 0; }
.code__head .tab { color: var(--code-muted); }
.code__head .tab:hover, .code__head .tab[aria-selected="true"] { color: var(--code-fg); }
.code__head .label { color: var(--code-muted); padding-left: 10px; }
.code__head .btn { color: var(--code-muted); }
.code__head .btn:hover { background: rgba(255,255,255,.06); color: var(--code-fg); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: 13px; line-height: 1.7; }

/* ---------- Feedback ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg-soft); font-size: 14.5px; color: var(--text-secondary); }
.alert > .icon { margin-top: 2px; flex: none; }
.alert__title { font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.alert--info { background: var(--info-bg); border-color: var(--accent-line); } .alert--info > .icon { color: var(--info); }
.alert--success { background: var(--success-bg); border-color: transparent; } .alert--success > .icon { color: var(--success); }
.alert--warning { background: var(--warning-bg); border-color: transparent; } .alert--warning > .icon { color: var(--warning); }
.alert--danger { background: var(--danger-bg); border-color: transparent; } .alert--danger > .icon { color: var(--danger); }
.toast-region { position: fixed; right: 16px; bottom: 16px; z-index: var(--z-toast); display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 14px 16px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-float); animation: toast-in var(--duration-base) var(--ease-out); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: all var(--duration-base); }
.toast__icon { margin-top: 2px; color: var(--accent-text); }
.toast--success .toast__icon { color: var(--success); } .toast--danger .toast__icon { color: var(--danger); }
.toast > div { flex: 1; min-width: 0; }
.toast__title { font-weight: 600; font-size: 14.5px; }
.toast__text { font-size: 13.5px; color: var(--text-secondary); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: 16px; background: var(--overlay); opacity: 0; visibility: hidden; transition: opacity var(--duration-base), visibility var(--duration-base); }
.modal.is-open { opacity: 1; visibility: visible; }
.modal__dialog { width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-float); transform: translateY(8px) scale(.98); transition: transform var(--duration-base) var(--ease-out); }
.modal.is-open .modal__dialog { transform: none; }
.modal__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal__title { font-size: var(--text-h5); }
.modal__body { padding: 20px; display: grid; gap: 16px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--bg-soft); }
@media (max-width: 639px) { .modal { place-items: end center; padding: 0; } .modal__dialog { width: 100%; border-radius: var(--radius-xl) var(--radius-xl) 0 0; } }
.progress { height: 6px; border-radius: 6px; background: var(--border); overflow: hidden; }
.progress > span { display: block; height: 100%; width: var(--val, 40%); background: var(--accent); border-radius: inherit; }
.skeleton { background: linear-gradient(90deg, var(--bg-alt), var(--border), var(--bg-alt)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 48px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--text-tertiary); }
.breadcrumbs a:hover { color: var(--text-primary); }
.breadcrumbs .icon { width: 12px; height: 12px; }
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--radius-md); border: 1px solid var(--border); font: 500 13px/1 var(--font-mono); }
.pagination a:hover { border-color: var(--border-strong); }
.pagination [aria-current] { background: var(--surface-inverse); color: var(--text-inverse); border-color: transparent; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent-text); flex: none; }

/* ---------- Dashboard (кабинет) ---------- */
.app { display: grid; min-height: calc(100dvh - var(--header-h)); }
@media (min-width: 1024px) { .app { grid-template-columns: 240px minmax(0,1fr); } }
.sidebar { display: none; flex-direction: column; gap: 2px; padding: 16px 12px; border-right: 1px solid var(--border); background: var(--bg-soft); }
.sidebar.is-open { display: flex; position: fixed; inset: var(--header-h) auto 0 0; width: min(280px, 86vw); z-index: var(--z-overlay); box-shadow: var(--shadow-float); overflow-y: auto; }
@media (min-width: 1024px) { .sidebar { display: flex; position: sticky; top: var(--header-h); height: calc(100dvh - var(--header-h)); } .sidebar.is-open { position: sticky; inset: auto; width: auto; box-shadow: none; } }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); font-size: 14.5px; color: var(--text-secondary); }
.sidebar a:hover { background: var(--surface-hover); color: var(--text-primary); }
.sidebar a[aria-current] { background: var(--surface); color: var(--text-primary); font-weight: 600; box-shadow: var(--shadow-xs), 0 0 0 1px var(--border); }
.sidebar a[aria-current] .icon { color: var(--accent-text); }
.sidebar__group { padding: 16px 10px 6px; }
.sidebar__card { margin-top: auto; padding: 14px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); display: grid; gap: 10px; }
.app__main { padding: clamp(16px, 3vw, 32px); display: grid; gap: 20px; align-content: start; min-width: 0; }
.app__main > * { min-width: 0; }
.app__top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.app__top h1 { font-size: var(--text-h3); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (min-width: 1024px) { .stats { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.stat { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); display: grid; gap: 8px; min-width: 0; }
.stat__value { font-family: var(--font-display); font-size: clamp(24px, 2vw + 12px, 34px); line-height: 1; font-weight: 600; letter-spacing: -0.02em; }
.stat__delta { font: 500 12px/1 var(--font-mono); color: var(--success); }
.stat__delta.is-down { color: var(--danger); }
.chart { display: grid; grid-template-columns: repeat(var(--n, 14), minmax(0,1fr)); gap: clamp(2px, .6vw, 6px); align-items: end; height: 200px; border-bottom: 1px solid var(--border); background-image: linear-gradient(var(--border-subtle) 1px, transparent 1px); background-size: 100% 25%; }
.chart > span { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.chart > span > i { display: block; height: var(--h); background: linear-gradient(180deg, var(--chart-1), var(--accent)); }
.chart > span > i:first-child { border-radius: 3px 3px 0 0; background: var(--chart-2); }
.chart__x { display: grid; grid-template-columns: repeat(var(--n, 14), minmax(0,1fr)); gap: clamp(2px, .6vw, 6px); margin-top: 8px; font: 500 10px/1 var(--font-mono); color: var(--text-tertiary); text-align: center; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-secondary); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.key-mask { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; }

/* ---------- Документация системы ---------- */
.docs { display: grid; gap: 32px; padding-bottom: 32px; }
@media (min-width: 1024px) { .docs { grid-template-columns: 220px minmax(0,1fr); gap: 56px; } .docs__nav { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; } }
.docs__nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.docs__nav::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) { .docs__nav { flex-direction: column; border: 0; } }
.docs__nav a { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-secondary); white-space: nowrap; }
.docs__nav a:hover { background: var(--surface-hover); color: var(--text-primary); }
.docs__nav .n { font: 600 11px/1 var(--font-mono); color: var(--accent-text); letter-spacing: .06em; }
.docs-section { padding: 28px 0 40px; border-top: 1px solid var(--border); display: grid; gap: 16px; }
.docs-section > * { min-width: 0; }
.docs-section:first-child { border-top: 0; padding-top: 4px; }
.docs-section > h2 { font-size: var(--text-h3); }
.docs-section > p { color: var(--text-secondary); max-width: 46em; }
.demo { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.demo__stage { padding: 28px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background-color: var(--bg-soft); background-image: radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 16px 16px; overflow-x: auto; }
.demo__stage--block { display: block; }
@media (max-width: 639px) { .demo__stage { padding: 18px; } }
.demo__code { border-top: 1px solid var(--border); }
.demo__code summary { cursor: pointer; padding: 10px 16px; font: 600 11px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-tertiary); list-style: none; }
.demo__code summary::-webkit-details-marker { display: none; }
.demo__code summary:hover { color: var(--accent-text); }
.demo__code pre { margin: 0; padding: 16px; background: var(--code-bg); color: var(--code-fg); font-size: 12.5px; line-height: 1.6; overflow-x: auto; white-space: pre; }
.swatch { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.swatch__chip { height: 64px; box-shadow: inset 0 -1px 0 var(--border); }
.swatch__info { padding: 8px 10px; display: grid; gap: 2px; font: 500 11px/1.35 var(--font-mono); color: var(--text-secondary); overflow-wrap: anywhere; }
.swatch__info span:first-child { color: var(--text-primary); font-weight: 600; }

/* ---------- Phone frame ---------- */
.phone { width: 300px; max-width: 100%; border-radius: 44px; padding: 10px; background: #141311; box-shadow: 0 30px 60px -24px rgba(29,28,25,.5), inset 0 0 0 1px rgba(255,255,255,.08); }
.phone__screen { height: 620px; border-radius: 34px; overflow: hidden; background: var(--bg); color: var(--text-primary); display: flex; flex-direction: column; }
.phone__status { display: flex; justify-content: space-between; padding: 12px 22px 6px; font: 600 12px/1 var(--font-sans); }
.phone__body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.phone__home { width: 110px; height: 4px; border-radius: 4px; background: var(--text-primary); opacity: .35; margin: 8px auto 10px; flex: none; }
@media (min-width: 1024px) { .hide-desktop-only { display: none !important; } }

/* On mobile screens, elevate the artwork above the lengthy mission text for instant visual impact */
@media (max-width: 899px) {
  .split figure.work {
    order: -1;
    margin-bottom: 0.5rem;
  }
}
