/* ВАРИАНТ А — «академический документ».
   Тёплая бумага вместо белого экрана, засечки в заголовках, чернильно-синий текст ссылок и
   бордовый цвет печати для акцентов. Первый экран освещается мягким пятном, идущим за
   курсором: свет, падающий на лист. Сторонних шрифтов и скриптов нет. */

:root {
  --paper: #f7f4ee;
  --card: #fffdf9;
  --ink: #1b1d21;
  --dim: #5b6068;
  --line: #ddd5c7;
  --accent: #16305c;
  --seal: #8c2b2b;
  --rule: rgba(22, 48, 92, .045);
  --fold: #ece5d8;
  --serif: Georgia, "Times New Roman", "PT Serif", serif;
  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  /* Зернистость бумаги: шум рисуется фильтром SVG прямо в стиле — ни одного запроса
     наружу и ни одного лишнего файла. */
  background: var(--paper) 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='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E") repeat;
  color: var(--ink);
  font: 17px/1.66 var(--sans);
  position: relative;
}

/* Лампа над листом: пятно света идёт за курсором по всей странице (hero.js). */
.lamp {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity .5s ease-out;
  background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 40%),
    rgba(214, 164, 62, .16), rgba(214, 164, 62, .06) 45%, transparent 72%);
}
.lamp.lit { opacity: 1; }

/* Чернильный шлейф от курсора (hero.js): холст поверх страницы, нажатий не перехватывает. */
.ink {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 700; }
h1 { font-size: 38px; line-height: 1.18; margin: 30px 0 16px; letter-spacing: -0.015em; }
h2 { font-size: 25px; line-height: 1.26; margin: 0 0 12px; }
h3 { font-size: 19px; margin: 26px 0 6px; }
p { margin: 0 0 14px; }
a { color: var(--accent); }

/* ── шапка: бланк ──────────────────────────────────────────────────────────── */
.bar {
  display: flex;
  align-items: baseline;
  gap: 26px;
  flex-wrap: wrap;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 20px 12px;
  border-bottom: 3px double var(--line);
}
.bar .brand::before {
  content: "";
  display: inline-block;
  width: 17px;
  height: 17px;
  margin-right: 9px;
  vertical-align: -2px;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c2b2b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21c3.6-1.2 6.2-3 8-5.4'/%3E%3Cpath d='M20.5 3.5c-6 .6-10.2 3-12.3 7.2-.7 1.4-1 2.9-1 4.6 1.7 0 3.2-.3 4.6-1 4.2-2.1 6.6-6.3 8.7-10.8z'/%3E%3C/svg%3E");
}
.bar .brand {
  margin-right: 14px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-decoration: none;
}
.bar nav { display: flex; gap: 20px; flex-wrap: wrap; }
.bar nav a {
  color: var(--dim);
  text-decoration: none;
  font-size: 15px;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}
.bar nav a:hover { color: var(--seal); border-bottom-color: var(--seal); }

main {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 26px auto 48px;
  padding: 0 20px 40px;
}

.bar, footer { position: relative; z-index: 2; }
section {
  position: relative;
  margin: 0 0 26px;
  /* Листы одной высоты: короткий раздел не должен выглядеть обрезком бумаги. Разделы
     длиннее этой меры растут дальше — текст важнее ровного края. */
  min-height: 430px;
  padding: 30px 34px 26px 52px;
  background: var(--card) repeating-linear-gradient(
    to bottom, transparent 0 27px, var(--rule) 27px 28px);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(27, 29, 33, .05), 0 10px 22px rgba(27, 29, 33, .05);
  transition: transform .22s ease-out, box-shadow .22s ease-out;
}
/* Под рукой лист приподнимается над столом. */
section:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 3px rgba(27, 29, 33, .06), 0 18px 34px rgba(27, 29, 33, .10);
  z-index: 3;
}
/* Поле листа — красная черта слева. */
section::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 34px;
  width: 1px;
  background: rgba(140, 43, 43, .2);
  transition: background-color .22s ease-out;
}
section:hover::before { background: rgba(140, 43, 43, .42); }
/* Загнутый уголок: у листа срезан угол (там виден стол), а сам отогнутый треугольник
   лежит поверх — со сгибом по диагонали и тенью под ним. */
section::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 42px;
  height: 42px;
  background:
    linear-gradient(315deg, var(--paper) 0 49.6%, transparent 49.6%),
    linear-gradient(135deg, transparent 0 50%, var(--fold) 50% 100%);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  filter: drop-shadow(-2px -2px 3px rgba(27, 29, 33, .13));
}

.lead { font-size: 19.5px; }
.note { color: var(--dim); font-size: 15.5px; }
.todo { color: #a49c8e; }
.crumb { color: var(--dim); font-size: 15px; margin: 22px 0 0; }
.crumb a { color: var(--dim); }

/* ── первый экран со светом ────────────────────────────────────────────────── */
.hero {
  padding: 30px 34px 34px 52px;
  overflow: hidden;
}
/* Водяной знак: круглая печать в углу листа, как на заверенном документе. */
.hero::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 26px;
  width: 168px;
  height: 168px;
  pointer-events: none;
  opacity: .11;
  transform: rotate(-9deg);
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%238c2b2b' stroke-width='3'%3E%3Ccircle cx='100' cy='100' r='92'/%3E%3Ccircle cx='100' cy='100' r='78'/%3E%3C/g%3E%3Cpath d='M62 104l24 24 52-56' fill='none' stroke='%238c2b2b' stroke-width='9' stroke-linecap='square'/%3E%3Ctext x='100' y='166' text-anchor='middle' font-family='Georgia,serif' font-size='19' letter-spacing='4' fill='%238c2b2b'%3E%D0%92%D0%9E%D0%9F%D0%A0%D0%9E%D0%A1%3C/text%3E%3C/svg%3E");
}
.hero > * { position: relative; z-index: 1; }

.cta { margin: 24px 0 16px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 12px 20px;
  background: var(--accent);
  color: #fffdf9;
  text-decoration: none;
  border: 1px solid var(--accent);
  font-size: 16px;
}
.btn:hover { background: #0f2246; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: rgba(22, 48, 92, .06); }

/* ── три довода: как выписка из документа ──────────────────────────────────── */
.three { display: grid; gap: 28px; }
.three h2 {
  font-size: 20px;
  margin-bottom: 8px;
  padding-left: 14px;
  border-left: 3px solid var(--seal);
}
.three p { margin: 0; color: var(--dim); padding-left: 17px; }

/* ── шаги ──────────────────────────────────────────────────────────────────── */
.steps { list-style: none; counter-reset: step; margin: 20px 0 8px; padding: 0; }
.steps li { position: relative; padding-left: 50px; margin-bottom: 24px; }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  line-height: 30px;
  text-align: center;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--seal);
  border: 1px solid var(--seal);
  background: var(--card);
}
.steps h3 { margin: 2px 0 4px; font-size: 18px; }
.steps p { margin: 0; color: var(--dim); }

dl { margin: 18px 0; }
dt { font-family: var(--serif); font-size: 18px; font-weight: 700; margin-top: 18px; }
dd { margin: 4px 0 0; color: var(--dim); }

/* ── прайс как бланк ───────────────────────────────────────────────────────── */
.price { width: 100%; border-collapse: collapse; margin: 18px 0 16px; font-size: 16px; }
.price th, .price td {
  border-top: 1px solid var(--line);
  padding: 13px 10px 13px 0;
  text-align: left;
  vertical-align: top;
}
.price th { width: 32%; font-family: var(--serif); font-weight: 700; }
.price td:nth-child(2) { width: 22%; white-space: nowrap; color: var(--seal); font-weight: 700; }
.price td:last-child { color: var(--dim); font-size: 15.5px; }

figure { margin: 28px 0 8px; }
figure img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 1px 0 var(--line), 0 12px 24px rgba(27, 29, 33, .06);
}
figure img[width="390"] { width: 390px; max-width: 100%; max-height: 640px; }
figcaption { color: var(--dim); font-size: 14.5px; margin-top: 10px; font-style: italic; }

.contact { font-size: 18px; }

footer { position: relative; }
footer::after {
  content: "";
  position: absolute;
  right: 28px;
  top: -34px;
  width: 78px;
  height: 78px;
  transform: rotate(-7deg);
  opacity: .9;
  filter: drop-shadow(0 3px 5px rgba(27, 29, 33, .22));
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 3l7.6 6.3 9.5-3.4 4.6 8.9 10 1.3-1.1 10 8.2 5.9-6.1 8 3.6 9.4-9.1 4.3-.9 10-10-1-7 7.2-7.8-6.3-9.6 3.3-4.4-9-10-1.5 1.3-10L11 40.6l6.2-7.9-3.4-9.4 9.1-4.1 1.1-10 9.9 1.2 7.2-7z' fill='%238c2b2b'/%3E%3Ccircle cx='50' cy='48' r='27' fill='none' stroke='%23f3d7d7' stroke-width='1.6' opacity='.55'/%3E%3Ctext x='50' y='58' text-anchor='middle' font-family='Georgia,serif' font-size='30' fill='%23f6e2e2'%3E%D0%92%3C/text%3E%3C/svg%3E");
}

footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 20px 48px;
  border-top: 3px double var(--line);
  color: var(--dim);
  font-size: 15px;
}
footer p { margin: 0 0 6px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 29px; }
  h2 { font-size: 21px; }
  .lead { font-size: 17.5px; }
  .bar { gap: 10px 18px; padding: 14px 16px 10px; }
  main { max-width: none; margin: 12px 0 24px; padding: 0 10px 32px; }
  section { padding: 22px 16px 20px 30px; margin-bottom: 16px; min-height: 0; }
  section::before { left: 18px; }
  section::after { display: none; }
  .hero { padding: 22px 16px 24px 30px; }
  .hero::after { width: 96px; height: 96px; top: 8px; right: 8px; }
  .btn { width: 100%; text-align: center; }
  .price, .price tbody, .price tr, .price th, .price td { display: block; width: auto; }
  .price tr { border-top: 1px solid var(--line); padding: 12px 0; }
  .price th, .price td { border: none; padding: 0; }
  .price td:nth-child(2) { margin: 2px 0 4px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15161a;
    --card: #1b1d22;
    --ink: #e9e5dd;
    --dim: #a5a29b;
    --line: #3a3831;
    --accent: #9cb8e4;
    --seal: #d59191;
  }
  .btn { color: #15161a; background: var(--accent); border-color: var(--accent); }
  .btn:hover { background: #b3c9ec; }
  .btn.ghost { background: transparent; color: var(--accent); }
  .lamp {
    background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 40%),
      rgba(156, 184, 228, .13), rgba(156, 184, 228, .05) 45%, transparent 72%);
  }
  main { box-shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 18px 50px rgba(0, 0, 0, .35); }
  .hero::after { opacity: .13; }
}

/* ── ЖИВОЕ ПОВЕДЕНИЕ ───────────────────────────────────────────────────────────
   Всё движение — в тематике документа: росчерк пера под пунктом меню, приподнятый
   лист у снимков и кнопок, заливка бордовой краской у номеров шагов. Движения
   короткие и мелкие: страница должна отзываться, а не плясать. При включённом в
   системе запрете анимаций всё замирает (см. prefers-reduced-motion ниже). */

/* Меню: пункт приподнимается, под ним слева направо прочерчивается росчерк. */
.bar nav a {
  position: relative;
  transition: color .18s ease-out, transform .18s ease-out;
  border-bottom: 0;
}
.bar nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--seal);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .26s cubic-bezier(.2, .7, .3, 1);
}
.bar nav a:hover { color: var(--seal); transform: translateY(-1px); }
.bar nav a:hover::after { transform: scaleX(1); }

/* Кнопки: лист приподнимается под рукой и опускается при нажатии. */
.btn {
  transition: transform .16s ease-out, box-shadow .16s ease-out, background-color .16s ease-out;
  box-shadow: 0 1px 0 rgba(27, 29, 33, .12);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(22, 48, 92, .22); }
.btn:active { transform: translateY(0); box-shadow: 0 1px 0 rgba(27, 29, 33, .12); }

/* Ссылки в тексте: подчёркивание дорисовывается пером слева направо. */
main p a, main li a, dd a, figcaption a {
  text-decoration: none;
  background-image: linear-gradient(var(--seal), var(--seal));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: background-size .28s cubic-bezier(.2, .7, .3, 1), color .18s ease-out;
  padding-bottom: 1px;
}
main p a:hover, main li a:hover, dd a:hover, figcaption a:hover {
  color: var(--seal);
  background-size: 100% 2px;
}

/* Доводы: лист чуть подаётся вперёд, краска на полях густеет. */
.three div { transition: transform .2s ease-out; }
.three div:hover { transform: translateX(3px); }
.three h2 { transition: border-color .2s ease-out; }
.three div:hover h2 { border-left-color: var(--accent); }

/* Шаги: номер заливается краской печати. */
.steps li::before {
  transition: background-color .2s ease-out, color .2s ease-out, transform .2s ease-out;
}
.steps li:hover::before { background: var(--seal); color: var(--card); transform: translateY(-1px); }

/* Снимки: лист приподнимается над столом. */
figure img {
  transition: transform .25s ease-out, box-shadow .25s ease-out;
}
figure img:hover {
  transform: translateY(-3px);
  box-shadow: 0 1px 0 var(--line), 0 20px 36px rgba(27, 29, 33, .12);
}

/* Строка прайса подсвечивается, как под линейкой. */
.price tr { transition: background-color .18s ease-out; }
.price tr:hover { background: rgba(140, 43, 43, .05); }

/* Внутренние страницы (у них в первом экране есть путь «Главная → …») набираются мельче:
   заголовок раздела не должен кричать так же, как обещание на главной. */
.hero:has(.crumb) h1 { font-size: 31px; }
.hero:has(.crumb) .lead { font-size: 17.5px; }
.hero:has(.crumb) .lead::first-letter { font-size: 48px; }

/* Росчерк пера под заголовком главной: прорисовывается при загрузке (hero.js). */
.sign {
  display: block;
  width: min(420px, 100%);
  height: 30px;
  margin: -6px 0 14px;
  stroke: var(--seal);
  opacity: .55;
}

/* Буквица первого абзаца — от рукописного листа. */
.hero .lead::first-letter {
  float: left;
  font-family: var(--serif);
  font-size: 58px;
  line-height: .86;
  padding: 6px 10px 0 0;
  color: var(--seal);
}



@media (prefers-reduced-motion: reduce) {
  .bar nav a, .bar nav a::after, .btn, main p a, .three div, .steps li::before, figure img,
  .price tr { transition: none; }
  .bar nav a:hover, .btn:hover, .three div:hover, figure img:hover { transform: none; }
}

@media (max-width: 640px) {
  footer::after { right: 14px; top: -28px; width: 62px; height: 62px; }
}

@media (prefers-color-scheme: dark) {
  :root { --rule: rgba(156, 184, 228, .05); --fold: #23262c; }
  main::before { background: rgba(213, 145, 145, .22); }
  main::after { background: linear-gradient(135deg, transparent 50%, var(--line) 50%, var(--paper) 52%); }
}
