:root {
  /* Основная палитра Stack SMP */
  --stack-background: #20332F;
  --stack-heading: #F2DFAB;
  --stack-text: #E7EBDF;
  --stack-accent: #93D6B2;
  --stack-muted: #ADBCB0;

  /* Оттенки пиксельного пейзажа */
  --stack-hill-far: #293F38;
  --stack-hill-mid: #325046;
  --stack-hill-near: #192C28;

  /* Интерфейсные токены */
  --stack-surface: #1A2B27;
  --stack-border: rgba(173, 188, 176, 0.22);
  --stack-border-strong: rgba(242, 223, 171, 0.48);
  --stack-header-height: 60px;

  /* Системные шрифты */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Liberation Sans", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "Liberation Mono", Menlo, Consolas, monospace;

  /* Тайминги и кривые */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.4, 0, 0.2, 1);

  /* Контейнер */
  --container-max: 1040px;
  --container-pad: clamp(16px, 3.5vw, 40px);
}

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

/* Полностью скрываем нативный скроллбар — поверх него работает кастомный оверлей */
html {
  background-color: var(--stack-background);
  color: var(--stack-text);
  font-family: var(--font-sans);
  font-size: clamp(16px, 15.6px + 0.12vw, 17px);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--stack-header-height) + 20px);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Во время перетаскивания кастомного скроллбара отключаем smooth, чтобы двигался 1:1 без задержек */
html.is-scrollbar-dragging {
  scroll-behavior: auto !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--stack-background);
  color: var(--stack-text);
  overflow-x: clip;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.is-map-page {
  height: 100svh;
  overflow: hidden;
}

body.is-map-page .site-footer {
  display: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* Доступность */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 12px 16px;
  background-color: var(--stack-heading);
  color: var(--stack-background);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--stack-background);
  transform: translateY(-140%);
  transition: transform 180ms var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--stack-accent);
  outline-offset: 2px;
}

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

[tabindex="-1"]:focus:not(:focus-visible) {
  outline: none;
}

/* Контейнер */
.container {
  width: 100%;
  max-width: calc(var(--container-max) + var(--container-pad) * 2);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* Шапка: плотный фон, без блюра и теней */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--stack-background);
  border-bottom: 1px solid var(--stack-border);
  flex-shrink: 0;
}

.header-inner {
  min-height: var(--stack-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  flex-wrap: nowrap;
  padding-block: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--stack-heading);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.brand:hover {
  color: var(--stack-text);
}

.brand:active {
  transform: translateY(1px);
}

.brand-crest {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.brand-wordmark {
  height: 16px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  color: var(--stack-text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 180ms var(--ease-out), background-color 180ms var(--ease-out);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background-color: var(--stack-accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 220ms var(--ease-out);
}

.nav-link:hover {
  color: var(--stack-accent);
  background-color: rgba(147, 214, 178, 0.05);
}

.nav-link[aria-current="page"] {
  color: var(--stack-accent);
  background-color: rgba(147, 214, 178, 0.09);
}

.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Круговой пиксельный лоадер (показывается только при реальной задержке загрузки или загрузке карты) */
.page-loader,
.map-loader {
  position: fixed;
  top: var(--stack-header-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.92);
  transition:
    opacity 200ms var(--ease-out),
    transform 200ms var(--ease-out),
    visibility 0s linear 200ms;
}

.map-loader {
  position: absolute;
  inset: 0;
  z-index: 5;
  background-color: var(--stack-background);
}

.page-loader.is-active,
.map-loader.is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition:
    opacity 160ms var(--ease-out),
    transform 160ms var(--ease-out),
    visibility 0s linear 0s;
}

.px-ring {
  position: relative;
  width: 40px;
  height: 40px;
}

.px-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  background-color: var(--stack-hill-mid);
  transform: scale(0.6);
  opacity: 0.4;
  animation: px-ring-pulse 720ms var(--ease-inout) infinite;
  animation-delay: calc(var(--i) * 90ms);
  animation-play-state: paused;
}

.page-loader.is-active .px-dot,
.map-loader.is-active .px-dot {
  animation-play-state: running;
}

/* 8 квадратиков по кругу без вращения */
.px-dot:nth-child(1) { left: 17px; top: 3px; }
.px-dot:nth-child(2) { left: 27px; top: 7px; }
.px-dot:nth-child(3) { left: 31px; top: 17px; }
.px-dot:nth-child(4) { left: 27px; top: 27px; }
.px-dot:nth-child(5) { left: 17px; top: 31px; }
.px-dot:nth-child(6) { left: 7px;  top: 27px; }
.px-dot:nth-child(7) { left: 3px;  top: 17px; }
.px-dot:nth-child(8) { left: 7px;  top: 7px; }

@keyframes px-ring-pulse {
  0%, 100% {
    transform: scale(0.58);
    background-color: var(--stack-hill-mid);
    opacity: 0.38;
  }
  25% {
    transform: scale(1.22);
    background-color: var(--stack-heading);
    opacity: 1;
  }
  52% {
    transform: scale(0.92);
    background-color: var(--stack-accent);
    opacity: 0.85;
  }
}

/* Основная область и плавные переходы страниц */
main {
  flex: 1 0 auto;
  transition: opacity 140ms var(--ease-out), transform 140ms var(--ease-out);
}

main.is-leaving {
  opacity: 0;
  transform: translateY(-5px);
  pointer-events: none;
}

main.is-entering {
  animation: stack-main-enter 220ms var(--ease-out) both;
}

@keyframes stack-main-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Страница карты */
.map-main {
  flex: 1 1 auto;
  height: calc(100vh - var(--stack-header-height));
  height: calc(100svh - var(--stack-header-height));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.map-stage {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: var(--stack-hill-near);
}

.map-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background-color: var(--stack-hill-near);
  opacity: 0;
  transition: opacity 280ms var(--ease-out);
}

.map-frame.is-loaded {
  opacity: 1;
}

/* Первый экран (Hero) — строго на весь экран */
.hero {
  position: relative;
  width: 100%;
  min-height: calc(100vh - var(--stack-header-height));
  min-height: calc(100svh - var(--stack-header-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--stack-background);
  border-bottom: 1px solid var(--stack-border);
  overflow: hidden;
  padding-top: clamp(28px, 5vh, 56px);
  padding-bottom: clamp(168px, 27vh, 270px);
}

.hero-backdrop {
  position: absolute;
  inset: auto 0 0 0;
  height: clamp(190px, 28vw, 350px);
  pointer-events: none;
  user-select: none;
  z-index: 0;
  animation: hero-landscape-rise 680ms var(--ease-out) both;
}

.hero-picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-landscape {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

@keyframes hero-landscape-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 680px;
}

.js .hero-anim {
  animation: hero-item-in 500ms var(--ease-out) both;
  animation-delay: calc(var(--anim-i, 0) * 65ms + 30ms);
}

@keyframes hero-item-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  margin: 0;
  line-height: 1;
}

.hero-wordmark {
  width: clamp(232px, 58vw, 372px);
  height: auto;
  margin-inline: auto;
}

.hero-slogan {
  margin: 22px 0 0;
  font-size: clamp(1.125rem, 1rem + 0.65vw, 1.4375rem);
  font-weight: 600;
  color: var(--stack-text);
  line-height: 1.35;
  text-wrap: balance;
}

.hero-meta {
  margin: 10px 0 0;
  font-size: 0.9375rem;
  color: var(--stack-muted);
  letter-spacing: 0.01em;
}

/* Панель адреса и действий */
.hero-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.ip-bar {
  display: inline-flex;
  align-items: stretch;
  background-color: var(--stack-hill-near);
  border: 2px solid var(--stack-border-strong);
  max-width: 100%;
  transition: border-color 180ms var(--ease-out);
}

.ip-bar:hover {
  border-color: var(--stack-heading);
}

.ip-code {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--stack-heading);
  letter-spacing: 0.01em;
  user-select: all;
  -webkit-user-select: all;
  white-space: nowrap;
  overflow-x: auto;
  cursor: pointer;
  transition: color 180ms var(--ease-out), background-color 180ms var(--ease-out);
}

.ip-code:hover {
  background-color: rgba(242, 223, 171, 0.06);
}

.copy-btn {
  display: none;
}

.js .copy-btn {
  display: inline-grid;
  place-items: center;
}

.btn-primary {
  position: relative;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-left: 2px solid var(--stack-background);
  background-color: var(--stack-heading);
  color: var(--stack-background);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out), transform 140ms var(--ease-out);
}

.btn-primary:hover {
  background-color: #f7e9c2;
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary[data-copied="true"] {
  background-color: var(--stack-accent);
  color: var(--stack-background);
}

.copy-btn-label {
  grid-area: 1 / 1;
  display: inline-block;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}

.copy-btn-label[data-label="copied"] {
  opacity: 0;
  transform: translateY(6px);
}

.btn-primary[data-copied="true"] .copy-btn-label[data-label="default"] {
  opacity: 0;
  transform: translateY(-6px);
}

.btn-primary[data-copied="true"] .copy-btn-label[data-label="copied"] {
  opacity: 1;
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  background-color: var(--stack-hill-near);
  color: var(--stack-text);
  border: 2px solid var(--stack-border);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  white-space: nowrap;
  transition:
    border-color 180ms var(--ease-out),
    color 180ms var(--ease-out),
    background-color 180ms var(--ease-out),
    transform 140ms var(--ease-out);
}

.btn-secondary:hover {
  border-color: var(--stack-accent);
  color: var(--stack-accent);
  background-color: var(--stack-surface);
}

.btn-secondary:active {
  transform: translateY(1px);
}

.copy-feedback {
  margin: 12px 0 0;
  min-height: 1.5em;
  font-size: 0.875rem;
  color: var(--stack-accent);
  max-width: 48ch;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}

.copy-feedback.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.copy-feedback[data-state="warn"] {
  color: var(--stack-heading);
}

/* Индикатор скролла внизу Hero */
.hero-scroll-hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  color: var(--stack-muted);
  text-decoration: none;
  opacity: 0.72;
  animation: scroll-hint-bob 2.4s var(--ease-inout) infinite;
  transition: color 180ms var(--ease-out), opacity 180ms var(--ease-out);
}

.hero-scroll-hint:hover {
  color: var(--stack-heading);
  opacity: 1;
}

@keyframes scroll-hint-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* Плавное проявление секций при скролле */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 440ms var(--ease-out) var(--reveal-delay, 0ms),
    transform 440ms var(--ease-out) var(--reveal-delay, 0ms);
}

.js [data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================
   Структурированные секции главной страницы
   ========================================== */
.section {
  padding-block: clamp(56px, 8vw, 92px);
  border-bottom: 1px solid var(--stack-border);
  scroll-margin-top: calc(var(--stack-header-height) + 12px);
}

.section:last-of-type {
  border-bottom: 0;
}

.section-alt {
  background-color: var(--stack-surface);
}

.content-wrap {
  max-width: 980px;
}

.section-head {
  margin-bottom: clamp(24px, 3.5vw, 36px);
}

.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
}

.section-kicker {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stack-accent);
}

.section-heading {
  margin: 0;
  font-size: clamp(1.5rem, 1.3rem + 0.75vw, 2rem);
  font-weight: 700;
  color: var(--stack-heading);
  line-height: 1.2;
  text-wrap: balance;
}

.body-lead {
  margin: 14px 0 0;
  max-width: 62ch;
  font-size: 1.05rem;
  line-height: 1.62;
  color: var(--stack-text);
}

.version-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--stack-heading);
  background-color: var(--stack-background);
  border: 1px solid var(--stack-border-strong);
}

/* 01 / О сервере — 3 чётких плитки */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 24px;
  background-color: var(--stack-hill-near);
  border: 1px solid var(--stack-border);
  text-decoration: none;
  color: inherit;
  transition: border-color 180ms var(--ease-out), background-color 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.feature-card:hover {
  border-color: var(--stack-border-strong);
}

.feature-card-link:hover {
  border-color: var(--stack-accent);
  background-color: var(--stack-surface);
  transform: translateY(-2px);
}

.feature-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feature-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background-color: var(--stack-background);
  border: 1px solid var(--stack-border);
  color: var(--stack-accent);
}

.feature-icon {
  width: 18px;
  height: 18px;
}

.feature-label {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--stack-heading);
  line-height: 1.3;
}

.feature-detail {
  margin: 0;
  color: var(--stack-muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

/* 02 / Как зайти — сетка 2x2 на контрастном фоне */
.steps-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.step-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 22px 24px;
  background-color: var(--stack-background);
  border: 1px solid var(--stack-border);
  transition: border-color 180ms var(--ease-out);
}

.step-card:hover {
  border-color: var(--stack-border-strong);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  background-color: var(--stack-hill-near);
  border: 1px solid var(--stack-border-strong);
  color: var(--stack-heading);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.875rem;
  transition: border-color 180ms var(--ease-out), color 180ms var(--ease-out);
}

.step-card:hover .step-num {
  border-color: var(--stack-accent);
  color: var(--stack-accent);
}

.step-content {
  min-width: 0;
}

.step-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--stack-text);
  line-height: 1.35;
}

.step-text {
  margin: 8px 0 0;
  color: var(--stack-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.step-link-row {
  margin: 12px 0 0;
}

.steps-footnote {
  margin: 20px 0 0;
  padding: 12px 16px;
  background-color: var(--stack-hill-near);
  border: 1px solid var(--stack-border);
  border-left: 3px solid var(--stack-accent);
  font-size: 0.9375rem;
  color: var(--stack-heading);
  font-weight: 500;
}

/* Встроенный код и ссылки */
.inline-code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--stack-heading);
  background-color: var(--stack-hill-near);
  padding: 2px 6px;
  border: 1px solid var(--stack-border);
  overflow-wrap: anywhere;
}

.inline-code-copy {
  display: inline;
  cursor: pointer;
  transition: border-color 180ms var(--ease-out), color 180ms var(--ease-out), background-color 180ms var(--ease-out);
}

.inline-code-copy:hover {
  border-color: var(--stack-accent);
  color: var(--stack-accent);
}

.inline-code-copy[data-copied="true"] {
  border-color: var(--stack-accent);
  background-color: var(--stack-accent);
  color: var(--stack-background);
}

.inline-link {
  color: var(--stack-accent);
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  overflow-wrap: anywhere;
  transition: color 180ms var(--ease-out);
}

.inline-link:hover {
  color: var(--stack-heading);
}

/* 03 / Перед входом — раздельные плавные аккордионы */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background-color: var(--stack-hill-near);
  border: 1px solid var(--stack-border);
  transition: border-color 200ms var(--ease-out);
}

.faq-item:hover {
  border-color: rgba(173, 188, 176, 0.38);
}

.faq-item.is-open,
.faq-item[open]:not(.is-closing) {
  border-color: var(--stack-border-strong);
}

.faq-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 14px 20px;
  font-weight: 600;
  color: var(--stack-text);
  cursor: pointer;
  user-select: none;
  transition: color 180ms var(--ease-out);
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary:hover {
  color: var(--stack-accent);
}

.faq-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border: 1px solid var(--stack-border);
  background-color: var(--stack-background);
  transition: border-color 200ms var(--ease-out);
}

.faq-toggle::before,
.faq-toggle::after {
  content: "";
  position: absolute;
  background-color: var(--stack-accent);
  transition: transform 240ms var(--ease-out), background-color 200ms var(--ease-out), opacity 200ms var(--ease-out);
}

.faq-toggle::before {
  width: 10px;
  height: 2px;
}

.faq-toggle::after {
  width: 2px;
  height: 10px;
}

.faq-summary:hover .faq-toggle {
  border-color: var(--stack-accent);
}

.faq-item.is-open > .faq-summary .faq-toggle,
.faq-item[open]:not(.is-closing) > .faq-summary .faq-toggle {
  border-color: var(--stack-border-strong);
}

.faq-item.is-open > .faq-summary .faq-toggle::before,
.faq-item[open]:not(.is-closing) > .faq-summary .faq-toggle::before {
  background-color: var(--stack-heading);
}

.faq-item.is-open > .faq-summary .faq-toggle::after,
.faq-item[open]:not(.is-closing) > .faq-summary .faq-toggle::after {
  transform: rotate(90deg) scaleY(0);
  opacity: 0;
}

.faq-panel {
  overflow: hidden;
  will-change: height, opacity;
}

.faq-answer {
  padding: 0 20px 20px;
  color: var(--stack-muted);
  font-size: 0.96rem;
}

.faq-answer p {
  margin: 0 0 10px;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* Страница правил и 404 */
.page-content {
  padding-block: clamp(44px, 7vw, 80px);
}

.rules-doc {
  max-width: 68ch;
}

.page-heading {
  margin: 0;
  font-size: clamp(1.75rem, 1.45rem + 1.2vw, 2.375rem);
  font-weight: 700;
  color: var(--stack-heading);
  line-height: 1.2;
  text-wrap: balance;
}

.rules-placeholder {
  margin-top: 24px;
  padding: 24px;
  background-color: var(--stack-hill-near);
  border: 1px solid var(--stack-border);
}

.rules-status-text {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--stack-text);
}

.rules-status-action {
  margin: 14px 0 0;
}

/* Подвал без дублирования вкладок хедера */
.site-footer {
  margin-top: auto;
  background-color: var(--stack-hill-near);
  border-top: 1px solid var(--stack-border);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 16px;
}

.footer-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  color: var(--stack-muted);
}

.footer-brand {
  color: var(--stack-heading);
  font-weight: 600;
}

.footer-sep {
  opacity: 0.5;
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-link,
.footer-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--stack-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: color 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.footer-link:hover,
.footer-top:hover {
  color: var(--stack-accent);
}

.footer-top:hover {
  transform: translateY(-2px);
}

/* Кастомный оверлейный скроллбар (не смещает страницу, полупрозрачный, расширяется при hover) */
.custom-scrollbar {
  position: fixed;
  top: calc(var(--stack-header-height) + 6px);
  right: 3px;
  bottom: 6px;
  width: 14px;
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease-out);
  touch-action: none;
}

.custom-scrollbar.is-scrollable {
  opacity: 1;
  pointer-events: auto;
}

.custom-scrollbar-thumb {
  position: absolute;
  top: 0;
  right: 2px;
  width: 4px;
  min-height: 36px;
  background-color: rgba(242, 223, 171, 0.34);
  border-radius: 2px;
  cursor: grab;
  will-change: transform;
  transition: width 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.custom-scrollbar.is-scrolling .custom-scrollbar-thumb {
  background-color: rgba(242, 223, 171, 0.56);
}

.custom-scrollbar:hover .custom-scrollbar-thumb {
  width: 8px;
  background-color: rgba(242, 223, 171, 0.72);
}

.custom-scrollbar.is-dragging .custom-scrollbar-thumb {
  width: 8px;
  background-color: var(--stack-accent);
  cursor: grabbing;
}

@media (pointer: coarse) {
  .custom-scrollbar {
    pointer-events: none !important;
    width: 6px;
    right: 2px;
  }

  .custom-scrollbar.is-scrollable {
    opacity: 0;
  }

  .custom-scrollbar.is-scrollable.is-scrolling {
    opacity: 1;
  }

  .custom-scrollbar-thumb {
    width: 3px;
    right: 1px;
  }
}

/* Адаптив для мобильных экранов */
@media (max-width: 680px) {
  .hero {
    justify-content: flex-start;
    padding-top: clamp(44px, 11svh, 96px);
    padding-bottom: clamp(220px, 38svh, 320px);
  }

  .hero-backdrop {
    height: clamp(210px, 40svh, 330px);
  }

  .hero-wordmark {
    width: clamp(216px, 66vw, 310px);
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .ip-bar {
    width: 100%;
    max-width: 360px;
  }

  .ip-code {
    flex: 1 1 auto;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.9375rem;
  }

  .btn-primary {
    padding: 10px 14px;
    font-size: 0.875rem;
    flex-shrink: 0;
  }

  .btn-secondary {
    width: 100%;
    max-width: 360px;
  }

  .nav-link {
    padding: 8px 10px;
    font-size: 0.9rem;
  }
}

@media (max-width: 400px) {
  .brand {
    gap: 7px;
  }

  .brand-crest {
    width: 22px;
    height: 22px;
  }

  .brand-wordmark {
    height: 13px;
  }

  .nav-link {
    padding: 8px 7px;
    font-size: 0.85rem;
  }

  .ip-code {
    font-size: 0.875rem;
    padding-inline: 8px;
  }

  .btn-primary {
    padding-inline: 10px;
    font-size: 0.8125rem;
  }
}

/* Альбомная ориентация на телефонах */
@media (max-height: 480px) and (orientation: landscape) {
  .hero {
    justify-content: center;
    padding-top: 20px;
    padding-bottom: 84px;
  }

  .hero-wordmark {
    width: 210px;
  }

  .hero-slogan {
    margin-top: 12px;
    font-size: 1.0625rem;
  }

  .hero-actions {
    margin-top: 16px;
  }

  .hero-backdrop {
    height: 92px;
  }

  .hero-scroll-hint {
    display: none;
  }
}

/* Планшеты и десктоп: сетки секций */
@media (min-width: 680px) {
  .steps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 820px) {
  .hero-backdrop {
    height: clamp(220px, 26vw, 360px);
  }

  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

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