/* =========================================================================
   Графитовая редакция — направление A · AVatar Сайты
   ДНК 08 (neutral · antiqua · editorial-rail), светлый режим.
   Графит/чернила по светлой бумаге + один бордо-акцент.
   ========================================================================= */

/* ---------- Шрифты (self-hosted, latin + cyrillic раздельно) ---------- */
@font-face {
  font-family: 'Playfair Display'; font-style: normal; font-weight: 500;
  font-display: swap; src: url('fonts/playfair-latin-500.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Playfair Display'; font-style: normal; font-weight: 500;
  font-display: swap; src: url('fonts/playfair-cyrillic-500.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Playfair Display'; font-style: normal; font-weight: 600;
  font-display: swap; src: url('fonts/playfair-latin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Playfair Display'; font-style: normal; font-weight: 600;
  font-display: swap; src: url('fonts/playfair-cyrillic-600.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Playfair Display'; font-style: normal; font-weight: 700;
  font-display: swap; src: url('fonts/playfair-latin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Playfair Display'; font-style: normal; font-weight: 700;
  font-display: swap; src: url('fonts/playfair-cyrillic-700.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('fonts/manrope-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('fonts/manrope-cyrillic-400.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 500;
  font-display: swap; src: url('fonts/manrope-latin-500.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 500;
  font-display: swap; src: url('fonts/manrope-cyrillic-500.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 600;
  font-display: swap; src: url('fonts/manrope-latin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 600;
  font-display: swap; src: url('fonts/manrope-cyrillic-600.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 700;
  font-display: swap; src: url('fonts/manrope-latin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 700;
  font-display: swap; src: url('fonts/manrope-cyrillic-700.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

/* ---------- Токены ---------- */
:root {
  --bg: #EFEFEE;          /* бумага, фон страницы (нейтраль, светлый) */
  --card: #F8F8F7;        /* приподнятые панели / модалка */
  --ink: #1B1C1D;         /* основной текст, заголовки (графит) */
  --ink-soft: #5D5D5C;    /* вторичный текст, рельс */
  --line: #D9D9D7;        /* волосяные линейки (нейтр. декор) */
  --accent: #7A1F2B;      /* бордо — единственный акцент */
  --accent-deep: #5E1620; /* бордо hover/active */
  --paper-hi: #F4F4F3;    /* текст на бордо */

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* rem-шкала отступов (8pt) */
  --s-1: 0.5rem; --s-2: 1rem; --s-3: 1.5rem; --s-4: 2rem;
  --s-6: 3rem; --s-8: 4rem; --s-10: 5rem; --s-16: 8rem;

  --measure: 65ch;
  --rail-w: 4.5rem;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Сброс / база ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;      /* 17px база */
  font-weight: 400;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}
::selection { background: rgba(122, 31, 43, 0.16); color: var(--ink); }

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

/* видимый фокус в бордо (кастомный, не дефолт браузера) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: var(--s-2); top: -4rem;
  background: var(--card); color: var(--ink);
  padding: var(--s-1) var(--s-3); z-index: 60;
  font-weight: 600; text-decoration: none; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: var(--s-2); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Каркас страницы ---------- */
.shell {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 84rem;
  margin: 0 auto;
  padding: 0 var(--s-3);
}

/* ---------- Рельс-оглавление ---------- */
.rail { display: none; }

@media (min-width: 1024px) {
  .shell { grid-template-columns: var(--rail-w) 1fr; column-gap: var(--s-6); }
  .rail {
    display: block;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: var(--s-8) 0;
    align-self: start;
  }
  .rail__inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--s-4);
    writing-mode: vertical-rl;
    text-orientation: mixed;
  }
  .rail__brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: var(--ink);
  }
  .rail__list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: var(--s-3);
  }
  .rail__link, .rail__muted {
    display: inline-flex; align-items: center; gap: 0.6rem;
    font-size: 0.8125rem; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase;
    text-decoration: none; color: var(--ink-soft);
    transition: color 0.24s var(--ease), transform 0.24s var(--ease);
  }
  .rail__num {
    font-family: var(--font-display);
    font-weight: 600; letter-spacing: 0; font-size: 0.9rem;
  }
  .rail__link:hover { color: var(--ink); }
  .rail__link.is-active { color: var(--accent); transform: translateY(-2px); }
  .rail__link.is-active .rail__num { color: var(--accent); }
  .rail__muted { opacity: 0.45; cursor: default; }
}

/* ---------- Общие секции ---------- */
.main { min-width: 0; }
.section { padding-block: var(--s-16); border-top: 1px solid var(--line); }
.section:first-child { border-top: 0; }

.kicker {
  font-size: 0.8125rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--s-3);
}
.kicker--soft { color: var(--ink-soft); }

.measure { max-width: var(--measure); }

.lead {
  font-size: clamp(1.2rem, 2.4vw, 1.42rem);
  line-height: 1.5;
  color: var(--ink);
  max-width: 58ch;
  text-wrap: pretty;
}
.muted { color: var(--ink-soft); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-body); font-size: 1rem; font-weight: 600;
  line-height: 1; text-decoration: none; cursor: pointer;
  border: 0; border-radius: 4px;
  padding: 0.9rem 1.6rem;
  transition: background 0.2s var(--ease), transform 0.12s var(--ease);
}
.btn--primary { background: var(--accent); color: var(--paper-hi); }
.btn--primary:hover { background: var(--accent-deep); }
.btn--primary:active { transform: translateY(1px); }
.btn--ghost {
  padding: 0.9rem 0.25rem; border-radius: 0;
  color: var(--ink);
  box-shadow: inset 0 -1px 0 0 var(--line);
}
.btn--ghost:hover { box-shadow: inset 0 -2px 0 0 var(--accent); }

.btn__arrow { font-family: var(--font-body); transition: transform 0.2s var(--ease); }
.btn--primary:hover .btn__arrow { transform: translateX(3px); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(var(--s-8), 12vh, var(--s-16)); }
.hero__eyebrow {
  display: inline-flex; align-items: baseline; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.1rem; color: var(--ink);
  margin: 0 0 var(--s-4);
}
.hero__eyebrow::before {
  content: ""; width: 2rem; height: 1px; background: var(--accent);
  display: inline-block; transform: translateY(-0.35em);
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-4);
  max-width: 16ch;
  text-wrap: balance;
}
.hero__title em {
  font-style: normal;
  color: var(--accent);
}
.hero__lead { margin: 0 0 var(--s-6); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.hero__note {
  margin-top: var(--s-8);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  max-width: 54ch;
  font-size: 0.98rem;
  color: var(--ink-soft);
}
.hero__note b { color: var(--ink); font-weight: 600; }

/* ---------- Секция «Чем отличается» ---------- */
.section__head { margin-bottom: var(--s-8); }
.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 var(--s-3);
  max-width: 20ch;
  text-wrap: balance;
}

.diffs { list-style: none; margin: 0; padding: 0; }
.diff {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-2);
  padding-block: var(--s-6);
  border-top: 1px solid var(--line);
}
.diff:first-child { border-top: 0; padding-top: 0; }
.diff__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.diff__body { margin: 0; max-width: 60ch; color: var(--ink-soft); }
.diff__body strong { color: var(--ink); font-weight: 600; }

@media (min-width: 720px) {
  .diff {
    grid-template-columns: minmax(0, 15rem) 1fr;
    gap: var(--s-6);
    align-items: baseline;
  }
}

/* ---------- Финальный мини-CTA внутри секции ---------- */
.tail {
  margin-top: var(--s-10);
  padding-top: var(--s-6);
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: var(--s-4);
  align-items: center; justify-content: space-between;
}
.tail__text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0; max-width: 24ch;
}

/* ---------- Подвал ---------- */
.foot {
  border-top: 1px solid var(--line);
  padding-block: var(--s-8);
  display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-8);
  justify-content: space-between;
  font-size: 0.9375rem; color: var(--ink-soft);
}
.foot a { color: var(--ink-soft); text-decoration: none; }
.foot a:hover { color: var(--accent); }
.foot__brand { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.foot__req { max-width: 44ch; line-height: 1.5; }

/* ---------- Модалка логина ---------- */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: var(--s-3);
}
.modal__overlay {
  position: absolute; inset: 0;
  background: rgba(20, 21, 22, 0.55);
  backdrop-filter: blur(2px);
}
.modal__panel {
  position: relative;
  background: var(--card);
  width: min(28rem, 100%);
  padding: var(--s-8) var(--s-6) var(--s-6);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(27, 28, 29, 0.06), 0 24px 48px -20px rgba(27, 28, 29, 0.22);
}
.modal__close {
  position: absolute; top: var(--s-3); right: var(--s-3);
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  background: transparent; border: 0; cursor: pointer;
  color: var(--ink-soft); font-size: 1.4rem; line-height: 1;
  border-radius: 4px;
}
.modal__close:hover { color: var(--ink); }
.modal__eyebrow {
  font-family: var(--font-display); font-weight: 600;
  font-size: 0.95rem; color: var(--accent); margin: 0 0 var(--s-1);
}
.modal__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.7rem; line-height: 1.15; letter-spacing: -0.01em;
  margin: 0 0 var(--s-4);
}
.field { margin-bottom: var(--s-3); }
.field__label {
  display: block; font-size: 0.875rem; font-weight: 600;
  margin-bottom: var(--s-1); color: var(--ink);
}
.field__input {
  width: 100%; font-family: var(--font-body); font-size: 1rem;
  padding: 0.8rem 0.9rem; border-radius: 4px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  transition: border-color 0.2s var(--ease);
}
.field__input::placeholder { color: var(--ink-soft); }
.field__input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.modal__submit { width: 100%; justify-content: center; margin-top: var(--s-2); }
.modal__fine { margin: var(--s-3) 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.modal__fine a { color: var(--accent); }

/* ---------- Движение: reveal (scroll-driven, один момент) ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@supports (animation-timeline: view()) {
  .reveal {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 5% cover 22%;
  }
  .stagger > * {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 2% cover 26%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .stagger > * { animation: none; opacity: 1; transform: none; }
  * { transition-duration: 0.001ms !important; }
}
