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

:root {
  --r-lg: 32px;
  --r-md: 26px;
  --r-sm: 16px;
  --r-pill: 999px;
  --soft-line: rgba(34, 28, 23, .07);
  --soft-shadow: 0 1px 2px rgba(20, 14, 8, .04), 0 10px 30px -12px rgba(20, 14, 8, .14);
  --curve: 44px;
}

/* ============================================================
   БЛОКИ НАПЛЫВАЮТ ДРУГ НА ДРУГА СКРУГЛЁННЫМИ КРАЯМИ
   ============================================================ */
.hero, .cat-hero { z-index: 0; }
.hero-stats { padding-bottom: calc(48px + var(--curve)); }
.cat-hero-inner { padding-bottom: calc(clamp(44px, 5vw, 64px) + var(--curve)); }
.cat-hero.compact .cat-hero-inner { padding-bottom: calc(36px + var(--curve)); }

.section, .candle-section, .map-section, .footer {
  position: relative; z-index: 1;
  margin-top: calc(var(--curve) * -1);
  border-radius: var(--curve) var(--curve) 0 0;
  box-shadow: 0 -18px 40px -24px rgba(0, 0, 0, .35);
}
.section { padding-top: clamp(76px, 8vw, 116px); padding-bottom: calc(clamp(56px, 7vw, 96px) + var(--curve)); }
.candle-section { padding-bottom: calc(clamp(56px, 7vw, 96px) + var(--curve)); }
.footer { padding-top: clamp(60px, 7vw, 88px); }
.map-section { overflow: hidden; border-bottom: 0; padding-bottom: var(--curve); }
.map-layout { height: calc(100vh - var(--header-h) - var(--curve)); }

/* ============================================================
   ШАПКА
   ============================================================ */
.brand-mark { border-radius: 14px; }
.nav { align-items: center; gap: 2px; }
.nav-item { height: 38px; padding: 0 12px; border-radius: var(--r-pill); transition: background .35s, color .3s; }
.nav-item::after { display: none; }
.nav-item:hover { background: rgba(255, 255, 255, .06); }
.nav-item.active { background: rgba(216, 180, 114, .14); color: #F3DDB1; }
.header-link, .header-cta { border-radius: var(--r-pill); }
.header-cta { padding: 0 18px; }
.icon-btn { border-radius: 50%; }
.mobile-menu { border-radius: 0 0 var(--r-lg) var(--r-lg); bottom: auto; max-height: calc(100vh - var(--header-h)); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7); }
.mobile-menu a { border-bottom: 0; padding: 12px 16px; margin: 0 -16px; border-radius: var(--r-sm); }
.mobile-menu a:hover, .mobile-menu a[aria-current="page"] { background: rgba(255, 255, 255, .05); }
.mobile-menu .mm-cta { border-radius: var(--r-pill); margin: 20px 0 0; }

/* «На этой странице» — плавающая капсула */
.page-nav {
  height: 0; background: none; border: 0; box-shadow: none !important;
  z-index: 950; pointer-events: none;
}
.page-nav-inner {
  pointer-events: auto;
  width: fit-content; max-width: calc(100% - 24px);
  margin: 14px auto 0; padding: 5px;
  border-radius: var(--r-pill);
  background: rgba(247, 242, 232, .82);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 0 0 1px rgba(34, 28, 23, .06), 0 14px 34px -14px rgba(20, 14, 8, .45);
  gap: 2px;
}
.pn-label { padding: 0 8px 0 12px; margin-right: 0; }
.page-nav a { position: relative; z-index: 1; padding: 8px 15px; border-radius: var(--r-pill); transition: color .35s; }
.page-nav a:hover { background: rgba(34, 28, 23, .05); }
.page-nav a.active { color: #fff; }
.page-nav a.active::after { display: none; }
body:not(.has-ind) .page-nav a.active { background: var(--tone, var(--wine)); }
.pn-ind {
  top: 5px; bottom: 5px; height: auto; border-radius: var(--r-pill);
  background: var(--tone, var(--wine));
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--tone, var(--wine)) 80%, transparent);
  z-index: 0;
}

/* ============================================================
   КНОПКИ, ЧИПЫ, МЕТКИ — «таблетки»
   ============================================================ */
.btn, .pill-btn, .chip, .era, .f-btn, .act-btn, .myth-q button, .cf-btn,
.orn-presets button, .orn-colors button, .link-pill, .builder-actions .btn, .orn-actions .btn {
  border-radius: var(--r-pill);
}
.btn { padding: 0 26px; }
.tag, .tag-sm, .p-tags span, .pm-meta span, .pm-works li, .unesco-badge, .verdict, .lr-status,
.bld-style, .compare-badge, .cw-item, .m-btn.now::after, .sr-kind {
  border-radius: var(--r-pill);
}
.tag-sm, .verdict, .lr-status, .bld-style, .unesco-badge { padding: 4px 12px; }
.compare-badge { padding: 6px 14px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); background: rgba(12, 9, 7, .55); }
.pl-btn { border-radius: 50%; }
.myth-q { gap: 8px; }

/* поля ввода */
.hero-search { border-radius: var(--r-pill); padding: 6px 6px 6px 22px; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .6); }
.hero-search .btn { border-radius: var(--r-pill); padding: 0 26px; }
.field input, .field select { border-radius: var(--r-sm); border-color: rgba(34, 28, 23, .16); background: #FDFBF7; }
.field textarea { border-radius: 20px; border-color: rgba(34, 28, 23, .16); background: #FDFBF7; }
.candle-form input, .mini-search { border-radius: var(--r-pill); }
.candle-form input { padding: 0 22px; }
.search-box { border-radius: var(--r-lg); }
.search-field { padding: 16px 16px 16px 24px; }
.search-results .sr { border-bottom: 0; margin: 2px 8px; border-radius: var(--r-sm); width: calc(100% - 16px); }
.search-results { padding-bottom: 8px; }
.search-hints { border-bottom: 0; padding: 4px 22px 14px; }
.search-field { border-bottom-color: rgba(34, 28, 23, .08); }

/* ============================================================
   КАРТОЧКИ
   ============================================================ */
.category, .tool, .route, .rel-card, .theory, .craft, .story-form, .quiz-bar, .feast,
.mem-card, .bld-card, .myth-front, .map-banner, .route-cta, .cta-strip {
  border-radius: var(--r-md);
  border: 1px solid var(--soft-line);
  box-shadow: var(--soft-shadow);
}
.category, .rel-card, .theory {
  border-top-width: 1px; border-top-color: var(--soft-line);
  background: linear-gradient(165deg, color-mix(in srgb, var(--tone) 9%, #fff) 0%, #fff 55%);
}
.category:hover, .rel-card:hover { border-color: color-mix(in srgb, var(--tone) 30%, transparent); }

/* иконка в мягком круге */
.cat-ico, .rel-ico, .tool-ico {
  box-sizing: content-box; padding: 13px; border-radius: 50%;
  background: color-mix(in srgb, var(--tone, var(--wine)) 12%, #fff);
}
.cat-ico, .rel-ico { width: 26px; height: 26px; }
.tool-ico { width: 26px; height: 26px; color: var(--wine); background: rgba(123, 47, 50, .09); }
.category h3 { margin-top: 20px; }
.cat-art, .rel-art { opacity: .08; }

.map-banner { background: linear-gradient(120deg, rgba(60, 90, 75, .12), var(--paper-50) 60%); border-radius: var(--r-lg); padding: 22px 26px 22px 22px; }
.route-cta, .cta-strip { border-radius: var(--r-lg); background: linear-gradient(120deg, var(--paper-200), var(--paper-100)); }

/* тёмные карточки */
.lost-card, .lost-row, .story, .p-card, .date-card, .person-main, .hero-panel, .next-date, .mem-candle, .builder, .rc, .progress-box, .lr-now, .modal-box {
  border-radius: var(--r-md);
}
.lost-card, .lost-row, .story, .p-card { border-color: rgba(244, 237, 226, .07); background: linear-gradient(170deg, #241D17, var(--ink-600)); }
.hero-panel { border-radius: var(--r-lg); padding: 12px; background: rgba(32, 26, 21, .7); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.modal-box { border-radius: var(--r-lg); }
.next-date { border-radius: var(--r-lg); background: linear-gradient(120deg, #8A3539, var(--wine) 50%, #5E2326); box-shadow: 0 24px 50px -24px rgba(123, 47, 50, .9); }
.mem-candle { border-radius: var(--r-pill); padding: 16px 18px 16px 26px; }
.date-card { border-radius: 22px; }

/* картинки — во вставной рамке и с аркой сверху */
.plate { border-radius: 22px; }
.plate-lg { border-radius: 180px 180px 22px 22px; }
.plate-lg .plate-art { top: 36%; }
.lost-card .plate { border-radius: 90px 90px 18px 18px; margin: 10px 10px 0; }
.lost-card .plate-sm { height: 170px; }
.mem-card .mini-plate, .bld-card .mini-plate { margin: 10px 10px 0; border-radius: 20px; }
.story .mini-plate, .lost-row .mini-plate { margin: 10px; border-radius: 20px; min-height: calc(100% - 20px); }
.lost-row { grid-template-columns: 300px 1fr; }
.story { grid-template-columns: 340px 1fr; }
.person-main { border-radius: 220px 220px var(--r-md) var(--r-md); }
.craft-orn { margin: 10px 10px 0; border-radius: 18px; border-bottom: 0; }
.compare { border-radius: var(--r-lg); }
.compare-side { border-radius: inherit; }

/* внутренние плашки */
.mem-facts, .bld-detail, .lr-now { border-radius: 18px; }
.mem-foot { border-top-color: rgba(34, 28, 23, .07); }
.style-panel {
  border-left: 0; border-radius: var(--r-lg);
  background: linear-gradient(120deg, color-mix(in srgb, var(--c, var(--tone)) 14%, var(--paper-100)), var(--paper-100) 60%);
}
.sp-signs li::before { border-radius: 50%; transform: none; }
.note { border-left: 0; padding: 16px 22px; border-radius: 20px; background: color-mix(in srgb, var(--tone) 8%, var(--paper-50)); }
.pm-fact { border-left: 0; border-radius: 20px; }
.story blockquote { border-left: 0; padding: 14px 20px; border-radius: 18px; background: rgba(216, 180, 114, .07); }

/* шкалы и плитки */
.st-btn { border-top: 1px solid var(--soft-line); border-radius: 20px; padding: 14px 16px; box-shadow: var(--soft-shadow); }
.st-btn small::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%;
  background: var(--c); vertical-align: 1px;
}
.st-btn.on small::before { background: #fff; }
.m-btn { border-radius: 20px; border-color: var(--soft-line); box-shadow: var(--soft-shadow); }
.m-btn.now::after { padding: 2px 8px; }
.feast { border-radius: var(--r-md); }
.feast.none { border-radius: var(--r-md); }

/* «Было — стало»: список мест */
.compare-picker { border-top: 0; gap: 4px; }
.cp-item { border-left: 0; border-radius: 18px; padding: 10px 18px; }
.cp-item.on { background: var(--ink-700); color: var(--cream); }
.cp-item.on i { color: var(--cream-dim); }

/* люди на главной */
.people-list { border-top: 0; gap: 4px; }
.person-item { border-bottom: 0; border-radius: 20px; padding: 14px 18px; background: rgba(255, 255, 255, .025); }
.person-item:hover { padding-left: 26px; background: rgba(216, 180, 114, .08); }
.person-item.accent { background: rgba(123, 47, 50, .25); }

/* хронология */
.timeline-row { border-bottom: 0; border-radius: 20px; padding: 16px 18px; margin-left: -18px; }
.timeline-row:hover { background: rgba(255, 255, 255, .03); }
.timeline-row::before { left: -11px; }

/* кухня и ЮНЕСКО — мягкие плитки вместо линеек */
.food-grid { gap: 16px; }
.dish { border-top: 0; padding: 22px 24px; border-radius: var(--r-md); background: #fff; box-shadow: var(--soft-shadow); }
.unesco-line { gap: 16px; }
.un-item { border-top: 0; padding: 22px 24px; border-radius: var(--r-md); background: rgba(255, 255, 255, .035); }
.steps { gap: 16px; border-top: 0; }
.step, .step + .step { padding: 24px; border: 0; border-radius: var(--r-md); background: #fff; box-shadow: var(--soft-shadow); }
.step h3::before { width: 36px; height: 6px; border-radius: 6px; }

/* цифры в шапках разделов */
.cat-stats { gap: 8px; }
.cat-stats > div, .cat-stats > div:last-child {
  border: 0; border-radius: 20px; padding: 12px 18px;
  background: rgba(255, 255, 255, .045);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.stat { border-top: 0; padding: 18px 20px; border-radius: 22px; background: rgba(255, 255, 255, .035); }

/* свеча */
.candle-wall { border-top: 0; padding-top: 4px; }
.flame { width: 140px; height: 140px; margin: 0 auto; border-radius: 50%; background: radial-gradient(circle, rgba(216, 150, 67, .16), transparent 70%); }

/* ============================================================
   КАРТА
   ============================================================ */
.map-side { border-right: 0; }
.map-tabs { margin: 14px 14px 0; padding: 4px; border: 0; border-radius: var(--r-pill); background: var(--ink-600); }
.map-tabs button { border-bottom: 0; margin: 0; border-radius: var(--r-pill); padding: 10px; transition: background .35s, color .3s; }
.map-tabs button.on { background: var(--paper-50); color: var(--ink); }
.pl-item { border-bottom: 0; border-radius: 14px; padding: 7px 6px 7px 12px; }
.rc { border-left: 1px solid var(--line-dark); border-radius: 20px; }
.rc.on { border-color: var(--gold); }
.map-wrap { margin: 14px 14px 14px 0; border-radius: var(--r-lg); overflow: hidden; }
.map { border-radius: inherit; }
.route-info { border-radius: 24px; }
.map-fit { border-radius: 50%; }
.leaflet-bar { border-radius: 16px !important; overflow: hidden; border: 0 !important; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5) !important; }
.leaflet-popup-content-wrapper { border-radius: 22px; }
.pp-actions button, .pp-actions a { border-radius: var(--r-pill); padding: 7px 12px; }

/* ============================================================
   ПОДВАЛ
   ============================================================ */
.footer { border-top: 0; }
.footer-bottom { border-top-color: rgba(244, 237, 226, .07); }

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */
@media (max-width: 860px) {
  :root { --curve: 32px; }
  .lost-row, .story { grid-template-columns: 1fr; }
  .story .mini-plate, .lost-row .mini-plate { min-height: 170px; margin-bottom: 0; }
  .map-wrap { margin: 12px 12px 0; }
  .map-layout { height: auto; }
  .person-main { border-radius: 160px 160px var(--r-md) var(--r-md); }
  .unesco-line, .food-grid { gap: 12px; }
}
@media (max-width: 620px) {
  :root { --curve: 26px; --r-md: 22px; --r-lg: 26px; }
  .plate-lg { border-radius: 120px 120px 20px 20px; }
  .mem-candle { border-radius: var(--r-md); }
  .page-nav-inner { max-width: calc(100% - 20px); margin-top: 10px; }
  .timeline-row { margin-left: -12px; padding: 14px 12px; }
  .hero-search { border-radius: 26px; padding: 8px; }
  .hero-search input { padding: 8px 12px; }
}
.header-inner { gap: 20px; }
.header-actions { gap: 4px; }
@media (max-width: 1400px) { .nav-item { padding: 0 10px; font-size: 14.5px; } .header-link { padding: 0 10px; } }
@media (max-width: 1200px) {
  .nav { display: none; }
  .burger { display: grid; }
}
@media (max-width: 1260px) { .nav-item { padding: 0 8px; } .header-inner { gap: 14px; } }
.page-nav + .section { padding-top: clamp(112px, 10vw, 148px); }
