@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("assets/fonts/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("assets/fonts/onest-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

:root {
  --ink: #0b0b0b;
  --graphite: #171717;
  --paper: #f2f1ee;
  --muted: #bdbab4;
  --scan: #ff3a2d;
  --pad: clamp(20px, 5vw, 72px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-sweep: cubic-bezier(0.65, 0, 0.35, 1);
  --sweep-delay: 0.55s;
  --sweep-time: 1.5s;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--ink); color-scheme: dark; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "Onest", system-ui, sans-serif;
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--scan); color: var(--ink); }
:focus-visible { outline: 2px solid var(--scan); outline-offset: 3px; }

a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }

/* ---------- Шапка ---------- */
.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--pad) 22px;
  background: linear-gradient(to bottom, rgba(11, 11, 11, 0.96) 55%, rgba(11, 11, 11, 0));
}
.top-name {
  min-width: 0;
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.top-name sup { font-size: 0.6em; margin-left: 1px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 2px;
  font: 800 1rem/1 "Onest", system-ui, sans-serif;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform 0.25s var(--ease-out), background-color 0.2s, box-shadow 0.25s var(--ease-out);
}
.btn-primary { background: var(--scan); color: var(--ink); }
.btn-primary:hover { background: #ff5247; transform: translateY(-2px); box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.8); }
.btn-primary:active { transform: translateY(0); box-shadow: none; }
.btn-small { min-height: 44px; padding: 0 20px; font-size: 0.9375rem; }

/* ---------- Первый экран ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  padding: 0 var(--pad) clamp(28px, 5vh, 56px);
  --logo-w: min(62vw, 880px);
  --logo-top: clamp(88px, 15vh, 150px);
  --logo-h: calc(var(--logo-w) * 0.49);
}
.logo-spacer { flex: none; height: calc(var(--logo-top) + var(--logo-h)); }

/* фактура прядей: вертикальные штрихи разной толщины */
.hair {
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 23px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 5px),
    radial-gradient(120% 90% at 30% 40%, #1a1a1a 0%, var(--ink) 70%);
}

.reveal { clip-path: inset(0 0 0 0); }

.photo-layer { position: absolute; inset: 0; z-index: -2; }
.hero-photo {
  position: absolute;
  right: 0;
  top: 0;
  width: min(52%, 760px);
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  filter: grayscale(1) contrast(1.08) brightness(0.78);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 42%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 42%);
}

.logo-stage { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.logo-box {
  position: absolute;
  left: var(--pad);
  top: var(--logo-top);
  width: var(--logo-w);
}
.logo-box svg { display: block; width: 100%; height: auto; overflow: visible; }

.bar {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.beam {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--scan);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

/* шлейф луча: градиент слева от линии вместо свечения */
.beam::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 100%;
  width: clamp(60px, 9vw, 140px);
  background: linear-gradient(90deg, rgba(255, 58, 45, 0), rgba(255, 58, 45, 0.16));
}

/* ---------- Текст первого экрана ---------- */
.hero-copy { position: relative; max-width: 36rem; margin-top: auto; padding-top: 28px; }
h1 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero-meta { margin: 12px 0 0; color: var(--muted); font-size: 0.9375rem; }
.hero-meta a { display: inline-block; padding: 12px 0; text-decoration-color: rgba(189, 186, 180, 0.5); }
.hero-meta a:hover { color: var(--paper); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 26px; }
.hero-phone { font-weight: 700; font-size: 1rem; text-decoration: none; padding: 12px 0; font-variant-numeric: tabular-nums; }
.hero-phone:hover { text-decoration: underline; }
.hero-msg { margin: 6px 0 0; color: var(--muted); font-size: 0.9375rem; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.hero-msg { align-items: center; }
.hero-msg a { color: var(--paper); font-weight: 700; text-decoration: none; padding: 12px 0; }
.hero-msg a:hover { text-decoration: underline; }
.hero-addr { margin: 6px 0 0; color: var(--muted); font-size: 0.875rem; }

/* ---------- Мотив первого экрана: «штрихкод-стрижка» ---------- */
@media (prefers-reduced-motion: no-preference) {
  .bar {
    animation: bar-grow 0.9s var(--ease-out) both;
    animation-delay: calc(var(--i) * 0.022s);
  }
  .reveal {
    animation: sweep-reveal var(--sweep-time) var(--ease-sweep) var(--sweep-delay) both;
  }
  .beam {
    animation: sweep-beam var(--sweep-time) var(--ease-sweep) var(--sweep-delay) both;
  }
  .hero-copy > * {
    animation: rise 0.8s var(--ease-out) both;
  }
  .hero-copy > :nth-child(2) { animation-delay: 0.08s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.16s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.24s; }
  .hero-copy > :nth-child(5) { animation-delay: 0.32s; }
}

@keyframes bar-grow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
@keyframes sweep-reveal {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes sweep-beam {
  0% { opacity: 1; transform: translateX(0); }
  92% { opacity: 1; }
  100% { opacity: 0; transform: translateX(calc(100vw - 2px)); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Телефон ---------- */
@media (max-width: 760px) {
  .hero { --logo-w: calc(100vw - var(--pad) * 2); --logo-top: 36vh; }
  .hero-photo {
    width: 100%;
    height: 62%;
    object-position: 50% 30%;
    -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
  }
  .hero-copy { max-width: none; }
  .hero-actions .btn-primary { flex: 1 1 100%; min-height: 56px; }
}

/* =====================================================
   Страница ниже первого экрана
   ===================================================== */
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 96px; }

.wrap { width: min(100% - var(--pad) * 2, 1120px); margin-inline: auto; }
.wrap-narrow { width: min(100% - var(--pad) * 2, 760px); }

.top-nav { display: none; gap: 28px; margin-left: auto; margin-right: 28px; font-weight: 700; font-size: 0.9375rem; }
.top-nav a { text-decoration: none; padding: 10px 0; }
.top-nav a:hover { color: var(--scan); }
@media (min-width: 900px) { .top-nav { display: flex; } }

.sec { padding: clamp(72px, 11vw, 132px) 0 clamp(56px, 8vw, 96px); }
h2 {
  margin: 0 0 14px;
  font-weight: 800;
  font-size: clamp(1.875rem, 4.4vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
h3 { margin: 0; font-weight: 800; font-size: 1.125rem; letter-spacing: -0.01em; }
.lead { margin: 0 0 clamp(36px, 5vw, 56px); max-width: 38rem; color: var(--muted); font-size: 1.0625rem; }
.lead a { color: var(--paper); }

/* разделитель из штрихкода */
.divider-box { width: min(100% - var(--pad) * 2, 1120px); margin-inline: auto; }
.divider {
  display: block;
  width: 100%;
  height: clamp(26px, 3.2vw, 38px);
  color: rgba(255, 255, 255, 0.5);
  transform-origin: 50% 100%;
}

/* ---------- Прайс ---------- */
.price-grid { display: grid; gap: clamp(36px, 5vw, 56px) clamp(32px, 6vw, 88px); }
@media (min-width: 900px) { .price-grid { grid-template-columns: 1fr 1fr; } }
.price-group ul { list-style: none; margin: 14px 0 0; padding: 0; }
.price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name price" "time book";
  gap: 4px 20px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.price-row:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.pr-name { grid-area: name; font-weight: 700; overflow-wrap: anywhere; }
.pr-time { grid-area: time; color: var(--muted); font-size: 0.875rem; }
.pr-price { grid-area: price; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.pr-book { grid-area: book; justify-self: end; display: inline-flex; align-items: center; min-height: 44px; color: var(--paper); font-weight: 700; font-size: 0.9375rem; text-decoration: underline; text-decoration-color: rgba(242, 241, 238, 0.4); }
.pr-book:hover, .pr-book:focus-visible { color: var(--scan); text-decoration-color: var(--scan); }

/* ---------- Работы ---------- */
.works {
  list-style: none;
  margin: clamp(28px, 4vw, 44px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.works li { position: relative; overflow: hidden; border-radius: 2px; aspect-ratio: 3 / 4; }
.works figure { position: absolute; inset: 0; margin: 0; }
.works img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.works .w-wide { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
.works .w-last { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
.works .w-last img { object-position: 50% 28%; }
.works figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 36px 14px 12px;
  font-weight: 700;
  font-size: 0.875rem;
  background: linear-gradient(to top, rgba(11, 11, 11, 0.82), rgba(11, 11, 11, 0));
}
@media (min-width: 900px) {
  .works { grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(2, clamp(300px, 33vw, 430px)); gap: 12px; }
  .works li, .works .w-wide, .works .w-last { aspect-ratio: auto; grid-column: span 3; }
  .works .w-wide { grid-column: span 7; }
  .works .w-fade { grid-column: span 5; }
  .works .w-fade img { object-position: 50% 30%; }
}
.sec-cta { margin: clamp(32px, 4vw, 48px) 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.text-link { font-weight: 700; padding: 12px 0; }
.text-link:hover { color: var(--scan); }

/* ---------- Мастера ---------- */
.masters { list-style: none; margin: 0; padding: 0; }
.master {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px 24px;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.master:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.m-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.m-name { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; }
.m-role { color: var(--muted); font-size: 0.9375rem; }
.m-meta { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.m-book { justify-self: start; color: var(--paper); font-weight: 700; text-decoration: underline; text-decoration-color: rgba(242, 241, 238, 0.4); padding: 12px 0; }
.m-book:hover, .m-book:focus-visible { color: var(--scan); text-decoration-color: var(--scan); }
@media (min-width: 900px) {
  .master { grid-template-columns: 1.1fr 1.4fr auto; }
  .m-book { justify-self: end; }
}

/* ---------- Адреса ---------- */
.addr-grid { display: grid; gap: 44px; }
@media (min-width: 800px) { .addr-grid { grid-template-columns: 1fr 1fr; gap: 88px; } }
.addr p { margin: 8px 0 0; color: var(--muted); }
.addr p a { color: var(--paper); display: inline-block; padding: 10px 0; }
.addr h3 { font-size: 1.5rem; }
.btn-ghost { margin-top: 22px; border: 2px solid var(--paper); color: var(--paper); background: transparent; }
.btn-ghost:hover { background: var(--paper); color: var(--ink); transform: translateY(-2px); }

/* ---------- Вопросы ---------- */
.faq { margin-top: clamp(28px, 4vw, 44px); border-top: 1px solid rgba(255, 255, 255, 0.14); }
details { border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 40px 20px 0;
  position: relative;
  font-weight: 700;
  font-size: 1.0625rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -8px;
  border-right: 2px solid var(--scan);
  border-bottom: 2px solid var(--scan);
  transform: rotate(45deg);
  transition: transform 0.25s var(--ease-out);
}
details[open] summary::after { transform: rotate(-135deg); margin-top: -3px; }
details p { margin: 0 0 20px; color: var(--muted); max-width: 40rem; }

/* ---------- Финал: сканер на кассе ---------- */
.finale {
  padding: clamp(80px, 12vw, 150px) 0 clamp(72px, 10vw, 128px);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0 2px, transparent 2px 23px),
    radial-gradient(110% 120% at 70% 100%, #1b1b1b 0%, var(--ink) 70%);
}
.finale h2 { font-size: clamp(2.5rem, 7.5vw, 6rem); letter-spacing: -0.035em; margin-bottom: clamp(28px, 4vw, 48px); }
.scan { position: relative; margin-bottom: clamp(32px, 4.5vw, 52px); }
.scan-code { display: block; width: 100%; height: clamp(84px, 14vw, 150px); color: var(--paper); }
.scan-dim { opacity: 0.2; }
.scan-lit { position: absolute; inset: 0; }
.scan-beam {
  position: absolute;
  top: -12px;
  bottom: -12px;
  left: 0;
  width: 100%;
  border-right: 2px solid var(--scan);
  opacity: 0;
  transform: translateX(-100%);
  pointer-events: none;
}
.finale-row { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 40px; }
.btn-large { min-height: 64px; padding: 0 44px; font-size: 1.125rem; }
.finale-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; color: var(--muted); font-size: 0.9375rem; }
.finale-facts li + li { position: relative; }
.finale-facts a { color: var(--paper); font-weight: 700; text-decoration: none; padding: 12px 0; display: inline-block; }
.finale-facts a:hover { text-decoration: underline; }
.finale-msg { margin: 18px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 16px; color: var(--muted); font-size: 0.9375rem; }
.finale-msg a { color: var(--paper); font-weight: 700; text-decoration: none; padding: 12px 0; }
.finale-msg a:hover { text-decoration: underline; }

.foot { padding: 28px 0 44px; font-size: 0.9375rem; }
.foot .divider { margin-bottom: 28px; height: 14px; }
.foot-row { display: grid; gap: 14px; }
@media (min-width: 800px) { .foot-row { grid-template-columns: 1fr auto auto; align-items: center; gap: 40px; } }
.foot p { margin: 0; }
.foot-name { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; }
.foot-name sup { font-size: 0.55em; }
.foot-name span { display: block; margin-top: 2px; font-weight: 500; font-size: 0.875rem; letter-spacing: 0; color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 22px; }
.foot-links a { text-decoration: none; padding: 12px 0; }
.foot-links a:hover { text-decoration: underline; }
.foot-note { color: var(--muted); font-size: 0.875rem; }
@media (min-width: 700px) {
  .finale-facts { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 24px; }
}

/* ---------- Нижняя панель записи на телефоне ---------- */
.dock {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom));
  background: rgba(11, 11, 11, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  transform: translateY(110%);
  visibility: hidden;
  transition: transform 0.35s var(--ease-out), visibility 0s linear 0.35s;
}
.dock .btn { width: 100%; min-height: 54px; }
.dock.show { transform: none; visibility: visible; transition-delay: 0s; }
@media (min-width: 900px) { .dock { display: none; } }
@media (max-width: 899px) { .foot { padding-bottom: 96px; } }

/* ---------- Движение ниже первого экрана ----------
   Один язык: вход по оси X слева направо, кривая ease-out, 0.7 с.
   Красный луч только в финале (и на первом экране). Ритм: 0.7 / 0.9 / 1.2 с.
   Без скрипта и при уменьшенном движении все видно сразу. */
@media (prefers-reduced-motion: no-preference) {
  /* разделители между разделами (подвальный остается статичным) */
  .js main > .divider-box .divider { clip-path: inset(0 100% 0 0); transition: clip-path 0.7s var(--ease-out); }
  .js main > .divider-box.in .divider { clip-path: inset(0 0 0 0); }

  /* «Работы»: каждая плитка открывается слева направо, фото чуть оседает; в ряду шаг 0.07 с */
  .js .works figure { clip-path: inset(0 100% 0 0); }
  .js .works img { transform: scale(1.06); }
  .js .works li.in figure {
    clip-path: inset(0 0 0 0);
    transition: clip-path 0.7s var(--ease-out) var(--d, 0s);
  }
  .js .works li.in img { transform: none; transition: transform 0.9s var(--ease-out) var(--d, 0s); }

  /* финал: луч проходит по штрихкоду один раз */
  .js .scan-lit { clip-path: inset(0 100% 0 0); }
  .js .finale.in .scan-lit { animation: sweep-reveal 1.2s var(--ease-sweep) 0.1s both; }
  .js .finale.in .scan-beam { animation: scan-beam 1.2s var(--ease-sweep) 0.1s both; }

  /* то, что пролистали без остановки или что выше экрана после перезагрузки, показывается сразу */
  .js .instant, .js .instant * { transition: none !important; animation: none !important; }
}
@keyframes scan-beam {
  0% { opacity: 1; transform: translateX(-100%); }
  92% { opacity: 1; }
  100% { opacity: 0; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dock { transition: none; }
}
/* на телефоне нижняя панель заменяет кнопку в шапке: две красные кнопки не нужны */
@media (max-width: 899px) {
  body.dock-on .top .btn { visibility: hidden; }
}
@media print {
  .js main > .divider-box .divider, .js .works figure, .js .scan-lit { clip-path: none; }
  .js .works img { transform: none; }
  .dock { display: none; }
}
