/* SUA — Ember Nocturne · tokens = стадии огня (DESIGN.md §3, BRANDBOOK.md §5) */

:root {
  --bg: #0E0B09;
  --surface: #171210;
  --coal: #241A15;
  --ember: #E4572E;
  --flame: #FF7A3D;
  --gold: #C89B5A;
  --ash: #EDE6DA;
  --ash-dim: #A89B8C;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, monospace;

  --space: clamp(96px, 12vw, 176px);
  --gutter: clamp(20px, 4vw, 56px);
}

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

html { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--ash);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a { color: inherit; }

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

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

/* ------- утилиты ------- */

.dict-card {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--gold);
  border: 1px solid var(--coal);
  padding: 10px 16px;
  display: inline-block;
  width: fit-content;
}
.dict-card em { font-style: normal; color: var(--ash-dim); }

.sec-head { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.sec-head--pad { padding-top: var(--space); }
.sec-head__no {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash-dim);
  margin-bottom: 20px;
}
.sec-head__title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-weight: 520;
  font-size: clamp(2.2rem, 5.2vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 18ch;
}
.sec-head__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-top: 18px;
}

.ph { position: relative; overflow: hidden; }
.ph img {
  position: absolute;
  inset: -8% 0;
  width: 100%;
  height: 116%;
  object-fit: cover;
}
.ph--tall { aspect-ratio: 4 / 5; }
.ph--wide { aspect-ratio: 16 / 10; }
.txingar__grid .ph--wide { aspect-ratio: 4 / 5; }
.ph__cap {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash);
  background: rgba(14, 11, 9, 0.72);
  padding: 6px 10px;
}

/* стартовые скрытия ставит ТОЛЬКО JS после проверки libs (html.jsr):
   CDN умер → jsr не появится → сайт статично виден */
html.jsr [data-reveal] { opacity: 0; }
html.jsr .ph, html.jsr .dish__ph, html.jsr .errauts__ph { clip-path: inset(8% 5% 8% 5%); }
html.jsr .dish { opacity: 0; }
html.jsr [data-scrub-words] .word { opacity: 0.18; }

/* heat-haze на hero-слове: только desktop + не reduce (класс heat ставит JS) */
html.heat [data-heat] { filter: url(#heat); }

/* burn-переход: огонь выедает низ hero при скролле (JS + WebGL, слои выше контента) */
.hero__burn {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  height: 92vh;
  z-index: 3;
  pointer-events: none;
}

/* тлеющий след курсора (desktop, JS) */
.ember-trail {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* ------- scroll-ember (прогресс, desktop) ------- */

.scroll-ember {
  position: fixed;
  left: 22px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--coal);
  z-index: 40;
  pointer-events: none;
  opacity: 0;
}
html.jsr .scroll-ember { opacity: 1; }
.scroll-ember__head {
  position: absolute;
  top: 0;
  left: -1.5px;
  width: 4px;
  height: 56px;
  border-radius: 4px;
  background: linear-gradient(to bottom, var(--flame), rgba(228, 87, 46, 0));
}

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

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--gutter);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease;
}
.nav.is-solid { background: var(--bg); border-color: var(--coal); }
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.nav__mark { width: 40px; height: 40px; }
.nav__word {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.22em;
  color: var(--ash);
}
.nav__cta {
  position: relative;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ash);
  padding: 12px 2px;
}
.nav__cta::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 8px;
  height: 1px;
  width: 100%;
  background: var(--ember);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}
.nav__cta:hover::after,
.nav__cta:focus-visible::after { transform: scaleX(1); }

/* ------- hero ------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: clip;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(14, 11, 9, 0.6) 0%, rgba(14, 11, 9, 0) 24%,
    rgba(14, 11, 9, 0) 52%, rgba(14, 11, 9, 0.78) 86%, rgba(14, 11, 9, 0.9) 100%);
}
.hero__photo {
  position: absolute;
  inset: -9% 0 0 0;
  width: 100%;
  height: 118%;
  object-fit: cover;
  object-position: center bottom;
}
.hero__embers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(64px, 9vh, 110px);
}
.hero__title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-weight: 540;
  font-size: clamp(5.5rem, 22vw, 19rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin: 22px 0 18px;
}
.hero__tag {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60;
  font-weight: 460;
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  color: var(--ash);
}
.hero__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash-dim);
  margin-top: 26px;
}
.hero__scroll {
  position: absolute;
  right: var(--gutter);
  bottom: 28px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.hero__scroll-line {
  width: 1px;
  height: 64px;
  background: var(--coal);
  position: relative;
  overflow: hidden;
}
.hero__scroll-line::after {
  content: "";
  position: absolute;
  left: 0;
  top: -40%;
  width: 100%;
  height: 40%;
  background: var(--ember);
  animation: ember-drip 2.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
.hero__scroll-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ash-dim);
  writing-mode: vertical-rl;
}
@keyframes eguzki-spin { to { transform: rotate(360deg); } }
@keyframes ember-drip {
  0% { top: -40%; }
  70%, 100% { top: 110%; }
}

/* ------- manifest ------- */

.manifest {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space) var(--gutter);
}
.manifest__dict { margin-bottom: 34px; }
.manifest__line { display: block; }
.manifest__title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-weight: 500;
  font-size: clamp(2.4rem, 6.4vw, 5.6rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
  max-width: 16ch;
}
.manifest__copy {
  margin-top: 44px;
  display: grid;
  gap: 14px;
  max-width: 52ch;
  color: var(--ash-dim);
}

/* ------- txingar ------- */

.txingar { padding: var(--space) 0; border-top: 1px solid var(--coal); }
.txingar__dict { margin: 34px var(--gutter) 0; max-width: 1200px; }
.txingar__grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 44px var(--gutter) 0;
  display: grid;
  grid-template-columns: 5fr 4fr 3.4fr;
  gap: clamp(18px, 2.5vw, 36px);
  align-items: center;
}
.txingar__body { padding-bottom: 8px; }
.txingar__lead {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 90;
  font-weight: 470;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.35;
  margin-bottom: 26px;
}
.txingar__spec {
  font-family: var(--font-mono);
  margin-bottom: 26px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.txingar__spec .spec__temp {
  color: var(--ember);
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
}
.txingar__spec .spec__word {
  color: var(--ash-dim);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.txingar__body > p:last-child { color: var(--ash-dim); max-width: 38ch; }

/* ------- gar (menu) ------- */

.gar { border-top: 1px solid var(--coal); padding-bottom: var(--space); }
.gar .sec-head { padding-top: var(--space); }
.menu { margin-top: 54px; overflow: clip; }
.menu__track {
  list-style: none;
  display: flex;
  gap: clamp(18px, 2.5vw, 40px);
  padding: 0 var(--gutter);
  width: max-content;
}
.dish { width: clamp(240px, 24vw, 340px); flex: none; }
.dish__ph {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  margin-bottom: 16px;
}
.dish__ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.8) brightness(0.94);
  transition: filter 0.7s ease;
}
.dish:hover .dish__ph img,
.dish:focus-within .dish__ph img { filter: none; }
.dish__act {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.dish__name {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60;
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.2;
}
.dish.is-active .dish__ph img { filter: none; }
.dish.is-active .dish__act { color: var(--ember); }
.dish__spec {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ash-dim);
  margin-top: 6px;
}

/* ------- errauts ------- */

.errauts { border-top: 1px solid var(--coal); }
.errauts__ph {
  aspect-ratio: 21 / 9;
  overflow: hidden;
}
.errauts__ph img { width: 100%; height: 118%; object-fit: cover; }
.errauts__body {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space) var(--gutter) 0;
}
.errauts__dict { margin-top: 30px; }
.errauts__lead {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 90;
  font-weight: 470;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.35;
  max-width: 40ch;
  margin-top: 34px;
}
.errauts__last {
  margin-top: 20px;
  color: var(--ash-dim);
  max-width: 44ch;
}

/* ------- sutegi ------- */

.sutegi { padding: var(--space) 0; border-top: 1px solid var(--coal); }
.sutegi__dict { margin: 30px var(--gutter) 0; max-width: 1200px; }
.sutegi__grid {
  max-width: 1200px;
  margin: 44px auto 0;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(18px, 2.5vw, 36px);
  align-items: start;
}
.sutegi__grid .ph:first-child { aspect-ratio: 16 / 11; }
.sutegi__grid .ph:last-child { aspect-ratio: 4 / 5; margin-top: clamp(24px, 4vw, 64px); }
.sutegi__txoko {
  max-width: 1200px;
  margin: 44px auto 0;
  padding: 0 var(--gutter);
  font-family: var(--font-display);
  font-variation-settings: "opsz" 90;
  font-weight: 470;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.35;
  color: var(--ash-dim);
  max-width: 52ch;
}

/* ------- reserve (единственный loud-момент) ------- */

.reserve {
  background: var(--ember);
  color: var(--bg);
  border-top: 1px solid var(--flame);
}
.reserve__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(72px, 9vw, 120px) var(--gutter);
}
.reserve__welcome {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-weight: 540;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.reserve__line {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60;
  font-weight: 470;
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  margin-top: 14px;
}
.reserve__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 44px;
}
.reserve__note {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 30px;
  opacity: 0.78;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 30px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  overflow: hidden;
}
.btn--solid {
  background: var(--bg);
  color: var(--ash);
}
.btn--solid::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--flame);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}
.btn--solid:hover::before,
.btn--solid:focus-visible::before { transform: scaleX(1); }
.btn--solid > * { position: relative; z-index: 1; }
.btn--ghost {
  border: 1px solid var(--bg);
  color: var(--bg);
  transition: background 0.3s ease, color 0.3s ease;
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  background: var(--bg);
  color: var(--ember);
}

/* ------- footer ------- */

.footer {
  position: relative;
  border-top: 1px solid var(--coal);
  padding: clamp(80px, 10vw, 140px) 0 0;
  overflow: clip;
}
.footer__eguzki {
  animation: eguzki-spin 90s linear infinite;
  position: absolute;
  right: -120px;
  top: -60px;
  width: 480px;
  height: 480px;
  color: var(--coal);
  pointer-events: none;
}
.footer__inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter) 44px;
}
.footer__mark { width: 56px; height: 56px; margin-bottom: 40px; }
.footer__statement {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-weight: 510;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ash);
}
.footer__meta {
  margin-top: 54px;
  padding-top: 22px;
  border-top: 1px solid var(--coal);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ash-dim);
}
.footer__legend {
  width: 100%;
  max-width: 52ch;
  color: var(--gold);
}

/* ------- night (one fire, one night) ------- */

.night { padding: var(--space) 0; border-top: 1px solid var(--coal); }
.night__dict { margin: 30px var(--gutter) 0; max-width: 1200px; }
.night__list {
  list-style: none;
  max-width: 1200px;
  margin: 56px auto 0;
  padding: 0 var(--gutter);
  position: relative;
}
.night__list::before {
  /* линия тления — фирменный элемент (BRANDBOOK §7.3) */
  content: "";
  position: absolute;
  left: calc(var(--gutter) + 90px);
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--coal);
}
.night__row {
  position: relative;
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: baseline;
  padding: 26px 0;
}
.night__row + .night__row { border-top: 1px solid rgba(36, 26, 21, 0.55); }
.night__row::after {
  content: "";
  position: absolute;
  left: calc(90px - 3px);
  top: 34px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 10px rgba(255, 122, 61, 0.45);
}
.night__time {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-align: right;
}
.night__time--dawn { color: var(--ember); }
.night__row.is-active .night__time { color: var(--ember); }
.night__row.is-active .night__text { color: var(--ash); }
.night__text {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60;
  font-weight: 470;
  font-size: clamp(1.15rem, 1.9vw, 1.55rem);
  line-height: 1.35;
  max-width: 46ch;
  color: var(--ash-dim);
  transition: color 0.5s ease;
}
.night__time { transition: color 0.5s ease; }

/* ------- stats (the house in numbers, inspo stat:row) ------- */

.stats { border-top: 1px solid var(--coal); }
.stats__row {
  list-style: none;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(56px, 7vw, 96px) var(--gutter);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px clamp(20px, 3vw, 48px);
}
.stat { position: relative; }
.stat + .stat::before {
  content: "";
  position: absolute;
  left: calc(-1 * clamp(10px, 1.5vw, 24px));
  top: 8%;
  bottom: 8%;
  width: 1px;
  background: var(--coal);
}
.stat__value {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-weight: 510;
  font-size: clamp(2.6rem, 5.6vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ash);
}
.stat__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash-dim);
  margin-top: 14px;
  max-width: 20ch;
}

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

@media (max-width: 900px) {
  .scroll-ember { display: none; }
  .txingar__grid { grid-template-columns: 1fr 1fr; }
  .txingar__body { grid-column: 1 / -1; order: -1; }
  .sutegi__grid { grid-template-columns: 1fr; }
  .sutegi__grid .ph:last-child { margin-top: 0; }
  .errauts__ph { aspect-ratio: 4 / 3; }
}

@media (max-width: 768px) {
  body { font-size: 16px; }
  .hero__scroll { display: none; }
  .menu {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .menu__track { width: auto; }
  .dish {
    width: min(78vw, 320px);
    scroll-snap-align: center;
  }
  .menu__track li:last-child { margin-right: var(--gutter); }
  .txingar__grid { grid-template-columns: 1fr; }
  .footer__meta { flex-direction: column; }
  .stats__row { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3)::before { display: none; }
  .night__list::before {
  /* линия тления — фирменный элемент (BRANDBOOK §7.3) */ left: calc(var(--gutter) + 62px); }
  .night__list::before { left: calc(var(--gutter) + 78px); }
  .night__row { grid-template-columns: 66px 1fr; gap: 20px; }
  .night__row::after { left: calc(78px - 3px); }
  .night__time { font-size: 12px; white-space: nowrap; }
}

/* ------- reduced motion ------- */

@media (prefers-reduced-motion: reduce) {
  .footer__eguzki { animation: none; }
  .hero__scroll-line::after { animation: none; }
  .hero__photo { filter: none; }
  .dish__ph img,
  .btn--solid::before,
  .nav__cta::after { transition: none; }
}
