/* =========================================================
   Слёт гуманитарных штабов «МЫВМЕСТЕ» — стили лендинга
   Редизайн: hero+параллакс, счётчики, reveal-анимации,
   кластеризация меток, поиск по списку штабов.
   Всё завязано на CSS custom properties в :root — тема
   переключаема без правки остального кода.
   ========================================================= */

:root {
  --color-yellow: #FDD749;
  --color-orange: #F79759;
  --color-dark: #131919;
  --color-bg: #FFFFFF;
  --color-bg-alt: #FBFBF9;
  --color-neutral: #808285;
  --color-neutral-soft: rgba(19, 25, 25, 0.08);
  --gradient-accent: linear-gradient(135deg, #FDD749, #F79759);
  --gradient-accent-soft: linear-gradient(135deg, rgba(253, 215, 73, 0.16), rgba(247, 151, 89, 0.16));

  --font-heading: 'Unbounded', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-soft: 0 4px 20px rgba(19, 25, 25, 0.08);
  --shadow-soft-hover: 0 10px 30px rgba(19, 25, 25, 0.16);
  --shadow-layered: 0 2px 6px rgba(19, 25, 25, 0.06), 0 16px 40px rgba(19, 25, 25, 0.10);

  --transition-fast: 0.2s ease;
  --transition-med: 0.3s ease;

  --container-max: 1280px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-dark);
  background: var(--color-bg);
  overflow-x: hidden;
  line-height: 1.55;
}

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

a {
  color: inherit;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  margin: 0;
  line-height: 1.2;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-dark);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 1000;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 56px 0;
}

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

.section-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
}

.section-subtitle {
  color: var(--color-neutral);
  font-size: 15px;
  margin: 0 0 28px;
}

/* ---------- Reveal-on-scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.steps-grid .step-card:nth-child(2) { transition-delay: 0.08s; }
.steps-grid .step-card:nth-child(3) { transition-delay: 0.16s; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-position var(--transition-med);
  white-space: nowrap;
}

.btn--primary {
  background: var(--gradient-accent);
  background-size: 160% 160%;
  background-position: 0% 50%;
  color: var(--color-dark);
  box-shadow: var(--shadow-soft);
}

.btn--primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-soft-hover);
  background-position: 100% 50%;
}

.btn--ghost {
  background: rgba(19, 25, 25, 0.04);
  color: var(--color-dark);
  border: 1px solid rgba(19, 25, 25, 0.14);
}

.btn--ghost:hover {
  transform: translateY(-2px);
  background: rgba(19, 25, 25, 0.08);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-neutral-soft);
  padding: 14px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.header-text {
  min-width: 0;
  flex: 1;
}

.header-title {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--color-neutral);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-cta {
  display: none;
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--gradient-accent);
  color: var(--color-dark);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.header-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 56px 0 40px;
  background: linear-gradient(180deg, #FFFDF6 0%, var(--color-bg) 70%);
}

.hero-decor {
  position: absolute;
  inset: -10% -10% -10% -10%;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.hero-decor__icon {
  position: absolute;
  color: var(--color-orange);
  opacity: 0.1;
}

.hero-decor__icon--heart {
  top: 6%;
  right: 8%;
  color: var(--color-orange);
  opacity: 0.12;
  transform: rotate(-8deg);
}

.hero-decor__icon--hands {
  bottom: 4%;
  left: 4%;
  color: var(--color-dark);
  opacity: 0.07;
}

.hero-decor__icon--box {
  top: 46%;
  right: 22%;
  color: var(--color-yellow);
  opacity: 0.14;
  transform: rotate(6deg);
}

.hero-decor__icon--flag {
  top: 14%;
  left: 14%;
  color: var(--color-dark);
  opacity: 0.06;
}

.hero-decor__icon--people {
  bottom: 8%;
  right: 6%;
  color: var(--color-orange);
  opacity: 0.09;
}

.hero-decor__icon--circle1 {
  top: 60%;
  left: 30%;
  color: var(--color-yellow);
  opacity: 0.15;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-orange);
  background: rgba(247, 151, 89, 0.12);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 18px;
}

.hero-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--color-neutral);
  max-width: 620px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 44px;
}

.hero-counters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.hero-counter {
  background: var(--color-bg);
  border: 1px solid var(--color-neutral-soft);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
}

.hero-counter__num {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 26px;
  color: var(--color-dark);
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.hero-counter__suffix {
  font-size: 20px;
  color: var(--color-orange);
}

.hero-counter__label {
  font-size: 12.5px;
  color: var(--color-neutral);
  margin-top: 4px;
}

/* ---------- How it works ---------- */

.how-section {
  position: relative;
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.step-card {
  position: relative;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: 28px 24px 24px;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-med), box-shadow var(--transition-med);
}

.step-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-soft-hover);
}

.step-card__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--gradient-accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.step-card__num {
  position: absolute;
  top: 24px;
  right: 24px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 34px;
  color: rgba(19, 25, 25, 0.06);
}

.step-card__title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-card__text {
  font-size: 14px;
  color: var(--color-neutral);
  margin: 0;
}

/* ---------- Map section ---------- */

.map-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.map-wrap {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-layered);
  background: #eef0ee;
  order: -1;
}

.map {
  width: 100%;
  height: 100%;
}

.map-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 24px;
  background: var(--gradient-accent);
}

.map-fallback__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-fallback__text {
  max-width: 340px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-dark);
  margin: 0;
}

.map-fallback__text code {
  background: rgba(255, 255, 255, 0.6);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: monospace;
}

.shtaby-list-wrap {
  width: 100%;
}

.shtaby-search {
  position: relative;
  margin-bottom: 14px;
}

.shtaby-search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-neutral);
  pointer-events: none;
}

.shtaby-search__input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 12px 14px 12px 40px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-neutral-soft);
  background: var(--color-bg);
  color: var(--color-dark);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.shtaby-search__input::placeholder {
  color: var(--color-neutral);
}

.shtaby-search__input:focus {
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px rgba(247, 151, 89, 0.15);
}

.shtaby-list {
  list-style: none;
  margin: 0;
  padding: 4px 6px 4px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-orange) transparent;
}

.shtaby-list::-webkit-scrollbar {
  width: 6px;
}

.shtaby-list::-webkit-scrollbar-track {
  background: transparent;
}

.shtaby-list::-webkit-scrollbar-thumb {
  background: var(--gradient-accent);
  border-radius: var(--radius-pill);
}

.shtaby-list__empty {
  color: var(--color-neutral);
  font-size: 14px;
  padding: 16px;
}

.shtaby-list__empty.is-hidden {
  display: none;
}

.shtab-card {
  border: 1px solid var(--color-neutral-soft);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
  background: var(--color-bg);
}

.shtab-card.is-hidden {
  display: none;
}

.shtab-card:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.shtab-card.is-active {
  border-color: var(--color-orange);
  background: var(--gradient-accent-soft);
  box-shadow: var(--shadow-soft-hover);
}

.shtab-card__name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.shtab-card__address {
  font-size: 13px;
  color: var(--color-neutral);
}

.shtab-card__panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(19, 25, 25, 0.15);
  display: none;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.shtab-card.is-active .shtab-card__panel {
  display: flex;
}

.shtab-card__team-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.shtab-card__team-role {
  color: var(--color-neutral);
}

.shtab-card__phone {
  font-weight: 600;
}

.shtab-card__socials {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* Balloon content inside Yandex map popup */
.balloon-content {
  font-family: var(--font-body);
  font-size: 13px;
  min-width: 200px;
  max-width: 260px;
}

.balloon-content h3 {
  font-family: var(--font-heading);
  font-size: 15px;
  margin-bottom: 6px;
}

.balloon-content p {
  margin: 4px 0;
}

.balloon-content .shtab-card__socials {
  margin-top: 8px;
}

.ymap-pin {
  width: 26px;
  height: 26px;
  border-radius: 50% 50% 50% 0;
  background: var(--gradient-accent);
  border: 2px solid var(--color-dark);
  transform: rotate(-45deg);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-fast);
}

.ymap-pin:hover {
  transform: rotate(-45deg) scale(1.15);
}

/* Кластер меток (простая grid-based кластеризация, см. js/app.js) */
.ymap-cluster {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--gradient-accent);
  border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(19, 25, 25, 0.25), 0 0 0 3px rgba(19, 25, 25, 0.06);
  color: var(--color-dark);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.ymap-cluster:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(19, 25, 25, 0.3), 0 0 0 3px rgba(19, 25, 25, 0.08);
}

.map-popup {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  max-width: 320px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft-hover);
  padding: 18px;
  z-index: 10;
}

.map-popup__close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-neutral);
  padding: 0;
}

.badge-round {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 11px;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.badge-round:hover {
  transform: translateY(-2px) scale(1.06);
}

/* ---------- News section ---------- */

.news-badge {
  display: inline-block;
  background: var(--gradient-accent);
  color: var(--color-dark);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
}

.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.news-status {
  color: var(--color-neutral);
  font-size: 14px;
}

.news-card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition-med), transform var(--transition-med);
}

.news-card:hover {
  box-shadow: var(--shadow-soft-hover);
  transform: translateY(-6px);
}

.news-card__media {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--gradient-accent);
}

.news-card__media-placeholder {
  width: 100%;
  height: 180px;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-card__media-placeholder svg {
  opacity: 0.8;
}

.news-card__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.news-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.source-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  color: #fff;
  letter-spacing: 0.02em;
}

.source-badge--vk {
  background: #4a76a8;
}

.source-badge--tg {
  background: #229ED9;
}

.source-badge--other {
  background: var(--color-neutral);
}

.news-card__date {
  font-size: 12px;
  color: var(--color-neutral);
}

.news-card__text {
  font-size: 14px;
  color: var(--color-dark);
  flex: 1;
}

.news-card__link {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-orange);
  text-decoration: none;
  align-self: flex-start;
  transition: transform var(--transition-fast);
  display: inline-block;
}

.news-card__link:hover {
  text-decoration: underline;
  transform: translateX(2px);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--color-dark);
  color: #fff;
  padding: 40px 0 16px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
}

.footer-logo {
  width: 120px;
  height: auto;
}

.footer-note {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-neutral);
  margin: 0 0 8px;
}

.footer-contacts p {
  margin: 4px 0;
  font-size: 14px;
}

.footer-contacts a {
  text-decoration: none;
  color: #fff;
}

.footer-contacts a:hover {
  text-decoration: underline;
}

.social-links {
  display: flex;
  gap: 10px;
}

.social-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.social-badge:hover {
  transform: translateY(-2px) scale(1.06);
}

.footer-bottom {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  color: var(--color-neutral);
}

/* ---------- Back to top ---------- */

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--color-bg);
  box-shadow: var(--shadow-soft-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--transition-med), transform var(--transition-med), visibility var(--transition-med);
  z-index: 60;
  will-change: transform, opacity;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-3px) scale(1.05);
}

/* =========================================================
   Reduced motion — уважаем настройки пользователя
   ========================================================= */

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

  .reveal,
  .btn,
  .shtab-card,
  .news-card,
  .step-card,
  .back-to-top,
  .ymap-pin,
  .ymap-cluster,
  .badge-round,
  .social-badge {
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .hero-decor {
    transform: none !important;
  }
}

/* =========================================================
   Tablet / Desktop breakpoint (~768px)
   ========================================================= */

@media (min-width: 768px) {
  .section {
    padding: 76px 0;
  }

  .section-title {
    font-size: 34px;
  }

  .section-subtitle {
    font-size: 16px;
  }

  .header-logo {
    width: 56px;
    height: 56px;
  }

  .header-title {
    font-size: 18px;
  }

  .header-subtitle {
    font-size: 13px;
  }

  .header-cta {
    display: inline-flex;
  }

  .hero {
    padding: 88px 0 64px;
  }

  .hero-title {
    font-size: 48px;
  }

  .hero-subtitle {
    font-size: 18px;
  }

  .hero-counters {
    grid-template-columns: repeat(4, 1fr);
  }

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

  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (min-width: 1024px) {
  .map-layout {
    flex-direction: row;
    align-items: stretch;
    height: 600px;
  }

  .shtaby-list-wrap {
    width: 32%;
    flex-shrink: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    order: 0;
  }

  .shtaby-list {
    flex: 1;
    max-height: none;
  }

  .map-wrap {
    width: 68%;
    height: 100%;
    order: 1;
  }

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

/* =========================================================
   Wide desktop (~1440px)
   ========================================================= */

@media (min-width: 1440px) {
  .header-title {
    font-size: 20px;
  }

  .section-title {
    font-size: 38px;
  }

  .hero-title {
    font-size: 54px;
  }
}
