/* Токены */
:root {
  --bg: #faf6ea;          /* айвори */
  --bg-deep: #ebe1cd;     /* бежевый */
  --paper: #ffffff;       /* белый */
  --ink: #1c2a21;
  --ink-soft: #4c5a4e;
  --line: #d9d2bd;
  --accent: #5d6a29;      /* оливковый: текст и мелкие акценты */
  --olive-soft: #dde1bd;  /* светлая оливка: плашки */
  --cta: #f2953a;         /* оранжевый: кнопки, шкала, маркеры */
  --cta-hover: #f7aa55;
  --green: #1f3d2d;       /* глубокий зелёный */
  --green-ink: #faf6ea;
  --green-soft: #c3cfb9;

  --font-display: "Geologica", "Onest", system-ui, sans-serif;
  --font-body: "Onest", system-ui, sans-serif;

  --r-lg: 32px;
  --r-md: 22px;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(88px, 12vw, 168px);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure, blockquote { margin: 0; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 450;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: clamp(2rem, 3.6vw + 0.6rem, 3.3rem); }
p { margin: 0; text-wrap: pretty; }

::selection { background: var(--olive-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
html { scrollbar-color: #a9b085 var(--bg); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* Иконки */
.ico { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; }
.ico--line { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 1.05em 1.6em;
  border-radius: 999px;
  background: var(--cta);
  color: var(--ink);
  font: 500 1rem/1 var(--font-body);
  text-decoration: none;
  box-shadow: 0 10px 24px -12px rgba(150, 90, 20, 0.55);
  transition: background-color 200ms ease, transform 140ms var(--ease-out), box-shadow 200ms ease;
}
.btn:active { transform: scale(0.97); }
.btn--small { padding: 0.75em 1.2em; font-size: 0.9375rem; box-shadow: none; }
.btn--light { background: var(--cta); color: var(--green); box-shadow: 0 12px 28px -14px rgba(0, 0, 0, 0.6); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--cta-hover); box-shadow: 0 14px 28px -12px rgba(150, 90, 20, 0.6); }
  .btn--light:hover { background: var(--cta-hover); }
}

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-weight: 500; text-decoration: none;
  padding: 0.6em 0.2em;
}
.link-arrow .ico { transition: transform 220ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .link-arrow:hover .ico { transform: translateX(4px); }
}

/* Шапка */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 0%, transparent);
  transition: background-color 250ms ease, box-shadow 250ms ease;
}
.top.is-scrolled { background: var(--bg); box-shadow: 0 1px 0 var(--line); }
.top__in { display: flex; align-items: center; gap: 24px; height: 76px; }
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.15; margin-right: auto; }
.brand__name { font: 500 1.125rem/1.2 var(--font-display); letter-spacing: -0.01em; }
.brand__role { font-size: 0.8125rem; color: var(--ink-soft); }
.nav { display: flex; gap: 6px; }
.nav a {
  text-decoration: none; font-size: 0.9375rem; color: var(--ink-soft);
  padding: 0.5em 0.85em; border-radius: 999px;
  transition: background-color 180ms ease, color 180ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { background: var(--bg-deep); color: var(--ink); }
}

/* Первый экран */
.hero { padding-block: clamp(24px, 4vw, 56px) clamp(72px, 9vw, 128px); }
.hero__grid {
  display: grid; grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(32px, 6vw, 96px); align-items: center;
}
.hero__title { font-size: clamp(2.6rem, 4.6vw + 0.8rem, 5rem); font-weight: 400; letter-spacing: -0.035em; line-height: 1.02; }
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.hero__title .line > span { display: inline-block; }
.hero__title .line:last-child > span { color: var(--accent); }
.hero__lead { margin-top: 28px; max-width: 34em; font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.25rem); color: var(--ink-soft); }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 36px; }
.hero__facts {
  display: grid; grid-template-columns: repeat(3, auto); justify-content: start;
  gap: 8px 36px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 0.9375rem; color: var(--ink-soft); max-width: 40em;
}
.hero__facts b { display: block; color: var(--ink); font: 500 1rem/1.3 var(--font-display); }

.hero__photo { position: relative; justify-self: end; width: min(100%, 500px); }
.hero__photo::before {
  content: ""; position: absolute; inset: 8% -6% -5% 10%;
  background: var(--olive-soft); border-radius: var(--r-lg);
  z-index: -1;
}
.hero__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%; border-radius: var(--r-lg); }
.hero__badge {
  position: absolute; left: -28px; bottom: 36px;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px 14px 16px;
  background: var(--paper); border-radius: 20px;
  box-shadow: 0 18px 40px -18px rgba(31, 61, 45, 0.35);
  font-size: 0.875rem; line-height: 1.3; color: var(--ink-soft);
}
.hero__badge-num { font: 400 2.5rem/1 var(--font-display); color: var(--accent); letter-spacing: -0.04em; }

/* Симптомы */
.symptoms { background: var(--paper); padding-block: var(--section); }
.symptoms__grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(40px, 7vw, 112px); align-items: start; }
.symptoms__text p { margin-top: 24px; color: var(--ink-soft); font-size: 1.125rem; max-width: 30em; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips li {
  padding: 0.7em 1.15em; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line);
  font-size: 1rem; line-height: 1.25;
}
.chips li:nth-child(5n+1) { background: var(--olive-soft); border-color: transparent; }

/* Подход */
.approach { padding-block: var(--section); }
.approach__head { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px 80px; align-items: end; }
.approach__head p { color: var(--ink-soft); font-size: 1.125rem; max-width: 30em; }

.weeks { margin-top: clamp(56px, 7vw, 96px); }
.weeks__rail { position: relative; height: 6px; border-radius: 6px; background: var(--bg-deep); overflow: hidden; }
.weeks__fill { position: absolute; inset: 0; background: var(--cta); border-radius: inherit; transform-origin: 0 50%; transform: scaleX(0.04); }
.weeks__cells { display: grid; grid-template-columns: repeat(12, 1fr); margin-top: 14px; }
.weeks__cells li {
  font: 400 0.875rem/1 var(--font-display); color: #647061;
  font-variant-numeric: tabular-nums;
  transition: color 300ms ease;
}
.weeks__cells li.on { color: var(--ink); }
.weeks__labels { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; font-size: 0.875rem; color: var(--ink-soft); }
.weeks__labels span:nth-child(2) { text-align: center; }
.weeks__labels span:last-child { text-align: right; }

.stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 56px; }
.stage { padding: 36px 32px 40px; border-radius: var(--r-md); background: var(--paper); }
.stage:nth-child(2) { background: var(--bg-deep); }
.stage:nth-child(3) { background: var(--green); color: var(--green-ink); }
.stage h3 { font-size: 1.75rem; }
.stage__sub { margin-top: 6px; font-size: 0.9375rem; color: var(--ink-soft); }
.stage:nth-child(3) .stage__sub { color: var(--green-soft); }
.stage ul { margin-top: 28px; display: grid; gap: 12px; }
.stage li { position: relative; padding-left: 22px; line-height: 1.45; }
.stage li::before {
  content: ""; position: absolute; left: 0; top: 0.55em;
  width: 8px; height: 8px; border-radius: 50%; background: var(--cta);
}
.stage:nth-child(3) li::before { background: var(--cta); }

/* Программы */
.programs { padding-block: var(--section); background: var(--bg-deep); }
.programs__head { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 80px; align-items: end; margin-bottom: 56px; }
.programs__head p { color: var(--ink-soft); font-size: 1.125rem; max-width: 30em; }

.prog-name { font-size: clamp(1.6rem, 1.4vw + 1rem, 2.25rem); font-weight: 500; letter-spacing: -0.01em; }
.prog-desc { margin-top: 12px; color: var(--ink-soft); max-width: 36em; }
.price { display: flex; flex-direction: column; gap: 2px; }
.price__sum { font: 400 clamp(1.75rem, 1.2vw + 1.2rem, 2.25rem)/1.1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price__term { font-size: 0.875rem; color: var(--ink-soft); }

.gut { background: var(--green); color: var(--green-ink); border-radius: var(--r-lg); padding: clamp(28px, 4vw, 56px); }
.gut .prog-name { font-size: clamp(2.2rem, 3vw + 1rem, 3.75rem); font-weight: 400; letter-spacing: -0.03em; }
.gut .prog-desc, .gut .price__term { color: var(--green-soft); }
.gut__top { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.gut .price { text-align: right; }

.tabs {
  position: relative; display: inline-flex; gap: 4px; margin-top: 44px;
  padding: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.07);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative; z-index: 1;
  appearance: none; border: 0; background: none; cursor: pointer;
  padding: 0.75em 1.25em; border-radius: 999px; white-space: nowrap;
  font: 500 0.9375rem/1 var(--font-body); color: var(--green-soft);
  transition: color 220ms ease;
}
.tabs button[aria-selected="true"] { color: var(--green); }
.tabs__pill {
  position: absolute; z-index: 0; top: 0; left: 0; width: 0; height: 0;
  border-radius: 999px; background: var(--cta);
  transition: transform 300ms var(--ease-in-out), width 300ms var(--ease-in-out);
}
.panels { margin-top: 36px; }
.panel { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px 64px; align-items: start; }
.panel[hidden] { display: none; }
.panel.is-entering { animation: panel-in 320ms var(--ease-out); }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } }
.panel__label { font-size: 0.875rem; color: var(--green-soft); margin-bottom: 14px; }
.panel__goal {
  font: 300 clamp(1.25rem, 0.8vw + 1rem, 1.6rem)/1.35 var(--font-display);
  letter-spacing: -0.01em; color: var(--green-ink);
  padding-top: 20px; border-top: 1px solid rgba(250, 246, 234, 0.18);
}
.dots { display: grid; gap: 10px; }
.dots li { position: relative; padding-left: 22px; line-height: 1.45; }
.dots li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; border-radius: 50%; background: var(--cta); }
.gut .dots li::before { background: var(--cta); }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.prog { background: var(--paper); border-radius: var(--r-lg); padding: clamp(28px, 3.4vw, 48px); display: flex; flex-direction: column; }
.prog .price { margin: 28px 0 20px; }

/* Раскрывашки */
.more, .qa { border-top: 1px solid var(--line); }
.more summary, .qa summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 0; font-weight: 500;
}
.more summary::-webkit-details-marker, .qa summary::-webkit-details-marker { display: none; }
.more__ico { position: relative; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--bg); transition: background-color 200ms ease, transform 250ms var(--ease-out); }
.more__ico::before, .more__ico::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1.6px; background: currentColor; border-radius: 2px; translate: -50% -50%; }
.more__ico::after { rotate: 90deg; transition: rotate 250ms var(--ease-out); }
details[open]:not(.is-closing) > summary .more__ico { background: var(--olive-soft); }
details[open]:not(.is-closing) > summary .more__ico::after { rotate: 0deg; }
@media (hover: hover) and (pointer: fine) {
  summary:hover .more__ico { background: var(--olive-soft); }
}
.more__body > div { overflow: hidden; }
.more__body .dots, .more__body .dirs { padding-bottom: 22px; }
.note { padding: 0 0 22px; font-size: 0.9375rem; color: var(--ink-soft); }
.dirs dt { font: 500 1.0625rem/1.3 var(--font-display); }
.dirs dd { margin: 4px 0 16px; color: var(--ink-soft); }
.dirs dd:last-child { margin-bottom: 0; }

/* О враче */
.doctor { padding-block: var(--section); }
.doctor__grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(40px, 7vw, 112px); align-items: start; }
.doctor__photos { position: sticky; top: 108px; display: grid; grid-template-columns: 1fr; }
.doctor__main img { border-radius: var(--r-lg); aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; width: 86%; }
.doctor__second { width: 46%; justify-self: end; margin-top: -32%; position: relative; }
.doctor__second img { border-radius: var(--r-md); aspect-ratio: 3 / 4; object-fit: cover; border: 6px solid var(--bg); }
.doctor__role { margin-top: 12px; font-size: 1.125rem; color: var(--accent); font-weight: 500; }
.doctor__text > .reveal > p:last-child { margin-top: 24px; font-size: 1.125rem; max-width: 34em; }
.research {
  margin-top: 48px; padding: 32px 36px; border-radius: var(--r-md);
  background: var(--olive-soft);
}
.research p { font: 400 clamp(1.25rem, 0.8vw + 1rem, 1.55rem)/1.35 var(--font-display); letter-spacing: -0.01em; }
.research footer { margin-top: 16px; font-size: 0.9375rem; color: var(--ink-soft); }
.cv { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 56px; }
.cv h3 { font-size: 1.25rem; font-weight: 500; margin-bottom: 18px; }
.cv__list { display: grid; gap: 14px; font-size: 0.9688rem; line-height: 1.45; }
.cv__list span { display: block; font: 500 0.8125rem/1.4 var(--font-display); color: var(--accent); font-variant-numeric: tabular-nums; }

/* Вопросы */
.faq { padding-block: var(--section); background: var(--paper); }
.faq__grid { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: clamp(40px, 7vw, 112px); align-items: start; }
.faq__photo { margin-top: 40px; max-width: 320px; }
.faq__photo img { border-radius: var(--r-lg); aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 25%; }
.faq__list { border-bottom: 1px solid var(--line); }
.qa summary { padding: 26px 0; font: 450 clamp(1.125rem, 0.5vw + 1rem, 1.375rem)/1.3 var(--font-display); letter-spacing: -0.01em; }
.qa .more__body p { padding: 0 48px 28px 0; color: var(--ink-soft); max-width: 40em; }

/* Запись */
.cta { background: var(--green); color: var(--green-ink); padding-block: var(--section) 0; overflow: hidden; }
.cta__grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px 80px; align-items: end; }
.cta__text { padding-bottom: var(--section); }
.cta h2 { font-size: clamp(2.4rem, 4.4vw + 0.6rem, 4.6rem); font-weight: 400; letter-spacing: -0.035em; }
.cta__text p { margin-top: 24px; color: var(--green-soft); font-size: 1.1875rem; max-width: 28em; }
.cta__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; margin-top: 40px; }
.phone { display: inline-flex; align-items: center; gap: 0.55em; font: 400 1.25rem/1 var(--font-display); text-decoration: none; font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .phone:hover { color: var(--cta); } }
.cta__photo img { border-radius: var(--r-lg) var(--r-lg) 0 0; aspect-ratio: 4 / 5; object-fit: cover; object-position: 40% 20%; }

/* Подвал */
.foot { background: var(--green); color: var(--green-soft); font-size: 0.9375rem; border-top: 1px solid rgba(250, 246, 234, 0.12); }
.foot__in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 40px; padding-block: 36px; }
.foot__name { color: var(--green-ink); font: 500 1rem/1.3 var(--font-display); }
.foot a { text-decoration: none; color: var(--green-ink); }
.foot__warn { flex-basis: 100%; font-size: 0.8125rem; opacity: 0.8; }

/* Плашка записи на телефоне */
.dock { display: none; }

/* Анимации: контент виден по умолчанию, прячем только при наличии JS */
@media (prefers-reduced-motion: no-preference) {
  .js .hero__title .line > span { transform: translateY(105%); animation: rise 1000ms var(--ease-out) forwards; }
  .js .hero__title .line:nth-child(2) > span { animation-delay: 80ms; }
  .js .hero__title .line:nth-child(3) > span { animation-delay: 160ms; }
  .js .hero__lead, .js .hero__actions, .js .hero__facts { opacity: 0; transform: translateY(14px); animation: fade-up 800ms var(--ease-out) forwards; }
  .js .hero__lead { animation-delay: 320ms; }
  .js .hero__actions { animation-delay: 420ms; }
  .js .hero__facts { animation-delay: 520ms; }
  .js .hero__photo img { clip-path: inset(100% 0 0 0 round var(--r-lg)); animation: unveil 1200ms var(--ease-out) 100ms forwards; }
  .js .hero__photo::before { opacity: 0; transform: translate(-16px, -16px); animation: fade-to-place 1200ms var(--ease-out) 450ms forwards; }
  .js .hero__badge { opacity: 0; transform: translateY(12px) scale(0.96); animation: fade-up 700ms var(--ease-out) 900ms forwards; }

  .js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out); }
  .js .reveal.in { opacity: 1; transform: none; }
  .js .reveal-img img { clip-path: inset(18% 0 0 0 round var(--r-lg)); opacity: 0; transition: clip-path 1100ms var(--ease-out), opacity 700ms var(--ease-out); }
  .js .reveal-img.in img { clip-path: inset(0 0 0 0 round var(--r-lg)); opacity: 1; }
  .js .doctor__second.reveal-img img { transition-delay: 200ms; }
  .js .chips li { opacity: 0; transform: translateY(10px) scale(0.97); transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); transition-delay: calc(var(--i, 0) * 40ms); }
  .js .chips.in li { opacity: 1; transform: none; }
  .js .stages .stage:nth-child(2) { transition-delay: 90ms; }
  .js .stages .stage:nth-child(3) { transition-delay: 180ms; }
}
@keyframes rise { to { transform: translateY(0); } }
@keyframes fade-up { to { opacity: 1; transform: none; } }
@keyframes unveil { to { clip-path: inset(0 0 0 0 round var(--r-lg)); } }
@keyframes fade-to-place { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tabs__pill { transition: none; }
  .panel.is-entering { animation: none; }
}

/* Адаптив */
@media (max-width: 1020px) {
  .nav { display: none; }
  .hero__grid, .symptoms__grid, .approach__head, .programs__head, .doctor__grid, .faq__grid, .cta__grid { grid-template-columns: 1fr; }
  .hero__photo { justify-self: start; width: min(100%, 460px); }
  .stages { grid-template-columns: 1fr; }
  .duo { grid-template-columns: 1fr; }
  .doctor__photos { position: static; max-width: 520px; }
  .faq__photo { display: none; }
  .cta__photo { max-width: 420px; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .top__in { height: 64px; }
  .brand__name { font-size: 1rem; }
  .hero__facts { grid-template-columns: 1fr; gap: 14px; margin-top: 40px; }
  .hero__badge { left: 12px; bottom: 12px; }
  .hero__photo::before { inset: 6% -4% -4% 8%; }
  .weeks__cells li:nth-child(even) { visibility: hidden; }
  .weeks__labels span:nth-child(2) { display: none; }
  .stage { padding: 28px 24px 32px; }
  .gut__top { flex-direction: column; align-items: flex-start; }
  .gut .price { text-align: left; }
  .panel { grid-template-columns: 1fr; }
  /* Вкладки столбиком: все три направления видны сразу */
  .tabs { display: flex; flex-direction: column; margin-top: 32px; border-radius: 24px; overflow: visible; }
  .tabs button { min-height: 50px; padding: 0.75em 1.1em; border-radius: 19px; font-size: 1rem; text-align: left; color: var(--green-ink); }
  .tabs__pill { border-radius: 19px; }
  .cv { grid-template-columns: 1fr; }
  .research { padding: 24px; }
  .qa .more__body p { padding-right: 0; }
  .foot { padding-bottom: 84px; }
  .dock {
    display: flex; align-items: center; justify-content: center; gap: 0.6em;
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30;
    padding: 1em; border-radius: 999px;
    background: var(--cta); color: var(--ink); text-decoration: none; font-weight: 500;
    box-shadow: 0 14px 32px -12px rgba(31, 61, 45, 0.55);
    transform: translateY(140%);
    transition: transform 350ms var(--ease-out);
  }
  .dock.is-visible { transform: none; }
  .top .btn--small { display: none; }
}
