/**
 * Главная: уровень NGO (autism.org.uk), минимализм, без «лендинговых» карточек.
 * Шрифт Inter подключается в index.html. Hero: full-bleed + overlay. Glass — умеренно.
 */

:root {
  --h-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --h-ink: #0f0f0f;
  --h-ink-muted: #4a4a4a;
  --h-line: rgba(15, 15, 15, 0.08);
  --h-white: #fff;
  --h-hero-overlay: rgba(0, 0, 0, 0.42);
  --h-glass-bg: rgba(255, 255, 255, 0.1);
  --h-glass-border: rgba(255, 255, 255, 0.22);
  --h-glass-blur: 16px;
  --h-header-solid: rgba(255, 255, 255, 0.96);
  --h-space: clamp(1.5rem, 4vw, 4rem);
  --h-container: min(100% - 2 * var(--h-space), 72rem);
  --h-touch: 48px;
}

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

html {
  scroll-behavior: smooth;
}

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

body.home {
  margin: 0;
  font-family: var(--h-font);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--h-ink);
  background: var(--h-white);
  -webkit-font-smoothing: antialiased;
}

body.home.a11y-reduce-motion * {
  animation: none !important;
  transition-duration: 0.01ms !important;
}

/* Мобильное меню открыто: без прокрутки страницы под оверлеем */
html.menu-open,
body.home.menu-open {
  overflow: hidden;
}

html.a11y-font-large body.home {
  font-size: 118.75%;
}

body.home.a11y-high-contrast {
  --h-ink: #fff;
  --h-ink-muted: #e8e8e8;
  --h-line: rgba(255, 255, 255, 0.35);
  --h-white: #000;
  --h-hero-overlay: rgba(0, 0, 0, 0.65);
  --h-header-solid: #0a0a0a;
  background: #000;
  color: #fff;
}

body.home.a11y-high-contrast .section-ngo--muted {
  background: #0a0a0a !important;
}

body.home.a11y-high-contrast .cta-ngo {
  background: #111;
  border-color: var(--h-line);
}

body.home.a11y-high-contrast .btn-solid {
  background: #ffcc00;
  color: #000;
}

body.home.a11y-high-contrast .btn-hero--solid {
  background: #ffcc00;
  color: #000;
  border-color: #ffcc00;
}

body.home.a11y-high-contrast .program-card--preview {
  background: #000;
  border-color: #fff;
}

body.home.a11y-high-contrast .program-card--featured {
  background: #000;
  border: 2px solid #fff;
}

body.home.a11y-high-contrast .programs-preview__cta-block {
  border-color: #fff;
  background: #000;
}

body.home.a11y-high-contrast .tag {
  background: #fff;
  color: #000;
  border-color: #fff;
}

body.home.a11y-high-contrast .directions-stripes__item,
body.home.a11y-high-contrast .help-step {
  border-color: #fff;
}

body.home.a11y-high-contrast .about-ngo__figure {
  outline: 1px solid #fff;
}

.visually-hidden {
  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;
  left: 1rem;
  top: -100px;
  z-index: 10000;
  padding: 0.75rem 1rem;
  background: var(--h-ink);
  color: var(--h-white);
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
}

.skip-link:focus {
  top: 1rem;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ——— Header: прозрачный над hero → плотный при скролле ——— */
.header--over-hero {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding-top: env(safe-area-inset-top, 0px);
  transition: background 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  background: transparent;
  border-bottom: 1px solid transparent;
}

.header--over-hero.is-scrolled {
  background: var(--h-header-solid);
  backdrop-filter: blur(var(--h-glass-blur));
  -webkit-backdrop-filter: blur(var(--h-glass-blur));
  border-bottom-color: var(--h-line);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.header--over-hero:not(.is-scrolled) .header-ngo__logo-text {
  color: var(--h-white);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.header--over-hero:not(.is-scrolled) .header-ngo__link {
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.header--over-hero:not(.is-scrolled) .header-ngo__link:hover,
.header--over-hero:not(.is-scrolled) .header-ngo__link:focus-visible {
  color: #fff;
}

.header--over-hero.is-scrolled .header-ngo__logo-text,
.header--over-hero.is-scrolled .header-ngo__link {
  color: var(--h-ink);
  text-shadow: none;
}

.header--over-hero.is-scrolled .header-ngo__link:hover,
.header--over-hero.is-scrolled .header-ngo__link:focus-visible {
  color: #000;
}

.header-ngo__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: var(--h-container);
  margin: 0 auto;
  min-height: 72px;
  padding: 0.75rem 0;
}

.header-ngo__logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  min-height: var(--h-touch);
}

.header-ngo__logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  border-radius: 8px;
}

@media (min-width: 900px) {
  .header-ngo__logo-img {
    width: 48px;
    height: 48px;
  }
}

.header-ngo__logo-text {
  max-width: min(12.5rem, 46vw);
  line-height: 1.2;
}

@media (max-width: 380px) {
  .header-ngo__logo {
    font-size: 0.9rem;
    gap: 0.45rem;
  }

  .header-ngo__logo-img {
    width: 38px;
    height: 38px;
  }
}

.header-ngo__burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: var(--h-touch);
  min-height: var(--h-touch);
  padding: 0;
  border: 1px solid var(--h-glass-border);
  border-radius: 10px;
  background: var(--h-glass-bg);
  backdrop-filter: blur(var(--h-glass-blur));
  -webkit-backdrop-filter: blur(var(--h-glass-blur));
  cursor: pointer;
}

.header--over-hero.is-scrolled .header-ngo__burger {
  background: var(--h-white);
  border-color: var(--h-line);
}

.header-ngo__burger-line {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: currentColor;
  color: #fff;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

@media (prefers-reduced-motion: reduce) {
  .header-ngo__burger-line {
    transition: none;
  }
}

@media (max-width: 899px) {
  .header-ngo__burger[aria-expanded="true"] .header-ngo__burger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .header-ngo__burger[aria-expanded="true"] .header-ngo__burger-line:nth-child(2) {
    opacity: 0;
  }

  .header-ngo__burger[aria-expanded="true"] .header-ngo__burger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

.header--over-hero.is-scrolled .header-ngo__burger-line {
  color: var(--h-ink);
}

/*
 * Открытое меню: у шапки НЕЛЬЗЯ ставить backdrop-filter: иначе создаётся контекст
 * позиционирования, и position:fixed у .header-ngo__nav привязывается к шапке (~72px),
 * а не к окну — панель обрезается, ссылки «пропадают», виден белый обломок экрана.
 */
.header--over-hero:has(.header-ngo__nav.is-open) {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.header--over-hero.is-scrolled:has(.header-ngo__nav.is-open) {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.header--over-hero:has(.header-ngo__nav.is-open) .header-ngo__logo-text {
  color: var(--h-ink);
  text-shadow: none;
}

.header--over-hero:has(.header-ngo__nav.is-open) .header-ngo__burger-line {
  color: var(--h-ink);
}

@media (max-width: 899px) {
  .header-ngo__logo,
  .header-ngo__burger {
    position: relative;
    z-index: 210;
  }
}

.header-ngo__nav {
  display: none;
}

/* Мобильное меню: fullscreen overlay — отдельный экран навигации, не карточка/modal */
@media (max-width: 899px) {
  .header-ngo__nav {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 300;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s ease;
  }

  .header-ngo__nav.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .header-ngo__menu-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    margin: 0;
    padding: 0;
    border: none;
    cursor: pointer;
    background: rgba(12, 12, 14, 0.5);
  }

  .header-ngo__menu-sheet {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    min-height: 100dvh;
    padding: calc(env(safe-area-inset-top, 0px) + 24px) 24px calc(env(safe-area-inset-bottom, 0px) + 24px);
    background: #fafafa;
    border: none;
    border-radius: 0;
    box-shadow: none;
    transform: translateY(-100%);
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .header-ngo__nav.is-open .header-ngo__menu-sheet {
    transform: translateY(0);
  }

  .header-ngo__menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(15, 15, 15, 0.08);
  }

  .header-ngo__menu-brand {
    font-weight: 700;
    font-size: 1.0625rem;
    letter-spacing: -0.02em;
    color: var(--h-ink);
    line-height: 1.25;
  }

  .header-ngo__menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    color: var(--h-ink);
    transition: opacity 0.2s ease;
  }

  .header-ngo__menu-close:hover,
  .header-ngo__menu-close:focus-visible {
    opacity: 0.55;
  }

  .header-ngo__menu-close:focus-visible {
    outline: 2px solid var(--h-ink);
    outline-offset: 2px;
  }

  .header-ngo__menu-close-x {
    font-size: 1.85rem;
    line-height: 1;
    font-weight: 300;
  }

  .header-ngo__nav.is-open .header-ngo__list {
    flex: 1 1 auto;
    gap: 1rem;
    min-height: 0;
  }

  .header-ngo__nav.is-open .header-ngo__link {
    color: var(--h-ink) !important;
    text-shadow: none !important;
    padding: 0.5rem 0;
    min-height: 0;
    border-radius: 0;
    background: transparent !important;
    font-size: clamp(1.25rem, 4.2vw, 1.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    transition: opacity 0.2s ease;
  }

  .header-ngo__nav.is-open .header-ngo__link:hover,
  .header-ngo__nav.is-open .header-ngo__link:focus-visible {
    opacity: 0.55;
    color: var(--h-ink) !important;
  }

  .header-ngo__menu-cta {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 1.5rem;
  }

  .header-ngo__menu-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 0 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: var(--h-ink);
    border: none;
    border-radius: 999px;
    transition: opacity 0.2s ease;
  }

  .header-ngo__menu-cta-btn:hover {
    opacity: 0.88;
  }

  .header-ngo__menu-cta-btn:focus-visible {
    outline: 2px solid var(--h-ink);
    outline-offset: 3px;
  }

  body.home:not(.a11y-reduce-motion) .header-ngo__nav.is-open .header-ngo__list li {
    animation: menuNavItemIn 0.42s ease forwards;
    opacity: 0;
  }

  body.home:not(.a11y-reduce-motion) .header-ngo__nav.is-open .header-ngo__list li:nth-child(1) {
    animation-delay: 0.05s;
  }

  body.home:not(.a11y-reduce-motion) .header-ngo__nav.is-open .header-ngo__list li:nth-child(2) {
    animation-delay: 0.1s;
  }

  body.home:not(.a11y-reduce-motion) .header-ngo__nav.is-open .header-ngo__list li:nth-child(3) {
    animation-delay: 0.15s;
  }

  body.home:not(.a11y-reduce-motion) .header-ngo__nav.is-open .header-ngo__list li:nth-child(4) {
    animation-delay: 0.2s;
  }

  body.home:not(.a11y-reduce-motion) .header-ngo__nav.is-open .header-ngo__list li:nth-child(5) {
    animation-delay: 0.25s;
  }

  body.home:not(.a11y-reduce-motion) .header-ngo__nav.is-open .header-ngo__list li:nth-child(6) {
    animation-delay: 0.3s;
  }

  body.home:not(.a11y-reduce-motion) .header-ngo__nav.is-open .header-ngo__list li:nth-child(7) {
    animation-delay: 0.35s;
  }

  body.home.a11y-high-contrast .header-ngo__nav.is-open .header-ngo__menu-backdrop {
    background: #000;
  }

  body.home.a11y-high-contrast .header-ngo__nav.is-open .header-ngo__menu-sheet {
    background: #000;
  }

  body.home.a11y-high-contrast .header-ngo__nav.is-open .header-ngo__menu-header {
    border-bottom-color: rgba(255, 255, 255, 0.25);
  }

  body.home.a11y-high-contrast .header-ngo__nav.is-open .header-ngo__menu-brand,
  body.home.a11y-high-contrast .header-ngo__nav.is-open .header-ngo__menu-close {
    color: #fff;
  }

  body.home.a11y-high-contrast .header-ngo__nav.is-open .header-ngo__link {
    color: #fff !important;
  }

  body.home.a11y-high-contrast .header-ngo__nav.is-open .header-ngo__menu-cta-btn {
    background: #ffcc00;
    color: #000;
  }

  body.home.a11y-high-contrast .header--over-hero:has(.header-ngo__nav.is-open) {
    background: #000;
    border-bottom-color: rgba(255, 255, 255, 0.25);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@keyframes menuNavItemIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-ngo__menu-sheet {
    transition: none !important;
  }

  body.home .header-ngo__nav.is-open .header-ngo__list li {
    animation: none !important;
    opacity: 1 !important;
  }
}

.header-ngo__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.header-ngo__link {
  display: flex;
  align-items: center;
  min-height: var(--h-touch);
  padding: 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
}

.header-ngo__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.btn-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--h-touch);
  padding: 0 1.35rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--h-glass-border);
  background: var(--h-glass-bg);
  color: #fff;
  backdrop-filter: blur(var(--h-glass-blur));
  -webkit-backdrop-filter: blur(var(--h-glass-blur));
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.header--over-hero.is-scrolled .btn-glass {
  border-color: var(--h-line);
  background: rgba(15, 15, 15, 0.04);
  color: var(--h-ink);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}

.header--over-hero.is-scrolled .btn-glass:hover {
  background: rgba(15, 15, 15, 0.07);
  border-color: rgba(15, 15, 15, 0.15);
}

.header-ngo__cta {
  display: none;
}

@media (min-width: 900px) {
  .header-ngo__burger {
    display: none;
  }

  .header-ngo__nav {
    display: block;
    position: static;
    padding: 0;
    background: transparent;
    border: none;
    opacity: 1 !important;
    pointer-events: auto !important;
    overflow: visible;
  }

  .header-ngo__menu-backdrop {
    display: none !important;
  }

  .header-ngo__menu-sheet {
    display: contents;
  }

  .header-ngo__menu-header,
  .header-ngo__menu-cta {
    display: none !important;
  }

  .header-ngo__nav.is-open {
    display: block;
    position: static;
    inset: auto;
    z-index: auto;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    overflow: visible;
    box-shadow: none;
  }

  .header-ngo__nav.is-open .header-ngo__menu-sheet {
    transform: none;
  }

  .header-ngo__nav.is-open .header-ngo__link {
    color: inherit !important;
    text-shadow: inherit !important;
    font-size: 0.9375rem;
    font-weight: 500;
    background: transparent;
  }

  .header-ngo__nav.is-open .header-ngo__link:hover,
  .header-ngo__nav.is-open .header-ngo__link:focus-visible {
    color: inherit !important;
    background: transparent;
  }

  .header-ngo__list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.2rem;
  }

  .header-ngo__list .header-ngo__link {
    font-size: 0.875rem;
    padding: 0 0.35rem;
  }

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

/* ——— Hero full width ——— */
.section-ngo--muted {
  background: #fafafa;
}

/* Главная: пастельные полосы (чередование с белым) */
.section-bg--pastel-a {
  background: #f5f3ff;
}

.section-bg--pastel-b {
  background: #f0faf6;
}

.section-bg--pastel-c {
  background: #fff5f0;
}

.section-bg--pastel-d {
  background: #f0f5fb;
}

body.home.a11y-high-contrast .section-bg--pastel-a,
body.home.a11y-high-contrast .section-bg--pastel-b,
body.home.a11y-high-contrast .section-bg--pastel-c,
body.home.a11y-high-contrast .section-bg--pastel-d {
  background: #0a0a0a !important;
}

/* Блок «Как всё устроено» + страница rules */
.rules__lead {
  margin: 0.35rem 0 0;
  max-width: 40rem;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--h-ink-muted);
}

.rules__inner {
  width: var(--h-container);
  margin: 0 auto;
  padding-top: 0.5rem;
}

.rules-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.rules-grid--page {
  margin-bottom: 0.5rem;
}

.rule-card {
  padding: 20px;
  border-radius: 12px;
  background: #f7f7f7;
  border: 1px solid rgba(15, 15, 15, 0.06);
}

.rule-card__title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.05rem, 2vw, 1.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--h-ink);
  line-height: 1.3;
}

.rule-card__text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--h-ink-muted);
}

.rule-card__text + .rule-card__text {
  margin-top: 0.65rem;
}

.rule-card__text--more {
  font-size: 0.95rem;
}

.rules-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-top: clamp(1.75rem, 4vw, 2.25rem);
  padding-top: 1.5rem;
  border-top: 1px solid rgba(15, 15, 15, 0.08);
}

@media (max-width: 599px) {
  .rules-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .rules-download {
    text-align: left;
  }
}

.rules-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.35rem;
  font-weight: 600;
  font-size: 1.02rem;
  text-decoration: none;
  color: var(--h-ink);
  border: 1px solid var(--h-line);
  border-radius: 999px;
  background: var(--h-white);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.rules-more:hover {
  background: rgba(15, 15, 15, 0.04);
}

.rules-more:active {
  transform: scale(0.98);
}

.rules-download {
  text-align: right;
}

.rules-download__label {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  color: var(--h-ink-muted);
}

.rules-download__btn {
  font-weight: 600;
  color: var(--h-ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.rules-download__btn:hover {
  opacity: 0.85;
}

.rules-page__inner {
  width: var(--h-container);
  margin: 0 auto;
}

.rules-download--page {
  margin-top: 2rem;
  padding: 1.5rem;
  text-align: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(15, 15, 15, 0.08);
}

.rules-page__back {
  margin: 2rem 0 0;
  text-align: center;
}

.rules-page__back-link {
  font-weight: 600;
  color: var(--h-ink-muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

body.home.a11y-high-contrast .rule-card {
  background: #111;
  border-color: #fff;
}

body.home.a11y-high-contrast .rules-more {
  background: #000;
  color: #fff;
  border-color: #fff;
}

body.home.a11y-high-contrast .rules-download--page {
  background: #111;
  border-color: #fff;
}

.section-ngo__wrap {
  width: var(--h-container);
  margin: 0 auto;
}

.hero-ngo {
  position: relative;
  min-height: clamp(80vh, 92svh, 100vh);
  display: flex;
  align-items: flex-end;
  padding: calc(72px + var(--h-space)) var(--h-space) var(--h-space);
  /* Обрезаем фон при scale/parallax — иначе снизу «вылезает» яркая полоса без оверлея */
  overflow: hidden;
  isolation: isolate;
}

@media (max-width: 767px) {
  .hero-ngo {
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding-top: calc(76px + env(safe-area-inset-top, 0px));
    padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
    min-height: clamp(82svh, 90dvh, 100dvh);
  }
}

@media (min-width: 768px) {
  .hero-ngo {
    align-items: center;
    padding-top: calc(72px + 3rem);
  }
}

.hero-ngo__bg {
  position: absolute;
  /* Запас сверху: safe-area + px, иначе полоска без оверлея у края экрана */
  left: -4px;
  right: -4px;
  bottom: -4px;
  top: calc(-20px - env(safe-area-inset-top, 0px));
  background-color: #1a1a1a;
  background-image: url("../assets/img/kabinet-logopeda-v-detskom-sadu.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  z-index: 0;
}

@media (max-width: 767px) {
  .hero-ngo__bg {
    background-position: center 35%;
  }
}

.hero-ngo__parallax {
  will-change: transform;
}

/* На мобиле без scale — меньше артефактов у краёв */
@media (min-width: 768px) {
  body.home:not(.a11y-reduce-motion) .hero-ngo__parallax {
    transform: scale(1.04);
    transform-origin: center center;
  }
}

.hero-ngo__overlay {
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: -4px;
  top: calc(-20px - env(safe-area-inset-top, 0px));
  background: var(--h-hero-overlay);
  z-index: 1;
  pointer-events: none;
}

.hero-ngo__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--h-container);
  margin: 0 auto;
}

@media (max-width: 767px) {
  .hero-ngo__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
    padding-inline: 0.25rem;
  }
}

.hero-ngo__title {
  margin: 0 0 1rem;
  max-width: min(100%, 22rem);
  font-size: clamp(1.85rem, 4.5vw, 3.15rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: #fff;
}

@media (min-width: 768px) {
  .hero-ngo__title {
    max-width: min(100%, 28rem);
  }
}

.hero-ngo__sub {
  margin: 0 0 1.75rem;
  max-width: min(100%, 34rem);
  font-size: clamp(1.125rem, 2vw, 1.35rem);
  font-weight: 400;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
}

@media (max-width: 767px) {
  .hero-ngo__title {
    margin-bottom: 0.75rem;
    margin-inline: auto;
    text-align: center;
    max-width: min(100%, 22rem);
  }

  .hero-ngo__sub {
    margin-bottom: 1.25rem;
    margin-inline: auto;
    text-align: center;
    max-width: min(22rem, 100%);
  }
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--h-touch);
  padding: 0 1.75rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  border-radius: 999px;
  border: 1px solid var(--h-glass-border);
  background: var(--h-glass-bg);
  backdrop-filter: blur(var(--h-glass-blur));
  -webkit-backdrop-filter: blur(var(--h-glass-blur));
  transition: background 0.25s ease, transform 0.25s ease;
}

.btn-hero:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-hero:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.hero-ngo__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

@media (max-width: 767px) {
  .hero-ngo__actions {
    justify-content: center;
    width: 100%;
  }
}

/* Главный CTA в hero — светлая кнопка */
.btn-hero--solid {
  color: var(--h-ink);
  background: #fff;
  border-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.btn-hero--solid:hover {
  background: rgba(255, 255, 255, 0.92);
}

.btn-hero--solid:focus-visible {
  outline-color: #fff;
}

body.home:not(.a11y-reduce-motion) .hero-ngo__fade {
  animation: homeFadeUp 0.9s ease forwards;
  opacity: 0;
  animation-delay: 0.1s;
}

@keyframes homeFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ——— Секции: воздух, без карточных теней ——— */
.section-ngo {
  padding: clamp(4rem, 12vw, 7rem) var(--h-space);
}

.section-ngo--tight-top {
  padding-top: clamp(3rem, 8vw, 5rem);
}

.section-ngo__head {
  margin: 0 0 clamp(2.5rem, 6vw, 4rem);
  max-width: 20ch;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

/* Заголовок + лид в одной обёртке: меньше зазор между h2 и подзаголовком */
.section-ngo__head--with-lead {
  margin-bottom: 0.65rem;
  max-width: none;
}

.directions-ngo__lead {
  margin: 0 0 clamp(1.75rem, 5vw, 2.75rem);
  max-width: 42rem;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--h-ink-muted);
}

/*
 * Направления — не дублируем блок «Программы»:
 * вертикальный список-полосы, номер + заголовок + одна строка смысла (без фото и буллетов).
 */
.directions-stripes {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: var(--h-container);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.directions-stripes__item {
  display: grid;
  grid-template-columns: minmax(2.75rem, 3.5rem) minmax(0, 1fr);
  gap: 1rem 1.25rem;
  align-items: start;
  margin: 0;
  padding: 1.2rem 1.35rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(15, 15, 15, 0.08);
  border-left-width: 4px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}

.directions-stripes__item--a {
  border-left-color: #2f7d6b;
}

.directions-stripes__item--b {
  border-left-color: #4a6fa5;
}

.directions-stripes__item--c {
  border-left-color: #b8734a;
}

.directions-stripes__item--d {
  border-left-color: #6b5b8e;
}

.directions-stripes__index {
  display: block;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: rgba(15, 15, 15, 0.14);
  font-variant-numeric: tabular-nums;
  padding-top: 0.15rem;
}

.directions-stripes__title {
  margin: 0 0 0.4rem;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--h-ink);
}

.directions-stripes__line {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--h-ink-muted);
}

body.home.a11y-high-contrast .directions-stripes__item {
  background: #000;
}

body.home.a11y-high-contrast .directions-stripes__index {
  color: rgba(255, 255, 255, 0.35);
}

/* Как помогаем: горизонтально */
.help-row {
  display: grid;
  gap: 2.5rem;
  max-width: var(--h-container);
  margin: 0 auto;
}

@media (min-width: 900px) {
  .help-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }
}

.help-step {
  padding-top: 1.25rem;
  border-top: 1px solid var(--h-line);
}

.help-step__num {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--h-ink-muted);
}

.help-step__title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.help-step__text {
  margin: 0;
  font-size: 1rem;
  color: var(--h-ink-muted);
  line-height: 1.6;
}

/* О нас */
.about-ngo {
  max-width: var(--h-container);
  margin: 0 auto;
  display: grid;
  gap: clamp(2rem, 5vw, 3rem);
  align-items: center;
}

@media (min-width: 800px) {
  .about-ngo {
    grid-template-columns: 1fr 1.1fr;
    gap: 4rem;
  }
}

.about-ngo__figure {
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  overflow: hidden;
  background: #e8e8e8;
}

.about-ngo__figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-ngo__title {
  margin: 0 0 1.25rem;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.about-ngo__text {
  margin: 0;
  color: var(--h-ink-muted);
  font-size: 1.125rem;
  line-height: 1.7;
}

.about-ngo__text + .about-ngo__text {
  margin-top: 1rem;
}

/* Превью программ на главной: бенто 1+3, теги, результат, фото */
.programs-preview__inner {
  width: var(--h-container);
  margin: 0 auto;
}

.programs-preview .section-ngo__wrap {
  margin-bottom: clamp(1.5rem, 4.5vw, 2.5rem);
}

.programs-preview__lead {
  margin: 0.65rem 0 0;
  max-width: 44rem;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--h-ink-muted);
}

.programs-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  align-items: stretch;
}

/* Лейаут: [крупная featured] → [2 компактные] → [1 компактная по центру] */
.programs-grid--bento {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .programs-grid--bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .program-card--featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow: hidden;
  }

  .program-card--bento-last {
    grid-column: 1 / -1;
    max-width: calc(50% - 8px);
    justify-self: center;
    width: 100%;
  }
}

.program-card--preview {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid var(--h-line);
  background: #fff;
  min-height: 100%;
  box-sizing: border-box;
}

.program-card--compact {
  padding: 0;
  overflow: hidden;
}

.program-card--compact .program-card__content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.program-card--featured {
  overflow: hidden;
  background: #f0f7f5;
  border: 2px solid #2f7d6b;
}

.program-card--featured .program-card__content {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.program-card__media {
  position: relative;
  min-height: 200px;
  background: #e8eeec;
}

/* Лёгкое затемнение снизу фото — плашка читается на любом фоне */
.program-card__media::after,
.program-card__thumb::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35) 0%, transparent 100%);
  border-radius: inherit;
}

.program-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 200px;
}

.program-card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #ececec;
  overflow: hidden;
}

.program-card__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Плашка поверх фото — не «рвёт» блок между картинкой и текстом */
.tag--on-media {
  position: absolute;
  z-index: 1;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  margin: 0;
  box-sizing: border-box;
  padding: 0.5rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #0f3d34;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(47, 125, 107, 0.4);
  border-radius: 10px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.14);
}

@media (min-width: 768px) {
  .program-card--featured .tag--on-media {
    left: 14px;
    right: auto;
    bottom: 14px;
    max-width: min(22rem, calc(100% - 28px));
  }
}

.program-card__name {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--h-ink);
  line-height: 1.25;
}

.program-card--featured .program-card__name {
  font-size: clamp(1.25rem, 2.2vw, 1.45rem);
}

.program-card__outcome {
  margin: 0 0 0.85rem;
  flex: 1 1 auto;
  color: var(--h-ink);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.55;
}

.program-card__bullets {
  margin: 0 0 1.1rem;
  padding-left: 1.2rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--h-ink-muted);
}

.program-card__bullets li {
  margin-bottom: 0.3rem;
}

.program-card__bullets li:last-child {
  margin-bottom: 0;
}

.programs-preview__cta-block {
  margin-top: clamp(2rem, 5vw, 2.75rem);
  padding: clamp(1.5rem, 4vw, 2rem);
  text-align: center;
  border-radius: 12px;
  border: 1px solid var(--h-line);
  background: linear-gradient(180deg, #fafcfb 0%, #f3f8f6 100%);
}

.programs-preview__cta-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--h-ink);
}

.programs-preview__cta-text {
  margin: 0 auto 1.25rem;
  max-width: 32rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--h-ink-muted);
}

.programs-preview__cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--h-touch);
  padding: 0 1.35rem;
}

.programs-preview__more {
  margin-top: clamp(1.5rem, 4vw, 2rem);
  text-align: center;
}

.programs-preview__link {
  font-weight: 600;
  color: var(--h-ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.programs-preview__link:hover {
  opacity: 0.8;
}

/* Старый класс описания — на странице программ и др. */
.program-card__desc {
  margin: 0 0 1.25rem;
  flex: 1 1 auto;
  color: var(--h-ink-muted);
  font-size: 1rem;
  line-height: 1.55;
}

/* Результаты */
.results-ngo {
  max-width: var(--h-container);
  margin: 0 auto;
}

.results-ngo__list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 38rem;
}

.results-ngo__list li {
  position: relative;
  padding: 0.85rem 0 0.85rem 1.75rem;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--h-ink-muted);
  border-bottom: 1px solid var(--h-line);
}

.results-ngo__list li:last-child {
  border-bottom: none;
}

.results-ngo__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.15rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--h-ink);
  opacity: 0.35;
}

/* CTA блок */
.cta-ngo {
  padding: clamp(4rem, 10vw, 6rem) var(--h-space);
  text-align: center;
  background: #f6f6f6;
  border-top: 1px solid var(--h-line);
  border-bottom: 1px solid var(--h-line);
}

.cta-ngo__inner {
  max-width: 36rem;
  margin: 0 auto;
}

.cta-ngo__title {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cta-ngo__text {
  margin: 0 0 1.75rem;
  color: var(--h-ink-muted);
  font-size: 1.125rem;
}

.btn-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--h-touch);
  padding: 0 2rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: var(--h-ink);
  border: none;
  border-radius: 999px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-solid:hover {
  opacity: 0.88;
}

.btn-solid:focus-visible {
  outline: 2px solid var(--h-ink);
  outline-offset: 3px;
}

/* Footer */
.footer-ngo {
  padding: 3rem var(--h-space);
  border-top: 1px solid var(--h-line);
}

.footer-ngo__inner {
  width: var(--h-container);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .footer-ngo__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.footer-ngo__copy {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--h-ink-muted);
}

.footer-ngo__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-ngo__link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--h-ink);
  text-decoration: none;
}

.footer-ngo__link:hover,
.footer-ngo__link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ——— Внутренние страницы (контакты, программы): тот же визуальный язык, что и главная ——— */
body.home.page-inner .header--over-hero {
  background: var(--h-header-solid);
  backdrop-filter: blur(var(--h-glass-blur));
  -webkit-backdrop-filter: blur(var(--h-glass-blur));
  border-bottom-color: var(--h-line);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

body.home.page-inner .header--over-hero .header-ngo__logo-text,
body.home.page-inner .header--over-hero .header-ngo__link {
  color: var(--h-ink);
  text-shadow: none;
}

body.home.page-inner .header--over-hero .header-ngo__link:hover,
body.home.page-inner .header--over-hero .header-ngo__link:focus-visible {
  color: #000;
}

body.home.page-inner .header-ngo__burger {
  background: var(--h-white);
  border-color: var(--h-line);
}

body.home.page-inner .header-ngo__burger-line {
  color: var(--h-ink);
}

body.home.page-inner .header--over-hero .btn-glass {
  border-color: var(--h-line);
  background: rgba(15, 15, 15, 0.04);
  color: var(--h-ink);
}

body.home.page-inner .header--over-hero .btn-glass:hover {
  background: rgba(15, 15, 15, 0.07);
  border-color: rgba(15, 15, 15, 0.15);
}

body.home.page-inner .header-ngo__link[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.page-inner-main {
  padding-top: calc(72px + env(safe-area-inset-top, 0px));
}

body.home.page-inner .page-inner-main .section-ngo.page-inner-section {
  padding-top: clamp(2rem, 5vw, 3rem);
  padding-bottom: clamp(4rem, 10vw, 6rem);
}

.page-inner-head {
  width: var(--h-container);
  margin: 0 auto clamp(2rem, 5vw, 3rem);
}

.page-inner-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--h-ink);
}

.page-inner-lead {
  margin: 0;
  max-width: 36rem;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--h-ink-muted);
}

/* Контакты */
.page-inner-contacts {
  width: var(--h-container);
  margin: 0 auto;
  display: grid;
  gap: clamp(2rem, 5vw, 3rem);
  max-width: 42rem;
}

.page-inner-card {
  padding: 1.5rem 1.35rem;
  border-radius: 12px;
  border: 1px solid var(--h-line);
  background: #fff;
}

.page-inner-card__title {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--h-ink);
}

.page-inner-card__phone {
  margin: 0;
}

.page-inner-card__tel {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--h-ink);
  text-decoration: none;
  border-bottom: 2px solid rgba(15, 15, 15, 0.15);
  transition: opacity 0.2s ease;
}

.page-inner-card__tel:hover {
  opacity: 0.75;
}

.page-inner-card__note {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  color: var(--h-ink-muted);
}

.page-inner-card__hint {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--h-ink-muted);
}

.page-inner-card__hint code {
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: #f0f0f0;
}

.page-inner-messengers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-messenger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--h-touch);
  padding: 0 1.35rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--h-ink);
  border-radius: 999px;
  border: 1px solid var(--h-line);
  background: #fafafa;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-messenger:hover {
  background: #f0f0f0;
  border-color: rgba(15, 15, 15, 0.18);
}

.btn-messenger:focus-visible {
  outline: 2px solid var(--h-ink);
  outline-offset: 3px;
}

.page-inner-map {
  margin-top: 0.25rem;
}

.page-inner-map-frame {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border: 1px solid var(--h-line);
  border-radius: 12px;
  background: #f3f3f3;
}

.page-inner-map-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.page-inner-map-link {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
}

.page-inner-map-link a {
  font-weight: 600;
  color: var(--h-ink);
}

/* Программы (страница): фильтр по возрасту + сетка карточек */
.page-inner-programs {
  width: var(--h-container);
  margin: 0 auto;
}

.page-inner-programs .filters {
  margin: 0 0 clamp(1.5rem, 4vw, 2.25rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem 1.15rem;
  background: #fafafa;
  border: 1px solid var(--h-line);
  border-radius: 12px;
}

.page-inner-programs .filters__label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--h-ink);
}

.page-inner-programs .filters__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-inner-programs .filters__btn {
  min-height: var(--h-touch);
  padding: 0 1rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid var(--h-line);
  border-radius: 999px;
  background: #fff;
  color: var(--h-ink);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.page-inner-programs .filters__btn:hover,
.page-inner-programs .filters__btn:focus-visible {
  border-color: rgba(15, 15, 15, 0.25);
}

.page-inner-programs .filters__btn--active {
  background: var(--h-ink);
  color: #fff;
  border-color: var(--h-ink);
}

.page-inner-programs .filters__empty {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  background: #f6f6f6;
  border: 1px solid var(--h-line);
  border-radius: 10px;
  color: var(--h-ink-muted);
  font-size: 1rem;
}

.programs-grid-full {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
}

.page-inner-programs .program-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  min-height: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid var(--h-line);
  border-radius: 12px;
  transition: box-shadow 0.2s ease;
}

.page-inner-programs .program-card.is-hidden {
  display: none !important;
}

.page-inner-programs .program-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}

.page-inner-programs .program-card__title {
  margin: 0 0 0.65rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--h-ink);
  line-height: 1.3;
}

.page-inner-programs .program-card__lead {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  color: var(--h-ink-muted);
  line-height: 1.55;
}

.page-inner-programs .program-card__list {
  margin: 0 0 1.15rem;
  padding-left: 1.2rem;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--h-ink);
}

.page-inner-programs .program-card__list li {
  margin-bottom: 0.35rem;
}

.page-inner-programs .program-card__list li:last-child {
  margin-bottom: 0;
}

.page-inner-programs .program-card__btn {
  margin-top: auto;
  align-self: flex-start;
}

/* Документы внизу страницы программ */
.programs-docs {
  padding-top: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: clamp(2rem, 5vw, 3rem);
  border-top: 1px solid var(--h-line);
  background: linear-gradient(180deg, #fafafa 0%, #fff 40%);
}

.programs-docs__inner {
  width: var(--h-container);
  margin: 0 auto;
}

.programs-docs__title {
  margin: 0 0 1.25rem;
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.programs-docs__grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .programs-docs__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.doc-card {
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--h-line);
  border-radius: 12px;
  background: #fff;
}

.doc-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.doc-card__text {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--h-ink-muted);
  line-height: 1.5;
}

.doc-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.doc-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 0.2rem;
  box-sizing: border-box;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  color: var(--h-ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.doc-card__link:hover {
  opacity: 0.85;
}

.doc-card__link--primary {
  text-decoration: none;
  padding: 0 1rem;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--h-line);
  background: var(--h-ink);
  color: #fff;
}

.doc-card__link--primary:hover {
  opacity: 0.92;
}

body.home.page-inner.a11y-high-contrast .page-inner-card,
body.home.page-inner.a11y-high-contrast .page-inner-programs .program-card,
body.home.page-inner.a11y-high-contrast .doc-card {
  background: #000;
  border-color: #fff;
}

body.home.page-inner.a11y-high-contrast .doc-card__link--primary {
  background: #fff;
  color: #000;
  border-color: #fff;
}

body.home.page-inner.a11y-high-contrast .btn-messenger {
  background: #000;
  color: #fff;
  border-color: #fff;
}

/* Наши специалисты — фото: assets/img/specialist/1.jpg … 7.jpg */
.specialists-list {
  width: var(--h-container);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 5vw, 3.5rem);
}

.specialist-card {
  display: grid;
  gap: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--h-line);
  border-radius: 12px;
  background: #fff;
}

@media (min-width: 768px) {
  .specialist-card {
    grid-template-columns: min(200px, 28vw) 1fr;
    align-items: start;
    gap: clamp(1.25rem, 3vw, 2rem);
  }
}

.specialist-card__photo {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: #ececec;
  max-width: 240px;
}

@media (max-width: 767px) {
  .specialist-card__photo {
    max-width: 16rem;
    margin: 0 auto;
    width: 100%;
  }

  .specialist-card {
    text-align: left;
  }
}

.specialist-card__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.specialist-card__name {
  margin: 0 0 0.5rem;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--h-ink);
  line-height: 1.25;
}

.specialist-card__role {
  margin: 0 0 1rem;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--h-ink-muted);
}

.specialist-card__bio p {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--h-ink-muted);
}

.specialist-card__bio p:last-child {
  margin-bottom: 0;
}

.specialist-card__bio ul {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
  color: var(--h-ink-muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.specialist-card__bio li {
  margin-bottom: 0.4rem;
}

.specialist-card__bio strong {
  color: var(--h-ink);
  font-weight: 600;
}

body.home.page-inner.a11y-high-contrast .specialist-card {
  background: #000;
  border-color: #fff;
}

body.home.page-inner.a11y-high-contrast .specialist-card__name {
  color: #fff;
}

body.home.page-inner.a11y-high-contrast .specialist-card__role,
body.home.page-inner.a11y-high-contrast .specialist-card__bio p,
body.home.page-inner.a11y-high-contrast .specialist-card__bio ul {
  color: #e8e8e8;
}

body.home.page-inner.a11y-high-contrast .specialist-card__bio strong {
  color: #fff;
}

/* Главная: превью галереи (bento) */
.gallery-preview__lead {
  margin: 0.35rem 0 0;
  max-width: 40rem;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--h-ink-muted);
}

.gallery-preview__inner {
  width: var(--h-container);
  margin: 0 auto;
  padding-top: 0.5rem;
  text-align: center;
}

.gallery-preview__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-auto-rows: 140px;
  gap: 12px;
}

.gallery-preview__tile {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  background: #ececec;
  outline: none;
  box-shadow: 0 1px 0 rgba(15, 15, 15, 0.06);
}

.gallery-preview__tile:focus-visible {
  outline: 2px solid var(--h-ink);
  outline-offset: 3px;
}

.gallery-preview__tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-preview__tile img {
    transition: none;
  }
}

.gallery-preview__tile:hover img,
.gallery-preview__tile:focus-visible img {
  transform: scale(1.04);
}

.gallery-preview__tile--hero {
  grid-row: span 2;
}

.gallery-preview__tile--more img {
  transform: none;
}

.gallery-preview__tile--more:hover img,
.gallery-preview__tile--more:focus-visible img {
  transform: scale(1.04);
}

.gallery-preview__more-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  pointer-events: none;
}

.gallery-preview__more-text {
  font-weight: 700;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  letter-spacing: 0.02em;
}

.gallery-preview__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.75rem;
  padding: 0.7rem 1.35rem;
  font-weight: 600;
  font-size: 1.02rem;
  text-decoration: none;
  color: var(--h-ink);
  border: 1px solid var(--h-line);
  border-radius: 999px;
  background: var(--h-white);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.gallery-preview__cta:hover {
  background: rgba(15, 15, 15, 0.04);
  border-color: rgba(15, 15, 15, 0.18);
}

.gallery-preview__cta:active {
  transform: scale(0.98);
}

@media (max-width: 699px) {
  .gallery-preview__grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(96px, 28vw);
  }

  .gallery-preview__tile--hero {
    grid-column: 1 / -1;
    grid-row: span 2;
    min-height: 200px;
  }
}

body.home.a11y-high-contrast .gallery-preview__tile {
  outline: 1px solid #fff;
}

body.home.a11y-high-contrast .gallery-preview__more-overlay {
  background: rgba(0, 0, 0, 0.65);
}

body.home.a11y-high-contrast .gallery-preview__cta {
  background: #000;
  color: #fff;
  border-color: #fff;
}

/* Видео: превью на главной и страница video.html */
.video-preview__lead {
  margin: 0.35rem 0 0;
  max-width: 40rem;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--h-ink-muted);
}

.video-preview__inner {
  width: var(--h-container);
  margin: 0 auto;
  padding-top: clamp(0.75rem, 2vw, 1.25rem);
  text-align: center;
}

.video-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .video-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.video {
  position: relative;
  padding-top: 56.25%;
  border-radius: 16px;
  overflow: hidden;
  background: #0f0f0f;
  box-shadow: 0 2px 12px rgba(15, 15, 15, 0.08);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 28px rgba(15, 15, 15, 0.14);
}

@media (prefers-reduced-motion: reduce) {
  .video {
    transition: none;
  }

  .video:hover {
    transform: none;
  }
}

.video-preview__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  padding: 0.7rem 1.35rem;
  font-weight: 600;
  font-size: 1.02rem;
  text-decoration: none;
  color: var(--h-ink);
  border: 1px solid var(--h-line);
  border-radius: 999px;
  background: var(--h-white);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.video-preview__cta:hover {
  background: rgba(15, 15, 15, 0.04);
  border-color: rgba(15, 15, 15, 0.18);
}

.video-preview__cta:active {
  transform: scale(0.98);
}

.video-page .page-inner-head {
  margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
}

.video-grid-full {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  max-width: var(--h-container);
  margin: 0 auto;
}

@media (min-width: 768px) {
  .video-grid-full {
    grid-template-columns: 1fr 1fr;
  }
}

body.home.a11y-high-contrast .video-preview__cta {
  background: #000;
  color: #fff;
  border-color: #fff;
}

body.home.a11y-high-contrast .video {
  outline: 1px solid var(--h-line);
}

body.home.a11y-high-contrast .video:hover {
  box-shadow: none;
}

/* Страница галереи: hero + сетка 1+2 + «день из жизни» + masonry + CTA */
.gallery-page__intro {
  margin-bottom: clamp(1.5rem, 4vw, 2rem);
}

.gallery-page__content {
  width: var(--h-container);
  margin: 0 auto;
}

/* Верх: 1 крупная + 2 малых */
.grid-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
  margin-bottom: clamp(2rem, 5vw, 2.75rem);
}

.grid-top .photo-card--hero {
  grid-row: span 2;
}

@media (max-width: 767px) {
  .grid-top {
    grid-template-columns: 1fr 1fr;
  }

  .grid-top .photo-card--hero {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 200px;
  }

  .grid-top .photo-card--hero img {
    width: 100%;
    max-height: min(52vw, 320px);
    object-fit: cover;
  }
}

/* Карточка фото + подпись по ховеру */
.gallery-page .photo-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #ececec;
  text-align: left;
  box-shadow: 0 2px 10px rgba(15, 15, 15, 0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-page .photo-card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  vertical-align: top;
  transition: transform 0.4s ease;
}

.gallery-page .photo-card__overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 14px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  opacity: 0;
  transition: opacity 0.28s ease;
}

.gallery-page .photo-card:hover .photo-card__overlay,
.gallery-page .photo-card:focus-visible .photo-card__overlay {
  opacity: 1;
}

.gallery-page .photo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15, 15, 15, 0.14);
}

.gallery-page .photo-card:hover img {
  transform: scale(1.02);
}

.gallery-page .photo-card:focus-visible {
  outline: 2px solid var(--h-ink);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-page .photo-card,
  .gallery-page .photo-card img {
    transition: none;
  }

  .gallery-page .photo-card:hover,
  .gallery-page .photo-card:hover img {
    transform: none;
  }

  .gallery-page .photo-card__overlay {
    opacity: 1;
  }
}

/* «День из жизни центра» */
.gallery-story {
  margin-bottom: clamp(2rem, 5vw, 2.75rem);
}

.gallery-story__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--h-ink);
}

.gallery-story__lead {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--h-ink-muted);
  max-width: 36rem;
}

.gallery-story__strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.gallery-story__strip .photo-card--story {
  flex: 0 0 min(200px, 72vw);
  scroll-snap-align: start;
}

/* Masonry */
.gallery-masonry {
  display: block;
  column-count: 2;
  column-gap: 12px;
  padding-bottom: 0.5rem;
}

@media (min-width: 769px) {
  .gallery-masonry {
    column-count: 3;
  }
}

.gallery-masonry .photo-card {
  break-inside: avoid;
  page-break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin-bottom: 12px;
}

/* CTA */
.gallery-cta {
  width: var(--h-container);
  margin: clamp(2.5rem, 6vw, 3.5rem) auto 0;
  padding: clamp(1.75rem, 4vw, 2.25rem);
  text-align: center;
  border-radius: 16px;
  border: 1px solid var(--h-line);
  background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
}

.gallery-cta__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.2rem, 2.8vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--h-ink);
}

.gallery-cta__text {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  color: var(--h-ink-muted);
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.gallery-cta__btn {
  display: inline-flex;
}

body.home.a11y-high-contrast .gallery-page .photo-card {
  outline: 1px solid var(--h-line);
}

body.home.a11y-high-contrast .gallery-page .photo-card:hover {
  box-shadow: none;
}

body.home.a11y-high-contrast .gallery-cta {
  background: #111;
  border-color: #fff;
}

/* Lightbox */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.gallery-lightbox[hidden] {
  display: none !important;
}

.gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

.gallery-lightbox__panel {
  position: relative;
  z-index: 1;
  width: min(100vw - 1rem, 1200px);
  max-height: min(92vh, 940px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem 3.25rem;
  pointer-events: none;
  touch-action: manipulation;
}

.gallery-lightbox__panel > * {
  pointer-events: auto;
}

.gallery-lightbox__img {
  max-width: 100%;
  max-height: min(88vh, 920px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}

.gallery-lightbox__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  font-size: 1.75rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  transition: background 0.2s ease;
}

.gallery-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  font-size: 1.75rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: background 0.2s ease;
}

.gallery-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.gallery-lightbox__prev {
  left: 0.25rem;
}

.gallery-lightbox__next {
  right: 0.25rem;
}

@media (max-width: 599px) {
  .gallery-lightbox__panel {
    padding: 2.75rem 0.25rem 2.25rem;
  }

  .gallery-lightbox__prev {
    left: 0.1rem;
  }

  .gallery-lightbox__next {
    right: 0.1rem;
  }
}

.gallery-lightbox__caption {
  position: absolute;
  bottom: 3.1rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  max-width: min(92vw, 34rem);
  padding: 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}

.gallery-lightbox__caption:empty {
  display: none;
}

.gallery-lightbox__counter {
  position: absolute;
  bottom: 1.15rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.gallery-lightbox__hint {
  display: none;
  position: absolute;
  bottom: 0.25rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  max-width: 90vw;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

@media (max-width: 768px) {
  .gallery-lightbox__hint {
    display: block;
  }

  .gallery-lightbox__caption {
    bottom: 3.65rem;
    font-size: 0.88rem;
  }
}

body.gallery-lightbox-open {
  overflow: hidden;
}

body.home.a11y-high-contrast .gallery-lightbox__close,
body.home.a11y-high-contrast .gallery-lightbox__nav {
  background: #000;
  border: 2px solid #fff;
  color: #fff;
}

