/* ==========================================================================
   «Кострома» — интерактивный путеводитель
   base.css: палитра, типографика, кнопки, шапка, подвал, общие компоненты
   ========================================================================== */

:root {
  /* Палитра: льняная бумага, чернила, волжская синь, киноварь, золото иконостаса */
  --paper: #F4EDDF;
  --paper-2: #EBE1CC;
  --paper-3: #E2D6BC;
  --card: #FFFDF8;
  --ink: #241D16;
  --ink-2: #4B4035;
  --muted: #7B6D5D;
  --line: #DDD1BB;
  --line-2: #C3B392;
  --volga: #173F4F;
  --volga-2: #215468;
  --volga-ink: #0D2833;
  --red: #B5341F;
  --red-2: #8E2616;
  --red-soft: #F6E3DC;
  --gold: #C08A2B;
  --gold-2: #E4C476;
  --gold-soft: #F5EACB;
  --moss: #3F7A4E;
  --ok: #2F7A4A;
  --warn: #B5341F;

  /* Цвета категорий */
  --cat-temple: #B8862B;
  --cat-monastery: #8F2E21;
  --cat-museum: #1F5C6B;
  --cat-square: #5B4A7B;
  --cat-monument: #46698A;
  --cat-theatre: #9C2C5E;
  --cat-park: #3F7A4E;
  --cat-nature: #2C6B57;
  --cat-craft: #8A5A2B;

  --font-display: 'Oranienbaum', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-ui: 'Golos Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-read: 'Literata', Georgia, 'PT Serif', 'Times New Roman', serif;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(36, 29, 22, .05), 0 6px 18px rgba(36, 29, 22, .07);
  --shadow-md: 0 14px 34px rgba(36, 29, 22, .14);
  --shadow-lg: 0 28px 70px rgba(13, 40, 51, .38);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: .25s;
  --header-h: 74px;
  --max: 1200px;
}

/* ---------- Сброс и база ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* scrollbar-gutter: место под полосу прокрутки остаётся и тогда, когда открытая карточка или панорама блокирует страницу, — содержимое не прыгает вбок */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); scrollbar-gutter: stable; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
/* лёгкая «зернистость» бумаги */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.2 0 0 0 0 0.15 0 0 0 0 0.1 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
h1, h2, h3, h4, h5 { margin: 0; color: var(--ink); font-weight: 600; line-height: 1.2; }
h1, h2, .display { font-family: var(--font-display); font-weight: 400; letter-spacing: .005em; line-height: 1.04; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); }
h3 { font-size: 1.22rem; line-height: 1.3; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--red); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--red-2); }
img, svg, video, iframe { max-width: 100%; }
img { display: block; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding-left: 1.25em; }
li { margin: .25em 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
small { font-size: .85em; }
::selection { background: var(--gold-2); color: var(--ink); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 2000; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; transition: top var(--t); }
.skip:focus { top: 12px; color: var(--paper); }

.ico { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.25em; }
.ico--fill { fill: currentColor; stroke: none; }

/* ---------- Раскладка ---------- */
.wrap { width: min(100% - 44px, var(--max)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 44px, 860px); margin-inline: auto; }
.wrap--wide { width: min(100% - 44px, 1400px); margin-inline: auto; }
.section { padding-block: clamp(48px, 7vw, 92px); }
.section--alt { background: var(--paper-2); }
.section--card { background: var(--card); border-block: 1px solid var(--line); }
.section--tight { padding-block: clamp(28px, 4vw, 48px); }
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.flow > * + * { margin-top: var(--flow, 16px); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Заголовок раздела */
.s-head { max-width: 760px; margin: 0 auto clamp(28px, 4vw, 44px); text-align: center; }
.s-head--left { margin-inline: 0; text-align: left; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 12px;
  color: var(--red); font-size: .78rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
}
.eyebrow::before { content: ''; width: 26px; height: 2px; background: currentColor; border-radius: 2px; }
.s-head--center .eyebrow::after, .s-head:not(.s-head--left) .eyebrow::after { content: ''; width: 26px; height: 2px; background: currentColor; border-radius: 2px; }
.s-head p { color: var(--muted); font-size: 1.05rem; margin-top: 12px; }
.s-head h2 + p { max-width: 680px; margin-inline: auto; }
.s-head--left h2 + p { margin-inline: 0; }
.s-more { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; margin-top: 14px; }
.s-more .ico { transition: transform var(--t) var(--ease); }
.s-more:hover .ico { transform: translateX(4px); }

/* ---------- Кнопки, плашки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 24px; border: 1.5px solid transparent; border-radius: 999px;
  font-family: var(--font-ui); font-weight: 600; font-size: .96rem; line-height: 1.2; text-align: center;
  color: var(--ink); background: var(--paper-3); text-decoration: none; white-space: nowrap;
  transition: transform var(--t) var(--ease), box-shadow var(--t), background-color var(--t), color var(--t), border-color var(--t);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--ink); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: none; }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-2); color: #fff; }
.btn--dark { background: var(--volga); color: #fff; }
.btn--dark:hover { background: var(--volga-2); color: #fff; }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: var(--gold-2); color: var(--ink); }
.btn--ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: var(--gold-2); color: var(--ink); }
.btn--outline-light { background: transparent; border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn--outline-light:hover { border-color: var(--gold-2); color: var(--gold-2); box-shadow: none; }
.btn--sm { padding: 8px 16px; font-size: .86rem; }
.btn--lg { padding: 15px 30px; font-size: 1.05rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .ico { width: 1.15em; height: 1.15em; }

.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px;
  border: 1.5px solid var(--line-2); border-radius: 999px; background: var(--card);
  color: var(--ink-2); font-weight: 500; font-size: .88rem; line-height: 1.2; white-space: nowrap;
  transition: background-color var(--t), color var(--t), border-color var(--t), transform var(--t) var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip .ico { width: 1.05em; height: 1.05em; }
.chip__n { font-size: .78em; opacity: .65; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-2); font-size: .76rem; font-weight: 600; letter-spacing: .02em; line-height: 1.4; white-space: nowrap;
}
.pill--gold { background: var(--gold-soft); color: #7A5512; }
.pill--red { background: var(--red-soft); color: var(--red-2); }
.pill--green { background: #E1EFE3; color: #275F38; }
.pill--blue { background: #DCE9EE; color: var(--volga); }

/* ---------- Шапка ---------- */
.hdr {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244, 237, 223, .9);
  -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid var(--line);
}
.hdr__in { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); flex: none; }
.brand:hover { color: var(--ink); }
.brand__mark { flex: none; width: 42px; height: 42px; color: var(--red); fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s var(--ease); }
.brand:hover .brand__mark { transform: rotate(-8deg) translateY(-2px); }
.brand__text b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.62rem; line-height: 1; }
.brand__text small { display: block; margin-top: 2px; font-size: .64rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.brand--light, .brand--light:hover { color: #fff; }
.brand--light .brand__mark { color: var(--gold-2); }
.brand--light .brand__text small { color: rgba(255, 255, 255, .6); }
/* Буква «а»-каланча в названии: размеры привязаны к кеглю, низ фигуры лежит на базовой линии */
.wordmark__a { position: relative; display: inline-block; width: .48em; height: .8em; vertical-align: baseline; }
.wordmark__a svg { display: block; width: 100%; height: 100%; }

.nav { display: flex; align-items: center; gap: 2px; }
.nav__a {
  position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 10px 13px; white-space: nowrap;
  background: none; border: 0; border-radius: 999px; font-family: inherit; font-weight: 500; font-size: .95rem; color: var(--ink-2); line-height: 1.2;
}
.nav__a::after { content: ''; position: absolute; left: 13px; right: 13px; bottom: 5px; height: 2px; border-radius: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform var(--t) var(--ease); }
.nav__a:hover, .nav__a.is-active { color: var(--ink); }
.nav__a:hover::after, .nav__a.is-active::after { transform: scaleX(1); }
.nav__a .ico { width: 1em; height: 1em; transition: transform var(--t); }
.nav__more { position: relative; }
.nav__more.is-open .nav__a .ico, .nav__more:hover .nav__a .ico { transform: rotate(180deg); }

.menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 110; width: 330px; padding: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md);
  display: grid; gap: 2px; opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity var(--t), transform var(--t) var(--ease), visibility var(--t);
}
.nav__more.is-open .menu, .nav__more:hover .menu, .nav__more:focus-within .menu { opacity: 1; visibility: visible; transform: none; }
.menu__t { padding: 8px 12px 4px; font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.menu a { display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: var(--ink); transition: background-color var(--t); }
.menu a:hover { background: var(--paper-2); color: var(--ink); }
.menu a.is-active { background: var(--gold-soft); }
.menu__ic { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--paper-2); color: var(--red); }
.menu a.is-active .menu__ic { background: #fff; }
.menu b { display: block; font-weight: 600; font-size: .93rem; line-height: 1.25; }
.menu small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.35; }

.hdr__tools { display: flex; align-items: center; gap: 10px; flex: none; }
.burger { display: none; width: 46px; height: 46px; align-items: center; justify-content: center; background: none; border: 1.5px solid var(--line-2); border-radius: 12px; color: var(--ink); }
.burger .ico { width: 24px; height: 24px; }

/* Мобильное меню */
.mnav { display: none; }

/* ---------- Нижняя панель навигации (телефон) ---------- */
.bbar { display: none; }

/* ---------- Подвал ---------- */
.ftr { position: relative; margin-top: 0; background: var(--volga); color: rgba(255, 255, 255, .78); }
.ftr::before {
  content: ''; display: block; height: 6px;
  background: repeating-linear-gradient(90deg, var(--gold-2) 0 14px, var(--red) 14px 22px, var(--gold-2) 22px 36px);
}
.ftr__in { padding: clamp(44px, 6vw, 72px) 0 0; }
.ftr__grid { display: grid; grid-template-columns: 1.5fr .8fr .8fr 1fr; gap: clamp(24px, 4vw, 56px); }
.ftr__brand p { font-size: .93rem; line-height: 1.7; max-width: 360px; margin-top: 14px; }
.ftr__tag { display: inline-block; margin-top: 14px; padding: 7px 13px; border-radius: 10px; background: rgba(255, 255, 255, .08); font-size: .8rem; color: rgba(255, 255, 255, .85); }
.ftr__col h4 { margin-bottom: 14px; color: var(--gold-2); font-size: .76rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.ftr__col a { display: block; padding: 5px 0; color: rgba(255, 255, 255, .78); font-size: .92rem; }
.ftr__col a:hover { color: var(--gold-2); }
.ftr__col p { font-size: .9rem; line-height: 1.65; }
.ftr__prog { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .07); font-size: .85rem; }
.ftr__bar { height: 6px; margin-top: 9px; border-radius: 6px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.ftr__bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--gold-2), var(--red)); transition: width .8s var(--ease); }
.ftr__bottom { margin-top: clamp(32px, 4vw, 48px); padding: 18px 0 26px; border-top: 1px solid rgba(255, 255, 255, .14); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: .8rem; color: rgba(255, 255, 255, .55); }
.ftr__bottom a { color: rgba(255, 255, 255, .75); }
.ftr__bottom a:hover { color: var(--gold-2); }

/* ---------- Карточки ---------- */
.card {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); color: inherit;
  transition: transform var(--t) var(--ease), box-shadow var(--t), border-color var(--t);
}
a.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); color: inherit; }
.card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(135deg, var(--volga), var(--volga-2)); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
a.card:hover .card__media img { transform: scale(1.05); }
.card__body { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px 22px; flex: 1; }
.card__body h3 { font-size: 1.18rem; }
.card__body h3 a { color: inherit; }
.card__body p { color: var(--muted); font-size: .92rem; margin: 0; }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; font-size: .84rem; color: var(--muted); }
.card--text { padding: 26px 26px 24px; }
.card--text .ico { width: 44px; height: 44px; padding: 11px; border-radius: 12px; background: var(--gold-soft); color: var(--red); }
.card--text p { color: var(--muted); font-size: .94rem; margin-top: 8px; }
.card--wide { flex-direction: row; }
.card--wide .card__media { width: 42%; aspect-ratio: auto; min-height: 220px; flex: none; }
.card--wide .card__body { flex: 1; }

.badge {
  position: absolute; left: 14px; top: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; background: var(--bg, var(--volga)); color: #fff;
  font-size: .72rem; font-weight: 600; letter-spacing: .04em; line-height: 1.3; box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
.badge .ico { width: .95em; height: .95em; }
.badge--year { left: auto; right: 14px; background: rgba(20, 16, 12, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); letter-spacing: .02em; }
.card__no { position: absolute; left: 14px; top: 14px; z-index: 2; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--red); color: #fff; font-family: var(--font-display); font-size: 1.35rem; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }

/* Арка-наличник для избранных кадров */
.arch { position: relative; overflow: hidden; border-radius: 999px 999px var(--radius) var(--radius); aspect-ratio: 3 / 4; background: var(--volga); }
.arch img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.arch::after { content: ''; position: absolute; inset: 10px; border: 1.5px solid rgba(255, 255, 255, .55); border-radius: inherit; pointer-events: none; }
a:hover .arch img { transform: scale(1.05); }

/* ---------- Цифры ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.stat { position: relative; padding: 22px 22px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-align: left; color: inherit; font: inherit; }
.stat__n { display: block; font-family: var(--font-display); font-size: clamp(2.4rem, 4.6vw, 3.6rem); line-height: 1; color: var(--red); white-space: nowrap; }
.stat__n small { font-size: .42em; color: var(--muted); font-family: var(--font-ui); font-weight: 500; margin-left: 4px; }
.stat__l { display: block; margin-top: 8px; color: var(--ink-2); font-size: .9rem; font-weight: 500; }
.stat--dark { background: transparent; border-color: rgba(255, 255, 255, .18); color: #fff; }
.stat--dark .stat__n { color: var(--gold-2); }
.stat--dark .stat__n small { color: rgba(255, 255, 255, .7); }
.stat--dark .stat__l { color: rgba(255, 255, 255, .85); }

/* ---------- Цитата, врезка, факты ---------- */
.quote { position: relative; margin: 0; padding: 26px 30px 26px 30px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--font-read); font-size: 1.12rem; line-height: 1.65; color: var(--ink); }
.quote::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 4px; background: var(--gold); }
.quote cite { display: block; margin-top: 10px; font-family: var(--font-ui); font-style: normal; font-size: .86rem; color: var(--muted); }
.note { padding: 16px 20px; border-radius: var(--radius-sm); background: var(--gold-soft); border: 1px solid #EBD9A6; font-size: .94rem; color: var(--ink-2); }
.note--red { background: var(--red-soft); border-color: #EFCBC0; }
.note--blue { background: #DCE9EE; border-color: #C3D9E1; }
.note b { color: var(--ink); }

/* ---------- Окно поверх страницы ---------- */
.dlg { position: fixed; inset: 0; z-index: 600; display: none; align-items: flex-end; justify-content: center; }
.dlg.is-open { display: flex; }
.dlg__bg { position: absolute; inset: 0; background: rgba(13, 40, 51, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
/* Само окно не прокручивается — прокручивается его внутренняя часть (.dlg__scroll), поэтому полоса прокрутки
   начинается и заканчивается там же, где текст: не вылезает наверх на скруглённый угол и не уходит под низ карточки */
.dlg__box {
  --dlg-pad: clamp(22px, 3.5vw, 44px);
  position: relative; width: min(100%, 980px); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
  display: flex; flex-direction: column; overflow: hidden; padding: var(--dlg-pad) 0;
  background: var(--paper); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-lg);
  animation: dlgUp .4s var(--ease) both;
}
.dlg__scroll { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.dlg__in { padding: 0 var(--dlg-pad); }
.dlg--center { align-items: center; padding: 20px; }
.dlg--center .dlg__box { border-radius: var(--radius-lg); animation: dlgIn .35s var(--ease) both; }
.dlg__x { position: sticky; top: 0; float: right; z-index: 3; width: 44px; height: 44px; display: grid; place-items: center; margin: 0 calc(var(--dlg-pad) - 8px) 0 12px; border: 0; border-radius: 50%; background: var(--ink); color: var(--paper); transition: transform var(--t), background-color var(--t); }
.dlg__x:hover { transform: rotate(90deg); background: var(--red); }
@keyframes dlgUp { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: none; } }
@keyframes dlgIn { from { opacity: 0; transform: scale(.94) translateY(14px); } to { opacity: 1; transform: none; } }
body.dlg-open { overflow: hidden; }

/* ---------- Полосы прокрутки ---------- */
/* В Chromium и Safari полосу рисуют правила ::-webkit-scrollbar; Firefox понимает только стандартные свойства (блок @supports). */
*::-webkit-scrollbar { width: 12px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--volga-2); background: color-mix(in srgb, var(--volga) 62%, var(--paper)); border: 3px solid transparent; border-radius: 12px; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--volga); }
*::-webkit-scrollbar-thumb:active { background: var(--red); }
*::-webkit-scrollbar-corner { background: transparent; }
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-width: thin; scrollbar-color: var(--volga) transparent; }
}

/* ---------- Уведомления ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 1200; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--paper); font-size: .92rem; box-shadow: var(--shadow-md); animation: toastIn .3s var(--ease) both; }
.toast .ico { color: var(--gold-2); }
.toast--ok .ico { color: #8CD3A0; }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Появление при прокрутке ---------- */
html.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .75s ease, transform .75s var(--ease); }
html.js .reveal.in { opacity: 1; transform: none; }
html.js .reveal.d1 { transition-delay: .08s; } html.js .reveal.d2 { transition-delay: .16s; } html.js .reveal.d3 { transition-delay: .24s; } html.js .reveal.d4 { transition-delay: .32s; }

/* ---------- Скелетон для незагруженных картинок ---------- */
.imgph { position: relative; background: linear-gradient(110deg, var(--paper-2) 30%, var(--paper) 50%, var(--paper-2) 70%); background-size: 220% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }

/* ---------- Наверх ---------- */
.to-top { position: fixed; right: 22px; bottom: 22px; z-index: 90; width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--volga); color: var(--gold-2); box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity var(--t), transform var(--t), visibility var(--t), background-color var(--t); }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top .ico { transform: rotate(-90deg); width: 22px; height: 22px; }
.hdr.is-scrolled { box-shadow: 0 6px 24px rgba(36, 29, 22, .08); }
.to-top:hover { background: var(--red); color: #fff; }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .ftr__grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .ftr__grid > .ftr__col:last-child { grid-column: 1 / -1; }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  :root { --header-h: 64px; }
  .nav { display: none; }
  .hdr__cta { display: none; }
  .burger { display: inline-flex; }
  .brand__mark { width: 36px; height: 36px; }
  .brand__text b { font-size: 1.42rem; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card--wide { flex-direction: column; }
  .card--wide .card__media { width: 100%; aspect-ratio: 16 / 9; min-height: 0; }
  .mnav {
    display: block; position: fixed; z-index: 99; top: var(--header-h); left: 0; right: 0; bottom: 0; overflow: auto;
    padding: 18px 22px calc(96px + env(safe-area-inset-bottom)); background: var(--paper);
    opacity: 0; visibility: hidden; transform: translateY(-10px); transition: opacity var(--t), transform var(--t) var(--ease), visibility var(--t);
  }
  body.nav-open .mnav { opacity: 1; visibility: visible; transform: none; }
  body.nav-open { overflow: hidden; }
  .mnav__t { margin: 20px 0 8px; font-size: .74rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
  .mnav a { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 14px; padding: 11px 10px; border-radius: 14px; color: var(--ink); }
  .mnav a:active, .mnav a.is-active { background: var(--paper-2); }
  .mnav a b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.45rem; line-height: 1.1; }
  .mnav a small { display: block; color: var(--muted); font-size: .84rem; }
  .mnav .menu__ic { width: 44px; height: 44px; }
  .ftr__grid { grid-template-columns: 1fr 1fr; }
  .ftr__grid > .ftr__brand { grid-column: 1 / -1; }
  .dlg { align-items: stretch; }
  .dlg__box { width: 100%; max-height: 100vh; max-height: 100dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .dlg--center { align-items: flex-end; padding: 0; }
}
@media (max-width: 820px) {
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .bbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
    background: rgba(255, 253, 248, .96); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .bbar a, .bbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; padding: 4px 2px; background: none; border: 0; border-radius: 12px; color: var(--muted); font-size: .66rem; font-weight: 500; letter-spacing: .01em; line-height: 1.2; }
  .bbar .ico { width: 23px; height: 23px; }
  .bbar a.is-active, .bbar button.is-active { color: var(--red); }
  .bbar a:active, .bbar button:active { background: var(--paper-2); }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .to-top { display: none; }
  .ftr__bottom { flex-direction: column; }
}
@media (max-width: 640px) {
  .wrap, .wrap--narrow, .wrap--wide { width: calc(100% - 32px); }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 16px; }
  .brand__text small { display: none; }
  .ftr__grid { grid-template-columns: 1fr; gap: 26px; }
  .ftr__grid > .ftr__col:last-child { grid-column: auto; }
  .btn { padding: 12px 20px; }
  h2 { font-size: clamp(1.7rem, 8vw, 2.3rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html.js .reveal { opacity: 1; transform: none; }
}

@media print {
  .hdr, .bbar, .ftr, .to-top, .toasts, body::after { display: none !important; }
  body { background: #fff; padding: 0; }
  html.js .reveal { opacity: 1; transform: none; }
}
