/* ═══════════════════════════════════════════════════════════════════════
   хирургия.москва v4 — warm paper · serif display · soft forms · airy
   Display : Spectral 300–600 (+italic)   ·   Body / UI : Golos Text 400–700
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --font-d: 'Spectral', Georgia, 'Times New Roman', serif;   /* display / headlines */
  --font-b: 'Golos Text', system-ui, sans-serif;             /* body + UI           */
  --font-m: 'Golos Text', system-ui, sans-serif;             /* small labels        */

  /* warm paper palette ------------------------------------------------ */
  --bg:          #F7F4EE;
  --surface:     #F1EBE1;
  --surface-2:   #E9E1D4;
  --ink:         #201E1A;
  --muted:       #6B655B;
  --faint:       #A89F90;
  --line:        #E4DCCE;
  --line-strong: #D5CBB8;
  --accent:      #971910;
  --accent-deep: #6B0E07;
  --on-accent:   #FCF7F0;

  /* shape -------------------------------------------------------------- */
  --r-sm: 6px;
  --r:    9px;
  --r-lg: 14px;
  --r-xl: 22px;

  --shadow-soft: 0 18px 44px -28px rgba(54, 40, 24, .40);
  --shadow-pop:  0 30px 64px -34px rgba(54, 40, 24, .44);

  --gut: clamp(20px, 5vw, 84px);
  --maxw: 1280px;
}

[data-theme="ink"] {
  --bg:          #181610;
  --surface:     #201D16;
  --surface-2:   #28241B;
  --ink:         #ECE5D7;
  --muted:       #A39B8B;
  --faint:       #5C5444;
  --line:        #2C281E;
  --line-strong: #3C372B;
  --accent:      #E06155;
  --accent-deep: #C03A2E;
  --on-accent:   #1A1710;

  --shadow-soft: 0 18px 44px -26px rgba(0, 0, 0, .70);
  --shadow-pop:  0 30px 64px -32px rgba(0, 0, 0, .76);
}

/* ── reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-b);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .5s, color .5s;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--ink); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }

/* ── atoms ──────────────────────────────────────────────────────────── */
.lbl {
  font-family: var(--font-b); font-size: 12px; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.lbl.accent { color: var(--accent); }

.sec-num {
  display: inline-flex; align-items: center; gap: 13px;
  font-family: var(--font-b); font-size: 12.5px; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.sec-num::before { content: ""; width: 28px; height: 1px; background: var(--accent); flex-shrink: 0; }

.h-xl { font-family: var(--font-d); font-weight: 500; line-height: 1.04; letter-spacing: -.012em; }
.h-lg { font-family: var(--font-d); font-weight: 500; line-height: 1.1;  letter-spacing: -.008em; }
.h-md { font-family: var(--font-d); font-weight: 500; line-height: 1.18; letter-spacing: -.004em; }
.lead { color: var(--muted); font-size: clamp(16px,1.4vw,19px); line-height: 1.68; max-width: 56ch; }

/* ── buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-b); font-size: 15px; font-weight: 600; letter-spacing: .005em;
  white-space: nowrap; height: 52px; padding: 0 30px;
  border: 1px solid transparent; border-radius: var(--r);
  transition: background .25s, color .25s, border-color .25s, transform .25s, box-shadow .25s;
}
.btn .ar { display: inline-block; transition: transform .26s ease; }
.btn:hover .ar { transform: translateX(4px); }
.btn:active { transform: translateY(1px); }
.btn-solid {
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--accent) 72%, transparent);
}
.btn-solid:hover {
  background: var(--accent-deep); transform: translateY(-2px);
  box-shadow: 0 16px 30px -14px color-mix(in srgb, var(--accent) 66%, transparent);
}
.btn-outline { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-outline:hover { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }

/* ════ STICKY COMPACT HEADER ════════════════════════════════════════════ */
.compact-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%); transition: transform .4s cubic-bezier(.2,.7,.3,1);
}
.compact-header.show { transform: translateY(0); }
.compact-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 20px; }
.compact-brand { font-family: var(--font-d); font-weight: 600; font-size: 21px; letter-spacing: -.01em; }
.compact-brand b { color: var(--accent); }
.compact-nav { display: flex; gap: 6px; }
.compact-nav a { font-family: var(--font-b); font-size: 14px; color: var(--muted); padding: 9px 14px; border-radius: var(--r-sm); transition: color .2s, background .2s; }
.compact-nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); }
.compact-header .btn { height: 44px; padding: 0 24px; font-size: 14px; }
@media (max-width: 760px) { .compact-nav { display: none; } }

/* ════ MASTHEAD ═════════════════════════════════════════════════════════ */
.masthead {
  position: relative; overflow: hidden;
  min-height: clamp(540px, 90vh, 880px);
  display: flex; flex-direction: column;
  border-bottom: 1px solid var(--line);
}
/* keep the signature flow-lines, but calmer & warmer */
.bg-paths {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  color: var(--accent); opacity: .30;
}
.bg-paths svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* warm light wash so the wordmark sits in air */
.masthead::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(58% 48% at 50% 34%, color-mix(in srgb, var(--accent) 5%, transparent) 0%, transparent 72%);
}
.masthead::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 78% at 50% 40%, color-mix(in srgb, var(--bg) 38%, transparent) 0%, transparent 60%);
}

.mast-bar {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px var(--gut) 0; gap: 16px;
}
.mast-phone { font-family: var(--font-b); font-size: 15px; letter-spacing: .005em; white-space: nowrap; color: var(--muted); transition: color .2s; }
.mast-phone:hover { color: var(--accent); }

.mast-center {
  position: relative; z-index: 3; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: clamp(48px,9vh,128px) var(--gut) clamp(40px,7vw,86px);
  gap: clamp(28px, 3.6vw, 48px);
}

.logo-mark {
  font-family: var(--font-d); font-weight: 500; text-transform: uppercase;
  font-size: clamp(44px, 8.4vw, 150px); line-height: .98; letter-spacing: -.01em;
  color: var(--ink); white-space: nowrap; max-width: 100%;
}
.logo-mark .dot { color: var(--accent); }
.logo-mark .lm-2 { white-space: nowrap; }

/* ── mega nav ───────────────────────────────────────────────────────── */
.mega-nav { display: flex; align-items: center; justify-content: center; gap: clamp(4px, 1.4vw, 22px); flex-wrap: wrap; }
.mega-item { position: relative; }
.mega-trigger {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-family: var(--font-b); font-size: 15.5px; font-weight: 500; letter-spacing: .005em;
  color: var(--ink); padding: 11px 15px; border-radius: var(--r-sm);
  transition: color .2s, background .2s;
}
.mega-trigger:hover, .mega-item.open .mega-trigger { color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.mega-trigger .chev { font-size: 9px; color: var(--faint); transition: transform .25s, color .2s; }
.mega-item.open .mega-trigger .chev { transform: rotate(180deg); color: var(--accent); }

.submenu {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(-6px);
  min-width: 268px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-pop);
  padding: 10px; z-index: 20; text-align: left;
  opacity: 0; visibility: hidden; transition: opacity .22s, transform .22s, visibility .22s;
}
.mega-item.open .submenu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.submenu a {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; font-family: var(--font-b); font-size: 15px; color: var(--ink);
  border-radius: var(--r-sm); transition: background .16s, color .16s;
}
.submenu a:hover { background: var(--surface); color: var(--accent); }
.submenu a .ix { font-family: var(--font-d); font-style: italic; font-size: 15px; color: var(--accent); min-width: 22px; }
.submenu-wide { min-width: 344px; }

.mast-scroll-hint { position: relative; z-index: 3; display: flex; justify-content: center; padding-bottom: 30px; }
.mast-scroll-hint span {
  font-family: var(--font-b); font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); display: inline-flex; flex-direction: column; align-items: center; gap: 8px;
}
.mast-scroll-hint .arr { animation: bob 2.2s ease-in-out infinite; font-size: 15px; }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(5px) } }

@keyframes flow { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .bg-paths path { animation: none !important; }
  .mast-scroll-hint .arr { animation: none !important; }
}

/* ════ INTRO (second hero) ══════════════════════════════════════════════ */
.intro { padding-block: clamp(64px, 9vw, 132px); }
.intro-grid { display: grid; grid-template-columns: minmax(0,320px) 1fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.intro-photo { position: sticky; top: 120px; }
.intro-photo image-slot { width: 100%; height: auto; aspect-ratio: 1/1; border: 1px solid var(--line); border-radius: 50%; box-shadow: var(--shadow-soft); }

.intro-copy .eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.intro-copy .eyebrow::after { content: ""; height: 1px; width: 60px; background: var(--line-strong); }
.intro-title { font-size: clamp(36px, 4.8vw, 66px); margin-bottom: 24px; }
.intro-title .accent { color: var(--accent); font-style: italic; font-weight: 400; }
.intro-role { margin-bottom: 26px; }
.intro-body { color: var(--muted); font-size: clamp(16px,1.3vw,18px); line-height: 1.74; max-width: 56ch; margin-bottom: 18px; }
.intro-body b { color: var(--ink); font-weight: 600; }

.cred-list { list-style: none; display: flex; flex-direction: column; margin: 34px 0; }
.cred-list li { display: grid; grid-template-columns: 34px 1fr; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); align-items: baseline; font-size: 16px; line-height: 1.5; }
.cred-list li:first-child { border-top: 1px solid var(--line); }
.cred-list .ix { font-family: var(--font-d); font-style: italic; font-size: 16px; color: var(--accent); }

.intro-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }

/* ── section scaffolding ─────────────────────────────────────────────── */
section { scroll-margin-top: 76px; }
.sect { padding-block: clamp(64px,8vw,120px); }
.sect-rule { height: 1px; background: var(--line); border: 0; }
.sect-header {
  display: grid; grid-template-columns: 220px 1fr auto; gap: 28px; align-items: baseline;
  padding-bottom: clamp(34px,4vw,54px); border-bottom: 1px solid var(--line);
  margin-bottom: clamp(40px,5vw,64px);
}
.sect-header .h-lg { font-size: clamp(28px,3.6vw,46px); }
.sect-header .right { color: var(--muted); font-size: 15.5px; line-height: 1.6; max-width: 46ch; justify-self: end; text-align: right; }

/* ── маршрут — airy, no box grid ─────────────────────────────────────── */
.steps-row { display: grid; grid-template-columns: repeat(3,1fr); gap: clamp(28px,3.4vw,56px); }
.step-panel { display: flex; flex-direction: column; gap: 16px; }
.step-top { display: flex; align-items: center; justify-content: space-between; }
.step-num { font-family: var(--font-d); font-style: italic; font-size: 30px; line-height: 1; color: var(--accent); }
.step-arrow { color: var(--faint); font-size: 18px; line-height: 1; }
.step-panel h3 { font-size: clamp(22px,2vw,28px); }
.step-panel p { color: var(--muted); font-size: 15.5px; line-height: 1.66; }
.step-list { list-style: none; display: flex; flex-direction: column; gap: 11px; margin-top: 6px; padding-top: 20px; border-top: 1px solid var(--line); }
.step-list li { display: flex; gap: 12px; font-size: 14.5px; color: var(--muted); }
.step-list li::before { content: ""; width: 16px; height: 1px; background: var(--accent); flex-shrink: 0; margin-top: 11px; }

/* ── видео-библиотека (опционально) ──────────────────────────────────── */
.lib-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: clamp(20px,2vw,28px); }
.vid-card { background: var(--surface); border-radius: var(--r-lg); display: flex; flex-direction: column; cursor: pointer; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.vid-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.vid-card.hide { display: none; }
.vid-thumb { position: relative; aspect-ratio: 16/9; background: var(--surface-2); overflow: hidden; }
.vid-thumb image-slot { width: 100%; height: 100%; }
.vid-play-sm { position: absolute; right: 14px; bottom: 14px; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; }
.vid-play-sm svg { width: 14px; height: 14px; fill: var(--on-accent); margin-left: 2px; }
.vid-dur { position: absolute; left: 12px; bottom: 12px; font-size: 12px; color: #fff; background: rgba(0,0,0,.55); padding: 4px 9px; border-radius: 999px; }
.vid-info { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.vid-cat { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.vid-title { font-family: var(--font-d); font-weight: 500; font-size: 20px; line-height: 1.2; }

/* ── запись ──────────────────────────────────────────────────────────── */
.book { background: var(--surface); }
.book-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px,4vw,72px); align-items: start; }
.book-intro .sec-num { margin-bottom: 22px; }
.book-title { font-size: clamp(32px,3.6vw,50px); margin-bottom: 20px; }
.book-desc { margin-bottom: 36px; }
.book-contacts { display: flex; flex-direction: column; }
.contact-item { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; padding: 17px 0; border-top: 1px solid var(--line-strong); }
.contact-item:last-of-type { border-bottom: 1px solid var(--line-strong); }
.contact-item .k { font-family: var(--font-b); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.contact-item .v { font-family: var(--font-b); font-size: 18px; font-weight: 500; letter-spacing: .005em; }
.contact-item .v a:hover { color: var(--accent); }

form.book-form { display: grid; gap: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(22px,2.6vw,34px); box-shadow: var(--shadow-soft); }
.field { display: flex; flex-direction: column; gap: 8px; }
form label { font-family: var(--font-b); font-size: 12.5px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
form input, form textarea {
  font-family: var(--font-b); font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 14px 16px; outline: none; transition: border-color .18s, box-shadow .18s, background .18s; resize: vertical; width: 100%;
}
form input:focus, form textarea:focus { border-color: var(--accent); background: var(--bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
form input::placeholder, form textarea::placeholder { color: var(--faint); }
form .btn-solid { width: 100%; justify-content: center; margin-top: 6px; }
form .btn-solid:disabled { cursor: wait; opacity: .68; }
form .btn-solid.loading { font-size: 0; }
form .btn-solid.loading .ar { display: none; }
form .btn-solid.loading::after { content: "Отправляем..."; font-size: 13px; }
form .consent { font-family: var(--font-b); font-size: 12.5px; color: var(--faint); line-height: 1.6; }
.form-error { min-height: 18px; margin: 0; font-family: var(--font-b); font-size: 12.5px; line-height: 1.5; color: #a72b2b; }
.form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-done { display: none; padding: 26px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: var(--r-lg); background: var(--bg); font-size: 15px; line-height: 1.7; color: var(--accent-deep); box-shadow: var(--shadow-soft); }
.form-done.show { display: block; }
.form-done.show + form.book-form { display: none; }

/* ── footer ──────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding-block: clamp(52px,6vw,80px); }
.footer-top { display: grid; grid-template-columns: 1fr 200px 200px; gap: 36px; padding-bottom: 48px; border-bottom: 1px solid var(--line); margin-bottom: 34px; }
.footer-wordmark { font-family: var(--font-d); font-weight: 500; font-size: clamp(30px,4vw,54px); letter-spacing: -.01em; text-transform: uppercase; line-height: 1; margin-bottom: 16px; }
.footer-wordmark b { color: var(--accent); }
.footer-blurb { color: var(--muted); font-size: 15px; max-width: 36ch; }
.footer-col h5 { font-family: var(--font-b); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 18px; }
.footer-col a { display: block; font-size: 14.5px; color: var(--muted); padding: 6px 0; transition: color .18s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-bottom span, .footer-bottom a { font-family: var(--font-b); font-size: 13px; color: var(--faint); }
.footer-bottom a:hover { color: var(--accent); }
.disclaimer { font-family: var(--font-b); font-size: 12.5px; color: var(--faint); line-height: 1.74; max-width: 92ch; margin-bottom: 26px; }

/* ── scroll reveal ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .rev { opacity: 0; transform: translateY(22px); transition: opacity .75s ease, transform .75s cubic-bezier(.2,.7,.3,1); }
  .rev.in { opacity: 1; transform: none; }
}

/* ── responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1080px) { .intro-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
  .intro-grid { grid-template-columns: 1fr; }
  .intro-photo { max-width: 300px; position: static; }
  .book-grid { grid-template-columns: 1fr; }
  .steps-row { grid-template-columns: 1fr; gap: 40px; }
  .lib-grid { grid-template-columns: 1fr 1fr; }
  .sect-header { grid-template-columns: auto 1fr; }
  .sect-header .right { display: none; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .logo-mark { white-space: normal; font-size: clamp(46px, 16vw, 92px); line-height: .92; }
  .logo-mark .lm-2 { display: block; }
}
@media (max-width: 640px) {
  .lib-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .mast-phone { display: none; }
  .submenu { min-width: 230px; }
  .submenu-wide { min-width: 250px; }
}
