/* SUA v4 — «стадии огня» по DESIGN.md. Тихо и горячо: пламя шумно, угли молчаливы.
   70% bg/surface · 20% ash · 7% gold · 3% ember. Прямые углы, тонкие 1px линии.
   Motion: тление, не вспышка (0.8–1.2s, без bounce). */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; overflow-x: clip; }

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

::selection { background: var(--ember); color: var(--bg); }

:focus-visible { outline: 2px solid var(--flame); outline-offset: 3px; }

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

a { color: inherit; }

/* моно-метки: жар как спецификация (DESIGN.md §4) */
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ------- display: Fraunces opsz 144, wght ~500, «высеченный» голос ------- */

.giant {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-weight: 500;
  text-transform: uppercase;
  font-size: var(--giant-size);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ash);
}

.giant--ember { color: var(--ember); }

.giant--center { text-align: center; }

/* ------- словарная карточка (BRANDBOOK §7.1, фирменный приём) ------- */

.dict-card {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ash-dim);
  border: 1px solid var(--coal);
  padding: 10px 16px;
  text-transform: lowercase;
}

.dict-card em { color: var(--gold); font-style: normal; }

/* ------- mono-метка года (hero) ------- */

.stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--coal);
  padding: 9px 14px 8px;
  transform: rotate(-1.5deg);
}

/* ------- кнопки: заливка снизу (канон motion §5) ------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.btn--line {
  border: 1px solid var(--ember);
  color: var(--ember);
  padding: 0.85em 1.9em;
  background-image: linear-gradient(var(--flame), var(--flame));
  background-repeat: no-repeat;
  background-size: 100% 0%;
  background-position: 0 100%;
  transition: color 0.45s ease, background-size 0.45s ease, border-color 0.45s ease;
}

.btn--line:hover { background-size: 100% 100%; color: var(--bg); border-color: var(--flame); }

.btn--ghost {
  border: 1px solid var(--coal);
  color: var(--ash);
  padding: 0.85em 1.9em;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ------- линия тления (прогресс скролла, BRANDBOOK §7.3) ------- */

.smolder { position: fixed; left: 16px; top: 96px; bottom: 20px; width: 2px; background: var(--coal); z-index: 60; }

.smolder__head {
  position: absolute;
  left: 0; top: 0;
  width: 2px; height: 56px;
  background: linear-gradient(var(--flame), var(--ember));
  box-shadow: 0 0 12px rgba(228, 87, 46, 0.5);
}

/* ------- зерно (KEA-атмосфера) ------- */

.grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: screen;
}

/* ------- nav ------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 30px;
  background: rgba(14, 11, 9, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--coal);
}

.nav__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }

.nav__word {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-weight: 500;
  font-size: 25px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--gold);
}

.nav__links { display: flex; align-items: center; gap: 26px; }

.nav__link {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ash-dim);
  background-image: linear-gradient(var(--ember), var(--ember));
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 0 100%;
  padding-bottom: 3px;
  transition: color 0.3s ease, background-size 0.35s ease;
}

.nav__link:hover { color: var(--ash); background-size: 100% 1px; }

.nav .btn--line { font-size: 12px; padding: 0.8em 1.6em; }

/* ------- hero (bg = сажа; эмберы живут только здесь, BRANDBOOK §7.5) ------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 130px 24px 110px;
  overflow: hidden;
}

.hero__embers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero__stamp { margin-bottom: 34px; position: relative; z-index: 3; }

.hero__title { position: relative; z-index: 1; }

.js-heat .hero__title { filter: url(#heat); }

.hero__cut {
  position: relative;
  z-index: 2;
  width: min(520px, 54vw);
  margin-top: calc(-0.72 * var(--giant-size));
  rotate: -2.5deg;
  filter: drop-shadow(0 30px 34px rgba(0, 0, 0, 0.55));
}

.hero__dict { margin-top: 34px; position: relative; z-index: 3; }

.hero__cta { margin-top: 30px; position: relative; z-index: 3; }

.hero__cols {
  position: absolute;
  left: 0; right: 0; bottom: 34px;
  display: flex;
  justify-content: space-between;
  padding: 0 40px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash-dim);
}

/* ------- манифест (bg) ------- */

.manifesto {
  position: relative;
  text-align: center;
  padding: 190px 24px 170px;
  border-top: 1px solid var(--coal);
}

.manifesto .giant { max-width: 1100px; margin: 0 auto; }

.manifesto__prose {
  max-width: 540px;
  margin: 42px auto 0;
  font-size: 17px;
  color: var(--ash-dim);
}

.manifesto__est { margin-top: 48px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }

/* ------- меню (surface = тёплый уголь; фото grayscale→цвет) ------- */

.menu {
  background: var(--surface);
  border-top: 1px solid var(--coal);
  padding: 150px 24px 170px;
}

.menu__head { text-align: center; margin-bottom: 100px; }

.menu__dict { margin-bottom: 34px; }

.menu__meta {
  margin-top: 30px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.polaroids {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 64px 40px;
  max-width: 1180px;
  margin: 0 auto;
}

.polaroid { position: relative; }

.polaroid img {
  width: min(320px, 78vw);
  height: 360px;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.7s ease, scale 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.polaroid:hover img { filter: grayscale(0); scale: 1.03; }

.polaroid .mono {
  display: block;
  margin-top: 14px;
  color: var(--ash-dim);
  text-align: left;
  transition: color 0.3s ease;
}

.polaroid:hover .mono { color: var(--gold); }

.polaroid--r1 { rotate: -0.6deg; }
.polaroid--r2 { rotate: 0.5deg; }
.polaroid--r3 { rotate: -0.3deg; }

/* ------- числа (bg) ------- */

.numbers {
  position: relative;
  border-top: 1px solid var(--coal);
  text-align: center;
  padding: 150px 24px 200px;
  overflow: hidden;
}

.numbers__cut {
  width: min(520px, 64vw);
  margin: 56px auto 0;
  filter: drop-shadow(0 26px 30px rgba(0, 0, 0, 0.5));
}

.numbers__cols {
  list-style: none;
  position: absolute;
  left: 0; right: 0; bottom: 40px;
  display: flex;
  justify-content: space-between;
  padding: 0 44px;
}

.numbers__cols li { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ash-dim); line-height: 1.5; }

.numbers__cols .stat__v { font-family: var(--font-display); font-variation-settings: "opsz" 144; font-size: 34px; letter-spacing: 0; color: var(--ember); margin-bottom: 4px; }

.numbers__cols li:nth-child(2) { text-align: center; }
.numbers__cols li:nth-child(3) { text-align: right; }

/* ------- ночь (surface глубже — таймлайн тише, «угли молчаливы») ------- */

.night {
  background: var(--surface);
  border-top: 1px solid var(--coal);
  padding: 160px 24px 150px;
}

.night__inner { max-width: 860px; margin: 0 auto; }

.night__route {
  list-style: none;
  position: relative;
  margin-top: 80px;
  padding-left: 56px;
}

.night__route::before {
  content: "";
  position: absolute;
  left: 13px; top: 10px; bottom: 14px;
  border-left: 1px solid var(--coal);
}

.night__stop { position: relative; padding-bottom: 52px; }

.night__stop:last-child { padding-bottom: 0; }

.night__stop::before {
  content: "";
  position: absolute;
  left: -49px; top: 10px;
  width: 9px; height: 9px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: var(--surface);
}

.night__time {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.night__text { max-width: 520px; font-size: 17px; margin-top: 8px; color: var(--ash); }

.night__orn { display: block; margin: 56px auto 0; opacity: 0.6; }

/* ------- шеф (bg; лэйаут текст/фото) ------- */

.chef {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px;
  align-items: center;
  max-width: 1220px;
  margin: 0 auto;
  padding: 120px 32px 170px;
}

.chef__prose { max-width: 440px; font-size: 17px; color: var(--ash-dim); margin: 32px 0 44px; }

.chef__photo { position: relative; }

.chef__photo img {
  width: 100%;
  height: min(600px, 82vh);
  object-fit: cover;
  filter: saturate(1.05);
}

.chef__tag {
  display: block;
  margin-top: 12px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash-dim);
}

/* ------- резерв (bg; welcome) ------- */

.reserve {
  border-top: 1px solid var(--coal);
  text-align: center;
  padding: 180px 24px 160px;
}

.reserve__lead { font-family: var(--font-display); font-variation-settings: "opsz" 144; font-size: 28px; margin: 30px 0 48px; color: var(--ash); }

.reserve__note { margin-top: 38px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ash-dim); }

.reserve__ask { color: var(--gold); text-decoration: none; border-bottom: 1px solid var(--coal); transition: color 0.3s ease, border-color 0.3s ease; }

.reserve__ask:hover { color: var(--ember); border-color: var(--ember); }

/* ------- футер (surface; eguzkilore-паттерн фоном) ------- */

.footer {
  position: relative;
  background: var(--surface);
  border-top: 1px solid var(--coal);
  padding: 80px 32px 0;
  overflow: hidden;
}

.footer__eguzkilore {
  position: absolute;
  right: -140px;
  top: 40px;
  width: 520px;
  height: 520px;
  opacity: 0.5;
  pointer-events: none;
}

.footer__nav { display: flex; gap: 32px; position: relative; }

.footer__nav a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ash-dim);
  transition: color 0.3s ease;
}

.footer__nav a:hover { color: var(--ember); }

.footer__meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--coal);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ash-dim);
  position: relative;
}

.footer__legend { margin-top: 30px; opacity: 0.6; max-width: 560px; position: relative; }

.footer__cut { position: absolute; z-index: 1; opacity: 0.9; }

.footer__cut--a { width: 92px; left: 6%; bottom: 150px; rotate: -6deg; }

.footer__cut--b { width: 116px; right: 8%; bottom: 220px; rotate: 4deg; }

.footer__giant {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-weight: 500;
  font-size: 28vw;
  line-height: 0.82;
  text-align: center;
  letter-spacing: -0.02em;
  color: var(--ember);
  margin-top: 40px;
  margin-bottom: -0.12em;
  pointer-events: none;
}

/* ------- responsive ------- */

@media (max-width: 900px) {
  .chef { grid-template-columns: 1fr; gap: 60px; padding-bottom: 140px; }
  .chef__photo img { height: auto; }
  .hero__cut { width: min(400px, 72vw); }
  .numbers__cols { position: static; flex-direction: column; gap: 22px; margin-top: 60px; padding: 0; }
  .numbers__cols li, .numbers__cols li:nth-child(3) { text-align: center; }
  .manifesto { padding: 150px 20px 130px; }
  .numbers { padding: 130px 20px 140px; }
  .footer__cut--a { width: 70px; bottom: 110px; }
  .footer__cut--b { width: 88px; bottom: 150px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero__cols { padding: 0 20px; }
  .polaroid img { width: min(300px, 74vw); height: 320px; }
  .smolder { display: none; }
  .footer__nav { flex-wrap: wrap; }
}

/* ------- reduced motion: движение уходит, информация остаётся ------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .polaroid img { transition: none; }
}

/* ------- v5: шторы-переходы, тлеющая линия маршрута ------- */

/* штора: наклонная кромка (две переменные едут с разной скоростью, как у донора) */
.curtain {
  clip-path: polygon(0 calc(var(--yl, 0) * 1%), 100% calc(var(--yr, 0) * 1%), 100% 100%, 0 100%);
}

/* тлеющий заполнитель линии ночи: огонь ведёт через вечер */
.night__burn {
  position: absolute;
  left: 13px; top: 10px; bottom: 14px;
  width: 1px;
  background: var(--coal);
}

.night__burn-fill {
  position: absolute;
  inset: 0 0 auto 0;
  height: 0%;
  background: linear-gradient(var(--flame), var(--ember) 60%, rgba(228, 87, 46, 0));
  box-shadow: 0 0 10px rgba(228, 87, 46, 0.45);
}

.night__inner { position: relative; }

.night .night__route { position: relative; z-index: 1; }

/* кнопки: таргет ≥44px в нав */
@media (min-width: 769px) {
  .nav .btn--line { padding: 1em 1.8em; }
}

/* ------- v6: тлеющая кромка штор, дым KEA, skip-link, ember-trail ------- */

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 100;
  font-family: var(--font-body);
  font-size: 13px;
  padding: 10px 16px;
  background: var(--ember);
  color: var(--bg);
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus-visible { top: 12px; }

/* тлеющая кромка: линия на верхнем крае шторы, дышит ember'ом */
.seam {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ember) 30%, var(--flame) 50%, var(--ember) 70%, transparent);
  opacity: 0.5;
  z-index: 2;
}

/* KEA: дым между главами — полоса шумной текстуры, параллакс */
.kea {
  position: relative;
  height: 130px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='130'%3E%3Cfilter id='k'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.05' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.47 0 0 0 0 0.38 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='420' height='130' filter='url(%23k)'/%3E%3C/svg%3E");
  background-size: 420px 130px;
  opacity: 0.16;
  mix-blend-mode: screen;
  pointer-events: none;
}

.kea--b { transform: scaleX(-1); }

/* ember-trail: canvas курсора (desktop, рисует JS) */
.trail {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 95;
}
