/* Тихий минимализм: холодный серый, белая рамка, тёмные круглые значки, мягкие тени.
   Акцент — один: ультрамарин в точке напряжения и в точке у плашки. Только светлая тема. */
:root {
  color-scheme: light;
  --bg: #eceef1;          /* фон за рамкой */
  --frame: #f7f8f9;       /* рамка страницы */
  --surface: #ffffff;     /* карточки */
  --ink: #1d2025;
  --ink-2: #5d646e;
  --ink-3: #959ca5;
  --line: #e3e6ea;
  --orb: #1d2025;         /* тёмные круги со значками */
  --accent: #3a4bd1;
  --shadow-soft: 0 1px 2px rgba(29, 32, 37, .04), 0 8px 24px rgba(29, 32, 37, .05);
  --shadow-orb: 0 6px 14px rgba(29, 32, 37, .22), 0 2px 4px rgba(29, 32, 37, .12);
  --sans: "Mulish", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  /* ритм: у каждой секции половина шага сверху и снизу, между любыми соседними — ровно один шаг */
  --gap: 112px;
  --pad-x: 24px;
  --head: 72px;          /* высота шапки, которая лежит поверх страницы */
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--ink-3); text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--ink); }

/* Рамка страницы */
.frame {
  position: relative;
  max-width: 1120px;
  margin: 28px auto;
  background: var(--frame);
  border-radius: 20px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 1px 3px rgba(29, 32, 37, .04);
  overflow: hidden;
}


.top { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 22px 32px; flex-wrap: wrap; position: absolute; top: 0; left: 0; right: 0; z-index: 3; background: none; }
.top + main > :first-child:not(.hero) { padding-top: calc(var(--head) + var(--gap) / 2); }   /* внутренние страницы: место под шапкой */
.brand { font-weight: 500; font-size: 15px; text-decoration: none; letter-spacing: -.01em; }
.nav { display: flex; gap: 22px; }
.nav a { font-size: 14px; color: var(--ink-2); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* Типографика */
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -.025em; line-height: 1.12; }
h1 { font-size: clamp(34px, 5.2vw, 54px); max-width: 15em; margin-inline: auto; }
h1 em, .h2 em {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 1.06em; letter-spacing: -.01em;   /* строчные у засечкового ниже — подтянуто до высоты Mulish */
  color: var(--ink-2);   /* курсив бледнее основного текста, но читается: контраст ≈ 6:1 */
}
.h1--article { font-size: clamp(28px, 4vw, 40px); max-width: 20em; }
.h2 { font-size: clamp(26px, 3.4vw, 36px); }
h3 { font-size: 16px; letter-spacing: -.01em; }
.lead { font-size: 16px; color: var(--ink-2); max-width: 30em; margin: 18px auto 0; }
.sub { color: var(--ink-2); max-width: 34em; margin: 18px auto 0; font-size: 15px; }

/* Значки в тёмных кругах */
.orb {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--orb); color: #fff;
  box-shadow: var(--shadow-orb);
}
.orb svg { width: 20px; height: 20px; }
.orb--lg { width: 52px; height: 52px; }
.orb--lg svg { width: 24px; height: 24px; }
.orb--corner { position: absolute; top: -20px; right: -14px; width: 48px; height: 48px; }

/* Плашки */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink-2);
  padding: 5px 12px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow-soft);
}
.pill a { color: inherit; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(58, 75, 209, .14); }
/* метка места: синяя иконка на бледном голубом круге, без яркой заливки */
.dot--pin { width: 20px; height: 20px; display: grid; place-items: center; flex: none; background: rgba(58, 75, 209, .12); box-shadow: none; }
.dot--pin .pin { width: 12px; height: 12px; color: var(--accent); }
.tag { display: inline-block; font-size: 12px; color: var(--ink-2); padding: 4px 11px; border-radius: 999px; background: var(--frame); border: 1px solid var(--line); }

/* Кнопки */
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px; border-radius: 999px;
  background: var(--orb); color: #fff; text-decoration: none;
  font: 500 14px/1 var(--sans);
  box-shadow: var(--shadow-orb);
  transition: transform .4s ease, box-shadow .4s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--ghost { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); }

/* Первый экран: туман и орбиты */
.hero {
  position: relative; z-index: 0; text-align: center;
  min-height: calc(100svh - 56px);   /* высота экрана минус поля рамки */
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--head) + 24px) var(--pad-x) calc(var(--gap) / 2);
  /* без overflow: орбиты и туман не срезаются границей секции, а гаснут сами (маски ниже) */
}
.hero__in { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.hero__in .pill { margin: 22px 0 22px; }

.fog { position: absolute; inset: -20% -10%; pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 60%, transparent); mask-image: radial-gradient(closest-side, #000 60%, transparent); }
.fog span {
  position: absolute; border-radius: 50%; filter: blur(60px);
  background: radial-gradient(closest-side, rgba(214, 219, 226, .9), rgba(214, 219, 226, 0));
  animation: drift 48s ease-in-out infinite alternate;
}
.fog span:nth-child(1) { width: 52%; height: 60%; left: -4%; top: 10%; }
.fog span:nth-child(2) { width: 46%; height: 52%; right: -2%; top: 0; animation-duration: 62s; animation-delay: -20s; }
.fog span:nth-child(3) {
  width: 40%; height: 40%; left: 30%; top: 46%; animation-duration: 75s; animation-delay: -35s;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0));
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6%, -4%, 0) scale(1.08); }
}

/* Граф вопросов: центр — значок над заголовком (человек), ветви — варианты, у части — вопросы */
.hero__in > .graph {
  position: absolute; left: 50%; top: 26px;               /* 26px — центр значка .orb--lg */
  width: 1000px; height: 683px; margin: -217px 0 0 -500px;   /* viewBox 1200×820 в масштабе 0,83 — целиком внутри рамки */
  z-index: -1; pointer-events: none; overflow: visible;
}
.g-edge { fill: none; stroke: var(--ink); stroke-opacity: .11; stroke-width: 1;
  stroke-dasharray: 700; stroke-dashoffset: 700;
  animation: g-draw 2.4s cubic-bezier(.4, 0, .2, 1) forwards; animation-delay: calc(.25s + var(--i) * .09s); }
.g-node { fill: var(--surface); stroke: var(--ink); stroke-opacity: .3; stroke-width: 1;
  opacity: 0; animation: g-fade 1s ease forwards; animation-delay: 1.4s; }
.g-node--sm { stroke-opacity: .22; }
.g-label { font: 400 15.6px/1 var(--sans);   /* 15,6 × 0,83 ≈ 13px на экране */ fill: var(--ink-3); letter-spacing: .01em;
  opacity: 0; animation: g-fade 1.2s ease forwards; animation-delay: 2s; }
@keyframes g-draw { to { stroke-dashoffset: 0; } }
@keyframes g-fade { to { opacity: 1; } }
/* по очереди подсвечивается одна ветвь-вопрос: 6 вопросов × 4 с */
.g-edge--q { animation: g-draw 2.4s cubic-bezier(.4, 0, .2, 1) forwards, g-edge-focus 24s ease-in-out infinite;
  animation-delay: calc(.25s + var(--i) * .09s), calc(3s + var(--q) * 4s); }
.g-q .g-node--q { animation: g-fade 1s ease forwards, g-node-focus 24s ease-in-out infinite;
  animation-delay: 1.4s, calc(3s + var(--q) * 4s); }
.g-q .g-label { animation: g-fade 1.2s ease forwards, g-label-focus 24s ease-in-out infinite;
  animation-delay: 2s, calc(3s + var(--q) * 4s); }
@keyframes g-edge-focus { 0%, 20%, 100% { stroke: var(--ink); stroke-opacity: .11; } 6%, 14% { stroke: var(--accent); stroke-opacity: .55; } }
@keyframes g-node-focus { 0%, 20%, 100% { fill: var(--surface); stroke: var(--ink); stroke-opacity: .3; } 6%, 14% { fill: var(--accent); stroke: var(--accent); stroke-opacity: 1; } }
@keyframes g-label-focus { 0%, 20%, 100% { fill: var(--ink-3); } 6%, 14% { fill: var(--ink); } }

/* Три шага */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 760px; margin: 0 auto; padding: 0 24px; }
.step {
  position: relative; text-align: center;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-soft);
  padding: 36px 18px 22px; margin-top: 20px;
}
.step .orb { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); }
.step p { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }

/* Разделы */
.sec { position: relative; z-index: 1; padding: calc(var(--gap) / 2) var(--pad-x); }
.sec--center { text-align: center; }
.sec--center .tag { margin-bottom: 16px; }
.pagehead { text-align: center; display: flex; flex-direction: column; align-items: center; margin-bottom: 40px; }
.pagehead .pill { margin: 18px 0 18px; }
.pagehead > .orb + h1 { margin-top: 22px; }

/* Вопрос с фото */
.intro { display: grid; grid-template-columns: 280px minmax(0, 440px); gap: 88px; justify-content: center; align-items: center; }
.intro__photo {
  position: relative; width: 280px; aspect-ratio: 1; border-radius: 50%;
  padding: 8px; background: var(--surface); box-shadow: var(--shadow-soft);
}
.intro__photo::after {   /* тонкое кольцо — как ещё одна орбита */
  content: ""; position: absolute; inset: -22px; border-radius: 50%;
  border: 1px solid var(--ink); opacity: .07;
}
.intro__photo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 22%; display: block; filter: saturate(.85); }
.intro__text p { color: #3c424a; font-size: 15.5px; line-height: 1.8; margin: 22px 0 0; }

/* Карточка с текстом */
.panel {
  position: relative; max-width: 620px; margin: 0 auto;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-soft);
  padding: 34px 36px 30px;
}
.panel > .tag { margin-bottom: 16px; }
/* последний абзац карточки на главной — примечание, а не продолжение рассуждения */
.panel--note .prose > p:last-child { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.prose > * + * { margin-top: .9em; }
.prose h2 { font-size: 24px; margin-top: 1.8em; letter-spacing: -.02em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.4em; }
.prose p, .prose li { color: #3c424a; font-size: 15.5px; }
.prose ol, .prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: .5em; }
.prose li::marker { color: var(--ink-3); }
.prose strong { font-weight: 600; color: var(--ink); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.prose th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-3); padding: 0 12px 8px 0; border-bottom: 1px solid var(--line); }
.prose td { vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); color: #3c424a; }
.prose td:first-child { color: var(--ink-3); width: 40%; }

.facts { margin: 26px 0 0; display: grid; gap: 6px; font-size: 14.5px; }
.facts div { display: flex; gap: 8px; }
.facts dt { font-weight: 600; }
.facts dt::after { content: ":"; }
.facts dd { margin: 0; color: var(--ink-2); }

.sign { display: flex; align-items: center; gap: 12px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.sign__av { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: 50% 25%; }
.sign--bare { border-top: 0; padding-top: 0; margin-top: 22px; }
a.sign { text-decoration: none; color: inherit; }
a.sign:hover b { text-decoration: underline; text-underline-offset: 3px; }
.sign b { display: block; font-weight: 600; font-size: 13.5px; }
.sign small { display: block; font-size: 12px; color: var(--ink-3); }

/* Точка напряжения */
.tension { margin: 32px auto 0; max-width: 680px; color: var(--ink); }
.tension svg { width: 100%; height: auto; display: block; overflow: visible; }
.tension path { fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; }
.tension__lines { opacity: .22; }
.tension__flow { opacity: .55; }
.tension__flow path {
  stroke-dasharray: 2 26;
  animation: flow 9s linear infinite;
  animation-delay: calc(var(--i) * -0.9s);
}
@keyframes flow { to { stroke-dashoffset: -280; } }
.tension__point { fill: var(--accent); }
.tension__halo { fill: var(--accent); opacity: .12; transform-origin: 380px 140px; animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.7); opacity: .16; } 50% { transform: scale(1.25); opacity: .05; } }

/* Блог */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 300px)); justify-content: center; gap: 16px; margin-top: 32px; text-align: left; }
.cards--list { grid-template-columns: minmax(0, 620px); }
.card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-soft);
  padding: 22px; text-decoration: none; color: var(--ink);
  transition: transform .4s ease, box-shadow .4s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(29, 32, 37, .05), 0 14px 32px rgba(29, 32, 37, .08); }
.card__date { font-size: 12px; color: var(--ink-3); }
.card__title { font-weight: 500; font-size: 17px; line-height: 1.35; letter-spacing: -.015em; }
.card__text { font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.more { margin-top: 24px; font-size: 14px; }

/* Запись */
.cta { border-top: 1px solid var(--line); }
.cta .orb { margin-bottom: 20px; }

.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 22px 32px; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line); }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* Появление при прокрутке — только если есть скрипт */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 1.2s ease, transform 1.2s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .g-edge { stroke-dashoffset: 0; }
  .g-node, .g-label { opacity: 1; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media (max-width: 1060px) { .g-label { display: none; } }

@media (max-width: 720px) {
  .frame { margin: 0; border-radius: 0; }
  :root { --gap: 72px; --pad-x: 16px; --head: 60px; }
  .top { padding: 18px 16px; }
  .hero { min-height: 100svh; }
  .hero__in > .graph { transform: scale(.62); transform-origin: 500px 217px; }
  .g-label { display: none; }
  .steps { grid-template-columns: 1fr; padding: 0 16px; gap: 28px; }
  .panel { padding: 28px 20px 24px; }
  .intro { grid-template-columns: 1fr; gap: 48px; justify-items: center; text-align: center; }
  .intro__photo { width: 200px; }
  .sign--bare { justify-content: center; }
  .orb--corner { right: 12px; }
  .foot { padding: 20px 16px; }
  .btn { flex: 1 1 100%; }
}

[hidden] { display: none !important; }
