/* ============================================================
   ПАМЯТЬ СИЛЬНЕЕ ВРЕМЕНИ — цифровой портал Минска
   Общие стили: шапка, подвал, поиск, главная страница.
   Палитра: архивная бумага, тёплая темнота, золото, винный.
   ============================================================ */

/* ---------- ТОКЕНЫ ---------- */
:root {
  /* тёмные слои */
  --ink-900: #0B0908;
  --ink-800: #110E0C;
  --ink-700: #17130F;
  --ink-600: #201A15;
  --ink-500: #2A231C;

  /* бумага */
  --paper-50:  #F7F2E8;
  --paper-100: #F0E8DA;
  --paper-200: #E6DBC9;
  --paper-300: #D9CDB9;

  /* текст */
  --ink: #221C17;
  --ink-soft: #5E5349;
  --cream: #F4EDE2;
  --cream-soft: #CFC4B7;
  --cream-dim: #A39789;

  /* акценты */
  --gold: #D8B472;
  --gold-600: #B38F4A;
  --gold-dim: rgba(216, 180, 114, .14);
  --wine: #7B2F32;
  --wine-soft: rgba(123, 47, 50, .18);
  --rust: #A75932;
  --forest: #3C5A4B;

  /* линии */
  --line-dark: rgba(244, 237, 226, .12);
  --line-light: rgba(34, 28, 23, .14);

  /* шрифты */
  --display: 'Literata', Georgia, 'Times New Roman', serif;
  --sans: 'Golos Text', 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* ритм */
  --pad: clamp(16px, 4vw, 40px);
  --max: 1240px;
  --header-h: 64px;
  --r-lg: 12px;
  --r-md: 8px;
  --r-sm: 6px;

  --shadow-soft: 0 1px 2px rgba(20, 14, 8, .06), 0 6px 18px rgba(20, 14, 8, .06);
  --shadow-hard: 0 20px 50px rgba(0, 0, 0, .4);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- СБРОС ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 64px); -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--ink-800);
  color: var(--cream);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
::selection { background: var(--wine); color: #fff; }

svg.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ico {
  width: 18px; height: 18px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.ico.flip { transform: scaleX(-1); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 3000;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--paper-50); color: var(--ink); font-weight: 600;
}
.skip-link:focus { top: 12px; }
#content { display: block; height: 0; }

/* ---------- ТИПОГРАФИКА ---------- */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 500; line-height: 1.15; letter-spacing: -.01em; }

/* ---------- КНОПКИ ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 0 22px; border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 15px; font-weight: 600;
  transition: background .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn .ico { width: 17px; height: 17px; }
.btn-primary { background: var(--paper-50); color: var(--ink); }
.btn-primary:hover { background: #fff; }
.btn-dark { background: var(--ink-700); color: var(--cream); }
.btn-dark:hover { background: var(--wine); }
.btn:active { transform: translateY(1px); }

.pill-btn {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 30px; padding: 12px 20px;
  border: 1px solid rgba(216, 180, 114, .45); border-radius: var(--r-sm);
  color: var(--gold); font-size: 15px; font-weight: 600;
  transition: background .2s, border-color .2s;
}
.pill-btn:hover { background: var(--gold-dim); border-color: var(--gold); }
.toggle-icon { transition: transform .3s var(--ease); }
[aria-expanded="true"] .toggle-icon { transform: rotate(45deg); }

.icon-btn {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: var(--r-sm); border: 1px solid var(--line-dark);
  color: var(--cream-soft); transition: background .2s, color .2s, border-color .2s;
}
.icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .25); }
.icon-btn.round { border-radius: 50%; }

.chip {
  padding: 6px 12px; border-radius: var(--r-sm);
  border: 1px solid rgba(244, 237, 226, .2);
  font-size: 14px; font-weight: 500; color: var(--cream-soft);
  transition: color .2s, border-color .2s, background .2s;
}
.chip:hover { color: #fff; border-color: var(--gold); background: var(--gold-dim); }

/* ============================================================
   ШАПКА
   ============================================================ */
.header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--ink-800);
  border-bottom: 1px solid var(--line-dark);
}
.header-inner {
  max-width: 1360px; margin: auto; height: var(--header-h);
  padding: 0 var(--pad);
  display: flex; align-items: center; gap: 28px;
}

.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.brand-mark {
  width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--wine); color: var(--gold); flex: 0 0 auto;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--cream); line-height: 1.15; white-space: nowrap; }
.brand-text small { display: block; margin-top: 2px; font-family: var(--sans); font-size: 12px; font-weight: 400; color: var(--cream-dim); }

.nav { display: flex; align-items: stretch; gap: 2px; height: 100%; margin-right: auto; }
.nav-item {
  position: relative; display: flex; align-items: center;
  padding: 0 11px; font-size: 15px; font-weight: 500; color: var(--cream-soft);
  white-space: nowrap; transition: color .2s;
}
.nav-item:hover { color: #fff; }
.nav-item::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: -1px; height: 2px;
  background: var(--gold); transform: scaleX(0); transition: transform .25s var(--ease);
}
.nav-item:hover::after { transform: scaleX(.5); opacity: .5; }
.nav-item.active { color: #fff; }
.nav-item.active::after { transform: scaleX(1); opacity: 1; }

.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.header-link {
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 12px; border-radius: var(--r-sm);
  font-size: 15px; font-weight: 500; color: var(--cream-soft); white-space: nowrap;
  transition: background .2s, color .2s;
}
.header-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.header-link.active { color: var(--gold); }
.header-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-left: 6px;
  height: 40px; padding: 0 16px; border-radius: var(--r-sm);
  background: var(--wine); color: #FBF2E4;
  font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: background .2s;
}
.header-cta .ico { color: var(--gold); }
.header-cta:hover { background: #8E383C; }
.burger { display: none; }

/* мобильное меню */
.mobile-menu {
  position: fixed; inset: var(--header-h) 0 0; z-index: 999; overflow-y: auto;
  background: var(--ink-800);
  padding: 8px var(--pad) 32px;
  display: flex; flex-direction: column;
}
.mm-title { margin: 20px 0 6px; font-size: 13px; color: var(--cream-dim); }
.mobile-menu a {
  padding: 13px 0; font-size: 18px; font-weight: 500;
  border-bottom: 1px solid rgba(244, 237, 226, .08); color: var(--cream);
}
.mobile-menu a[aria-current="page"] { color: var(--gold); }
.mobile-menu .mm-cta {
  margin-top: 24px; border: 0; text-align: center; border-radius: var(--r-sm);
  background: var(--wine); color: #fff; padding: 15px; font-weight: 600;
}

/* ---------- НАВИГАЦИЯ ПО СТРАНИЦЕ ---------- */
.page-nav {
  position: sticky; top: var(--header-h); z-index: 900;
  background: var(--paper-100); color: var(--ink);
  border-bottom: 1px solid var(--line-light);
}
.page-nav-inner {
  max-width: var(--max); margin: auto; padding: 0 var(--pad);
  display: flex; align-items: center; gap: 4px;
  overflow-x: auto; scrollbar-width: none;
}
.page-nav-inner::-webkit-scrollbar { display: none; }
.pn-label { flex: 0 0 auto; margin-right: 10px; font-size: 13px; color: var(--ink-soft); }
.page-nav a {
  position: relative; flex: 0 0 auto;
  padding: 13px 10px; font-size: 14.5px; font-weight: 500; color: var(--ink-soft);
  transition: color .2s;
}
.page-nav a:hover { color: var(--ink); }
.page-nav a.active { color: var(--ink); }
.page-nav a.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px;
  background: var(--tone, var(--wine));
}

/* ---------- ПОИСК ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(8, 6, 5, .78);
  padding: 10vh var(--pad) var(--pad);
}
.search-box {
  max-width: 680px; margin: auto;
  background: var(--paper-50); color: var(--ink);
  border-radius: var(--r-lg); box-shadow: var(--shadow-hard);
  overflow: hidden;
}
.search-field {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 14px 18px; border-bottom: 1px solid var(--line-light);
}
.search-field > .ico { width: 22px; height: 22px; color: var(--wine); }
.search-field input {
  flex: 1; min-width: 0; background: none; border: 0; outline: none;
  color: var(--ink); font-size: 19px; font-family: var(--sans);
}
.search-field input::placeholder { color: #8C8075; }
.search-field .icon-btn { color: var(--ink-soft); border-color: var(--line-light); }
.search-field .icon-btn:hover { color: var(--ink); background: var(--paper-100); }
.search-hints {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 18px; border-bottom: 1px solid var(--line-light);
}
.search-hints > span { font-size: 14px; color: var(--ink-soft); }
.search-hints .chip { color: var(--ink); border-color: var(--line-light); }
.search-hints .chip:hover { border-color: var(--wine); background: var(--wine-soft); color: var(--ink); }
.search-results { max-height: 50vh; overflow-y: auto; }
.search-results .sr {
  display: flex; align-items: baseline; gap: 14px; width: 100%; text-align: left;
  padding: 13px 18px; border-bottom: 1px solid var(--line-light);
}
.search-results .sr:hover, .search-results .sr:focus-visible { background: var(--paper-100); }
.sr-kind { flex: 0 0 110px; font-size: 13px; color: var(--wine); font-weight: 600; }
.sr-text b { display: block; font-family: var(--display); font-size: 18px; font-weight: 500; }
.sr-text span { font-size: 14px; color: var(--ink-soft); }
.sr-empty { padding: 24px 18px; color: var(--ink-soft); font-size: 15px; }

/* ============================================================
   ГЛАВНЫЙ ЭКРАН
   ============================================================ */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1000px 520px at 85% 10%, rgba(123, 47, 50, .32), transparent 70%),
    var(--ink-700);
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.skyline {
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 38%;
  color: rgba(216, 180, 114, .16);
}

.hero-inner {
  position: relative; z-index: 2;
  max-width: var(--max); margin: auto;
  padding: clamp(48px, 7vw, 88px) var(--pad) 40px;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 5vw, 64px); align-items: center;
}
.hero h1 {
  font-size: clamp(40px, 5.6vw, 72px); line-height: 1.04; letter-spacing: -.02em;
  font-weight: 500; max-width: 13ch; color: var(--paper-50);
}
.hero-lead { margin-top: 20px; max-width: 50ch; color: var(--cream-soft); font-size: clamp(16px, 1.25vw, 19px); }

.hero-search {
  display: flex; align-items: center; gap: 10px;
  margin-top: 32px; padding: 6px 6px 6px 16px; max-width: 540px;
  border-radius: var(--r-md); background: var(--paper-50);
}
.hero-search:focus-within { box-shadow: 0 0 0 3px rgba(216, 180, 114, .45); }
.hero-search > .ico { color: var(--wine); width: 20px; height: 20px; }
.hero-search input {
  flex: 1; min-width: 0; background: none; border: 0; outline: none;
  color: var(--ink); font-family: var(--sans); font-size: 16px;
}
.hero-search input::placeholder { color: #8C8075; }
.hero-search .btn { min-height: 44px; padding: 0 20px; background: var(--wine); color: #fff; }
.hero-search .btn:hover { background: #8E383C; }

.hero-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.hero-chips > span { font-size: 14px; color: var(--cream-dim); margin-right: 2px; }

/* избранное место */
.hero-panel {
  padding: 14px; border-radius: var(--r-lg);
  background: var(--ink-600); border: 1px solid var(--line-dark);
}
.hero-panel-top { display: flex; justify-content: space-between; align-items: center; margin: 2px 4px 12px; }
.tag { font-size: 14px; font-weight: 500; color: var(--gold); }
.panel-dots { display: flex; gap: 6px; }
.panel-dots button {
  width: 8px; height: 8px; border-radius: 50%; background: rgba(244, 237, 226, .25);
  transition: background .2s;
}
.panel-dots button.on { background: var(--gold); }

/* ---------- «ПЛАСТИНА» С ГРАФИКОЙ ОБЪЕКТА ---------- */
.plate {
  position: relative; overflow: hidden; border-radius: var(--r-md);
  background: linear-gradient(160deg, #5E4E3E 0%, #3E3229 55%, #261E18 100%);
  isolation: isolate;
}
.plate-lg { height: 340px; }
.plate-lg .plate-art { top: 32%; width: 56%; }
.plate-sm { height: 180px; }
.plate-portrait { position: absolute; inset: 0; border-radius: 0; }

.plate-art {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: 76%; height: auto; z-index: 1;
  fill: none; stroke: rgba(246, 232, 205, .6); stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}

.plate-photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1; display: none;
  filter: saturate(.8);
}
.plate-photo.loaded { display: block; }
.plate-photo.loaded ~ .plate-art { display: none; }

.plate-veil {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(to top, rgba(12, 9, 7, .95) 0%, rgba(12, 9, 7, .8) 36%, rgba(12, 9, 7, .2) 64%, transparent 85%);
}
.plate-veil.strong { background: linear-gradient(to top, rgba(12, 9, 7, .97) 25%, rgba(12, 9, 7, .5) 60%, rgba(12, 9, 7, .1) 100%); }

.plate-caption { position: absolute; z-index: 3; left: 20px; right: 20px; bottom: 18px; }
.plate-caption small { display: block; font-size: 13.5px; color: #D9BE92; }
.plate-caption strong {
  display: block; margin-top: 2px;
  font-family: var(--display); font-size: clamp(24px, 2.4vw, 30px); font-weight: 500; color: #fff;
}
.plate-caption p { margin-top: 6px; font-size: 14.5px; color: #DCD2C6; max-width: 44ch; }

.plate-link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
  font-size: 15px; font-weight: 600; color: var(--gold);
  text-decoration: underline; text-decoration-color: rgba(216, 180, 114, .4); text-underline-offset: 4px;
}
.plate-link:hover { text-decoration-color: var(--gold); }
.plate-link .ico { width: 16px; height: 16px; }

/* ---------- цифры ---------- */
.hero-stats {
  position: relative; z-index: 2;
  max-width: var(--max); margin: 0 auto; padding: 8px var(--pad) 48px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.stat { padding-top: 16px; border-top: 1px solid var(--line-dark); }
.stat b {
  display: block; font-family: var(--display); font-size: clamp(28px, 2.6vw, 36px);
  font-weight: 500; color: var(--gold); line-height: 1;
}
.stat span { display: block; margin-top: 8px; font-size: 14px; color: var(--cream-dim); max-width: 24ch; }

/* ============================================================
   СЕКЦИИ
   ============================================================ */
.section { padding: clamp(56px, 7vw, 96px) var(--pad); }
.section.light { background: var(--paper-50); color: var(--ink); }
.section.paper { background: var(--paper-100); color: var(--ink); }
.section.dark { background: var(--ink-700); color: var(--cream); }
.section.darker { background: var(--ink-800); color: var(--cream); }
.container { max-width: var(--max); margin: auto; }

.section-head { max-width: 760px; margin-bottom: clamp(28px, 4vw, 44px); }
.section h2 { font-size: clamp(30px, 3.4vw, 44px); }
.section.dark h2, .section.darker h2 { color: var(--paper-50); }
.section-sub { margin-top: 12px; font-size: 17px; color: var(--ink-soft); max-width: 62ch; }
.section.dark .section-sub, .section.darker .section-sub, .legends .section-sub { color: var(--cream-dim); }
.section-sub.wide { max-width: 56ch; margin-top: 16px; }

/* ---------- РАЗДЕЛЫ НА ГЛАВНОЙ ---------- */
.categories { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.category {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 250px; padding: 26px 26px 24px;
  background: #fff; border: 1px solid var(--line-light); border-top: 4px solid var(--tone);
  border-radius: var(--r-md);
  transition: box-shadow .25s, border-color .25s;
}
.category > * { position: relative; z-index: 2; }
.category:hover { box-shadow: var(--shadow-soft); border-color: var(--tone); }
.cat-ico {
  width: 30px; height: 30px; color: var(--tone);
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.category h3 { font-size: 25px; margin-top: 18px; color: var(--ink); }
.category p { margin-top: 8px; font-size: 15.5px; color: var(--ink-soft); max-width: 40ch; }
.category-link {
  display: inline-flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 20px;
  font-size: 15px; font-weight: 600; color: var(--tone);
}
.category-link .ico { width: 16px; height: 16px; transition: transform .2s; }
.category:hover .category-link { text-decoration: underline; text-underline-offset: 4px; }
.category:hover .category-link .ico { transform: translateX(3px); }
.cat-art {
  position: absolute; z-index: 1; right: -18px; bottom: -22px;
  width: 210px; height: auto; pointer-events: none;
  fill: none; stroke: var(--tone); stroke-width: 1.3;
  stroke-linecap: round; stroke-linejoin: round; opacity: .1;
}

.map-banner {
  margin-top: 20px; padding: 22px 26px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  border-radius: var(--r-md); background: var(--paper-100); border: 1px solid var(--line-light);
  color: var(--ink); transition: border-color .25s;
}
.map-banner:hover { border-color: var(--forest); }
.map-banner-ico {
  width: 46px; height: 46px; padding: 11px; border-radius: 50%;
  background: var(--forest); color: #fff;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.map-banner-text { flex: 1 1 320px; }
.map-banner-text b { display: block; font-family: var(--display); font-size: 22px; font-weight: 500; }
.map-banner-text span { font-size: 15px; color: var(--ink-soft); }
.map-banner:hover .btn-dark { background: var(--forest); }

/* ---------- ХРОНОЛОГИЯ ---------- */
.era-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 28px; }
.era {
  padding: 9px 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line-dark);
  font-size: 15px; font-weight: 500; color: var(--cream-soft);
  transition: color .2s, border-color .2s, background .2s;
}
.era:hover { color: #fff; border-color: rgba(216, 180, 114, .5); }
.era.active { background: var(--gold); border-color: var(--gold); color: #1A140D; }

.timeline-list {
  position: relative; padding-left: 30px;
  max-height: 360px; overflow: hidden;
  transition: max-height .6s var(--ease);
}
.timeline-list::before {
  content: ""; position: absolute; left: 5px; top: 10px; bottom: 0; width: 1px;
  background: rgba(216, 180, 114, .4);
}
.timeline-list.expanded { max-height: 3200px; }
.timeline-list::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px;
  background: linear-gradient(to top, var(--ink-700), transparent);
  pointer-events: none; transition: opacity .4s;
}
.timeline-list.expanded::after { opacity: 0; }

.timeline-row {
  position: relative;
  display: grid; grid-template-columns: 150px 1fr; column-gap: 24px;
  padding: 16px 0; border-bottom: 1px solid rgba(244, 237, 226, .07);
}
.timeline-row::before {
  content: ""; position: absolute; left: -29px; top: 25px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ink-700); border: 2px solid var(--gold);
}
.timeline-row:hover::before { background: var(--gold); }
.timeline-row.is-hidden { display: none; }
.timeline-year { grid-row: span 2; font-family: var(--display); font-size: 20px; color: var(--gold); line-height: 1.4; }
.timeline-row h3 { font-size: 21px; color: var(--paper-50); }
.timeline-row h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.timeline-row p { margin-top: 4px; font-size: 15.5px; color: var(--cream-dim); max-width: 70ch; }

/* ---------- БЫЛО — СТАЛО ---------- */
.compare-wrap { display: grid; grid-template-columns: 1.4fr .6fr; gap: 32px; align-items: start; }

.compare {
  position: relative; overflow: hidden; border-radius: var(--r-md);
  width: 100%; aspect-ratio: 16 / 10;
  cursor: ew-resize; outline: none;
  user-select: none; -webkit-user-select: none;
  touch-action: pan-y;
}
.compare:focus-visible { box-shadow: 0 0 0 3px var(--wine); }
.compare-side {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, #7A867E 0%, #4D5852 55%, #2C332F 100%);
}
.compare-side .plate-art {
  position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%);
  width: 70%; height: auto;
  fill: none; stroke: rgba(255, 252, 245, .7); stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.compare-old {
  z-index: 2; clip-path: inset(0 50% 0 0);
  background: linear-gradient(160deg, #8A755B 0%, #5A4939 55%, #2E251D 100%);
  filter: sepia(.4);
}
.compare-old .plate-art { stroke: rgba(255, 238, 206, .8); }
.compare-badge {
  position: absolute; top: 12px; left: 12px; z-index: 4;
  font-size: 13.5px; font-weight: 600;
  padding: 5px 10px; border-radius: var(--r-sm);
  background: rgba(12, 9, 7, .7); color: #F2E7D6;
}
.compare-new .compare-badge { left: auto; right: 12px; }

.compare-handle {
  position: absolute; top: 0; bottom: 0; left: 50%; z-index: 5;
  width: 44px; transform: translateX(-50%);
  display: grid; place-items: center; pointer-events: none;
}
.handle-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #F6E8CD; }
.handle-grip {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--paper-50); color: var(--ink);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.handle-grip .ico { width: 22px; height: 22px; }

.compare-side-panel { display: flex; flex-direction: column; gap: 24px; }
.compare-meta small { font-size: 14px; font-weight: 500; color: var(--wine); }
.compare-meta h3 { font-size: clamp(24px, 2.4vw, 32px); margin-top: 4px; }
.compare-meta p { margin-top: 10px; font-size: 15.5px; color: var(--ink-soft); }

.compare-picker { display: grid; border-top: 1px solid var(--line-light); }
.compare-picker::before { content: "Другие места"; display: block; padding: 14px 0 6px; font-size: 13.5px; color: var(--ink-soft); }
.cp-item {
  display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left;
  padding: 10px 14px; border-left: 3px solid transparent;
  font-size: 15.5px; font-weight: 500; color: var(--ink);
  transition: background .2s, border-color .2s;
}
.cp-item:hover { background: var(--paper-100); }
.cp-item.on { border-left-color: var(--wine); background: var(--paper-100); font-weight: 600; }
.cp-item i { font-style: normal; font-size: 13px; font-weight: 400; color: var(--ink-soft); }

/* ---------- УТРАЧЕННЫЙ МИНСК (лента) ---------- */
.lost-rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(290px, 1fr);
  gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 14px; scrollbar-width: thin; scrollbar-color: rgba(216, 180, 114, .35) transparent;
}
.lost-card {
  position: relative; scroll-snap-align: start;
  border-radius: var(--r-md); overflow: hidden;
  background: var(--ink-600); border: 1px solid var(--line-dark);
  transition: border-color .25s;
}
.lost-card:hover { border-color: rgba(216, 180, 114, .45); }
.lost-card .plate { border-radius: 0; }
.lost-body { padding: 18px 20px 22px; }
.lost-years { font-size: 14px; color: var(--gold); }
.lost-card h3 { font-size: 23px; margin-top: 4px; color: var(--paper-50); }
.lost-card:hover h3 { text-decoration: underline; text-decoration-color: rgba(216, 180, 114, .5); text-underline-offset: 4px; }
.lost-card p { margin-top: 8px; font-size: 15px; color: var(--cream-dim); }

.rail-controls { display: flex; align-items: center; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- МАРШРУТЫ ---------- */
.route-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.route {
  display: flex; flex-direction: column;
  padding: 26px; border-radius: var(--r-md);
  background: #fff; border: 1px solid var(--line-light);
}
.route.featured { background: var(--ink-700); color: var(--cream); border-color: var(--ink-700); }
.route.featured h3 { color: var(--paper-50); }
.route.featured p, .route.featured .route-top { color: var(--cream-dim); }
.route.featured .route-points li { color: var(--cream-soft); }
.route.featured .route-points li::before { background: var(--gold); }
.route.featured .route-btn { color: var(--gold); }

.route-top { display: flex; gap: 16px; font-size: 14px; color: var(--ink-soft); }
.route-top span { display: inline-flex; align-items: center; gap: 6px; }
.route-top .ico { width: 16px; height: 16px; }
.route h3 { font-size: 26px; margin-top: 14px; }
.route p { margin-top: 8px; font-size: 15.5px; color: var(--ink-soft); }
.route-points { display: grid; gap: 4px; margin-top: 16px; }
.route-points li { position: relative; padding-left: 18px; font-size: 14.5px; color: var(--ink); }
.route-points li::before {
  content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%;
  background: var(--wine);
}
.route-btn {
  display: inline-flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 22px;
  font-size: 15px; font-weight: 600; color: var(--wine);
}
.route-btn:hover { text-decoration: underline; text-underline-offset: 4px; }
.route-btn .ico { width: 16px; height: 16px; }

.route-cta {
  margin-top: 20px; padding: 26px 28px;
  border-radius: var(--r-md); background: var(--paper-200);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.route-cta h3 { font-size: clamp(22px, 2vw, 27px); }
.route-cta p { margin-top: 6px; font-size: 15.5px; color: var(--ink-soft); max-width: 58ch; }

/* ---------- ЛЮДИ ---------- */
.people-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; }
.person-main {
  position: relative; min-height: 480px; overflow: hidden;
  border-radius: var(--r-md); background: var(--ink-600);
}
.person-main-content { position: absolute; z-index: 3; inset: auto 28px 26px; }
.person-main-content small { font-size: 14px; color: #CDAE82; }
.person-main-content h3 { font-size: clamp(32px, 3.4vw, 44px); margin-top: 4px; color: #fff; }
.person-main-content p { margin-top: 8px; font-size: 15.5px; color: #D5CAC0; max-width: 46ch; }

.people-list { display: flex; flex-direction: column; border-top: 1px solid var(--line-dark); }
.person-item {
  flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 16px 6px; border-bottom: 1px solid var(--line-dark);
  transition: background .2s;
}
.person-item:hover { background: rgba(255, 255, 255, .03); }
.person-item b { display: block; font-family: var(--display); font-size: 21px; font-weight: 500; color: var(--paper-50); }
.person-item i { font-style: normal; font-size: 14px; color: var(--cream-dim); }
.person-item .ico { color: var(--gold); transition: transform .2s; }
.person-item:hover b { text-decoration: underline; text-decoration-color: rgba(216, 180, 114, .5); text-underline-offset: 4px; }
.person-item:hover .ico { transform: translateX(3px); }
.person-item.accent b { color: var(--gold); }

/* ---------- ЛЕГЕНДЫ ---------- */
.legends { background: var(--ink-800); color: var(--cream); }
.legend-box { position: relative; max-width: 860px; margin: auto; }
.legend-quote { display: block; width: 40px; height: 40px; fill: var(--gold); opacity: .6; margin-bottom: 16px; }
.legend-track { position: relative; min-height: 200px; }
.legend {
  position: absolute; inset: 0; opacity: 0;
  transition: opacity .4s; pointer-events: none;
}
.legend.active { opacity: 1; position: relative; pointer-events: auto; }
.legend p {
  font-family: var(--display); font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.35; color: var(--paper-50); font-style: italic; font-weight: 400;
}
.legend footer { margin-top: 20px; }
.legend footer b { display: block; font-size: 16px; font-weight: 600; color: var(--gold); }
.legend footer span { font-size: 14.5px; color: var(--cream-dim); }

.legend-nav { display: flex; align-items: center; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.legend-dots { display: flex; gap: 6px; }
.legend-dots button { width: 8px; height: 8px; border-radius: 50%; background: rgba(244, 237, 226, .25); }
.legend-dots button.on { background: var(--gold); }

/* ---------- ИНСТРУМЕНТЫ ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.tool {
  display: flex; flex-direction: column;
  padding: 24px; border-radius: var(--r-md);
  background: #fff; border: 1px solid var(--line-light);
}
.tool-ico {
  width: 30px; height: 30px; color: var(--wine);
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.tool h3 { font-size: 22px; margin-top: 16px; }
.tool p { margin-top: 8px; font-size: 15px; color: var(--ink-soft); }
.tool a {
  display: inline-flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 18px;
  font-size: 15px; font-weight: 600; color: var(--wine);
}
.tool a:hover { text-decoration: underline; text-underline-offset: 4px; }
.tool a .ico { width: 16px; height: 16px; }

/* ---------- СВЕЧА ПАМЯТИ ---------- */
.candle-section {
  position: relative; overflow: hidden;
  padding: clamp(56px, 7vw, 96px) var(--pad);
  background: var(--ink-900);
}
.candle-glow {
  position: absolute; left: 18%; top: 50%; transform: translate(-50%, -50%);
  width: 520px; height: 520px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(216, 150, 67, .16), transparent 75%);
}

.candle {
  position: relative; max-width: var(--max); margin: auto;
  display: grid; grid-template-columns: 240px 1fr; gap: clamp(28px, 5vw, 64px); align-items: start;
}
.candle-left { text-align: center; padding-top: 6px; }
.flame { color: var(--gold); display: grid; place-items: center; }
.flame svg {
  width: 88px; height: 88px; fill: none; stroke: currentColor; stroke-width: 1.2;
  animation: flicker 3.2s ease-in-out infinite; transform-origin: bottom center;
}
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-1deg); }
  45% { transform: scale(1.06) rotate(1deg); }
}
.flame.pop svg { animation: pop .8s var(--ease); }
@keyframes pop { 40% { transform: scale(1.25); } }
.candle-count { margin-top: 14px; }
.candle-count b {
  display: block; font-family: var(--display); font-size: clamp(34px, 3.6vw, 48px);
  font-weight: 500; color: var(--gold); line-height: 1;
}
.candle-count span { display: block; margin-top: 6px; font-size: 14.5px; color: var(--cream-dim); }

.candle-right h2 { font-size: clamp(30px, 3.4vw, 44px); color: var(--paper-50); }
.candle-right > p { margin-top: 12px; font-size: 16.5px; color: var(--cream-soft); max-width: 58ch; }
.candle-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; max-width: 640px; }
.candle-form input {
  flex: 1 1 260px; min-width: 0; height: 48px; padding: 0 16px;
  border-radius: var(--r-sm); border: 1px solid rgba(244, 237, 226, .22);
  background: var(--ink-700); color: var(--cream);
  font-family: var(--sans); font-size: 16px; outline: none;
}
.candle-form input::placeholder { color: var(--cream-dim); }
.candle-form input:focus { border-color: var(--gold); }
.candle-note { margin-top: 10px; font-size: 15px; color: var(--gold); min-height: 22px; }

.candle-wall {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px;
  padding-top: 20px; border-top: 1px solid var(--line-dark);
}
.cw-hint { font-size: 14.5px; color: var(--cream-dim); }
.cw-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: var(--r-sm);
  background: rgba(216, 180, 114, .1);
  font-size: 14.5px; color: #EADCC4;
  animation: lightUp .4s var(--ease);
}
@keyframes lightUp { from { opacity: 0; } }
.cw-item .ico { width: 14px; height: 14px; color: var(--gold); }

/* ---------- ДОБАВИТЬ ИСТОРИЮ ---------- */
.contribute { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 5vw, 64px); align-items: start; }
.contribute h2 { font-size: clamp(30px, 3.4vw, 44px); }
.contribute-list { margin-top: 24px; display: grid; gap: 10px; }
.contribute-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 16px; color: var(--ink); }
.contribute-list .ico { color: var(--forest); width: 20px; height: 20px; margin-top: 2px; }

.story-form {
  padding: clamp(22px, 3vw, 32px); border-radius: var(--r-md);
  background: #fff; border: 1px solid var(--line-light);
  display: grid; gap: 18px;
}
.field { display: grid; gap: 6px; }
.field label { font-size: 15px; font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--r-sm);
  border: 1px solid rgba(34, 28, 23, .25); background: #fff; color: var(--ink);
  font-family: var(--sans); font-size: 16px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--wine); box-shadow: 0 0 0 3px var(--wine-soft);
}
.field.invalid input, .field.invalid textarea { border-color: #B03A3A; }
.err { font-size: 14px; color: #B03A3A; }
.form-status { font-size: 15px; color: var(--forest); font-weight: 600; min-height: 22px; }
.story-form .btn { justify-self: start; }

/* ---------- ПОДВАЛ ---------- */
.footer { background: var(--ink-900); color: var(--cream-dim); padding: clamp(48px, 6vw, 72px) var(--pad) 24px; border-top: 1px solid var(--line-dark); }
.footer-grid { max-width: var(--max); margin: auto; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand { font-family: var(--display); font-size: 24px; color: var(--paper-50); }
.footer-about p { margin-top: 10px; font-size: 15px; max-width: 42ch; }
.footer a.footer-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
  font-size: 15px; font-weight: 600; color: var(--gold);
}
.footer a.footer-cta:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer h4 { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--paper-100); margin-bottom: 12px; }
.footer a { display: block; font-size: 15px; margin-bottom: 8px; transition: color .2s; }
.footer-grid > div:not(.footer-about) a:hover { color: var(--paper-50); text-decoration: underline; text-underline-offset: 4px; }
.footer-bottom {
  max-width: var(--max); margin: 40px auto 0; padding-top: 18px;
  border-top: 1px solid var(--line-dark);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: 13.5px; color: #7A7067;
}

/* ---------- НАВЕРХ ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 900;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper-50); color: var(--ink);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.to-top.show { opacity: 1; visibility: visible; }

/* ---------- ПОЯВЛЕНИЕ ---------- */
.reveal:not(.in) { opacity: 0; }
/* сама анимация появления — в motion.css */

/* ---------- кликабельные карточки ---------- */
.stretched::after { content: ""; position: absolute; inset: 0; z-index: 3; }
.pill-btn.inline { margin-top: 0; margin-left: auto; }

.photo-credit {
  position: absolute; right: 8px; bottom: 6px; z-index: 3; max-width: 90%;
  padding: 1px 7px; border-radius: 4px; font: 400 11px/1.5 var(--sans);
  color: rgba(255, 255, 255, .85); background: rgba(10, 7, 5, .6);
  pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */
@media (max-width: 1320px) {
  .brand-text small { display: none; }
  .header-cta span { display: none; }
  .header-cta { padding: 0 12px; }
  .header-inner { gap: 18px; }
}

@media (max-width: 1080px) {
  .nav { display: none; }
  .burger { display: grid; }
  .header-actions { margin-left: auto; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-panel { max-width: 640px; }
  .compare-wrap { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .categories { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .route-grid { grid-template-columns: 1fr; }
  .people-grid { grid-template-columns: 1fr; }
  .person-main { min-height: 400px; }
  .contribute { grid-template-columns: 1fr; }
  .candle { grid-template-columns: 1fr; }
  .candle-left { display: flex; align-items: center; gap: 20px; text-align: left; }
  .candle-count { margin-top: 0; }
  .flame svg { width: 64px; height: 64px; }
  .candle-glow { left: 10%; top: 20%; }
  .timeline-row { grid-template-columns: 1fr; }
  .timeline-year { grid-row: auto; font-size: 17px; }
}

@media (max-width: 620px) {
  :root { --header-h: 58px; }
  .header-link span { display: none; }
  .header-link { padding: 0 10px; }
  .header-actions { gap: 2px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-text { font-size: 14.5px; white-space: normal; max-width: 120px; line-height: 1.1; }
  .header-link[href="map.html"], .header-cta { display: none; }
  .compare { aspect-ratio: 5 / 4; }
  .hero-search { flex-wrap: wrap; padding: 10px; }
  .hero-search > .ico { display: none; }
  .hero-search input { flex: 1 1 100%; padding: 6px 4px; }
  .hero-search .btn { width: 100%; }
  .hero-stats { gap: 18px; padding-bottom: 36px; }
  .plate-lg { height: 280px; }
  .categories, .tools-grid { grid-template-columns: 1fr; }
  .category { min-height: 0; }
  .lost-rail { grid-auto-columns: 86%; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .search-overlay { padding-top: 4vh; padding-left: 10px; padding-right: 10px; }
  .search-field input { font-size: 17px; }
  .sr-kind { flex-basis: 84px; }
  .legend-track { min-height: 250px; }
  .to-top { right: 12px; bottom: 12px; }
  .pill-btn.inline { margin-left: 0; }
  .pn-label { display: none; }
  .map-banner { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal:not(.in) { opacity: 1; }
}
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.light :focus-visible, .paper :focus-visible, .page-nav :focus-visible, .search-box :focus-visible { outline-color: var(--wine); }
