/* ============================================================
   KIOSK — дизайн-система dankar inside
   Печатно-типографская сетка: жёсткие углы, волосяные линейки,
   моноширинная разметка, инверсия на ховере. Никакого стекла,
   размытий и «шариков» — только бумага, краска и сетка.

   Цвета целиком управляются переменными, которые пишет админка:
   --bg-1/2/3 и --accent-rgb / --accent-2-rgb / --accent-3-rgb
   ============================================================ */

:root {
    --bg-1: #0a1628;
    --bg-2: #0d1f3c;
    --bg-3: #0f2847;
    --accent-rgb: 0, 212, 255;
    --accent-2-rgb: 0, 119, 182;
    --accent-3-rgb: 144, 224, 239;

    --ink: #f4f6f8;
    --ink-dim: rgba(244, 246, 248, 0.56);
    --ink-faint: rgba(244, 246, 248, 0.34);
    --rule: rgba(244, 246, 248, 0.16);
    --rule-soft: rgba(244, 246, 248, 0.09);

    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --disp: 'Space Grotesk', system-ui, -apple-system, sans-serif;

    --rail: 46px;
    --bar: 54px;
    --gut: clamp(18px, 4vw, 56px);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    background: var(--bg-1);
    color: var(--ink);
    font-family: var(--disp);
    font-weight: 400;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    padding-left: var(--rail);
    padding-top: var(--bar);
}

::selection {
    background: rgb(var(--accent-rgb));
    color: var(--bg-1);
}

/* ---------- фон: диагональная заливка + колонки наборной сетки ---------- */

.paper {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(158deg, var(--bg-1) 0%, var(--bg-1) 38%, var(--bg-2) 38%, var(--bg-2) 71%, var(--bg-3) 71%);
}

.paper::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(to right, var(--rule-soft) 0 1px, transparent 1px 12.5%);
    opacity: 0.9;
}

.paper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 80% at 82% 4%, rgba(var(--accent-rgb), 0.14), transparent 62%);
}

/* зерно — вместо блюра и «частиц» */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- вертикальный рельс слева ---------- */

.rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail);
    z-index: 70;
    border-right: 1px solid var(--rule);
    background: var(--bg-1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0 16px;
}

.rail-mark {
    width: 18px;
    height: 18px;
    background: rgb(var(--accent-rgb));
    flex-shrink: 0;
}

.rail-text {
    flex: 1;
    display: flex;
    align-items: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: var(--ink-faint);
    white-space: nowrap;
}

/* ---------- «сейчас читают» ----------
   Число берётся из того же presence-узла Firebase, что и в админке:
   живой ключ = запись моложе 60 с. Без анимаций — цифра просто меняется. */

.rail-live {
    display: none;
    align-items: center;
    gap: 7px;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    color: var(--ink-dim);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
}

.rail-live.on {
    display: flex;
}

.rail-live b {
    font-weight: 700;
    color: rgb(var(--accent-3-rgb));
    font-variant-numeric: tabular-nums;
}

.rail-live-dot {
    width: 6px;
    height: 6px;
    flex-shrink: 0;
    background: rgb(var(--accent-rgb));
    animation: liveBeat 2.6s steps(1, end) infinite;
}

@keyframes liveBeat {

    0%,
    62% {
        opacity: 1;
    }

    63%,
    100% {
        opacity: 0.2;
    }
}

/* на узких экранах рельса скрыта — счётчик переезжает в шапку */
.topbar .rail-live {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 10px;
    padding-left: 12px;
    border-left: 1px solid var(--rule);
}

.rail-clock {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    color: rgb(var(--accent-3-rgb));
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

/* ---------- верхняя панель ---------- */

.topbar {
    position: fixed;
    top: 0;
    left: var(--rail);
    right: 0;
    height: var(--bar);
    z-index: 71;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 var(--gut);
    background: color-mix(in srgb, var(--bg-1) 88%, transparent);
    border-bottom: 1px solid var(--rule);
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}

.brand i {
    font-style: normal;
    color: var(--ink-faint);
    font-size: 10px;
    letter-spacing: 0.14em;
}

.nav {
    display: flex;
    align-items: stretch;
    height: 100%;
}

.nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 clamp(10px, 2vw, 20px);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-dim);
    text-decoration: none;
    border-left: 1px solid var(--rule);
    transition: color 0.2s, background 0.2s;
}

.nav a:last-child {
    border-right: 1px solid var(--rule);
}

.nav a svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.nav a:hover {
    color: var(--bg-1);
    background: rgb(var(--accent-rgb));
}

.nav a.on {
    color: rgb(var(--accent-3-rgb));
}

/* ---------- контейнер ---------- */

.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--gut);
}

.wrap-narrow {
    max-width: 860px;
}

/* ---------- бегущая строка ----------
   Лента бесконечная: JS (core.js) клонирует эталонный блок столько раз,
   чтобы дорожка была шире экрана минимум на один блок, и записывает его
   ширину в --tk-unit. Сдвиг ровно на один блок замыкает цикл без стыка.
   Без JS работает запасной вариант: два блока в разметке и сдвиг на 50%. */

.ticker {
    border-block: 1px solid var(--rule);
    background: rgb(var(--accent-rgb));
    color: var(--bg-1);
    overflow: hidden;
    display: flex;
    user-select: none;
}

.ticker-lane {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    will-change: transform;
    animation: tickerRun var(--tk-dur, 30s) linear infinite;
}

/* остановка при наведении — чтобы можно было дочитать строку */
.ticker:hover .ticker-lane {
    animation-play-state: paused;
}

.ticker-track {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 26px;
    /* правый отступ равен внутреннему шагу — иначе на стыке блоков сбивается ритм */
    padding: 9px 26px 9px 0;
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ticker-track span {
    display: inline-flex;
    align-items: center;
    gap: 26px;
}

.ticker-track span::after {
    content: '';
    width: 5px;
    height: 5px;
    background: var(--bg-1);
    transform: rotate(45deg);
}

@keyframes tickerRun {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(calc(-1 * var(--tk-unit, 50%)));
    }
}

@media (prefers-reduced-motion: reduce) {
    .ticker-lane {
        animation: none;
    }
}

/* ---------- заголовки секций ---------- */

.sec {
    padding: clamp(46px, 8vw, 88px) 0 0;
}

.sec-head {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 26px;
}

.sec-num {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: rgb(var(--accent-rgb));
    flex-shrink: 0;
}

.sec-label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--ink-dim);
    flex-shrink: 0;
}

.sec-head .fill {
    flex: 1;
    height: 1px;
    background: var(--rule);
}

.sec-title {
    font-size: clamp(26px, 5.2vw, 46px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.02;
    margin-bottom: 22px;
}

.sec-title em {
    font-style: normal;
    color: rgb(var(--accent-3-rgb));
}

/* ---------- жёсткая рамка (панель) ---------- */

.frame {
    border: 1px solid var(--rule);
    background: color-mix(in srgb, var(--bg-2) 62%, transparent);
}

.frame-pad {
    padding: clamp(20px, 3.4vw, 34px);
}

/* ---------- строки-ссылки: инверсия на ховере ---------- */

.rows {
    border-top: 1px solid var(--rule);
}

.row {
    position: relative;
    display: grid;
    grid-template-columns: 46px 44px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 16px 16px 16px 0;
    border-bottom: 1px solid var(--rule);
    text-decoration: none;
    color: var(--ink);
    background: transparent;
    transition: background 0.28s var(--ease), color 0.28s var(--ease), padding-left 0.28s var(--ease);
}

.row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: rgb(var(--accent-rgb));
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s var(--ease);
}

.row:hover {
    background: rgb(var(--accent-rgb));
    color: var(--bg-1);
    padding-left: 12px;
}

.row:hover::before {
    transform: scaleY(1);
}

.row-idx {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.12em;
    color: var(--ink-faint);
    text-align: right;
    transition: color 0.28s;
}

.row:hover .row-idx {
    color: color-mix(in srgb, var(--bg-1) 62%, transparent);
}

.row-ico {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--rule);
    transition: border-color 0.28s, background 0.28s;
}

.row-ico svg {
    width: 19px;
    height: 19px;
}

.row:hover .row-ico {
    border-color: color-mix(in srgb, var(--bg-1) 34%, transparent);
    background: color-mix(in srgb, var(--bg-1) 10%, transparent);
}

.row-body {
    min-width: 0;
}

.row-name {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.012em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-sub {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--ink-dim);
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.28s;
}

.row:hover .row-sub {
    color: color-mix(in srgb, var(--bg-1) 66%, transparent);
}

.row-go {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    color: var(--ink-faint);
    transition: transform 0.3s var(--ease), color 0.28s;
}

.row-go svg {
    width: 18px;
    height: 18px;
}

.row:hover .row-go {
    color: var(--bg-1);
    transform: translateX(5px);
}

/* ---------- кнопка ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 22px;
    border: 1px solid rgb(var(--accent-rgb));
    background: transparent;
    color: rgb(var(--accent-3-rgb));
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.24s var(--ease), color 0.24s var(--ease);
}

.btn svg {
    width: 15px;
    height: 15px;
}

.btn:hover {
    background: rgb(var(--accent-rgb));
    color: var(--bg-1);
}

.btn-solid {
    background: rgb(var(--accent-rgb));
    color: var(--bg-1);
}

.btn-solid:hover {
    background: transparent;
    color: rgb(var(--accent-3-rgb));
}

/* ---------- подвал ---------- */

.foot {
    margin-top: clamp(56px, 9vw, 100px);
    border-top: 1px solid var(--rule);
    padding: 26px 0 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.foot a {
    color: var(--ink-dim);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 2px;
    transition: color 0.2s, border-color 0.2s;
}

.foot a:hover {
    color: rgb(var(--accent-3-rgb));
    border-color: rgb(var(--accent-rgb));
}

/* ---------- «оттиск»: снимок открывается прижатием ----------
   Аватарка ведёт себя как штемпель: её надо прижать и подержать.
   Пока палец/курсор давит — краска проступает (уходит grayscale),
   рамка «садится» на место, а поверх снимка проступает сам
   отпечаток пальца: контур на месте, закрашенная копия наплывает
   снизу вверх ровно за время выдержки.
   Отпустил раньше времени — оттиск смазан, всё возвращается. */

.press {
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.press img {
    transition: filter 0.36s var(--ease), transform 0.18s var(--ease);
}

/* физическое «вдавливание» */
.press.pressing img {
    transform: scale(0.972);
    filter: none;
}

.press.pressing::after {
    transform: none !important;
}

/* индикатор выдержки — сам отпечаток пальца поверх снимка,
   закрашенная копия наплывает снизу вверх за время удержания */
.press-finger {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--bg-1) 55%, transparent);
    opacity: 0;
    transition: opacity 0.2s var(--ease);
    pointer-events: none;
}

.press.pressing .press-finger {
    opacity: 1;
}

.pf-icon {
    position: relative;
    width: 34%;
    min-width: 26px;
    max-width: 64px;
    aspect-ratio: 1;
}

.pf-outline,
.pf-fill {
    position: absolute;
    inset: 0;
    display: block;
}

.pf-outline svg,
.pf-fill svg {
    width: 100%;
    height: 100%;
}

.pf-outline {
    color: var(--bg-1);
    opacity: 0.4;
}

.pf-fill {
    color: rgb(var(--accent-rgb));
    clip-path: inset(100% 0 0 0);
}

.press.pressing .pf-fill {
    animation: fingerFill var(--press-ms, 620ms) linear forwards;
}

@keyframes fingerFill {
    to {
        clip-path: inset(0% 0 0 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pf-fill {
        clip-path: inset(0% 0 0 0);
        animation: none;
    }
}

/* подпись-подсказка под штампом */
.press-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.press-hint svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

.press.pressing .press-hint {
    color: rgb(var(--accent-3-rgb));
}

/* плашка-инструкция поверх снимка: на десктопе — по наведению,
   на тапе — если отпустили раньше, чем оттиск успел пропечататься */
.press-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 8px;
    background: rgb(var(--accent-rgb));
    color: var(--bg-1);
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
    pointer-events: none;
}

.press-label svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.press:hover .press-label,
.press:focus-visible .press-label,
.press.nudge .press-label {
    opacity: 1;
    transform: none;
}

/* при слишком коротком нажатии плашка подсказывает, что надо держать */
.press.nudge .press-label {
    animation: nudgeShake 0.34s var(--ease);
}

.press.nudge .press-label .lbl-hold {
    display: inline;
}

.press.nudge .press-label .lbl-idle {
    display: none;
}

.press-label .lbl-hold {
    display: none;
}

@keyframes nudgeShake {

    0%,
    100% {
        margin-left: 0;
    }

    25% {
        margin-left: -4px;
    }

    75% {
        margin-left: 4px;
    }
}

/* пока идёт выдержка — плашку прячем, она мешает смотреть на снимок */
.press.pressing .press-label {
    opacity: 0;
    transform: translateY(100%);
}

/* короткая «вспышка» краски в момент, когда оттиск получился */
.press.inked {
    animation: inkFlash 0.42s var(--ease);
}

@keyframes inkFlash {
    0% {
        transform: scale(0.972);
    }

    45% {
        transform: scale(1.018);
    }

    100% {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .press.inked {
        animation: none;
    }
}

/* ---------- «поделиться»: короткая ссылка + QR ----------
   QR рисуется на клиенте (qr.js), никаких запросов на сторону. */

.share-btn {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border: 1px solid var(--rule);
    background: transparent;
    color: var(--ink-faint);
    cursor: pointer;
    transition: border-color 0.22s, color 0.22s, background 0.22s;
}

.share-btn svg {
    width: 14px;
    height: 14px;
}

.share-btn:hover {
    border-color: rgb(var(--accent-rgb));
    color: rgb(var(--accent-3-rgb));
}

/* внутри строки-ссылки цвета инвертируются вместе со строкой */
.link-card:hover .share-btn,
.row:hover .share-btn {
    border-color: color-mix(in srgb, var(--bg-1) 38%, transparent);
    color: var(--bg-1);
}

.link-card:hover .share-btn:hover,
.row:hover .share-btn:hover {
    background: var(--bg-1);
    color: rgb(var(--accent-rgb));
}

/* пустой слот сохраняет колонку сетки, даже если алиаса нет */
.link-share {
    display: inline-flex;
    align-items: center;
    min-width: 30px;
}

.share-modal {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: none;
    place-items: center;
    padding: 24px;
    background: color-mix(in srgb, var(--bg-1) 92%, transparent);
}

.share-modal.active {
    display: grid;
    animation: fade 0.2s ease;
}

.share-box {
    position: relative;
    width: 100%;
    max-width: 384px;
    border: 1px solid var(--rule);
    background: var(--bg-1);
    padding: clamp(20px, 4vw, 28px);
    animation: pop 0.28s var(--ease);
    cursor: default;
}

.share-box::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(var(--accent-rgb), 0.5);
    transform: translate(9px, 9px);
    pointer-events: none;
    z-index: -1;
}

.share-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--rule);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.share-head .fill {
    flex: 1;
}

.share-close {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--rule);
    background: transparent;
    color: var(--ink-dim);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.share-close svg {
    width: 12px;
    height: 12px;
}

.share-close:hover {
    border-color: rgb(var(--accent-rgb));
    color: rgb(var(--accent-3-rgb));
}

.share-title {
    margin-top: 18px;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.14;
}

/* QR: белое поле с обязательным «тихим» отступом */
.share-qr {
    margin-top: 18px;
    display: grid;
    place-items: center;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--rule);
}

.share-qr svg {
    display: block;
    width: min(216px, 56vw);
    height: auto;
    image-rendering: pixelated;
}

.share-url {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    border: 1px solid var(--rule);
}

.share-url input {
    min-width: 0;
    padding: 11px 12px;
    border: 0;
    background: color-mix(in srgb, var(--ink) 4%, transparent);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.03em;
    outline: none;
    text-overflow: ellipsis;
}

.share-copy {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 15px;
    border: 0;
    border-left: 1px solid var(--rule);
    background: rgb(var(--accent-rgb));
    color: var(--bg-1);
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.share-copy svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.share-copy:hover {
    background: rgb(var(--accent-3-rgb));
}

.share-copy.done {
    background: transparent;
    color: rgb(var(--accent-3-rgb));
}

.share-note {
    margin-top: 13px;
    font-family: var(--mono);
    font-size: 9.5px;
    line-height: 1.75;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

/* ---------- лайтбокс аватарки ---------- */

.avatar-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    place-items: center;
    padding: 28px;
    background: color-mix(in srgb, var(--bg-1) 92%, transparent);
    cursor: zoom-out;
}

.avatar-modal.active {
    display: grid;
    animation: fade 0.22s ease;
}

.avatar-modal-img {
    max-width: min(460px, 84vw);
    max-height: 84vh;
    border: 1px solid rgb(var(--accent-rgb));
    box-shadow: 14px 14px 0 rgba(var(--accent-2-rgb), 0.5);
    animation: pop 0.3s var(--ease);
}

@keyframes fade {
    from {
        opacity: 0;
    }
}

@keyframes pop {
    from {
        opacity: 0;
        transform: translate(10px, 10px);
    }
}

/* ---------- появление при прокрутке ---------- */

[data-in] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

[data-in].in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    [data-in] {
        opacity: 1;
        transform: none;
    }
}

/* ---------- адаптив ---------- */

@media (max-width: 720px) {
    :root {
        --rail: 0px;
        --bar: 50px;
    }

    .rail {
        display: none;
    }

    .row {
        grid-template-columns: 30px 38px 1fr auto;
        gap: 11px;
        padding: 14px 12px 14px 0;
    }

    .row-ico {
        width: 34px;
        height: 34px;
    }

    .row-ico svg {
        width: 17px;
        height: 17px;
    }

    .brand i {
        display: none;
    }

    .nav a {
        padding: 0 12px;
        letter-spacing: 0.1em;
    }
}

/* На узком экране подписи в шапке не помещаются (разделов стало три) —
   оставляем одни пиктограммы. Текст не удаляем, а прячем клипом:
   он должен остаться доступным скринридеру. */
@media (max-width: 620px) {
    .nav a {
        padding: 0 13px;
    }

    .nav a svg {
        width: 16px;
        height: 16px;
    }

    .nav a span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}
