/* ==========================================================================
   А-Медик — вариант 1. Дизайн-токены
   ========================================================================== */
:root {
  --font-display: "Manrope", "Golos Text", system-ui, sans-serif;
  --font-body: "Golos Text", system-ui, -apple-system, sans-serif;

  --bg: #e9efe7;
  --surface: #ffffff;
  --panel-radius: 28px;
  --frame-gap: 14px;
  --ink: #14261a;
  --ink-2: #2b3f31;
  --muted: #5f7364;
  --line: #dce5da;
  --line-strong: #c9d7c8;

  --green-900: #213f21;
  --green-800: #2a512b;
  --green-700: #2f5e31;
  --green-600: #356836;
  --green-500: #4a8a4c;
  --green-200: #cfe0cd;
  --green-100: #e3eee1;
  --green-50: #eef4ec;
  --red: #c43024;

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;

  --container: 1200px;
  --frame: 1360px;
  --gutter: clamp(12px, 2.5vw, 32px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------------------
   База
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font: 400 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }

img { max-width: 100%; display: block; }
svg { display: block; }
button { font: inherit; color: inherit; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid rgba(74, 138, 76, 0.45);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}
.frame {
  width: min(100% - 2 * var(--gutter), var(--frame));
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Кнопки
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn svg { width: 20px; height: 20px; flex: none; transition: transform 0.2s var(--ease-out); }
.btn:hover svg { transform: translateX(2px); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--green-700);
  color: #fff;
}
.btn-primary:hover { background: var(--green-900); }

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary svg { color: var(--green-600); }
.btn-secondary:hover { border-color: var(--green-600); color: var(--green-800); }

.btn-tonal {
  background: var(--green-100);
  color: var(--green-900);
}
.btn-tonal:hover { background: var(--green-200); }

.btn-sm { height: 44px; padding: 0 20px; font-size: 14px; }
.btn-lg { height: 58px; padding: 0 30px; font-size: 16px; }

/* Крупные кнопки: при наведении заливка проезжает слева направо */
.btn-lg {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn-lg::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  background: var(--sweep, transparent);
  transform: translateX(-101%);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.btn-lg:hover::before { transform: translateX(0); }
.btn-lg.btn-primary { --sweep: var(--green-900); }
.btn-lg.btn-primary:hover { background: var(--green-700); }
.btn-lg.btn-secondary { --sweep: var(--green-100); }

@media (prefers-reduced-motion: reduce) {
  .btn, .btn svg, .btn-lg::before { transition: none; }
}

/* --------------------------------------------------------------------------
   Шапка
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: var(--frame-gap);
}
.header-bar {
  background: var(--surface);
  border-radius: 22px;
  border: 1px solid transparent;
  transition: border-color 0.3s;
}
.site-header.is-scrolled .header-bar { border-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 74px;
  padding: 0 14px 0 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--green-900);
  flex: none;
}
.brand-mark { width: 50px; height: 46px; }
.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font: 800 20px/1 var(--font-display);
  letter-spacing: -0.01em;
}
.brand-sub {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.nav {
  display: flex;
  gap: 2px;
  margin-inline: auto;
  min-width: 0;
}
.nav a {
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}
.nav a:hover { color: var(--green-700); }

.header-contacts {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: none;
}
.header-address {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
}
.header-address-line { font-size: 13px; color: var(--muted); white-space: nowrap; }
.header-phone {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.header-phone:hover { color: var(--green-700); }

.burger {
  display: none;
  width: 46px;
  height: 46px;
  margin-left: auto;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  cursor: pointer;
  place-items: center;
}
.burger svg { width: 22px; height: 22px; }
.burger .burger-close { display: none; }
.burger[aria-expanded="true"] .burger-open { display: none; }
.burger[aria-expanded="true"] .burger-close { display: block; }

/* Мобильное меню: дропдаун под плашкой шапки поверх контента, ничего не сдвигает */
.mobile-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 60;
  padding-top: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-out), visibility 0s 0.22s;
}
.mobile-menu::before {
  /* прозрачная подложка на весь экран: тап мимо панели закрывает меню */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
}
.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-out);
}
.mobile-sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 8px 22px 22px;
}
.mobile-nav {
  display: flex;
  flex-direction: column;
}
.mobile-nav a {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font: 600 20px/1.2 var(--font-display);
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.mobile-nav a:hover { color: var(--green-700); }
.mobile-contacts {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-top: 20px;
}
.mobile-address { font-size: 14px; color: var(--muted); }
.mobile-phone {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.mobile-contacts .btn { width: 100%; margin-top: 14px; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: var(--frame-gap);
}
.hero-panel {
  background: var(--surface);
  border-radius: var(--panel-radius);
  overflow: hidden;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.hero-copy {
  padding: clamp(28px, 4vw, 56px) 0 clamp(28px, 4vw, 56px) clamp(24px, 3.6vw, 52px);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin: 0;
  padding: 0 14px 0 10px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid transparent;
  color: var(--green-800);
  font-size: 14px;
  font-weight: 500;
}
.chip svg { width: 16px; height: 16px; color: var(--green-600); }

.hero-title {
  margin: 22px 0 0;
  max-width: 660px;
  font: 700 clamp(2.3rem, 3.6vw, 3.25rem) / 1.08 var(--font-display);
  letter-spacing: -0.024em;
  color: var(--ink);
}
.hero-title .accent { color: inherit; }

.hero-lead {
  margin: 22px 0 0;
  max-width: 520px;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

/* Визуальная часть: фото впритык к краям плашки */
.hero-visual { position: relative; height: 100%; }

.hero-media {
  position: relative;
  margin: 0;
  height: 100%;
  min-height: clamp(420px, 42vw, 600px);
  border-radius: 24px 0 0 24px;
  overflow: hidden;
  background: var(--green-100);
  isolation: isolate;
}

.slider { position: absolute; inset: 0; }
.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 50%;
  opacity: 0;
  transition: opacity 0.8s var(--ease-out);
}
.slide.is-active { opacity: 1; }

.slider-dots {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 6px;
  padding: 7px;
  border-radius: var(--radius-pill);
  background: rgba(20, 38, 26, 0.32);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.slider-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: width 0.35s var(--ease-out), background 0.3s;
}
.slider-dot.is-active { width: 22px; background: #fff; }

.hero-panels {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.glass-panel {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 15px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.34));
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  backdrop-filter: blur(24px) saturate(1.7);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.panel-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--green-800);
}
.panel-icon svg { width: 16px; height: 16px; }
.panel-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.panel-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}
.panel-main {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.panel-sub {
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   О центре
   -------------------------------------------------------------------------- */
.about {
  padding: clamp(48px, 7vw, 96px) 0 clamp(72px, 9vw, 120px);
}

.section-title {
  margin: 0;
  font: 700 clamp(1.8rem, 3vw, 2.5rem) / 1.14 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
  gap: 16px;
  margin-top: clamp(20px, 2.6vw, 32px);
  align-items: stretch;
}

.about-media {
  position: relative;
  margin: 0;
  min-height: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--green-100);
}
.about-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 68% 50%;
}

.advantages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.advantage {
  display: flex;
  flex-direction: column;
  padding: 26px 26px 26px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}
.advantage-index {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--green-100);
  color: var(--green-800);
  font: 700 13px/1 var(--font-display);
  letter-spacing: 0.04em;
}
.advantage h3 {
  margin: 28px 0 0;
  font: 700 clamp(1.1rem, 1.5vw, 1.3rem) / 1.25 var(--font-display);
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: balance;
}
.advantage p {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: auto;
  padding: 18px 0 0;
  border: 0;
  background: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--green-700);
  text-decoration: none;
  cursor: pointer;
}
.text-link svg { width: 18px; height: 18px; transition: transform 0.3s var(--ease-out); }
.text-link:hover { color: var(--green-900); }
.text-link:hover svg { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   Модальное окно
   -------------------------------------------------------------------------- */
.modal {
  width: 100%;
  max-width: min(640px, calc(100% - 32px));
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-2);
}
.modal::backdrop {
  background: rgba(20, 38, 26, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.modal-inner {
  background: var(--surface);
  border-radius: var(--panel-radius);
  padding: clamp(22px, 3vw, 36px);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.modal-kicker {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--green-600);
}
.modal-title {
  margin: 6px 0 0;
  font: 700 clamp(1.5rem, 2.4vw, 2rem) / 1.15 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.modal-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-900);
  cursor: pointer;
  transition: background 0.2s;
}
.modal-close:hover { background: var(--green-200); }
.modal-close svg { width: 20px; height: 20px; }
.modal-text {
  margin: 16px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}
.modal-phone {
  font-weight: 600;
  color: var(--green-700);
  text-decoration: none;
  white-space: nowrap;
}
.modal-phone:hover { color: var(--green-900); }

/* Форма */
.form {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}
.form input[type="text"],
.form input[type="tel"] {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  font: 500 15px/1 var(--font-body);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.form input::placeholder { color: var(--muted); font-weight: 400; }
.form input:focus { border-color: var(--green-500); background: var(--surface); }
.form .btn { width: 100%; height: 52px; }
.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 6px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  cursor: pointer;
}
.form-consent input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--green-700);
  flex: none;
}
.form-consent a {
  color: var(--green-700);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(47, 94, 49, 0.4);
}
.form-consent a:hover { color: var(--green-900); text-decoration-color: currentColor; }
.modal-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.modal-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
}
.modal-check {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--green-700);
}
.modal-check svg { width: 18px; height: 18px; }
.modal[open] { animation: modal-in 0.28s var(--ease-out); }
.modal[open]::backdrop { animation: fade-in 0.28s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .modal[open], .modal[open]::backdrop { animation: none; }
}

/* --------------------------------------------------------------------------
   Появление при загрузке
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    animation: rise 0.9s var(--ease-out) forwards;
  }
  .reveal[data-delay="1"] { animation-delay: 0.08s; }
  .reveal[data-delay="2"] { animation-delay: 0.16s; }
  .reveal[data-delay="3"] { animation-delay: 0.26s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}

/* --------------------------------------------------------------------------
   Адаптив
   -------------------------------------------------------------------------- */
/* Шапка: ступенчато освобождаем место, чтобы пункты меню не переносились */
@media (max-width: 1400px) {
  .header-inner { gap: 22px; }
  .nav a { padding: 10px 11px; font-size: 14px; }
  .header-address .header-address-line { display: none; }
}
@media (max-width: 1280px) {
  .header-address { display: none; }
  .nav a { padding: 10px 9px; }
}

@media (max-width: 1100px) {
  .hero-panels { grid-template-columns: 1fr; max-width: 300px; }
}

@media (max-width: 1120px) {
  .nav, .header-contacts { display: none; }
  .burger { display: grid; }
  .mobile-menu { display: block; }
  .header-inner { height: 68px; padding: 0 12px 0 16px; }

  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .hero-copy { max-width: none; padding: clamp(24px, 4vw, 40px) clamp(20px, 4vw, 40px) clamp(24px, 4vw, 36px); }
  .hero-title, .hero-lead { max-width: 640px; }
  .hero-media { min-height: 0; height: auto; aspect-ratio: 16 / 10; border-radius: 20px 20px 0 0; }
  .hero-panels { grid-template-columns: 1fr 1fr; max-width: none; }

  .about-grid { grid-template-columns: 1fr; }
  .about-media { min-height: 0; aspect-ratio: 16 / 10; }
  .about-media img { position: static; height: 100%; aspect-ratio: 16 / 10; object-position: 70% 45%; }
}

/* Планшеты в альбомной ориентации: кадры ниже, чтобы не занимать весь экран */
@media (min-width: 900px) and (max-width: 1120px) {
  .hero-media { aspect-ratio: 2 / 1; }
  .slide { object-position: 55% 40%; }
  .about-media { aspect-ratio: 2 / 1; }
  .about-media img { aspect-ratio: 2 / 1; object-position: 70% 45%; }
}

@media (max-width: 640px) {
  :root { --frame-gap: 10px; --panel-radius: 20px; }
  .header-bar { border-radius: 18px; }
  .brand-mark { width: 42px; height: 39px; }
  .brand-name { font-size: 18px; }

  /* Группировка по близости: внутри группы 12–14px, между группами 24px */
  .hero-copy { padding: 18px 16px 24px; }
  .chip { height: 34px; font-size: 13px; }
  .hero-title { margin-top: 14px; font-size: clamp(1.75rem, 7.6vw, 2.2rem); line-height: 1.1; }
  .hero-lead { margin-top: 12px; font-size: 1rem; }
  .hero-actions { margin-top: 24px; gap: 10px; }
  .hero-actions .btn { width: 100%; height: 56px; }

  /* Галерея во всю ширину плашки, стеклянные плашки поверх фото, как на десктопе */
  .hero-media { aspect-ratio: 4 / 4.6; border-radius: 18px 18px 0 0; }
  .slider-dots { top: 12px; right: 12px; }
  .hero-panels {
    left: 12px;
    right: 12px;
    bottom: 12px;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .glass-panel { padding: 12px 14px; }

  /* «О центре»: фото между 2-й и 3-й карточкой */
  .about-grid { gap: 12px; }
  .advantages { display: contents; }
  .advantage:nth-child(-n + 2) { order: -1; }
  .about-media { order: 0; }
  .advantage:nth-child(n + 3) { order: 1; }

  .advantages { grid-template-columns: 1fr; }
  .advantage { padding: 22px; }
  .advantage h3 { margin-top: 22px; }
}
