/*
 * ЯЖИЗНЬ — моушен и микровзаимодействия.
 * Принцип: движения мало, оно медленное и согласованное.
 * Один оркестрованный вход hero, тихие reveal, ховер = подъём + тень.
 * Без 3D-наклонов, бликов и blur — они дешевят и лагают.
 */

:root {
    --polish-ease: cubic-bezier(0.22, 0.72, 0.22, 1);
    --polish-ease-out: cubic-bezier(0.2, 0.86, 0.28, 1);
    --polish-shadow-hover: 0 20px 52px rgba(16, 38, 34, 0.13);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h, 76px) + 18px);
}

body {
    overflow-x: clip;
}

/* ---------- Шапка: стекло + состояние прокрутки ---------- */

.site-header {
    transition: box-shadow 0.28s ease, background-color 0.28s ease;
}

.site-header.is-scrolled {
    box-shadow: 0 10px 34px rgba(17, 31, 28, 0.08);
}

/* Header fit */
.site-header .site-header__inner {
    gap: clamp(10px, 1.7vw, 24px);
}

.site-header .brand {
    flex: 0 1 auto;
    min-width: 0;
    gap: 10px;
}

.site-header .brand img {
    flex: 0 0 auto;
}

.site-header .brand--home img {
    width: clamp(148px, 11.6vw, 164px);
    max-width: 164px;
}

.site-header .brand__note,
.site-header .brand > span:not([class]) {
    display: -webkit-box;
    max-width: 168px;
    padding-left: 12px;
    border-left: 1px solid var(--line, rgba(23, 33, 31, 0.13));
    overflow: hidden;
    color: var(--muted, #5f6d68);
    font-size: 12px;
    font-weight: 400 !important;
    line-height: 1.22;
    letter-spacing: 0;
    text-transform: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.site-header .desktop-nav {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
    gap: clamp(12px, 1.45vw, 22px);
}

.site-header .desktop-nav a {
    white-space: nowrap;
    font-size: clamp(13px, 1vw, 15px);
}

.site-header .header-actions,
.site-header .phone-link {
    flex: 0 0 auto;
}

@media (max-width: 1280px) {
    .site-header .brand img {
        max-width: 118px;
    }

    .site-header .brand--home img {
        width: 142px;
        max-width: 142px;
    }

    .site-header .brand__note,
    .site-header .brand > span:not([class]) {
        max-width: 136px;
        font-size: 11px;
        line-height: 1.18;
    }

    .site-header .desktop-nav {
        gap: 12px;
    }
}

@media (max-width: 760px) {
    .site-header .brand--home img {
        width: 124px;
        max-width: 124px;
    }
}

@media (max-width: 1120px) {
    .site-header:has(.menu-toggle) .desktop-nav,
    .site-header:has(.menu-toggle) .phone-link,
    .site-header:has(.menu-toggle) .header-actions .btn {
        display: none !important;
    }

    .site-header:has(.menu-toggle) .menu-toggle {
        display: inline-flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
}

@supports ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
    .site-header {
        background: rgba(251, 250, 247, 0.72) !important;
        -webkit-backdrop-filter: blur(20px) saturate(1.1);
        backdrop-filter: blur(20px) saturate(1.1);
    }

    .modal,
    .document-modal__panel {
        background: rgba(255, 255, 255, 0.92) !important;
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
    }
}

/* ---------- Вход hero: один оркестрованный каскад ---------- */

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

.motion-ready .hero .eyebrow,
.motion-ready .hero h1,
.motion-ready .hero .hero__lead,
.motion-ready .hero .hero__text,
.motion-ready .hero .hero__actions,
.motion-ready .hero .medical-note--hero,
.motion-ready .hero .hero-proof,
.motion-ready .hero .hero__bottom,
.motion-ready .hero .stats,
.motion-ready .hero .hero-service,
.motion-ready .hero .hero-panel,
.motion-ready .hero .hero-media,
.motion-ready .hero .hero-doctor-strip,
.motion-ready .method-hero .kicker,
.motion-ready .method-hero h1,
.motion-ready .method-hero .lead,
.motion-ready .method-hero .hero-actions,
.motion-ready .method-hero .legal-warning,
.motion-ready .method-hero .method-card {
    animation: polish-rise 0.7s var(--polish-ease-out) both;
}

.motion-ready .hero .eyebrow,
.motion-ready .method-hero .kicker { animation-delay: 0.05s; }
.motion-ready .hero h1,
.motion-ready .method-hero h1 { animation-delay: 0.12s; }
.motion-ready .hero .hero__lead,
.motion-ready .method-hero .lead { animation-delay: 0.20s; }
.motion-ready .hero .hero__text { animation-delay: 0.26s; }
.motion-ready .hero .hero__actions,
.motion-ready .method-hero .hero-actions { animation-delay: 0.32s; }
.motion-ready .hero .medical-note--hero,
.motion-ready .method-hero .legal-warning { animation-delay: 0.38s; }
.motion-ready .hero .hero-proof,
.motion-ready .hero .hero__bottom,
.motion-ready .hero .stats,
.motion-ready .hero .hero-doctor-strip { animation-delay: 0.44s; }
.motion-ready .hero .hero-service,
.motion-ready .hero .hero-panel,
.motion-ready .hero .hero-media,
.motion-ready .method-hero .method-card { animation-delay: 0.30s; }

/* ---------- Появление при прокрутке: тихо, без blur ---------- */

.motion-ready .reveal {
    transition-duration: 0.6s;
    transition-timing-function: var(--polish-ease-out);
    transition-delay: calc(var(--motion-index, 0) * 70ms);
}

.motion-ready .motion-in {
    opacity: 0;
    transform: translateY(14px);
    transition:
        opacity 0.6s var(--polish-ease-out),
        transform 0.6s var(--polish-ease-out);
    transition-delay: calc(var(--motion-index, 0) * 70ms);
}

.motion-ready .motion-in.is-polished {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Карточки: подъём + тень, ничего больше ---------- */

.symptom-card,
.direction-card,
.route,
.route-card,
.service,
.program,
.program-card,
.doctor-card,
.doctor-mini,
.signal-card,
.pain-card,
.step,
.check-row,
.therapy-highlight__card,
.diagnostics button,
.equipment button,
.method-card,
.situation-card,
.trust-item,
.prep-card,
.strategy-card {
    transition:
        transform 0.3s var(--polish-ease),
        box-shadow 0.3s var(--polish-ease),
        border-color 0.3s ease,
        background-color 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    a.symptom-card:hover,
    a.route:hover,
    a.route-card:hover,
    button.situation-card:hover,
    .diagnostics button:hover,
    .equipment button:hover,
    a.symptom-card:focus-visible,
    button.situation-card:focus-visible,
    .diagnostics button:focus-visible {
        transform: translateY(-3px);
        box-shadow: var(--polish-shadow-hover);
        border-color: rgba(11, 95, 82, 0.30);
    }

    .strategy-card:hover,
    .program:hover,
    .program-card:hover,
    .service:hover,
    .doctor-card:hover,
    .doctor-mini:hover,
    .trust-item:hover,
    .prep-card:hover,
    .method-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 16px 40px rgba(16, 38, 34, 0.10);
    }

    .price-row:hover,
    .price-row:focus-within {
        transform: translateX(5px);
        box-shadow: inset 3px 0 0 rgba(11, 95, 82, 0.30);
    }

    .symptom-card:hover .symptom-card__icon,
    .situation-card:hover .situation-card__icon,
    .diagnostics button:hover .diag-icon {
        transform: translateY(-2px);
    }
}

.symptom-card__icon,
.situation-card__icon,
.diag-icon {
    transition: transform 0.28s var(--polish-ease);
}

.price-row {
    transition: transform 0.24s var(--polish-ease), box-shadow 0.24s ease;
}

/* ---------- Кнопки и ссылки: короткий отклик ---------- */

.btn,
.program-more,
.therapy-open,
.method-link,
.back-link,
.desktop-nav a,
.doctor-history summary {
    transition:
        transform 0.22s var(--polish-ease),
        box-shadow 0.22s var(--polish-ease),
        border-color 0.22s ease,
        color 0.22s ease,
        background-color 0.22s ease;
}

.btn:active,
.program-more:active,
.therapy-open:active {
    transform: translateY(0) scale(0.99);
}

.method-link:is(:hover, :focus-visible) {
    transform: translateX(4px);
}

.back-link:is(:hover, :focus-visible) {
    transform: translateX(-3px);
}

.doctor-history summary:is(:hover, :focus-visible) {
    color: var(--accent-dark, #07463d);
}

/* ---------- Фото врачей: едва заметный отклик ---------- */

.doctor-card__photo,
.doctor-mini img {
    transition: transform 0.5s var(--polish-ease-out);
}

.doctor-card:hover .doctor-card__photo,
.doctor-mini:hover img {
    transform: scale(1.02);
}

/* ---------- Точечные статические улучшения ---------- */

.price-new,
.price-old,
.price-row strong,
.hero-panel__price strong,
.checkup-details__price strong,
.online-consult-popup__price {
    white-space: nowrap;
}

.section--forest .method-card {
    color: #fff;
}

.section--forest .method-card:is(:hover, :focus-within) {
    border-color: rgba(142, 239, 228, 0.30);
}

.section--forest .method-card span {
    border: 1px solid rgba(142, 239, 228, 0.18);
    background: rgba(142, 239, 228, 0.10) !important;
    color: #8ef1e8;
}

.section--forest .method-card h3 {
    color: #fff;
}

.section--forest .method-card p {
    color: rgba(255, 255, 255, 0.76);
}

.cta .clinic-meta-card {
    position: relative;
    display: grid;
    gap: 14px;
    padding: 20px 22px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: calc(var(--radius, 12px) + 2px);
    color: #fff;
}

.cta .clinic-meta-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 0%, rgba(142, 239, 228, 0.08), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 58%);
}

.cta .clinic-meta-card > * {
    position: relative;
    z-index: 1;
}

.cta .clinic-hours {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    padding: 0;
}

.cta .clinic-metro {
    padding: 14px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.cta .clinic-hours span,
.cta .clinic-metro__title {
    display: block;
    margin: 0 0 8px;
    color: rgba(255, 255, 255, 0.54);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.cta .clinic-hours strong {
    color: rgba(255, 255, 255, 0.92);
    font-size: 18px;
    font-weight: 900;
    white-space: nowrap;
}

.cta .clinic-metro__list {
    display: grid;
    gap: 5px;
}

.cta .metro-station {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
}

.cta .metro-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--metro-line, #8ef1e8);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

/* ---------- Доступность ---------- */

html.a11y-on .motion-in,
html.a11y-on .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

@media (max-width: 760px) {
    a.symptom-card:hover,
    a.route:hover,
    button.situation-card:hover {
        transform: none;
    }
}

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

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

    .motion-in,
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}
