/* ============================================================
   Андрей Чирков — пишущий редактор, PR, перевод
   Палитра: тёплый монохром (trust-first editorial-минимализм)
   Шрифты: Lora (заголовки) + Manrope (текст) — локально, woff2
   ============================================================ */

/* ---------- Токены ---------- */
:root {
  --bg: #FBFAF7;            /* бумага */
  --bg-soft: #F5F3EE;       /* мягкие секции */
  --surface: #FFFFFF;
  --ink: #1A1917;           /* почти-чёрный текст */
  --ink-soft: #4A4741;
  --muted: #7A756B;         /* вторичный текст */
  --line: #E8E5DF;          /* границы 1px */
  --accent-deep: #3E5C4B;   /* глубокий оливково-зелёный (ссылки/акценты) */
  --tag-green: #EDF3EC;  --tag-green-ink: #346538;
  --tag-blue: #E1F3FE;   --tag-blue-ink: #1F6C9F;
  --tag-yellow: #FBF3DB; --tag-yellow-ink: #956400;
  --tag-red: #FDEBEC;    --tag-red-ink: #9F2F2D;
  --serif: "Lora", "Georgia", serif;
  --sans: "Manrope", "Segoe UI", sans-serif;
  --radius: 10px;
  --maxw: 1120px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Сброс и база ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
/* анкорные секции не зажимаются под sticky-шапку */
section[id], .faq-item { scroll-margin-top: 84px; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
::selection { background: var(--tag-yellow); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: 24px; }
@media (min-width: 640px) { .wrap { padding-inline: 40px; } }

section { padding-block: 88px; }
@media (max-width: 720px) { section { padding-block: 64px; } }

/* ---------- Типографика ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(34px, 5.4vw, 58px); }
h2 { font-size: clamp(26px, 3.6vw, 40px); }
h3 { font-size: 21px; line-height: 1.3; }
p { margin: 0 0 1em; }
.lead { font-size: 19px; color: var(--ink-soft); max-width: 620px; }

/* кнопки и ссылки — без задержки двойного тапа на мобильных */
.btn, .nav a, .topbar-phone, .faq-q { touch-action: manipulation; }
/* числа калькулятора не «прыгают» между десятичными разрядами */
.calc-total .sum, .adv-num { font-variant-numeric: tabular-nums; }

/* skip-ссылка на основной контент */
.skip {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip:focus { top: 12px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink); margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent-deep); flex: none; }

.sect-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 48px; }
.sect-head .lead { margin: 0; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px; border-radius: 6px;
  font-family: var(--sans); font-size: 15px; font-weight: 600; line-height: 1;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease), border-color 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: #33322E; text-decoration: none; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); text-decoration: none; }

/* ---------- Шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 247, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink); }
.brand small { display: block; font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; gap: 26px; align-items: center; }
.nav a { font-size: 15px; font-weight: 600; color: var(--ink-soft); }
.nav a:hover { color: var(--ink); text-decoration: none; }
/* активный раздел: цвет + подчёркивание (страницы портфолио — статично, главная — по прокрутке) */
.nav a.active {
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 7px;
}
.nav a.active:hover { color: var(--accent-deep); }
.topbar-phone { font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; }
@media (max-width: 860px) { .nav { display: none; } }

/* ---------- Hero ---------- */
.hero { padding-block: 96px 104px; overflow: hidden; }
@media (max-width: 720px) { .hero { padding-block: 56px 72px; } }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 64px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }
.hero h1 { margin-bottom: 24px; }
.hero .lead { margin-bottom: 36px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px; }

.hero-photo { position: relative; max-width: 420px; margin-left: auto; }
.hero-photo img { border-radius: 12px; border: 1px solid var(--line); width: 100%; height: auto; }
.hero-photo figcaption {
  position: absolute; left: 16px; bottom: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 14px; font-size: 13px; color: var(--muted);
}
.hero-photo figcaption b { display: block; color: var(--ink); font-size: 14px; }
@media (max-width: 860px) { .hero-photo { margin: 0 auto; } }

/* ---------- Теги-факты ---------- */
.tag {
  display: inline-block; padding: 7px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em;
}
.tag--green { background: var(--tag-green); color: var(--tag-green-ink); }
.tag--blue  { background: var(--tag-blue);  color: var(--tag-blue-ink); }
.tag--yellow{ background: var(--tag-yellow);color: var(--tag-yellow-ink); }
.tag--red   { background: var(--tag-red);   color: var(--tag-red-ink); }

/* ---------- О специалисте ---------- */
.about { background: var(--bg-soft); border-block: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: start; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; gap: 40px; } }

/* карьерный таймлайн — вертикальная линия, не карточки */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 30px 26px; border-left: 2px solid var(--line); }
.timeline li:last-child { padding-bottom: 4px; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-soft); border: 2px solid var(--accent-deep);
}
.timeline .t-when { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }
.timeline .t-where { font-weight: 700; }
.timeline .t-role { font-size: 15px; color: var(--ink-soft); }

.edu { margin-top: 40px; }
.edu h3 { margin-bottom: 10px; }
.edu p { font-size: 15.5px; color: var(--ink-soft); margin-bottom: 4px; }

/* ---------- Услуги ---------- */
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 860px) { .services-grid { grid-template-columns: 1fr; } }
.service {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 34px;
}
.service p { color: var(--ink-soft); font-size: 15.5px; margin-bottom: 16px; }
.service ul { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 15.5px; }
.service ul li { margin-bottom: 6px; }
.service .tag { margin-bottom: 18px; }
/* асимметрия сетки: первая и последняя услуги — во всю ширину, разная механика карточек */
.service--wide { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; align-items: start; }
.service--wide .col { grid-row: span 1; }
.service--wide ul.cols { columns: 2; column-gap: 28px; padding-left: 18px; }
@media (max-width: 860px) {
  .service--wide { grid-template-columns: 1fr; }
  .service--wide ul.cols { columns: 1; }
}

/* ---------- Преимущества ---------- */
.adv { background: var(--bg-soft); border-block: 1px solid var(--line); }
.adv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 32px; }
@media (max-width: 960px) { .adv-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .adv-grid { grid-template-columns: 1fr; } }
.adv-num { font-family: var(--serif); font-size: clamp(40px, 5vw, 60px); font-weight: 600; letter-spacing: -0.03em; line-height: 1; color: var(--accent-deep); }
.adv-grid > div { border-top: 2px solid var(--line); padding-top: 20px; }
.adv-grid > div p { color: var(--ink-soft); font-size: 15px; margin: 0; }
.adv-grid > div b { display: block; color: var(--ink); margin-bottom: 6px; font-size: 16px; }

/* ---------- Цены и калькулятор ---------- */
.calc-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 48px; align-items: start; }
@media (max-width: 860px) { .calc-grid { grid-template-columns: 1fr; gap: 32px; } }

.calc {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 34px;
}
.calc .field { margin-bottom: 20px; }
.calc label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.calc select, .calc input[type="number"] {
  width: 100%; padding: 12px 14px; font-family: var(--sans); font-size: 16px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink);
}
.calc .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.calc-check { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.calc-check input { width: 18px; height: 18px; accent-color: var(--accent-deep); }
.calc-total {
  border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
}
.calc-total .sum { font-family: var(--serif); font-size: clamp(30px, 4vw, 42px); font-weight: 600; letter-spacing: -0.02em; }
.calc-note { font-size: 13px; color: var(--muted); margin-top: 12px; margin-bottom: 0; }
.calc .btn { width: 100%; margin-top: 20px; justify-content: center; }

.prices-list { list-style: none; margin: 0; padding: 0; }
.prices-list li {
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: baseline;
  padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 15.5px;
}
.prices-list li p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.prices-list .price { font-weight: 700; white-space: nowrap; font-size: 16px; }
.prices-note { margin-top: 16px; font-size: 13.5px; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:first-child { border-top: 1px solid var(--line); }
.faq-item h3 { font-size: 18px; }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  background: none; border: 0; cursor: pointer; text-align: left; list-style: none;
  padding: 22px 0; font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink);
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q .fx { font-family: var(--sans); font-size: 24px; font-weight: 400; color: var(--muted); transition: transform 0.25s var(--ease); flex: none; }
.faq-item[open] .fx { transform: rotate(45deg); }
.faq-a { max-width: 720px; color: var(--ink-soft); padding-bottom: 24px; }

/* ---------- Контакты ---------- */
.contacts { background: #171613; color: #EDEAE3; }
.contacts .eyebrow { color: #A8A399; }
.contacts h2 { color: #F4F1EA; }
.contacts .lead { color: #B8B3A8; }
.contacts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; margin-top: 48px; }
@media (max-width: 860px) { .contacts-grid { grid-template-columns: 1fr; gap: 40px; } }

.c-lines { border-top: 1px solid #34322C; }
.c-line {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap;
  padding: 18px 0; border-bottom: 1px solid #34322C; font-size: 16px;
}
.c-line .k { color: #A8A399; font-size: 14px; }
.c-line a { color: #F4F1EA; font-weight: 700; font-size: 18px; }
.c-note { margin-top: 24px; font-size: 14px; color: #A8A399; }

/* форма */
.form label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.form .field { margin-bottom: 20px; }
.form input, .form select, .form textarea {
  width: 100%; padding: 13px 15px; font-family: var(--sans); font-size: 16px;
  background: #201F1B; border: 1px solid #3B392F; border-radius: 6px; color: #F4F1EA;
}
.form input::placeholder, .form textarea::placeholder { color: #7A756B; }
.form textarea { min-height: 110px; resize: vertical; }
.form .btn--form { background: #EDEAE3; color: #171613; }
.form .btn--form:hover { background: #fff; }

/* две кнопки отправки: Telegram / WhatsApp */
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.form-actions .btn--form { flex: 1 1 220px; justify-content: center; }
.form-note { font-size: 13px; color: #A8A399; }

/* ---------- Футер ---------- */
.footer { background: #171613; color: #7A756B; border-top: 1px solid #2A2922; padding-block: 28px; font-size: 14px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Библиотека портфолио ---------- */
/* хлебные крошки материала (вместо eyebrow-категории: она теперь здесь) */
.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 22px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent-deep); text-decoration: none; }
.crumbs a[aria-current="page"] { color: var(--ink-soft); }
.crumbs .sep { margin: 0 7px; color: var(--line); }
/* читалка: узкая колонка, «бумажная» типографика */
.reader { padding-block: 56px 72px; }
.reader .eyebrow { margin-bottom: 16px; }
.reader h1 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 18px; }
.r-meta {
  color: var(--muted); font-size: 14.5px;
  border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 32px;
}
.r-body { max-width: 70ch; font-size: 17.5px; }
.r-body p { margin-bottom: 1em; text-wrap: pretty; }
/* вопрос в жанре «вопрос — ответ» */
.r-body p.q { font-weight: 700; margin-top: 1.8em; color: var(--ink); }
.r-body h3 { font-size: 19px; margin: 1.9em 0 0.7em; }
/* список ссылок на чужие публикации */
.r-links { list-style: none; margin: 0; padding: 0; }
.r-links li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; overflow-wrap: anywhere; }
/* переходы между материалами */
.r-nav {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--line); margin-top: 44px; padding-top: 22px; font-size: 15px;
}
.r-cta {
  margin-top: 32px; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 24px; font-size: 15.5px;
}
/* встроенный просмотр PDF */
.pdf-frame {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); height: 720px; overflow: hidden;
}
.pdf-frame iframe { width: 100%; height: 100%; border: 0; }
.pdf-note { font-size: 13.5px; color: var(--muted); margin: 12px 0 0; }

/* реестр библиотеки */
.lib-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.lib-filters a { font-size: 13.5px; font-weight: 700; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); }
.lib-filters a:hover { border-color: var(--ink); text-decoration: none; color: var(--ink); }
.lib-cat { margin-top: 40px; scroll-margin-top: 84px; }
.lib-cat:first-of-type { margin-top: 0; }
.lib-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
/* вся строка-выжимка — одна кликабельная карточка */
.lib-list a.row {
  display: grid; grid-template-columns: 150px 1fr auto; gap: 20px; align-items: baseline;
  padding: 20px 16px; margin: 0 -16px; border-bottom: 1px solid var(--line);
  border-radius: 8px; color: inherit;
  transition: background 0.15s var(--ease);
}
.lib-list a.row:hover { background: var(--tag-yellow); text-decoration: none; }
.lib-list .cat { font-size: 12.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.lib-list .title { font-size: 16.5px; font-weight: 700; color: var(--ink); }
.lib-list .title > span { display: block; font-weight: 400; font-size: 14.5px; color: var(--ink-soft); margin-top: 4px; }
.lib-list .go { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--accent-deep); }
.lib-list .who { font-size: 13.5px; color: var(--muted); text-align: right; }
@media (max-width: 720px) {
  .lib-list a.row { grid-template-columns: 1fr; gap: 6px; padding: 18px 12px; margin: 0 -12px; }
  .lib-list .who { text-align: left; }
}
.lib-more { margin-top: 40px; }

/* ---------- Плавающие кнопки: быстрая связь и «наверх» ---------- */
.fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.fab-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(26, 25, 23, 0.22);
  transition: transform 0.15s var(--ease), box-shadow 0.2s, opacity 0.25s var(--ease);
}
.fab-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(26, 25, 23, 0.3); }
.fab-btn:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
.fab-btn svg { width: 24px; height: 24px; }
.fab-wa { background: #25D366; }           /* WhatsApp — фирменный зелёный */
.fab-max { background: var(--ink); }       /* МАКС — нейтральный тёмный до подтверждения бренда */
.fab-top {
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  opacity: 0; pointer-events: none;
}
.fab-top.show { opacity: 1; pointer-events: auto; }
@media (max-width: 720px) {
  .fab { right: 14px; bottom: 14px; gap: 8px; }
  .fab-btn { width: 44px; height: 44px; }
}

/* ---------- Появление при прокрутке ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
/* ======= Ресурсы: где читать работы ======= */
.res-row { display: flex; flex-wrap: wrap; gap: 12px; }
.res-row a {
  display: inline-flex; align-items: baseline; gap: 10px;
  padding: 13px 20px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); text-decoration: none; color: var(--ink);
  font-weight: 600; transition: border-color var(--ease), transform var(--ease);
}
.res-row a:hover { border-color: var(--accent-deep); transform: translateY(-2px); }
.res-domain { font-weight: 400; font-size: 14px; color: var(--muted); }
@media (max-width: 560px) { .res-row a { width: 100%; justify-content: space-between; } }
