/* ================================================================
   1. ПЕРЕМЕННЫЕ — главные цвета и шрифты сайта.
   Хотите сменить цвет везде сразу? Поменяйте его только здесь.
   ================================================================ */
:root {
  --paper:   #f3ece0;   /* фон — цвет старой бумаги */
  --paper-2: #e9dfcd;   /* фон потемнее для чередования секций */
  --ink:     #1f1b16;   /* основной текст — «чернила» */
  --ink-soft:#5a5046;   /* второстепенный текст */
  --accent:  #8c2a1c;   /* акцент — тёмно-красный, как сургучная печать */
  --gold:    #b48a3c;   /* золотистый для мелких деталей */
  --line:    rgba(31, 27, 22, .15);

  --font-display: "Prata", Georgia, serif;
  --font-body: "Golos Text", system-ui, sans-serif;
  --font-mono: "PT Mono", monospace;

  --radius: 4px;
  --max: 1160px;
}

/* ================================================================
   2. БАЗОВЫЕ НАСТРОЙКИ
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

/* Лёгкая «зернистость бумаги» поверх всей страницы */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.25 0 0 0 0 0.2 0 0 0 .25 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}
.container--narrow { max-width: 820px; }

.accent { color: var(--accent); font-style: italic; }

/* ================================================================
   3. КНОПКИ
   ================================================================ */
.btn {
  display: inline-block;
  padding: 15px 28px;
  font: 500 16px/1 var(--font-body);
  text-decoration: none;
  color: var(--paper);
  background: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .2s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); background: #6f1f14; }

.btn--ghost { background: transparent; color: var(--ink); border-color: transparent; padding-left: 4px; }
.btn--ghost:hover { background: transparent; color: var(--accent); }

.btn--outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--paper); }

.btn--light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--light:hover { background: var(--gold); border-color: var(--gold); }

.btn--small { padding: 10px 16px; font-size: 14px; }

/* ================================================================
   4. ШАПКА
   ================================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243, 236, 224, .9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header__inner { display: flex; align-items: center; gap: 32px; height: 72px; }

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo__mark {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  font: 22px/1 var(--font-display);
  color: var(--paper);
  background: var(--accent);
  border-radius: 50%;
}
.logo__text { font: 19px/1 var(--font-display); }
.logo__text em { font-style: normal; color: var(--accent); }

.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a { font-size: 15px; text-decoration: none; color: var(--ink-soft); white-space: nowrap; transition: color .2s; }
.header__cabinet { white-space: nowrap; }
.nav a:hover { color: var(--accent); }

.burger { display: none; }
.nav__cabinet { display: none; }

/* ================================================================
   5. ГЛАВНЫЙ ЭКРАН
   ================================================================ */
.hero { padding: 90px 0 110px; border-bottom: 1px solid var(--line); }
.hero__inner { display: grid; grid-template-columns: 1.5fr 1fr; gap: 64px; align-items: center; }

.eyebrow {
  font: 14px/1 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.hero__title {
  font: 400 clamp(40px, 6vw, 78px)/1.05 var(--font-display);
  letter-spacing: -.01em;
  margin-bottom: 28px;
}
.hero__lead { max-width: 560px; font-size: 19px; color: var(--ink-soft); margin-bottom: 40px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Лента времени */
.timeline { list-style: none; position: relative; padding-left: 28px; }
.timeline::before {
  content: "";
  position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 1px; background: var(--ink);
}
.timeline li { position: relative; display: flex; flex-direction: column; padding: 12px 0; color: var(--ink-soft); font-size: 15px; }
.timeline li::before {
  content: "";
  position: absolute; left: -28px; top: 20px;
  width: 11px; height: 11px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}
.timeline__year { font: 26px/1.1 var(--font-display); color: var(--ink); }
.timeline__now .timeline__year { color: var(--accent); }
.timeline__now::before { background: var(--accent) !important; border-color: var(--accent) !important; box-shadow: 0 0 0 6px rgba(140, 42, 28, .15); }

/* ================================================================
   6. СЕКЦИИ — общие правила
   ================================================================ */
.section { padding: 100px 0; }
.section--paper { background: var(--paper-2); }
.section--dark { background: var(--ink); color: var(--paper); }

.section__head {
  display: flex; align-items: baseline; gap: 20px;
  margin-bottom: 56px;
  padding-bottom: 20px;
  border-bottom: 1px solid currentColor;
  border-color: var(--line);
}
.section--dark .section__head { border-color: rgba(243, 236, 224, .2); }

.section__num { font: 18px/1 var(--font-display); color: var(--accent); min-width: 36px; }
.section--dark .section__num { color: var(--gold); }
.section__title { font: 400 clamp(32px, 4vw, 48px)/1.1 var(--font-display); }

/* --- Обо мне --- */
.about__grid { display: grid; grid-template-columns: 340px 1fr; gap: 64px; align-items: start; }
.about__photo {
  aspect-ratio: 4 / 5;
  display: grid; place-items: center;
  background: repeating-linear-gradient(45deg, var(--paper-2) 0 12px, var(--paper) 12px 24px);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font: 14px var(--font-mono);
}
.about__photo { overflow: hidden; }
.about__photo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.45); transform-origin: 50% 8%; }
.about__name { font: 30px/1.2 var(--font-display); margin-bottom: 20px; }
.about__text p { margin-bottom: 16px; color: var(--ink-soft); max-width: 620px; }
.about__text a { color: var(--accent); }

.facts { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 36px; background: var(--line); border: 1px solid var(--line); }
.facts li { background: var(--paper); padding: 20px; font-size: 15px; color: var(--ink-soft); }
.facts strong { display: block; font: 400 22px/1.2 var(--font-display); color: var(--ink); margin-bottom: 4px; }

/* --- Карточки направлений --- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1px; background: rgba(243, 236, 224, .15); border: 1px solid rgba(243, 236, 224, .15); }
.card { background: var(--ink); padding: 36px 32px; transition: background .3s; }
.card:hover { background: #2b251e; }
.card__tag { font: 13px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.card__title { font: 400 26px/1.2 var(--font-display); margin: 18px 0 12px; }
.card p { color: rgba(243, 236, 224, .7); font-size: 16px; }
.card--cta { display: block; text-decoration: none; background: var(--accent); }
.card--cta:hover { background: #6f1f14; }
.card--cta .card__tag { color: var(--paper); opacity: .75; }
.card--cta p { color: rgba(243, 236, 224, .85); }

/* --- Шаги --- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px 32px; }
.step { border-top: 2px solid var(--ink); padding-top: 20px; }
.step__num { font: 14px var(--font-mono); color: var(--accent); }
.step h3 { font: 400 23px/1.2 var(--font-display); margin: 12px 0 10px; }
.step p { font-size: 16px; color: var(--ink-soft); }

/* --- Отзывы: карусель --- */
.rating {
  margin-left: auto;
  font-size: 15px;
  text-decoration: none;
  color: rgba(243, 236, 224, .75);
  white-space: nowrap;
}
.rating:hover { color: var(--paper); }
.rating__stars { color: var(--gold); letter-spacing: 2px; }

/* Лента с карточками. scroll-snap заставляет карточки «защёлкиваться» при прокрутке */
.carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 48px) / 3);
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.carousel__track::-webkit-scrollbar { display: none; }

.review {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  padding: 32px;
  background: rgba(243, 236, 224, .05);
  border: 1px solid rgba(243, 236, 224, .15);
}
.review__head { display: flex; align-items: center; gap: 14px; }
.review__avatar {
  flex: none;
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--paper);
  font: 22px/1 var(--font-display);
  object-fit: cover;
}
.review__name { font: 19px/1.2 var(--font-display); }
.review__meta { font-size: 13px; color: rgba(243, 236, 224, .5); margin-top: 2px; }
.review__stars { color: var(--gold); letter-spacing: 3px; margin: 18px 0 10px; }
.review__text { font-size: 15.5px; line-height: 1.65; color: rgba(243, 236, 224, .82); }
/* Длинный отзыв сворачиваем до 7 строк */
.review__text.is-clamped { display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.review__more {
  align-self: flex-start;
  margin-top: 12px;
  padding: 0;
  background: none;
  border: none;
  color: var(--gold);
  font: 500 14px var(--font-body);
  cursor: pointer;
}
.review__more:hover { color: var(--paper); }

.carousel--static .carousel__controls { display: none; }
.carousel__controls { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 32px; }
.carousel__btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(243, 236, 224, .35);
  background: transparent;
  color: var(--paper);
  font-size: 18px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.carousel__btn:hover { background: var(--accent); border-color: var(--accent); }
.carousel__btn:disabled { opacity: .3; cursor: default; background: transparent; border-color: rgba(243, 236, 224, .35); }
.carousel__counter { min-width: 110px; text-align: center; font: 15px var(--font-mono); color: rgba(243, 236, 224, .7); }

/* --- Цены --- */
.prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
.price { position: relative; background: var(--paper); border: 1px solid var(--line); padding: 40px 32px; }
.price h3 { font: 400 24px/1.2 var(--font-display); }
.price__value { font: 32px/1.2 var(--font-display); color: var(--accent); margin: 18px 0 24px; }
.price__value small { font: 15px var(--font-body); color: var(--ink-soft); }
.price ul { list-style: none; }
.price li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink-soft); }
.price li::before { content: "— "; color: var(--accent); }
.price--featured { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: translateY(-12px); }
.price--featured .price__value { color: var(--gold); }
.price--featured li { color: rgba(243, 236, 224, .75); border-color: rgba(243, 236, 224, .15); }
.price__badge { position: absolute; top: -12px; right: 24px; background: var(--accent); color: var(--paper); font: 12px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; padding: 7px 10px; }

/* --- Платформа (анонс) --- */
.platform { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.platform__item { padding: 28px; border: 1px dashed var(--ink-soft); border-radius: var(--radius); }
.platform__item h3 { font: 400 21px/1.2 var(--font-display); margin-bottom: 10px; }
.platform__item p { font-size: 15px; color: var(--ink-soft); }

/* --- Вопросы --- */
.faq { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex; justify-content: space-between; gap: 20px;
  padding: 24px 0;
  font: 21px/1.3 var(--font-display);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-body); color: var(--accent); transition: transform .25s; }
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { padding: 0 0 24px; color: var(--ink-soft); max-width: 680px; }

/* --- Контакты и форма --- */
.contacts { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; }
.contacts__lead { color: rgba(243, 236, 224, .7); margin: -24px 0 32px; }
.contacts__list { list-style: none; }
.contacts__list li { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid rgba(243, 236, 224, .15); }
.contacts__list span { color: rgba(243, 236, 224, .55); font-size: 15px; }
.contacts__list a { text-decoration: none; }
.contacts__list a:hover { color: var(--gold); }

.form { display: flex; flex-direction: column; gap: 20px; background: rgba(243, 236, 224, .05); border: 1px solid rgba(243, 236, 224, .15); padding: 36px; }
.form label { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: rgba(243, 236, 224, .7); }
.form input, .form select {
  font: 16px var(--font-body);
  color: var(--paper);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(243, 236, 224, .35);
  padding: 10px 0;
  outline: none;
  transition: border-color .2s;
}
.form select option { color: var(--ink); }
.form input:focus, .form select:focus { border-color: var(--gold); }
.form .btn { margin-top: 8px; }
.form__consent { flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-size: 13px !important; line-height: 1.5; cursor: pointer; }
.form__consent input { flex: none; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--gold); cursor: pointer; }
.form__consent a { color: var(--paper); }
.form__consent a:hover { color: var(--gold); }
.form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form .btn:disabled { opacity: .6; cursor: wait; }
.form__note { font-size: 14px; color: var(--gold); min-height: 1em; }

/* --- Подвал --- */
.footer { padding: 28px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-soft); }
.footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer__links a { text-decoration: none; }
.footer__links a:hover { color: var(--accent); }

/* ---------- Плашка согласия на cookie (js/analytics.js) ---------- */
.cookie-banner {
  position: fixed;
  left: 24px; bottom: 24px;
  z-index: 200;
  max-width: 440px;
  padding: 20px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px -20px rgba(31, 27, 22, .45);
  font-size: 14px;
  color: var(--ink-soft);
  animation: cookieIn .4s ease;
}
.cookie-banner a { color: var(--accent); }
.cookie-banner__actions { display: flex; gap: 10px; margin-top: 14px; }
@keyframes cookieIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .cookie-banner { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}

/* ================================================================
   СТРАНИЦЫ-ДОКУМЕНТЫ (политика, согласие)
   ================================================================ */
.doc-header { border-bottom: 1px solid var(--line); }
.doc-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; }
.doc-header__back { font-size: 15px; color: var(--ink-soft); text-decoration: none; }
.doc-header__back:hover { color: var(--accent); }

.doc { max-width: 760px; margin: 0 auto; padding: 64px 24px 96px; }
.doc h1 { font: 400 clamp(30px, 5vw, 44px)/1.15 var(--font-display); margin-bottom: 12px; }
.doc__date { font: 14px var(--font-mono); color: var(--ink-soft); margin-bottom: 40px; }
.doc h2 { font: 400 24px/1.3 var(--font-display); margin: 40px 0 14px; }
.doc p, .doc li { color: var(--ink-soft); margin-bottom: 12px; }
.doc ul { padding-left: 22px; margin-bottom: 12px; }
.doc strong { color: var(--ink); font-weight: 500; }
.doc a { color: var(--accent); }
.doc__todo { background: #fff3c4; color: var(--ink); padding: 0 4px; border-radius: 3px; }

/* ================================================================
   7. АНИМАЦИЯ ПОЯВЛЕНИЯ
   Элементы с классом .reveal плавно «всплывают» при прокрутке.
   ================================================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.hero .reveal:nth-child(2) { transition-delay: .1s; }
.hero .reveal:nth-child(3) { transition-delay: .2s; }
.hero .reveal:nth-child(4) { transition-delay: .3s; }
.hero .timeline.reveal { transition-delay: .4s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ================================================================
   8. АДАПТИВНОСТЬ — как сайт выглядит на планшетах и телефонах.
   @media означает: «если экран уже N пикселей — примени эти правила»
   ================================================================ */
@media (max-width: 1000px) {
  .hero__inner, .about__grid, .contacts { grid-template-columns: 1fr; gap: 48px; }
  .about__photo { max-width: 320px; }
  .steps, .platform { grid-template-columns: repeat(2, 1fr); }
  .prices { grid-template-columns: 1fr; }
  .price--featured { transform: none; }
  .carousel__track { grid-auto-columns: calc((100% - 24px) / 2); }
}

@media (max-width: 1240px) {
  /* Меню превращается в «бургер» */
  .burger {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 40px; margin-left: auto;
    background: none; border: none; cursor: pointer;
  }
  .burger span { display: block; height: 2px; background: var(--ink); transition: transform .3s, opacity .3s; }
  .burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger.is-open span:nth-child(2) { opacity: 0; }
  .burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav {
    position: fixed; top: 72px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 24px;
    transform: translateY(-110%);
    visibility: hidden;
    transition: transform .3s, visibility .3s;
    z-index: -1;
  }
  .nav.is-open { transform: none; visibility: visible; }
  .nav a { padding: 14px 0; font-size: 18px; border-bottom: 1px solid var(--line); }
  .header__cabinet { display: none; }
  .nav .nav__cabinet { display: block; color: var(--accent); border-bottom: none; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .hero { padding: 56px 0 72px; }
  .hero__title { font-size: 35px; }
  .section { padding: 72px 0; }
  .section__head { margin-bottom: 40px; }
  .steps, .platform, .facts { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .carousel__track { grid-auto-columns: 88%; gap: 16px; }
  .review { padding: 24px; }
  .section__head { flex-wrap: wrap; }
  .rating { margin-left: 0; width: 100%; white-space: normal; }
  .form { padding: 24px; }
  .contacts__list li { flex-direction: column; gap: 2px; }
  .contacts__list a { overflow-wrap: anywhere; }
  .hero__actions .btn { width: 100%; text-align: center; }
}
