:root {
  /* Тёплая нейтральная база: чуть подкрашена в сторону акцента */
  --bg: #0b0a09;
  --bg-soft: #100e0c;
  --text: #f4f1ea;
  --text-muted: rgba(244, 241, 234, 0.66);
  --text-subtle: rgba(244, 241, 234, 0.44);

  /* Один сигнальный акцент: цвет дорожного знака и шлагбаума */
  --accent: #e2a03f;
  --accent-rgb: 226, 160, 63;
  --accent-hi: #f2b862;
  --accent-hi-rgb: 242, 184, 98;

  /* Зелёный остаётся опознавательным знаком продукта «Мой поселок» */
  --accent-green: #8aada0;
  --accent-green-rgb: 138, 173, 160;

  /* Совместимость со старой разметкой */
  --accent-blue: var(--accent);
  --accent-blue-rgb: var(--accent-rgb);

  --panel-bg: #0c0b0a;
  --divider: rgba(244, 241, 234, 0.1);
  --hairline: rgba(244, 241, 234, 0.14);

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-ui: var(--ease-out-quart);
  --transition-panel: 0.55s var(--ease-ui);
  --transition-micro: 0.2s var(--ease-out-quart);

  /* Единая моторика: раскрытие списков и переходы между страницами
     используют одну кривую и один сдвиг по вертикали. */
  --transition-collapse: 0.34s var(--ease-ui);
  --motion-shift: 18px;
  --motion-page-out: 190ms;
  --motion-page-in: 420ms;

  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-body: 'Onest', system-ui, -apple-system, sans-serif;
  --font: var(--font-body);
}

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

a,
button,
input,
label,
summary,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
}

/* Фон дублируем на html: при затухании страницы не должно мелькать белым. */
html {
  background: var(--bg);
}

html:not(.is-scrollable) body {
  overflow: hidden;
}

html.is-scrollable,
html.is-scrollable body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

h1, h2, h3, .page-hero__title, .page-section__title, .settlements-hero__title {
  font-family: var(--font-display);
  font-weight: 700;
}

a {
  color: inherit;
  text-decoration: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Позволяет анимировать высоту до auto - нужно для раскрытия списков. */
:root {
  interpolate-size: allow-keywords;
}

/* --- Фон: полотно жидкого металла под всем контентом --- */
.bg {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  /* lvh = «большая» высота вьюпорта: не сжимается и не растёт,
     когда мобильный браузер прячет или показывает адресную строку. */
  height: 100vh;
  height: 100lvh;
  pointer-events: none;
  overflow: hidden;
  /* Пока шейдер не поднялся, виден спокойный градиент того же тона. */
  background:
    radial-gradient(ellipse 90% 60% at 22% 12%, rgba(var(--accent-rgb), 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 80% 60% at 82% 78%, rgba(var(--accent-green-rgb), 0.05) 0%, transparent 58%),
    var(--bg);
}

/* Затемнение поверх металла: фон остаётся фоном, текст читается. */
.bg::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(11, 10, 9, 0.4);
}

/* На внутренних страницах текста больше — гасим сильнее. */
body[data-accent] .bg::before {
  background: rgba(11, 10, 9, 0.62);
}

/* Зерно поверх металла: убирает цифровую гладкость шейдера. */
.bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.liquid-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  animation: liquid-in 900ms var(--ease-out-quart) forwards;
}

@keyframes liquid-in {
  to { opacity: 1; }
}

/* --- Переходы между страницами --- */
body {
  animation: page-in var(--motion-page-in) var(--ease-ui) backwards;
}

/* fill-mode backwards, а не both: после проигрывания transform не должен
   оставаться на элементе и делать из него containing block для fixed-потомков. */
.shell,
.page-main {
  animation: page-in-shift var(--motion-page-in) var(--ease-ui) backwards;
}

@keyframes page-in {
  from { opacity: 0; }
}

@keyframes page-in-shift {
  from {
    opacity: 0;
    transform: translateY(var(--motion-shift));
  }
}

html.is-leaving body {
  opacity: 0;
  transition: opacity var(--motion-page-out) var(--ease-ui);
}

html.is-leaving .shell,
html.is-leaving .page-main {
  transform: translateY(calc(var(--motion-shift) * -0.4));
  transition: transform var(--motion-page-out) var(--ease-ui);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body,
  .shell,
  .page-main {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

/* --- Плашка cookie: компактная пилюля снизу по центру --- */
.cookie-banner {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  width: max-content;
  max-width: calc(100vw - 1.5rem);
  transform: translate(-50%, 120%);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.4s var(--ease-out-expo),
    opacity 0.3s var(--ease-out-quart);
}

.cookie-banner.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.cookie-banner.is-leaving {
  transform: translate(-50%, 120%);
  opacity: 0;
  pointer-events: none;
}

.cookie-banner__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem 0.85rem;
  padding: 0.45rem 0.45rem 0.45rem 0.95rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(12, 11, 10, 0.92);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.cookie-banner__text {
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--text-muted);
  white-space: nowrap;
}

.cookie-banner__text a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.cookie-banner__text a:hover {
  color: var(--accent-hi);
}

.cookie-banner__btn {
  flex: 0 0 auto;
  min-width: 2.5rem;
  min-height: 2rem;
  padding: 0.3rem 0.8rem;
  border: none;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.9);
  color: #0b0a09;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background var(--transition-micro), transform var(--transition-micro);
}

.cookie-banner__btn:hover {
  background: var(--accent-hi);
}

.cookie-banner__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
