/* ===========================
   SOMA — центр комплексного сопровождения
   Палитра: петроль — основа, светлый фон, голубой и терракота для акцентов
   =========================== */

:root {
  --petrol: #24494b;
  --petrol-deep: #1b393b;
  --cream: #f4f3ee;
  --sand: #c9c3b8;
  --sky: #b8ccd6;
  --sky-soft: #dde7eb;
  --terra: #bb7863;
  --terra-text: #9e5c48;
  --ink: #24494b;
  --ink-muted: #4f6b6c;
  --line: rgba(36, 73, 75, 0.16);
  --line-light: rgba(244, 243, 238, 0.22);
  --ff: 'Inter', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --radius: 14px;
  --gutter: clamp(16px, 5vw, 64px);
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ff);
  background: var(--cream);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--terra); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- Layout --- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(72px, 10vw, 128px) 0; }
.split { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(24px, 5vw, 80px); align-items: start; }
.narrow { max-width: 760px; }

/* --- Type --- */
.eyebrow {
  font-size: 14px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--terra-text); margin-bottom: 16px;
}
.eyebrow--light { color: var(--sky); }
.section-title {
  font-size: clamp(32px, 4.6vw, 52px); font-weight: 700;
  line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 28px;
}
.subhead {
  font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; letter-spacing: -0.01em;
  margin: clamp(56px, 7vw, 88px) 0 28px;
}
.subhead--light { color: var(--cream); }
.body-lg { font-size: clamp(18px, 1.7vw, 21px); line-height: 1.55; margin-bottom: 20px; }
.body { color: var(--ink-muted); margin-bottom: 16px; }
.note {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 15px; color: var(--ink-muted); max-width: 760px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 14px 28px; border-radius: 999px;
  font-size: 16px; font-weight: 600; line-height: 1.2; text-align: center;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-light { background: var(--cream); color: var(--petrol); }
.btn-light:hover { background: #fff; }
.btn-outline-light { border: 1.5px solid var(--line-light); color: var(--cream); }
.btn-outline-light:hover { border-color: var(--cream); }

/* --- Nav --- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background-color .3s, box-shadow .3s;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter);
  height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav-logo { display: block; flex-shrink: 0; }
.nav-logo-img { height: 24px; width: auto; }
.nav-logo-img--dark { display: none; }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 1.8vw, 28px); }
.nav-link { font-size: 15px; font-weight: 500; color: var(--cream); opacity: .85; transition: opacity .2s, color .2s; white-space: nowrap; }
.nav-link:hover, .nav-link--active { opacity: 1; }
.nav-link--cta {
  opacity: 1; padding: 10px 20px; border-radius: 999px;
  background: var(--cream); color: var(--petrol);
}
.nav.scrolled { background: rgba(244, 243, 238, 0.96); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(8px); }
.nav.scrolled .nav-logo-img--light { display: none; }
.nav.scrolled .nav-logo-img--dark { display: block; }
.nav.scrolled .nav-link { color: var(--petrol); }
.nav.scrolled .nav-link--cta { background: var(--petrol); color: var(--cream); }
.nav-burger { display: none; width: 44px; height: 44px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.nav-burger span { display: block; width: 24px; height: 2px; background: var(--cream); border-radius: 2px; transition: transform .3s, opacity .3s; }
.nav.scrolled .nav-burger span { background: var(--petrol); }

/* --- Hero --- */
.hero {
  background: var(--petrol); color: var(--cream);
  padding: clamp(120px, 16vh, 168px) 0 clamp(56px, 8vw, 88px);
  min-height: 100vh; display: flex; align-items: center;
}
.hero-inner { display: flex; flex-direction: column; gap: clamp(56px, 8vw, 88px); }
.hero-main { max-width: 820px; }
.hero-logo { width: min(620px, 100%); margin-bottom: clamp(36px, 5vw, 56px); }
.hero-lead { font-size: clamp(24px, 3vw, 36px); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; margin-bottom: 20px; }
.hero-sub { font-size: clamp(17px, 1.6vw, 20px); color: rgba(244, 243, 238, 0.78); max-width: 640px; margin-bottom: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
.hero-place { font-size: 15px; color: var(--sky); }
.hero-pins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pin {
  display: flex; flex-direction: column; gap: 8px;
  padding: 24px; border-radius: var(--radius);
  border: 1px solid var(--line-light); transition: background-color .25s, border-color .25s;
}
.pin:hover { background: rgba(244, 243, 238, 0.06); border-color: rgba(244, 243, 238, 0.4); }
.pin-num { font-size: 28px; font-weight: 700; color: var(--terra); line-height: 1; }
.pin-title { font-size: 18px; font-weight: 600; }
.pin-text { font-size: 15px; color: rgba(244, 243, 238, 0.7); line-height: 1.45; }

/* --- About --- */
.requests { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 32px; }
.request { display: flex; gap: 16px; padding: 22px 0; border-top: 1px solid var(--line); }
.request-num { font-size: 15px; font-weight: 700; color: var(--terra-text); min-width: 24px; padding-top: 2px; }
.request p { font-size: 17px; }

/* --- Directions --- */
.directions { background: var(--sky-soft); }
.dir-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 12px; }
.dir { background: var(--cream); border-radius: var(--radius); padding: 28px 24px; min-height: 140px; }
.dir h3 { font-size: 22px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.01em; }
.dir p { color: var(--ink-muted); font-size: 16px; }
.dir--note { background: var(--petrol); color: var(--cream); display: flex; align-items: flex-end; }
.dir--note p { color: var(--cream); font-weight: 600; font-size: 18px; line-height: 1.35; }

/* --- Founder --- */
.founder-head { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.founder-photo-wrap { border-radius: var(--radius); overflow: hidden; aspect-ratio: 564 / 720; background: var(--sand); }
.founder-photo { width: 100%; height: 100%; object-fit: cover; }
.founder-name { font-size: clamp(40px, 5.6vw, 64px); font-weight: 700; line-height: 1.02; letter-spacing: -0.025em; margin-bottom: 14px; }
.founder-role { font-size: 18px; font-weight: 600; color: var(--terra-text); margin-bottom: 28px; }
.story {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  margin-top: clamp(56px, 8vw, 96px); background: var(--petrol); color: var(--cream);
  border-radius: var(--radius); overflow: hidden;
}
.story-step { padding: 32px 28px; border-left: 1px solid var(--line-light); }
.story-step:first-child { border-left: none; }
.story-num { display: block; font-size: 36px; font-weight: 700; color: var(--sky); line-height: 1; margin-bottom: 20px; }
.story-step h3 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.story-step p { font-size: 15px; color: rgba(244, 243, 238, 0.78); line-height: 1.5; }
.book {
  display: grid; grid-template-columns: 220px 1fr; gap: clamp(28px, 5vw, 64px); align-items: center;
  margin-top: clamp(48px, 6vw, 72px);
}
.book-cover { width: 100%; border-radius: 4px; box-shadow: 0 18px 40px rgba(27, 57, 59, 0.22); }
.book-title { font-size: clamp(26px, 3vw, 36px); font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; margin-bottom: 8px; }
.book-sub { color: var(--ink-muted); margin-bottom: 18px; }
.book-authors { font-weight: 600; margin-bottom: 18px; }

/* --- Team --- */
.team { background: var(--cream); border-top: 1px solid var(--line); }
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.person { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; display: flex; flex-direction: column; }
.person-avatar {
  width: 56px; height: 56px; border-radius: 50%; margin-bottom: 20px;
  display: grid; place-items: center; background: var(--sky); color: var(--petrol);
  font-size: 18px; font-weight: 700; letter-spacing: 0.02em;
}
.person-name { font-size: 21px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 4px; }
.person-role { font-size: 15px; font-weight: 600; color: var(--terra-text); margin-bottom: 12px; }
.person-text { color: var(--ink-muted); font-size: 16px; }
.person-label { margin-top: 18px; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--terra-text); }
.person-list li { position: relative; padding: 6px 0 6px 16px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.person-list li::before { content: ""; position: absolute; left: 0; top: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--sky); }
.person--partners { grid-column: 1 / -1; background: var(--petrol); border-color: var(--petrol); color: var(--cream); justify-content: flex-end; }
.person--partners { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap; }
.person--partners .person-text { color: rgba(244, 243, 238, 0.8); margin-top: 8px; }
.partners-intro { flex: 1 1 420px; max-width: 680px; }
.partner-doctor { display: flex; align-items: center; gap: 16px; padding: 16px 24px 16px 16px; border: 1px solid var(--line-light); border-radius: var(--radius); }
.partner-doctor .person-avatar { margin-bottom: 0; flex-shrink: 0; }
.partner-name { font-size: 19px; font-weight: 700; line-height: 1.2; }
.partner-role { font-size: 15px; font-weight: 600; color: var(--sky); }
.partner-text { font-size: 14px; color: rgba(244, 243, 238, 0.75); margin-top: 6px; max-width: 360px; line-height: 1.45; }
.partner-doctor { align-items: flex-start; }

/* --- Medicine --- */
.medicine { background: var(--petrol); color: var(--cream); }
.medicine-title { font-size: clamp(38px, 6.4vw, 76px); font-weight: 700; line-height: 1.04; letter-spacing: -0.025em; margin-bottom: clamp(40px, 6vw, 64px); }
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.roles-col { border: 1px solid var(--line-light); border-radius: var(--radius); padding: 28px; }
.roles-col h3 { font-size: 22px; font-weight: 700; margin-bottom: 14px; }
.roles-col li { padding: 8px 0; border-top: 1px solid var(--line-light); color: rgba(244, 243, 238, 0.85); }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: none; }
.flow li { border-top: 2px solid var(--terra); padding-top: 18px; }
.flow span { display: block; font-size: 28px; font-weight: 700; color: var(--terra); line-height: 1; margin-bottom: 12px; }
.flow p { font-size: 16px; color: rgba(244, 243, 238, 0.85); }
.medicine-note { margin-top: 56px; font-size: 18px; font-weight: 600; color: var(--sky); }

/* --- Programs --- */
.prog-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; margin-top: 40px; }
.prog { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 28px; display: flex; flex-direction: column; }
.prog--main { background: var(--sky); border-color: var(--sky); }
.prog-tag { font-size: 13px; font-weight: 600; color: var(--terra-text); margin-bottom: 16px; }
.prog h3 { font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 6px; }
.prog-meta { font-weight: 600; color: var(--ink-muted); margin-bottom: 16px; font-size: 15px; }
.prog p:last-child { font-size: 16px; }

/* --- First meeting --- */
.first { background: var(--sky-soft); }
.first-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fact { background: var(--cream); border-radius: var(--radius); padding: 28px 24px; }
.fact-label { display: block; font-size: 14px; font-weight: 600; color: var(--terra-text); margin-bottom: 10px; }
.fact-value { font-size: 24px; font-weight: 700; line-height: 1.2; margin-bottom: 10px; letter-spacing: -0.01em; }
.fact-text { font-size: 15px; color: var(--ink-muted); }
.steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 48px; }
.step { display: flex; gap: 20px; padding: 24px 0; border-top: 1px solid var(--line); }
.step-num { font-size: 32px; font-weight: 700; color: var(--terra); line-height: 1; min-width: 48px; }
.step h4 { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.step p { color: var(--ink-muted); font-size: 16px; }

/* --- Space --- */
.space-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 40px; }
.space-item img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius); background: var(--sand); }
.space-item figcaption { margin-top: 12px; font-size: 15px; color: var(--ink-muted); }

/* --- Principles --- */
.principles-head { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(24px, 5vw, 80px); align-items: start; margin-bottom: 48px; }
.voice { font-size: clamp(40px, 5.6vw, 64px); font-weight: 700; line-height: 1.05; letter-spacing: -0.025em; }
.quote { font-size: 19px; font-weight: 700; margin-top: 24px; }
.principles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.principle { border-top: 2px solid var(--petrol); padding-top: 18px; }
.principle h3 { font-size: 18px; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.principle p { font-size: 15px; color: var(--ink-muted); }

/* --- Vestnik teaser --- */
.vestnik-home { background: var(--sky-soft); }
.vestnik-home-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.vestnik-all { font-weight: 600; border-bottom: 1.5px solid var(--sky); padding-bottom: 2px; margin-bottom: 28px; }
.vestnik-all:hover { border-color: var(--petrol); }
.vestnik-latest { margin-top: 24px; }

/* --- FAQ --- */
.faq-inner { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(24px, 5vw, 80px); }
.faq-list { border-bottom: 1px solid var(--line); }
.faq-item { border-top: 1px solid var(--line); }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 22px 0; text-align: left; font-size: 18px; font-weight: 600; line-height: 1.35;
}
.faq-icon { font-size: 24px; font-weight: 400; color: var(--terra-text); transition: transform .3s; flex-shrink: 0; }
.faq-q[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.faq-a > p { overflow: hidden; color: var(--ink-muted); }
.faq-a.open { grid-template-rows: 1fr; }
.faq-a.open > p { padding-bottom: 22px; }

/* --- Contact --- */
.contact { background: #a3604c; color: var(--cream); }
.contact .eyebrow--light { color: var(--cream); opacity: .85; }
.contact-inner { max-width: 1200px; }
.contact-title { font-size: clamp(40px, 6vw, 72px); font-weight: 700; line-height: 1.04; letter-spacing: -0.025em; margin-bottom: 24px; }
.contact-text { font-size: clamp(18px, 1.8vw, 21px); max-width: 640px; margin-bottom: 36px; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-bottom: 24px; }
.contact .btn-light { color: var(--petrol); }
.contact-phone { font-size: 20px; font-weight: 600; border-bottom: 1.5px solid rgba(244, 243, 238, 0.5); padding-bottom: 2px; }
.contact-phone:hover { border-color: var(--cream); }
.contact-place { font-size: 15px; opacity: .85; }
.social { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.social-link {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 20px;
  border: 1.5px solid rgba(244, 243, 238, 0.5); border-radius: 999px; font-size: 15px; font-weight: 600;
  transition: border-color .2s, background-color .2s;
}
.social-link:hover { border-color: var(--cream); background: rgba(244, 243, 238, 0.08); }
.footer-social { margin-top: 12px; font-size: 15px; font-weight: 500; }
.footer-social a:hover { color: var(--terra-text); }

/* --- Footer --- */
.footer { background: var(--cream); padding: 64px 0 32px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-logo { width: 240px; margin-bottom: 20px; }
.footer-meta { font-size: 15px; color: var(--ink-muted); }
.footer-nav { display: grid; grid-template-columns: repeat(2, auto); gap: 10px 40px; align-content: start; }
.footer-nav a { font-size: 15px; font-weight: 500; }
.footer-nav a:hover { color: var(--terra-text); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-muted); }

/* --- Reveal --- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* --- Responsive --- */
@media (max-width: 1080px) {
  .nav-burger { display: flex; order: 2; margin-right: -10px; }
  .nav-links {
    position: fixed; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--cream); padding: 8px var(--gutter) 24px;
    box-shadow: 0 12px 24px rgba(27, 57, 59, 0.12);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .25s, transform .25s, visibility .25s;
  }
  .nav-links.open { opacity: 1; transform: none; visibility: visible; }
  .nav-links li { border-bottom: 1px solid var(--line); }
  .nav-links li:last-child { border-bottom: none; padding-top: 16px; }
  .nav-link { display: block; padding: 14px 0; color: var(--petrol); opacity: 1; font-size: 17px; }
  .nav-link--cta { text-align: center; background: var(--petrol); color: var(--cream); padding: 14px 20px; }
  .nav.menu-open { background: var(--cream); }
  .nav.menu-open .nav-logo-img--light { display: none; }
  .nav.menu-open .nav-logo-img--dark { display: block; }
  .nav.menu-open .nav-burger span { background: var(--petrol); }

  .dir-grid { grid-template-columns: repeat(2, 1fr); }
  .story { grid-template-columns: repeat(2, 1fr); }
  .story-step:nth-child(3) { border-left: none; }
  .story-step:nth-child(n+3) { border-top: 1px solid var(--line-light); }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .principles-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 16px; }
  .prog-grid { grid-template-columns: 1fr 1fr; }
  .prog--main { grid-column: 1 / -1; }
  .space-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }
}

@media (max-width: 820px) {
  .split, .founder-head, .principles-head, .faq-inner { grid-template-columns: 1fr; }
  .hero-pins { grid-template-columns: 1fr; }
  .requests { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr 1fr; }
  .person--partners { grid-column: 1 / -1; }
  .roles { grid-template-columns: 1fr; }
  .first-facts { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .founder-photo-wrap { max-width: 440px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { min-height: auto; }
  .hero-actions .btn { width: 100%; }
  .dir-grid, .team-grid, .prog-grid, .story, .flow, .principles-grid { grid-template-columns: 1fr; }
  .story-step { border-left: none; border-top: 1px solid var(--line-light); }
  .story-step:first-child { border-top: none; }
  .dir { min-height: 0; }
  .book { grid-template-columns: 1fr; }
  .book-cover { max-width: 200px; }
  .footer-nav { grid-template-columns: 1fr 1fr; gap: 10px 24px; }
  .contact-actions .btn { width: 100%; }
}
