/* Белый лист, тёмно-синие чернила и маркер. Цвет маркера у каждой страницы свой: --mk на body. */
:root {
  --paper: #ffffff;
  --wash: #eef2f6;
  --ink: #0e1a3a;
  --mk: #ffe04a;
  --meta: #5e6a82;
  --soft: #aab6d3;
  --line: #d5dce6;
  --pad: clamp(16px, 4.5vw, 64px);
  --edge: max(var(--pad), calc((100% - 1320px) / 2 + var(--pad)));
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --display: "Sofia Sans Extra Condensed", "Arial Narrow", sans-serif;
  --text: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.story { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--text);
  overflow-x: clip;
}
a { color: inherit; }
img { max-width: none; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.order :focus-visible, .lb :focus-visible, .scene.dark :focus-visible { outline-color: #fff; }

.wrap { max-width: 1320px; margin: 0 auto; padding-inline: var(--pad); }
main { overflow-x: clip; }

/* Шапка: то же лицо, что в чате на Workzilla, и одно действие. Над тёмной сценой темнеет сама */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  transition: box-shadow 0.3s, background 0.35s, color 0.35s;
}
.top.stuck { box-shadow: 0 1px 0 var(--line); }
.top.dark { background: rgba(14, 26, 58, 0.84); color: #fff; }
.top.dark.stuck { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14); }
.top.dark .who-t small { color: var(--soft); }
.top.dark .btn { background: var(--mk); color: var(--ink); }
.top.dark .btn::before { background: #fff; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.who { display: flex; align-items: center; gap: 12px; text-decoration: none; line-height: 1.3; min-width: 0; }
.ava { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--mk); overflow: hidden; }
.ava img { display: block; width: 100%; height: 100%; }
.who-t b { display: block; font-weight: 500; }
.who-t small { display: block; color: var(--meta); font-size: 14px; transition: color 0.35s; }

/* Кнопка: при наведении по ней проходит маркер */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 14px 24px;
  border-radius: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  transition: color 0.25s, background 0.35s;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0 -25%;
  background: var(--mk);
  transform: translateX(-102%) skewX(-14deg);
  transition: transform 0.5s var(--ease);
}
.btn span { position: relative; }
.btn:hover, .btn:focus-visible { color: var(--ink); }
.btn:hover::before, .btn:focus-visible::before { transform: translateX(0) skewX(-14deg); }
.btn-light { background: var(--mk); color: var(--ink); }
.btn-light::before { background: #fff; }

/* Заголовок страницы: название узкой задачи во весь голос, слова выезжают по очереди */
h1 {
  font: 800 clamp(52px, 9.6vw, 132px)/0.9 var(--display);
  letter-spacing: -0.005em;
  margin: clamp(10px, 2.6vw, 36px) 0 0;
  text-wrap: balance;
}
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.1em 0.03em 0.16em; margin: -0.1em -0.03em -0.16em; }
.w > span { display: inline-block; }
.js .w > span { transform: translateY(112%); animation: rise 0.9s var(--ease) forwards; animation-delay: calc(var(--i) * 55ms + 60ms); }
@keyframes rise { to { transform: none; } }

.hero { padding-bottom: clamp(28px, 4vw, 56px); }
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(14px, 4vw, 56px);
  align-items: center;
  margin-top: clamp(16px, 2.4vw, 28px);
}
.lead { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.45; margin: 0; max-width: 46ch; }
.js .lead { animation: up 0.9s var(--ease) 0.35s backwards; }
.hint { margin: clamp(14px, 2vw, 22px) 0 0; color: var(--meta); font-size: 15px; max-width: 52ch; clear: both; }
.js .hint { animation: up 0.9s var(--ease) 0.55s backwards; }

/* Печать с местом в рейтинге: цифра стоит, надпись по кругу медленно едет */
.seal { width: clamp(108px, 13vw, 172px); aspect-ratio: 1; flex: none; }
.intro .seal { order: 2; }
.seal svg { display: block; width: 100%; height: 100%; overflow: visible; }
.seal-ring { font: 700 15.5px var(--text); fill: var(--ink); letter-spacing: 0.02em; }
.seal-n { font: 800 92px var(--display); fill: var(--ink); }
.seal .ring { transform-origin: 100px 100px; animation: spin 38s linear infinite; }
.js .seal { animation: stamp 0.75s cubic-bezier(0.3, 1.5, 0.5, 1) 0.75s backwards; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes stamp { from { transform: scale(0) rotate(-70deg); opacity: 0; } }
@keyframes up { from { opacity: 0; translate: 0 26px; } }

/* Маркер: им выделены только проверяемые факты. Проводится, когда строка попадает на экран */
mark {
  color: var(--ink);
  background-color: transparent;
  background-image: linear-gradient(var(--mk), var(--mk));
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 0.04em 0.32em;
  border-radius: 0.2em 0.45em 0.25em 0.5em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  white-space: nowrap;
}
.js mark { background-size: 0% 100%; transition: background-size 0.85s var(--ease) 0.12s; }
.js mark.in { background-size: 100% 100%; }

/* Появление групп: дети выезжают по очереди, когда группа попала на экран */
.js [data-rv]:not(.in) > * { opacity: 0; }
.js [data-rv].in > * { animation: up 0.8s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 70ms); }

/* Полоса с цифрами: весь экран в цвет маркера, факты закрашены белым, из нижнего края выглядывает автор */
.band { position: relative; background: var(--mk); margin-top: clamp(72px, 10vw, 150px); scroll-margin-top: 0; }
.scene + .band { margin-top: 0; }
.band-solo { margin-top: clamp(40px, 6vw, 80px); }
.band-in { position: relative; padding-block: clamp(40px, 6vw, 88px); }
.scene + .band .band-in { padding-top: clamp(96px, 9vw, 140px); }
.band-text { max-width: min(66%, 880px); }
.band-solo .band-text { max-width: none; }
.say { display: grid; gap: clamp(14px, 1.9vw, 28px); }
.say p { margin: 0; font: 800 clamp(34px, 5vw, 74px)/1.04 var(--display); text-wrap: balance; }
.band mark { background-image: linear-gradient(#fff, #fff); transition-delay: calc(var(--i, 0) * 90ms + 0.3s); padding: 0 0.2em; border-radius: 0.1em 0.2em 0.12em 0.24em; }
.band-note { font-size: 14px; max-width: 48ch; margin: clamp(18px, 2.4vw, 30px) 0 0; color: rgba(14, 26, 58, 0.74); }
.face {
  position: absolute;
  right: var(--pad);
  bottom: 0;
  height: 100%;
  max-width: 34%;
  margin: 0;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  clip-path: inset(-40% -10% 0 -10%);
}
.face img { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: bottom; }
.js .face[data-rv].in > img { animation: peep 1s var(--ease) backwards 0.1s; }
@keyframes peep { from { transform: translateY(30%); opacity: 0; } }

/* Бегущая строка коротких отзывов */
.ticker { overflow: hidden; padding-top: clamp(40px, 6vw, 84px); }
.ticker-track { display: flex; width: max-content; animation: tick 80s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-set { display: flex; align-items: center; flex: none; }
.tq {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font: 800 clamp(44px, 7vw, 100px)/1.05 var(--display);
  white-space: nowrap;
}
.tq small { font: 500 15px/1.2 var(--text); color: var(--meta); }
.tq::after {
  content: "";
  align-self: center;
  width: 0.3em;
  height: 0.3em;
  border-radius: 50%;
  background: var(--mk);
  margin-inline: clamp(18px, 2.6vw, 44px);
}
@keyframes tick { to { transform: translateX(-50%); } }

/* Отзывы: записки, в каждой маркером отмечен главный факт */
.wall { padding-top: clamp(28px, 4vw, 56px); }
.wall h2 { font: 800 clamp(40px, 6vw, 84px)/0.92 var(--display); margin: 0; }
.wall-sub { color: var(--meta); margin: 10px 0 0; max-width: 52ch; }
.notes { columns: 3 290px; column-gap: 18px; margin-top: clamp(20px, 3vw, 36px); }
.note {
  break-inside: avoid;
  margin: 0 0 18px;
  background: var(--wash);
  border-radius: 16px;
  padding: 22px 22px 18px;
  rotate: var(--r, 0deg);
  transition: rotate 0.45s var(--ease), translate 0.45s var(--ease), background 0.3s;
}
@media (hover: hover) { .note:hover { rotate: 0deg; translate: 0 -5px; background: #e5ebf2; } }
.note blockquote { margin: 0; line-height: 1.5; }
.note mark { white-space: normal; padding-inline: 0.18em; }
.note figcaption { margin-top: 14px; font-size: 14px; color: var(--meta); line-height: 1.4; }
.note figcaption b { color: var(--ink); font-weight: 700; }

/* Заказ */
.order { background: var(--ink); color: #fff; margin-top: clamp(56px, 9vw, 120px); padding-block: clamp(40px, 6.5vw, 96px); }
.order-in { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(28px, 5vw, 72px); align-items: end; }
.order h2 { font: 800 clamp(54px, 9.4vw, 132px)/0.88 var(--display); margin: 0; }
.order .btn { margin-top: clamp(20px, 2.6vw, 32px); font-size: 18px; padding: 18px 30px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 18px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; color: #c9d2e6; line-height: 1.45; }
.steps li::before {
  content: counter(s);
  font: 800 30px/1 var(--display);
  color: var(--ink);
  background: var(--mk);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.steps b { display: block; color: #fff; font-weight: 700; }

/* Другие страницы: у каждой свой цвет маркера, при наведении рядом с курсором появляется работа */
.more { padding-block: clamp(32px, 5vw, 64px); }
.more h2 { font: 500 16px/1.4 var(--text); color: var(--meta); margin: 0 0 8px; }
.more a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 1.6vw, 22px);
  text-decoration: none;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.more a:last-child { border-bottom: 1px solid var(--line); }
.more .sw { width: clamp(16px, 1.8vw, 24px); height: clamp(16px, 1.8vw, 24px); border-radius: 50%; background: var(--c); transition: scale 0.4s var(--ease); }
.more .t {
  justify-self: start;
  font: 800 clamp(30px, 4.6vw, 60px)/1 var(--display);
  background: linear-gradient(var(--c), var(--c)) no-repeat 0 82% / 0% 58%;
  transition: background-size 0.55s var(--ease);
  padding-inline: 0.08em;
}
.more .n { font-size: 15px; color: var(--meta); white-space: nowrap; }
.more a:hover .t, .more a:focus-visible .t { background-size: 100% 58%; }
.more a:hover .sw, .more a:focus-visible .sw { scale: 1.5; }

.peek {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
  will-change: transform;
}
.peek.on { opacity: 1; }
.peek img {
  display: block;
  width: 300px;
  height: auto;
  border-radius: 10px;
  transform: translate(26px, -50%) rotate(3deg);
  box-shadow: 0 24px 50px -18px rgba(14, 26, 58, 0.55), 0 0 0 1px rgba(14, 26, 58, 0.08);
  background: var(--wash);
}

/* Главная: лицо крупно, из-за цветной плашки */
.hub { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.5fr); gap: clamp(20px, 4vw, 64px); align-items: end; }
.hub h1 { font-size: clamp(46px, 7.2vw, 106px); text-wrap: wrap; }
.hub .lead { margin-top: clamp(16px, 2.4vw, 28px); max-width: 52ch; }
.portrait { position: relative; margin: 0; justify-self: end; width: min(100%, 360px); aspect-ratio: 557 / 700; clip-path: inset(-10% -40% 0 -40%); }
.portrait::before {
  content: "";
  position: absolute;
  inset: 20% 0 0;
  background: var(--mk);
  border-radius: 46% 54% 14px 14px / 34% 40% 14px 14px;
  transform-origin: 50% 100%;
}
.portrait > img { position: absolute; left: 7%; bottom: 0; width: 86%; height: auto; display: block; }
.portrait .seal { position: absolute; left: -40%; bottom: 4%; width: clamp(104px, 10.5vw, 146px); }
.js .portrait::before { animation: grow 0.9s var(--ease) 0.15s backwards; }
.js .portrait > img { animation: peep 1s var(--ease) 0.35s backwards; }
@keyframes grow { from { transform: scaleY(0); } }

.foot { color: var(--meta); font-size: 14px; padding-block: 8px 40px; }
.foot p { max-width: 70ch; margin: 0; }

.buybar { display: none; }

/* Просмотр картинки */
.lb {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(10, 18, 42, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0s 0.25s;
}
.lb.on { opacity: 1; visibility: visible; transition: opacity 0.25s; }
.lb img { max-width: 94vw; max-height: 84vh; border-radius: 8px; background: #fff; transform: scale(0.95); transition: transform 0.4s var(--ease); touch-action: pan-y pinch-zoom; }
.lb { -webkit-tap-highlight-color: transparent; }
.lb.zoomed img { touch-action: auto; } /* страница увеличена пальцами: лист двигается в любую сторону, свайп не листает (site.js) */
.lb.on img { transform: none; }
.lb button { position: absolute; border: 0; background: #fff; color: var(--ink); font: 700 16px/1 var(--text); border-radius: 10px; padding: 12px 16px; cursor: pointer; }
.lb button:hover { background: var(--mk); }
.lb .lb-close { top: 16px; right: 16px; }
.lb .lb-prev { left: 16px; bottom: 16px; }
.lb .lb-next { right: 16px; bottom: 16px; }
.lb-count { position: absolute; top: 26px; left: 20px; color: #fff; font-weight: 700; }

@media (max-width: 760px) {
  body { padding-bottom: 78px; }
  .top { position: static; }
  .top .btn { display: none; }
  .intro { display: block; }
  .intro .seal { float: right; width: 104px; shape-outside: circle(50%); margin: 2px -2px 4px 14px; }
  .order-in, .hub { grid-template-columns: minmax(0, 1fr); }


  .band { margin-top: clamp(48px, 12vw, 80px); }
  .scene + .band .band-in { padding-top: 44px; }
  .band-in { padding-bottom: 0; display: flex; flex-direction: column; }
  .band-text { max-width: none; }
  .face { position: relative; right: auto; height: auto; width: 58%; max-width: 280px; align-self: flex-end; margin-top: -8px; clip-path: inset(-10% 0 0 0); }
  .face img { width: 100%; height: auto; }

  .notes {
    columns: auto;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(var(--pad) * -1);
    padding: 8px var(--pad) 14px;
    scrollbar-width: none;
  }
  .notes::-webkit-scrollbar { display: none; }
  .note { flex: 0 0 84%; margin: 0; scroll-snap-align: center; rotate: 0deg; align-self: flex-start; }

  .hub { align-items: start; }
  .portrait { justify-self: center; width: min(74%, 300px); margin-top: 8px; }
  .portrait .seal { left: -14%; bottom: 4%; width: 108px; }

  .buybar {
    display: block;
    position: fixed;
    inset: auto 0 0 0;
    padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--line);
    z-index: 5;
  }
  .buybar .btn { display: flex; }
}

/* Горизонтальный телефон (30.11): шапка не липнет и не накрывает сцену, кнопка заказа внизу слева
   (её вид задан в scenes.css рядом с раскладкой сцен), на главной фото стоит рядом с текстом */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1000px) {
  :root { --pad: clamp(16px, 3vw, 28px); }
  body { padding-bottom: 64px; }
  .top { position: static; }
  .top .btn { display: none; }
  .hub { grid-template-columns: minmax(0, 1fr) minmax(0, 32%); align-items: end; }
  .portrait { justify-self: end; width: min(100%, 250px); margin-top: 0; }
  .portrait .seal { left: -22%; width: 96px; }
  /* просмотр кадра: «Назад» и «Дальше» по бокам, а не поверх углов картинки */
  .lb img { max-width: calc(100vw - 216px); max-height: calc(100vh - 24px); }
  .lb .lb-close { top: 10px; right: 10px; }
  .lb .lb-prev, .lb .lb-next { top: 50%; bottom: auto; translate: 0 -50%; }
  .lb .lb-prev { left: 10px; }
  .lb .lb-next { right: 10px; }
  .lb-count { top: 18px; left: 14px; }
}
@media (orientation: landscape) and (max-height: 500px) and (max-width: 760px) {
  .face { width: 36%; max-width: 230px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .w > span { transform: none; }
  .js mark { background-size: 100% 100%; }
  .js [data-rv]:not(.in) > * { opacity: 1; }
  .ticker { overflow-x: auto; }
}
