/* ===== Дизайн-токены ===== */
:root {
  --bg: #FAF5EE;
  --card: rgba(255,252,246,.78);
  --ink: #453B31;
  --ink-soft: #7C6F60;
  --line: #EADFCE;
  --accent: #C89C60;
  --accent2: #8FB0BD;
  --accent-ink: #8A6B3E;
  --accent-soft: #F4EADA;
  --photo-filter: contrast(1.02);
}

/* ===== База ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); font-family: 'Manrope', sans-serif; color: var(--ink); }
a { color: inherit; text-decoration: none; }
a:hover { opacity: .8; }
button { font-family: inherit; }

@keyframes floatSoft { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulseDot { 0%,100% { opacity: .5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.35); } }

/* ===== Утилиты-миксы ===== */
/* Появление по скроллу (класс переключает JS) */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s cubic-bezier(.22,.8,.3,1), transform .8s cubic-bezier(.22,.8,.3,1); }
.reveal.is-visible { opacity: 1; transform: none; }
/* На мобильных убираем скругление у «карточек» */
@media (max-width: 640px) { .mobile-flat { border-radius: 0 !important; } }

/* ===== Корневой блок ===== */
.page { background: var(--bg); color: var(--ink); min-height: 100vh; }

/* ===== Прогресс-полоса скролла ===== */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; transform: scaleX(0); transform-origin: 0 50%; background: linear-gradient(90deg, var(--accent), var(--accent2)); z-index: 50; border-radius: 0 2px 2px 0; }

/* ===== Липкая шапка (появляется после прокрутки hero) ===== */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 40; transform: translateY(-100%); opacity: 0; transition: transform .38s cubic-bezier(.22,.8,.3,1), opacity .3s ease; background: color-mix(in srgb, var(--bg) 80%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1); border-bottom: 1px solid var(--line); box-shadow: 0 8px 30px -18px rgba(40,36,28,.4); }
.topbar.is-visible { transform: translateY(0); opacity: 1; }
.topbar__inner { max-width: 680px; margin: 0 auto; width: 100%; padding: 11px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar__brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.topbar__logo { display: block; flex: 0 0 32px; padding: 3px; border-radius: 9px; background: rgba(250,245,238,.58); }
.topbar__name { font-family: 'Cormorant Garamond', serif; font-size: 18px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; color: var(--ink); }
.topbar__nav { display: flex; align-items: center; gap: 20px; font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.topbar__link { display: flex; align-items: center; gap: 6px; }
.topbar__link:hover { color: var(--accent-ink); opacity: 1; }
.topbar__nav svg { color: var(--accent-ink); flex: 0 0 auto; }
@media (max-width: 520px) {
  .topbar__nav { gap: 14px; }
  .topbar__label { display: none; }        /* на мобильных навигация — только иконки */
  .topbar__name { font-size: 15px; }
}
@media (max-width: 360px) {
  .topbar__brand { gap: 0; }                /* на самых узких экранах убираем зазор бренда */
}

/* ===== Hero: фиксированное фото на весь экран ===== */
.hero { position: fixed; inset: 0; height: 100vh; z-index: 0; overflow: hidden; background: var(--accent-soft); }
.hero__picture { display: block; width: 100%; height: 100%; }
.hero__photo { display: block; width: 100%; height: 135%; object-fit: cover; object-position: 63% 35%; filter: var(--photo-filter); will-change: transform; }
.hero__tint { position: absolute; inset: 0; background: var(--accent); mix-blend-mode: color; opacity: 0; will-change: opacity; }

/* ===== Masthead: контент поверх hero ===== */
.masthead { position: relative; z-index: 1; min-height: 100svh; display: flex; flex-direction: column; justify-content: space-between; padding: 28px 20px 32px; }
.masthead__brand-row { max-width: 680px; margin: 0 auto; width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink); }
.masthead__brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.masthead__logo { display: block; flex: 0 0 32px; padding: 3px; border-radius: 10px; background: rgba(250,245,238,.58); }
.masthead__name { font-family: 'Cormorant Garamond', serif; font-size: clamp(18px,5vw,22px); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.masthead__role { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.masthead__nav { max-width: 680px; margin: 16px auto 0; width: 100%; display: flex; justify-content: flex-end; gap: 22px; padding-top: 14px; border-top: 1px solid rgba(69,59,49,.16); font-size: 15px; font-weight: 500; color: var(--ink-soft); }
.masthead__link { display: flex; align-items: center; gap: 7px; }
.masthead__link svg { color: var(--accent-ink); }
.masthead__intro { max-width: 680px; margin: 0 auto; width: 100%; color: var(--ink); }
.masthead__title { margin: 0; font-family: 'Cormorant Garamond', serif; font-weight: 500; font-size: clamp(32px,8vw,52px); line-height: 1.1; text-wrap: balance; text-shadow: 0 0 1px rgba(255,253,248,.9), 0 1px 3px rgba(255,253,248,.85), 0 0 14px rgba(255,253,248,.75), 0 0 34px rgba(255,253,248,.6); }
.masthead__subtitle { margin: 14px 0 0; font-size: 15.5px; line-height: 1.55; max-width: 44ch; color: var(--ink-soft); text-shadow: 0 0 1px rgba(255,253,248,.9), 0 1px 2px rgba(255,253,248,.85), 0 0 12px rgba(255,253,248,.7); }
.masthead__scroll { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 26px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--bg); text-shadow: -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink), 1px 1px 0 var(--ink), 0 0 2px var(--ink); }
.masthead__scroll-icon { animation: floatSoft 2.6s ease-in-out infinite; filter: drop-shadow(0.6px 0.6px 0 var(--ink)) drop-shadow(-0.6px -0.6px 0 var(--ink)); }
@media (max-width: 640px) {
  .masthead__nav { justify-content: space-between; gap: 8px; font-size: clamp(13px,4.4vw,18px); }
}
@media (max-width: 520px) {
  .masthead__brand-row { flex-direction: column; align-items: flex-start; gap: 5px; }
  .masthead__name { font-size: clamp(19px,6vw,24px); letter-spacing: .04em; }
  .masthead__role { font-size: 11px; letter-spacing: .1em; padding-left: 43px; }
}

/* ===== Лист контента ===== */
.sheet { position: relative; z-index: 1; background: color-mix(in srgb, var(--bg) 55%, transparent); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); box-shadow: 0 -18px 50px rgba(20,24,22,.14); }
.sheet__inner { max-width: 680px; margin: 0 auto; padding: 8px 20px 60px; }

/* ===== Секции: общие элементы ===== */
.section { padding-top: 72px; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-ink); }
.section-title { margin: 14px 0 0; font-family: 'Cormorant Garamond', serif; font-weight: 500; font-size: clamp(26px,6vw,36px); line-height: 1.18; }
.section-title--balance { text-wrap: balance; }
.section-subtitle { margin: 32px 0 14px; font-family: 'Cormorant Garamond', serif; font-weight: 500; font-size: 24px; color: var(--ink); }
.section__lead { margin: 18px 0 0; font-size: 16px; line-height: 1.7; color: var(--ink-soft); text-wrap: pretty; }
.section__text { margin: 14px 0 0; font-size: 15px; line-height: 1.6; color: var(--ink-soft); }
.section__text--pretty { text-wrap: pretty; }
.section__strong { color: var(--ink); }
.text-link { color: var(--accent-ink); border-bottom: 1px solid var(--line); }

/* ===== Карточки «Что такое остеопатия» ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 26px; }
.card { background: var(--card); border-radius: 24px; padding: 26px 24px; box-shadow: 0 1px 2px rgba(32,38,35,.04), 0 18px 44px -16px rgba(32,38,35,.12); }
.card__icon { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; }
.card__title { margin-top: 16px; font-family: 'Cormorant Garamond', serif; font-size: 23px; color: var(--ink); }
.card__text { margin: 8px 0 0; font-size: 14px; line-height: 1.65; color: var(--ink-soft); }

/* ===== Календарь ===== */
.calendar { margin-top: 24px; background: var(--card); border-radius: 26px; padding: 24px 20px; box-shadow: 0 1px 2px rgba(32,38,35,.04), 0 18px 44px -16px rgba(32,38,35,.12); }
.calendar__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; }
.calendar__nav-btn { width: 38px; height: 38px; border-radius: 12px; border: none; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; transition: background .2s ease, color .2s ease; }
.calendar__nav-btn:not(:disabled):hover { background: var(--accent2); color: #FAFBFA; }
.calendar__nav-btn:disabled { opacity: .35; cursor: default; }
.calendar__title { font-family: 'Cormorant Garamond', serif; font-size: 22px; color: var(--ink); }
.calendar__weekdays { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; text-align: center; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); padding-bottom: 10px; }
.calendar__grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px 4px; text-align: center; }
.calendar__blank { height: 38px; }
.calendar__day { height: 38px; line-height: 38px; font-size: 14px; }
.calendar__day--anapa { border-radius: 12px; background: var(--accent); color: #FAFBFA; font-weight: 600; margin: 0 2px; }
.calendar__day--korolyov { border-radius: 12px; background: var(--accent2); color: #FAFBFA; font-weight: 600; margin: 0 2px; }
.calendar__day--off { color: var(--ink-soft); opacity: .55; }
.calendar__legend { display: flex; gap: 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-soft); }
.calendar__legend-item { display: flex; align-items: center; gap: 7px; }
.calendar__dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.calendar__dot--anapa { background: var(--accent); animation: pulseDot 2.4s ease-in-out infinite; }
.calendar__dot--korolyov { background: var(--accent2); animation: pulseDot 2.4s ease-in-out infinite; }
.calendar__dot--none { background: var(--line); }

/* ===== Образование: таймлайн ===== */
.timeline { margin-top: 26px; background: var(--card); border-radius: 26px; padding: 8px 24px; box-shadow: 0 1px 2px rgba(32,38,35,.04), 0 18px 44px -16px rgba(32,38,35,.12); }
.timeline__item { display: flex; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--accent-soft); }
.timeline__item:last-child { border-bottom: none; }
.timeline__aside { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 54px; }
.timeline__badge { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.timeline__year { font-family: 'Cormorant Garamond', serif; font-size: 19px; color: var(--accent-ink); }
.timeline__role { font-weight: 600; font-size: 15px; }
.timeline__text { margin: 6px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink-soft); }

/* ===== Карусель дипломов ===== */
.diploma { position: relative; }
.diploma__track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 4px 0 2px; }
.diploma__track::-webkit-scrollbar { display: none; }
/* Мобильные: одна карточка почти на весь экран, но виден край следующей. */
.diploma__slide { flex: 0 0 auto; width: 88%; scroll-snap-align: start; border: none; padding: 0; cursor: zoom-in; border-radius: 14px; overflow: hidden; background: var(--accent-soft); box-shadow: 0 1px 2px rgba(32,38,35,.04), 0 14px 34px -18px rgba(32,38,35,.2); }
.diploma__img { display: block; width: 100%; aspect-ratio: 3/4; object-fit: cover; transition: transform .3s ease; }
.diploma__slide:hover .diploma__img { transform: scale(1.03); }
.diploma__arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--card); color: var(--accent-ink); box-shadow: 0 6px 20px rgba(30,40,35,.18); display: none; align-items: center; justify-content: center; padding: 0; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.diploma__arrow--prev { left: -8px; }
.diploma__arrow--next { right: -8px; }
.diploma__arrow:hover { background: var(--accent-soft); }
.diploma__arrow:disabled { opacity: 0; pointer-events: none; }
.diploma__dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.diploma__dot { width: 8px; height: 8px; border-radius: 50%; border: none; padding: 0; cursor: pointer; background: var(--line); transition: background .25s ease, transform .25s ease; }
.diploma__dot.is-active { background: var(--accent); transform: scale(1.35); }
/* Десктоп: три карточки на экран + стрелки листания. */
@media (min-width: 720px) {
  .diploma__slide { width: calc((100% - 24px) / 3); }
  .diploma__arrow { display: flex; }
}

/* ===== Отзывы ===== */
.reviews__list { margin-top: 26px; display: grid; gap: 12px; }
.review { margin: 0; background: var(--card); border-radius: 24px; padding: 26px 24px; box-shadow: 0 1px 2px rgba(32,38,35,.04), 0 18px 44px -16px rgba(32,38,35,.12); }
.review__text { margin: 0; font-size: 15px; line-height: 1.7; text-wrap: pretty; }
.review__footer { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.review__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; }
.review__name { font-weight: 600; font-size: 14px; }
.review__role { font-size: 12.5px; color: var(--ink-soft); }
.review-media { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.review-photo { position: relative; aspect-ratio: 3/4; border-radius: 18px; overflow: hidden; width: 100%; padding: 0; border: none; background: var(--accent-soft); cursor: zoom-in; }
.review-photo__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.review-photo:hover .review-photo__img { transform: scale(1.03); }
.review-video { position: relative; aspect-ratio: 3/4; border-radius: 18px; overflow: hidden; background: #1a1712; }
.review-video__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ===== Скелетоны отзывов (пока грузится reviews.json) ===== */
@keyframes skShimmer { 0% { background-position: -160% 0; } 100% { background-position: 160% 0; } }
.sk { background: linear-gradient(90deg, var(--accent-soft) 25%, #FBF5EA 50%, var(--accent-soft) 75%); background-size: 200% 100%; animation: skShimmer 1.3s ease-in-out infinite; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
.review-skel .sk-line { height: 13px; margin-bottom: 10px; }
.review-skel .sk-line:first-child { margin-top: 4px; }
.sk-line--short { width: 55%; }
.sk-avatar { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 40px; }
.sk-meta { flex: 1; }
.sk-line--name { height: 12px; width: 120px; margin: 0; }
.sk-media { aspect-ratio: 3/4; border-radius: 18px; }

/* ===== Контакты ===== */
.contacts__actions { display: flex; justify-content: flex-start; gap: 8px; margin-top: 26px; }
.contact-call { flex: 0 1 auto; min-width: 0; height: 56px; display: flex; align-items: center; justify-content: center; gap: 9px; background: var(--ink); color: var(--bg); border-radius: 18px; padding: 0 16px; font-weight: 600; font-size: 14px; white-space: nowrap; letter-spacing: .01em; box-shadow: 0 10px 30px rgba(40,36,28,.14); transition: transform .25s ease, box-shadow .25s ease; }
.contact-call:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(40,36,28,.2); opacity: 1; }
.contact-call svg { flex-shrink: 0; }
.contact-social { flex: 0 0 56px; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: var(--card); color: var(--ink); border-radius: 18px; padding: 0; box-shadow: 0 1px 2px rgba(32,38,35,.05), 0 12px 30px -12px rgba(32,38,35,.16); transition: transform .25s ease, background .25s ease; }
.contact-social:hover { transform: translateY(-2px); background: var(--accent-soft); opacity: 1; }
.contact-social svg { flex-shrink: 0; color: var(--accent-ink); }
.addresses { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 10px; margin-top: 12px; }
.address { position: relative; overflow: hidden; min-height: 132px; display: flex; flex-direction: column; align-items: flex-start; background: linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 92%, white), var(--accent-soft)); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 16px; padding: 18px 20px; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.address::before { content: ''; position: absolute; inset: 0; z-index: 0; background-image: var(--address-map); background-position: center; background-size: cover; opacity: .75; -webkit-mask-image: linear-gradient(to right, transparent 25%, rgba(0,0,0,.18) 43%, #000 78%); mask-image: linear-gradient(to right, transparent 25%, rgba(0,0,0,.18) 43%, #000 78%); pointer-events: none; }
.address--anapa { --address-map: url('maps/anapa.png'); }
.address--anapa:before { background-position: 50px; }
.address--korolyov { --address-map: url('maps/korolev.png'); }
.address > * { position: relative; z-index: 1; }
.address:hover { opacity: 1; transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 34%, transparent); box-shadow: 0 14px 34px -20px rgba(69,59,49,.32); }
.address__head { display: flex; align-items: center; gap: 7px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); }
.address__text { font-size: 15px; line-height: 1.5; margin-top: 7px; font-weight: 500; }
.address__link { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 14px; font-size: 11.5px; color: var(--accent-ink); }
.address__link svg { transition: transform .25s ease; }
.address:hover .address__link svg { transform: translateX(3px); }
.page-footer { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--ink-soft); }

/* ===== Лайтбокс ===== */
.lightbox { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(30,26,20,.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .28s ease; }
.lightbox.is-open { display: flex; opacity: 1; }
.lightbox__img { max-width: min(92vw, 720px); max-height: 88vh; border-radius: 12px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); }
.lightbox__close { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(250,245,238,.16); color: #FAF5EE; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: none; background: rgba(250,245,238,.16); color: #FAF5EE; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(250,245,238,.3); }
@media (max-width: 640px) { .lightbox__nav { display: none; } }
