/* ─────────────────────────────────────────────────────────────
   Вечер — страница кейса «Вечер одного проекта»
   Слой поверх vecher.css. Только то, что специфично для кейса.
   Небо, шапка, кнопки, токены — наследуются из vecher.css.
   ───────────────────────────────────────────────────────────── */

/* Прокрутка-якорь с учётом фикс-шапки */
html{ scroll-behavior: smooth; }

/* Контейнер кейса лежит поверх .page-sky (z-index:-1) */
.case-page{
  position: relative;
  z-index: 1;
}

/* ─────────────────────────────────────────────────────────────
   НЕБО КЕЙСА — сцена, а не обои главной.
   «Час кейса»: оттенок заката/засвета — токены на <html>.
   Gerwin = поздний янтарный дюск.
   ───────────────────────────────────────────────────────────── */
html{
  --case-dusk-hue: 46;   /* тёплый оттенок заката (зарево горизонта)  */
  --case-glow-hue: 60;   /* тон засвета-прожектора (янтарь)           */
}

/* Закат без буквального диска — только зарево у горизонта */
.page-sky .sky-sun{ display: none !important; }

/* Распределение стопов: тёплый янтарь сверху (за шапкой на обложке),
   розово-фиолетовый мост, глубокий синий снизу. JS ставит --sky-c1..c4.
   Верхний стоп темнеет ОЧЕНЬ быстро при скролле (~100px → ночь). */
.page-sky .sky-bg{
  background: linear-gradient(180deg,
    var(--sky-c1) 0%,
    var(--sky-c2) 30%,
    var(--sky-c3) 60%,
    var(--sky-c4) 100%) !important;
}

/* Полоса .sky-horizon была пришпилена к top:0 и давала янтарь
   за шапкой — убираем, теперь тепло несёт сам градиент. */
.page-sky .sky-horizon{ display: none !important; }

/* Засвет-прожектор убран */
.page-sky .sky-glow{ display: none !important; }

/* ─── ЗАРЕВО РАССВЕТА (финал) ───
   Тёплое свечение, привязанное к НИЖНЕЙ кромке вьюпорта. Разгорается
   только на последнем отрезке скролла (JS гонит --dawn-op) — «ночь
   начинает таять, у горизонта занимается рассвет». Тон — мягкий
   розово-золотой (прохладнее янтаря заката, ближе к утру). */
.page-sky .sky-dawn{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 70vh;
  pointer-events: none;
  opacity: var(--dawn-op, 0);
  background:
    /* раскалённое золотое ядро у самого горизонта */
    radial-gradient(150% 70% at 50% 118%,
      oklch(0.92 0.155 78 / .98) 0%,
      oklch(0.82 0.190 56 / .82) 18%,
      oklch(0.70 0.205 38 / .50) 38%,
      oklch(0.56 0.165 20 / .20) 58%,
      transparent 78%),
    /* широкий тёплый подъём снизу — оранж→коралл */
    linear-gradient(to top,
      oklch(0.74 0.180 48 / .80) 0%,
      oklch(0.62 0.165 32 / .42) 30%,
      oklch(0.50 0.130 18 / .16) 58%,
      transparent 100%);
  mix-blend-mode: screen;
}

/* ─── Шапка на тёмной сцене кейса ───
   Тема даёт светло-тёплую плашку (hue 80 + saturate 160%), которая на
   ночном фоне светится оранжевым. Кейс всегда тёмный — плашку делаем
   тёмной/нейтральной, без усиления теплоты. */
body[data-palette="dusk"] .site-header.is-scrolled,
body[data-palette="dusk"] .site-header.is-always-glass{
  background: oklch(0.10 0.04 282 / .30) !important;
  color: var(--on-night) !important;
  -webkit-backdrop-filter: blur(14px) saturate(105%) !important;
          backdrop-filter: blur(14px) saturate(105%) !important;
  border-bottom-color: oklch(0.97 0.02 80 / .08) !important;
}
body[data-palette="dusk"] .site-header.is-scrolled .logo-text,
body[data-palette="dusk"] .site-header.is-always-glass .logo-text{
  fill: oklch(0.97 0.02 80);
}

/* ─── Звёздный ховер на «Написать нам →» в финале (.btn--light) ─── */
.btn.btn--light{
  position: relative;
  overflow: hidden;
  transition:
    background 1.4s cubic-bezier(.22, .61, .36, 1),
    color      1.4s cubic-bezier(.22, .61, .36, 1),
    border-color 1.4s cubic-bezier(.22, .61, .36, 1) !important;
}
.btn.btn--light > *:not(.btn-stars){
  position: relative;
  z-index: 2;
}
.btn.btn--light:hover{
  background: oklch(0.20 0.07 265) !important;
  color: var(--on-night) !important;
  border-color: oklch(0.20 0.07 265) !important;
}
.btn.btn--light:hover .btn-stars{ opacity: 1; }

/* ─── Убираем звёздный ховер с .nav-cta шапки ─── */
.site-header .nav-cta{ position: static; overflow: visible; }
.site-header .nav-cta:hover{
  background: var(--on-night) !important;
  color: var(--night) !important;
  border-color: var(--on-night) !important;
}

/* ─── Общая обёртка чтения ─── */
.case-wrap{
  width: min(1180px, 100% - 48px);
  margin-inline: auto;
}
.case-measure{ max-width: 760px; }

/* ─── Скрим за актом: лёгкое затемнение неба под текстом ───
   Не карточка — мягкое радиальное «дыхание» темноты, чтобы
   кремовый текст читался на ярком закатном небе. Гасим на
   ночных актах, где небо и так тёмное. */
.act{
  position: relative;
  padding-block: clamp(96px, 13vh, 168px);
}
.act > .case-wrap{ position: relative; z-index: 2; }
.act-scrim{
  position: absolute; inset: 0;
  z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 80% at 30% 40%,
      oklch(0.12 0.04 285 / var(--scrim, .26)) 0%,
      transparent 62%);
  opacity: 1;
  transition: opacity .6s ease;
}

/* ─── Акт-метка (моно номер + название) ─── */
.act-tag{
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--on-night);
  opacity: .72;
  margin-bottom: 30px;
}
.act-tag::before{
  content: "";
  width: 30px; height: 1px;
  background: currentColor; opacity: .6;
}
.act-tag .num{ color: var(--accent, oklch(0.86 0.16 78)); opacity: 1; }

/* ═══════════════ АКТ 0 · ОБЛОЖКА ═══════════════ */
.cover{
  min-height: 100svh;
  padding-top: clamp(120px, 18vh, 220px);
  padding-bottom: clamp(56px, 8vh, 96px);
  display: flex; flex-direction: column;
  justify-content: space-between;
}
.cover-top{ }
.cover-back{
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--on-night); opacity: .7;
  margin-bottom: clamp(40px, 8vh, 92px);
  transition: opacity .2s ease, gap .2s ease;
}
.cover-back:hover{ opacity: 1; gap: 13px; }
.cover-eyebrow{
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent, oklch(0.88 0.15 80));
  margin-bottom: 22px;
}
.cover h1{
  font-family: var(--font-h1);
  font-weight: 700;
  font-size: clamp(40px, 6.4vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  max-width: 16ch;
  margin: 0 0 28px;
  color: var(--on-night);
  text-shadow: 0 2px 48px oklch(0.10 0.04 285 / .35);
  text-wrap: balance;
}
.cover-sub{
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.5;
  max-width: 80ch;
  color: var(--on-night); opacity: .9;
  margin: 0;
}

/* Мета-полоса под героем */
.cover-meta{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: clamp(44px, 7vh, 80px);
  border-top: 1px solid oklch(0.97 0.02 80 / .22);
  border-bottom: 1px solid oklch(0.97 0.02 80 / .22);
  background: oklch(0.97 0.02 80 / .1);
}
.cover-meta .cell{
  padding: 40px 36px;
  background: transparent;
}
.cover-meta .k{
  display: block;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--on-night); opacity: .6;
  margin-bottom: 9px;
}
.cover-meta .v{
  display: block;
  font-family: var(--font-h2);
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: 600;
  color: var(--on-night);
  letter-spacing: -0.01em;
}

/* Скролл-подсказка */
.cover-cue{
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--on-night); opacity: .66;
  margin-top: 36px;
}
.cover-cue .dot{
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent, oklch(0.86 0.16 78));
  box-shadow: 0 0 12px var(--accent, oklch(0.86 0.16 78));
  animation: cuePulse 2.4s ease-in-out infinite;
}
@keyframes cuePulse{
  0%,100%{ opacity: .4; transform: scale(.8); }
  50%{ opacity: 1; transform: scale(1.15); }
}

/* Обложка-изображение (большая, ниже героя) */
.cover-shot{
  position: relative;
  margin-top: clamp(48px, 8vh, 104px);
}
/* (старое правило .cover-shot img удалено — обложку заменил интерактивный
   виджет; логотип внутри него размерится своим .gv-real-logo) */

/* ═══════════════ АКТ 1 · БРИФ ═══════════════ */
.brief-lede{
  font-family: var(--font-h2);
  font-weight: 600;
  font-size: clamp(26px, 3.4vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--on-night);
  max-width: 34ch;
  margin: 0 0 8px;
  text-wrap: balance;
}
.brief-grid{
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  margin-top: clamp(40px, 6vh, 72px);
  align-items: start;
}
.brief-body p{
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.65;
  color: var(--on-night); opacity: .9;
  margin: 0 0 20px;
  max-width: 56ch;
}
.brief-aside{
  border-left: 1px solid oklch(0.97 0.02 80 / .24);
  padding-left: 26px;
}
.brief-aside .label{
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--on-night); opacity: .6;
  margin-bottom: 14px;
}
.brief-aside ul{ list-style: none; margin: 0; padding: 0; }
.brief-aside li{
  font-size: 15px; line-height: 1.5;
  color: var(--on-night); opacity: .9;
  padding: 13px 0;
  border-bottom: 1px solid oklch(0.97 0.02 80 / .12);
}
.brief-aside li:last-child{ border-bottom: 0; }

/* Большая выносная цитата задачи */
.pullquote{
  margin: clamp(40px, 7vh, 80px) 0 0;
  padding-left: clamp(20px, 3vw, 44px);
  border-left: 3px solid var(--accent, oklch(0.86 0.16 78));
}
.pullquote p{
  font-family: var(--font-h1);
  font-weight: 600;
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--on-night);
  margin: 0;
  text-wrap: balance;
}

/* ═══════════════ АКТ 2 · РАБОТА ═══════════════ */
.work-head{ margin-bottom: clamp(44px, 7vh, 80px); }
.work-head h2{
  font-family: var(--font-h1);
  font-weight: 700;
  font-size: clamp(30px, 4.4vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--on-night);
  margin: 0;
  max-width: 28ch;
  text-wrap: balance;
}
.steps{ display: grid; gap: 1px; background: oklch(0.97 0.02 80 / .14); border-block: 1px solid oklch(0.97 0.02 80 / .14); }
.step{
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  grid-template-rows: auto auto;
  gap: 0 clamp(24px, 3vw, 48px);
  padding: clamp(36px, 5vh, 56px) clamp(28px, 3vw, 48px);
  background: transparent;
  align-items: start;
}
.step-num{
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 700;
  letter-spacing: .08em;
  color: var(--accent, oklch(0.86 0.16 78));
  grid-column: 1;
  grid-row: 1;
  margin-bottom: 12px;
}
.step-main{
  grid-column: 1;
  grid-row: 2;
}
.step-main h3{
  font-family: var(--font-h2);
  font-weight: 600;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--on-night);
  margin: 0 0 14px;
}
.step-main p{
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.6;
  color: var(--on-night); opacity: .88;
  margin: 0;
}
.step-aside{
  font-size: 14px; line-height: 1.55;
  color: var(--on-night); opacity: .72;
  grid-column: 2;
  grid-row: 2;
  padding-top: 0;
  align-self: start;
}
.step-aside .insight{
  display: block;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--on-night); opacity: .55;
  margin-bottom: 10px;
}

/* ═══════════════ АКТ 3 · РЕЗУЛЬТАТ + СОЗВЕЗДИЕ ═══════════════ */
.result{ text-align: center; }
.result-head h2{
  font-family: var(--font-h1);
  font-weight: 700;
  font-size: clamp(30px, 4.6vw, 64px);
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--on-night);
  margin: 0 auto 14px;
  max-width: 22ch;
  text-wrap: balance;
}
.result-head p{
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.55;
  color: var(--on-night); opacity: .82;
  max-width: 48ch; margin: 0 auto;
}

/* Созвездие */
.constellation{
  position: relative;
  width: min(940px, 100%);
  margin: clamp(48px, 8vh, 96px) auto 0;
  aspect-ratio: 16 / 9;
}
.constellation svg{ position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cn-line{
  stroke: var(--accent, oklch(0.86 0.16 78));
  stroke-width: 1;
  opacity: 0;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: opacity .6s ease, stroke-dashoffset 1.1s ease;
}
.is-lit .cn-line{ opacity: .42; stroke-dashoffset: 0; }

/* Узлы-звёзды (HTML поверх svg для текста) */
.cn-node{
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  opacity: 0;
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.3,1);
}
.is-lit .cn-node{ opacity: 1; }
.cn-node .dot{
  width: 10px; height: 10px; border-radius: 50%;
  margin: 0 auto 16px;
  background: #fff;
  box-shadow: 0 0 8px #fff, 0 0 22px var(--accent, oklch(0.86 0.16 78));
  animation: cnTwinkle var(--tw, 3s) ease-in-out infinite;
}
.cn-node.is-hero .dot{
  width: 18px; height: 18px;
  box-shadow: 0 0 14px #fff, 0 0 40px var(--accent, oklch(0.86 0.16 78)), 0 0 70px var(--accent, oklch(0.86 0.16 78));
}
@keyframes cnTwinkle{
  0%,100%{ opacity: .65; transform: scale(.9); }
  50%{ opacity: 1; transform: scale(1.12); }
}
.cn-node .val{
  display: block;
  font-family: var(--font-h1);
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--on-night);
}
.cn-node.is-hero .val{
  font-size: clamp(46px, 6vw, 88px);
  text-shadow: 0 0 60px var(--accent, oklch(0.86 0.16 78 / .6));
}
.cn-node .cap{
  display: block;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--on-night); opacity: .68;
  margin-top: 10px;
}

/* Fallback / упрощённый финал: цифры в ряд */
.metrics-row{
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 3vw, 48px);
  margin: clamp(48px, 8vh, 88px) auto 0;
  width: min(1000px, 100%);
}
.metric{ text-align: center; }
.metric .val{
  display: block;
  font-family: var(--font-h1);
  font-weight: 700;
  font-size: clamp(34px, 4.4vw, 62px);
  line-height: 1; letter-spacing: -0.03em;
  color: var(--on-night);
}
.metric.is-hero .val{ color: var(--accent, oklch(0.88 0.16 80)); }
.metric .cap{
  display: block;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--on-night); opacity: .66;
  margin-top: 12px;
}

/* Переключение финала через Tweaks */
html[data-finale="plain"] .constellation{ display: none; }
html[data-finale="plain"] .metrics-row{ display: grid; }

/* ═══════════════ АКТ 4 · ФИНАЛ ═══════════════ */
.finale{ text-align: center; padding-bottom: clamp(80px, 12vh, 140px); }
.finale h2{
  font-family: var(--font-h1);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 72px);
  line-height: 1.0; letter-spacing: -0.03em;
  color: var(--on-night);
  margin: 0 auto 30px; max-width: 16ch;
  text-wrap: balance;
}
.finale-actions{
  display: inline-flex; flex-wrap: wrap; gap: 14px; justify-content: center;
}
.next-case{
  margin-top: clamp(64px, 10vh, 120px);
  padding-top: clamp(32px, 5vh, 52px);
  border-top: 1px solid oklch(0.97 0.02 80 / .16);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; text-align: left;
}
.next-case .label{
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--on-night); opacity: .6;
  margin-bottom: 12px;
}
.next-case .title{
  font-family: var(--font-h1);
  font-weight: 700;
  font-size: clamp(22px, 3vw, 40px);
  line-height: 1.05; letter-spacing: -0.02em;
  color: var(--on-night);
  text-wrap: balance;
}
.next-case a.arrow-big{
  font-family: var(--font-h2);
  font-size: clamp(30px, 4vw, 52px);
  color: var(--on-night); opacity: .8;
  transition: transform .25s ease, opacity .25s ease;
  flex-shrink: 0;
}
.next-case:hover a.arrow-big{ transform: translateX(8px); opacity: 1; }

/* Маркер «текст-рыба» — мягкая подсказка под замену */
.placeholder-note{
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent, oklch(0.86 0.16 78));
  opacity: .8;
  border: 1px dashed oklch(0.86 0.16 78 / .5);
  border-radius: 3px;
  padding: 3px 8px;
  margin-bottom: 18px;
}

/* ─── Появление актов ─── */
.act .case-wrap > *{ }
.reveal{ opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.3,1); }
.is-in .reveal, .reveal.is-in{ opacity: 1; transform: none; }
.is-in .reveal:nth-child(2){ transition-delay: .08s; }
.is-in .reveal:nth-child(3){ transition-delay: .16s; }

/* ─── Адаптив ─── */
@media (max-width: 860px){
  .brief-grid{ grid-template-columns: 1fr; }
  .step{ grid-template-columns: 56px 1fr; }
  .step-aside{ grid-column: 2; border-top: 1px solid oklch(0.97 0.02 80 / .12); padding-top: 16px; margin-top: 4px; }
  .cover-meta{ grid-template-columns: repeat(2, 1fr); }
  .cover-meta .cell:nth-child(-n+2){ border-bottom: 1px solid oklch(0.97 0.02 80 / .14); }
  .next-case{ flex-direction: column; align-items: flex-start; }
  .metrics-row{ grid-template-columns: repeat(2, 1fr); row-gap: 36px; }
}
@media (max-width: 520px){
  .cover-meta{ grid-template-columns: 1fr; }
  .cover-meta .cell{ border-bottom: 1px solid oklch(0.97 0.02 80 / .12); }
  .metrics-row{ grid-template-columns: 1fr; }
}

/* ─── Ручной тумблер движения (Tweaks) ─── */
html.no-motion *, html.no-motion *::before, html.no-motion *::after{ animation: none !important; }
html.no-motion .reveal{ opacity: 1 !important; transform: none !important; transition: none !important; }
html.no-motion .cn-node, html.no-motion .cn-line{ opacity: 1 !important; transform: translate(-50%,-50%); }
html.no-motion .cn-line{ stroke-dashoffset: 0 !important; }

/* ─── Доступность ─── */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation: none !important; }
  .reveal{ opacity: 1 !important; transform: none !important; }
  html{ scroll-behavior: auto; }
  .cn-node, .cn-line{ opacity: 1 !important; transform: translate(-50%,-50%) !important; }
  .cn-line{ stroke-dashoffset: 0 !important; }
}
