/*
  NEORGANIKI 2.0 — «Лес, который слушает».
  Ложится поверх style.css: переопределяет токены и добавляет главы
  лендинга, чат, консоль Хранителя и аналитику админки.

  Современные возможности, у всех есть запасной путь:
  - @view-transition — плавная смена страниц без SPA;
  - animation-timeline: view() — появление по прокрутке силами CSS;
  - @property — анимируемые градиенты на кнопках;
  - color-mix(), :has(), container queries, text-wrap: balance;
  - WebGL-глубина пейзажей (nova.js) поверх обычных <img>.
*/

/* ── Токены ─────────────────────────────────────────────────── */

:root {
  --void: #05080a;
  --abyss: #081011;
  --carbon: #0d1617;
  --line: rgba(160, 220, 200, 0.12);
  --line-strong: rgba(160, 220, 200, 0.22);

  --emerald-deep: #0b3d2e;
  --emerald-core: #17805a;
  --emerald-glow: #3ef0a6;
  --emerald-mist: #8fd8bb;

  --ruby-deep: #4a0510;
  --ruby-core: #c8102e;
  --ruby-glow: #a8142c;
  --ruby-heat: #ff7a4a;
  --amber: #ffb347;

  --ash: #93a29c;
  --bone: #ece7de;
  --moon: #c9dbe0;

  --glass: rgba(10, 20, 21, 0.55);
  --glass-strong: rgba(8, 16, 17, 0.78);
  --glass-edge: rgba(200, 255, 235, 0.14);

  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Manrope', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-silk: cubic-bezier(0.65, 0, 0.35, 1);
  --radius: 1.25rem;
}

@property --spin {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

@property --heat {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}

/* Плавная смена страниц — кросс-документные View Transitions */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: vt-out 0.45s var(--ease-silk) both;
}

::view-transition-new(root) {
  animation: vt-in 0.6s var(--ease-out) both;
}

@keyframes vt-out {
  to { opacity: 0; filter: blur(8px); transform: scale(0.985); }
}

@keyframes vt-in {
  from { opacity: 0; filter: blur(10px); transform: scale(1.015); }
}

.header { view-transition-name: header; }

html {
  scroll-padding-top: 5rem;
}

body {
  font-family: var(--font-sans);
  font-size: 16.5px;
  letter-spacing: 0.005em;
  background:
    radial-gradient(120vw 80vh at 80% -10%, rgba(23, 128, 90, 0.12), transparent 60%),
    radial-gradient(90vw 70vh at -10% 110%, rgba(200, 16, 46, 0.09), transparent 60%),
    var(--void);
  background-attachment: fixed;
}

body::before {
  opacity: 0.05;
  mix-blend-mode: overlay;
}

h1, h2, h3, .chapter__title, .portal__title {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

a { color: inherit; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--ruby-core);
  border-radius: 999px;
  color: #fff;
}

.skip:focus { top: 1rem; }

:focus-visible {
  outline: 2px solid var(--emerald-glow);
  outline-offset: 3px;
  border-radius: 6px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--emerald-mist);
}

.kicker::before {
  content: '';
  width: 2.25rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor);
}

.glow-text {
  font-style: italic;
  color: var(--ruby-glow);
  background: linear-gradient(100deg, #e6c78a 0%, var(--ruby-glow) 35%, #e6c78a 60%, var(--ruby-heat) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 24px rgba(158, 18, 38, 0.45));
  animation: shimmer 6s linear infinite;
}

.glow-text--emerald {
  background-image: linear-gradient(100deg, #b6ffe0, var(--emerald-glow) 40%, #7fd9b8 70%, #b6ffe0);
  filter: drop-shadow(0 0 22px rgba(62, 240, 166, 0.35));
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.brandmark {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.8em;
  letter-spacing: 0.22em;
  color: var(--emerald-mist);
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--radius);
}

.surface {
  background: linear-gradient(160deg, rgba(14, 26, 27, 0.78), rgba(8, 14, 15, 0.82));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
}

/* ── Кнопки ─────────────────────────────────────────────────── */

.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: transform 0.5s var(--ease-out), box-shadow 0.4s, border-color 0.3s, color 0.3s, background 0.3s;
  will-change: transform;
}

.btn > span { position: relative; z-index: 1; }

.btn--xl { padding: 1.15rem 2.4rem; font-size: 0.74rem; }

.btn--ruby {
  border: 0;
  color: #fff;
  background:
    conic-gradient(from var(--spin), transparent 0 70%, rgba(255, 255, 255, 0.55) 80%, transparent 90%) border-box,
    linear-gradient(135deg, #8f1426, var(--ruby-core) 55%, #7a0a1d);
  box-shadow: 0 10px 40px -10px rgba(158, 18, 38, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: spin 5s linear infinite;
}

.btn--ruby::after {
  content: '';
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, #8f1426, var(--ruby-core) 55%, #7a0a1d);
}

.btn--ruby:hover { box-shadow: 0 14px 60px -8px rgba(158, 18, 38, 0.95); }

@keyframes spin {
  to { --spin: 360deg; }
}

.btn--glass,
.btn--ghost {
  color: var(--bone);
  background: rgba(10, 22, 22, 0.42);
  border: 1px solid var(--glass-edge);
  backdrop-filter: blur(12px);
}

.btn--glass::before,
.btn--ghost::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(120px circle at var(--mx, 50%) var(--my, 50%), rgba(62, 240, 166, 0.28), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn--glass:hover,
.btn--ghost:hover {
  border-color: rgba(62, 240, 166, 0.5);
  color: #fff;
}

.btn--glass:hover::before,
.btn--ghost:hover::before { opacity: 1; }

.linklike {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

/* ── Поля ───────────────────────────────────────────────────── */

.field {
  background: rgba(4, 10, 11, 0.6);
  border: 1px solid var(--line-strong);
  border-radius: 0.8rem;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.field:focus {
  border-color: var(--emerald-glow);
  box-shadow: 0 0 0 4px rgba(62, 240, 166, 0.12);
  background: rgba(4, 12, 13, 0.85);
}

/* ── Шапка ──────────────────────────────────────────────────── */

.header {
  transition: background 0.5s, border-color 0.5s, transform 0.5s var(--ease-out);
}

.header.is-scrolled {
  background: rgba(5, 10, 11, 0.62);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom-color: var(--line);
}

.header.is-hidden { transform: translateY(-100%); }

.nav a {
  position: relative;
  padding-block: 0.4rem;
}

.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--emerald-glow);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease-out);
}

.nav a:hover::after,
.nav a.is-current::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav a.is-current { color: var(--bone); }

.burger {
  display: grid;
  gap: 5px;
  place-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 16, 17, 0.4);
  font-size: 0;
}

.burger span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--bone);
  transition: transform 0.4s var(--ease-out);
}

.burger[aria-expanded='true'] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.burger[aria-expanded='true'] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

.mobile-menu {
  background: rgba(5, 10, 11, 0.92);
  backdrop-filter: blur(24px);
}

.mobile-menu a {
  font-family: var(--font-display);
  font-size: 1.9rem;
  text-transform: none;
  letter-spacing: 0;
}

.mobile-menu.is-open a {
  animation: menu-in 0.6s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(14px); }
}

/* ── Живой пейзаж ───────────────────────────────────────────── */

.scene {
  position: relative;
  overflow: hidden;
  background: #071012;
}

.scene picture,
.scene__img,
.scene canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene__img {
  object-fit: cover;
  transform: scale(1.06);
  transition: opacity 0.8s;
}

.scene canvas {
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
}

.scene.is-gl canvas { opacity: 1; }
.scene.is-gl .scene__img { opacity: 0; }

/* ── 0. Портал ──────────────────────────────────────────────── */

.portal {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto auto;
  overflow: hidden;
  isolation: isolate;
}

.portal__scene {
  position: absolute;
  inset: 0;
  z-index: -3;
}

.spores {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.portal__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(5, 8, 10, 0.55) 0%, transparent 22%, transparent 55%, rgba(5, 8, 10, 0.92) 100%),
    radial-gradient(90% 70% at 20% 60%, rgba(5, 8, 10, 0.72), transparent 70%);
  pointer-events: none;
}

.portal__content {
  align-self: end;
  padding-top: 8rem;
  padding-bottom: 3rem;
  max-width: 76rem;
}

.portal__title {
  max-width: 14ch;
  margin-top: 1.5rem;
  font-size: clamp(2.9rem, 7.6vw, 7.4rem);
  line-height: 0.95;
  color: var(--bone);
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.6);
}

.portal__lead {
  max-width: 38rem;
  margin-top: 1.75rem;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.75;
  color: rgba(236, 231, 222, 0.82);
}

.portal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
}

.portal__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1px;
  padding-bottom: 2.5rem;
}

.portal__stats > div {
  padding: 1.1rem 1.25rem;
  border-top: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(8, 16, 17, 0.38), transparent);
}

.portal__stats dt {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1;
  color: var(--bone);
}

.portal__stats dd {
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash);
}

.portal__whisper {
  position: absolute;
  left: 57%;
  top: 50%;
  z-index: 1;
  translate: 0 -50%;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 1.6vw, 1.4rem);
  letter-spacing: 0.3em;
  color: rgba(255, 200, 210, 0.9);
  text-shadow: 0 0 20px rgba(158, 18, 38, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s;
}

.portal__whisper.is-visible { opacity: 0.85; }

.portal__hint {
  position: absolute;
  right: 1.5rem;
  bottom: 2.5rem;
  display: none;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ash);
  writing-mode: vertical-rl;
}

.portal__hint span {
  width: 1px;
  height: 4rem;
  background: linear-gradient(var(--emerald-glow), transparent);
  animation: drip 2.4s var(--ease-silk) infinite;
}

@keyframes drip {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

@media (min-width: 1024px) {
  .portal__hint { display: flex; }
}

/* Появление первого экрана */
[data-rise] {
  animation: rise 1.4s var(--ease-out) both;
  animation-delay: 0.6s;
}

.portal__stats[data-rise] { animation-delay: 1.1s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(28px); filter: blur(6px); }
}

/* Заголовок по буквам (nova.js оборачивает слова и буквы) */
.split-word {
  display: inline-block;
  white-space: nowrap;
}

.split-char {
  display: inline-block;
  animation: char-in 1.1s var(--ease-out) both;
  animation-delay: calc(0.2s + var(--ci) * 22ms);
}

@keyframes char-in {
  from { opacity: 0; transform: translateY(0.6em) rotate(6deg); filter: blur(8px); }
}

.dawn .split-char { animation-play-state: paused; }
.dawn.is-in .split-char { animation-play-state: running; }

/* ── Бегущая строка ─────────────────────────────────────────── */

.ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: rgba(8, 14, 15, 0.7);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.ticker__track {
  display: flex;
  width: max-content;
  gap: 2.5rem;
  padding-block: 1.1rem;
  animation: marquee 42s linear infinite;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ash);
}

.ticker__track i { color: var(--ruby-glow); font-style: normal; }

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ── Главы ──────────────────────────────────────────────────── */

.chapter {
  position: relative;
  padding-block: clamp(6rem, 13vw, 11rem);
  isolation: isolate;
}

.chapter__head { max-width: 50rem; }

.chapter__title {
  margin-top: 1.5rem;
  font-size: clamp(2.3rem, 5.2vw, 4.6rem);
  line-height: 1.02;
}

.chapter__title em { font-weight: 500; }

.chapter__lead {
  margin-top: 1.5rem;
  max-width: 36rem;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ash);
}

.chapter__body {
  margin-top: 2rem;
  font-size: 1.04rem;
  line-height: 1.85;
  color: rgba(236, 231, 222, 0.78);
}

.chapter__backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.chapter__backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--void) 0%, rgba(5, 8, 10, 0.45) 22%, rgba(5, 8, 10, 0.55) 70%, var(--void) 100%);
}

/* Появление по прокрутке: CSS scroll-timeline, иначе — класс от JS */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out), filter 1.1s;
  filter: blur(4px);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

@supports (animation-timeline: view()) {
  .js .reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
    animation: reveal-view linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }

  @keyframes reveal-view {
    from { opacity: 0; transform: translateY(40px); filter: blur(5px); }
  }
}

.no-js .reveal { opacity: 1; transform: none; filter: none; }

/* ── 1. Манифест ────────────────────────────────────────────── */

.manifest {
  margin: clamp(3rem, 7vw, 6rem) 0 0;
  max-width: 64rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 3.25rem);
  line-height: 1.25;
  color: var(--bone);
}

.manifest .w {
  opacity: 0.14;
  transition: opacity 0.35s, color 0.35s, text-shadow 0.35s;
}

.manifest .w.is-lit { opacity: 1; }

.manifest .w.is-key.is-lit {
  color: #e6c78a;
  text-shadow: 0 0 22px rgba(158, 18, 38, 0.55);
}

.realms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.25rem;
  margin-top: clamp(4rem, 8vw, 7rem);
  perspective: 1200px;
}

.realm {
  position: relative;
  padding: 2.25rem 2rem 2.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(140% 90% at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    linear-gradient(160deg, rgba(13, 24, 25, 0.85), rgba(6, 11, 12, 0.9));
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease-out), border-color 0.4s;
  animation-delay: calc(var(--i) * 120ms);
}

.realm:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.realm__glyph {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  font-size: 1.3rem;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 0 18px color-mix(in srgb, var(--accent) 25%, transparent);
  transform: translateZ(40px);
}

.realm__num {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--ash);
}

.realm h3 {
  margin-top: 2rem;
  font-size: 1.75rem;
  transform: translateZ(28px);
}

.realm p {
  margin-top: 0.9rem;
  color: var(--ash);
  line-height: 1.75;
  transform: translateZ(14px);
}

.why { margin-top: clamp(4rem, 8vw, 7rem); }

.why__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 2.5rem 3rem;
  margin-top: 2rem;
}

.why__item {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-strong);
}

.why__item h3 {
  font-size: 1.6rem;
  font-style: italic;
  color: var(--moon);
}

.why__item p {
  margin-top: 0.8rem;
  color: var(--ash);
  line-height: 1.8;
}

/* ── 2. Сосуд ───────────────────────────────────────────────── */

.vessel {
  display: grid;
  gap: 3rem;
  width: min(100%, 86rem);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.vessel__stage {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: calc(var(--radius) * 1.6);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 40px 120px -40px rgba(158, 18, 38, 0.35);
}

.vessel__scene { position: absolute; inset: 0; }

.vessel__crystal {
  position: absolute;
  left: 50%;
  bottom: 6%;
  translate: -50% 0;
  width: 46%;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.6));
  opacity: 0;
  transition: opacity 0.8s;
}

/* Кристалл поверх фото нужен только если пейзаж не загрузился */
.vessel__stage:not(:has(.scene)) .vessel__crystal { opacity: 1; }

.vessel__text { align-self: center; max-width: 36rem; }

.spectro {
  margin-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.spectro__row {
  position: relative;
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: 1rem 0 1.2rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.spectro__row dt {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash);
  padding-top: 0.2rem;
}

.spectro__row dd { color: var(--bone); }

.spectro__bar {
  position: absolute;
  left: 10rem;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--ruby-core), var(--ruby-glow), var(--amber));
  transform: scaleX(calc(var(--v) / 100));
  transform-origin: left;
  box-shadow: 0 0 12px rgba(158, 18, 38, 0.6);
}

@supports (animation-timeline: view()) {
  .spectro__bar {
    animation: meter linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 40%;
  }

  @keyframes meter {
    from { transform: scaleX(0); }
  }
}

.vessel__text .btn { margin-top: 2.5rem; }

@media (min-width: 960px) {
  .vessel { grid-template-columns: 1.05fr 1fr; gap: 6rem; }
  .vessel__stage { aspect-ratio: auto; min-height: 44rem; }
}

/* ── 3. Кинозал ─────────────────────────────────────────────── */

.cinema {
  position: relative;
  width: min(100%, 86rem);
  margin: clamp(3rem, 7vw, 5rem) auto 0;
  padding-inline: 1.5rem;
}

.cinema__screen { display: none; }

.cinema__steps {
  list-style: none;
  display: grid;
  gap: 1.25rem;
}

.cinema__step {
  position: relative;
  padding: 2rem 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(13, 24, 25, 0.85), rgba(6, 11, 12, 0.9));
  overflow: hidden;
}

.cinema__num {
  font-family: var(--font-display);
  font-size: 3.5rem;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 30px color-mix(in srgb, var(--accent) 55%, transparent);
}

.cinema__tag {
  display: inline-block;
  margin-left: 1rem;
  vertical-align: 0.9rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.cinema__step h3 {
  margin-top: 1.25rem;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.cinema__step p {
  margin-top: 0.9rem;
  line-height: 1.85;
  color: rgba(236, 231, 222, 0.78);
}

.cinema__detail {
  padding-left: 1rem;
  border-left: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  font-size: 0.88rem;
  color: var(--ash) !important;
}

.cinema__mobile {
  height: 14rem;
  margin: 1.5rem -1.75rem -2rem;
}

@media (min-width: 960px) {
  .cinema {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 5rem;
  }

  .cinema__screen {
    position: sticky;
    top: 6rem;
    display: block;
    height: calc(100svh - 8rem);
    border-radius: calc(var(--radius) * 1.6);
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: 0 40px 140px -50px rgba(0, 0, 0, 0.9);
  }

  .cinema__frame {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.06);
    transition: opacity 1.1s var(--ease-silk), transform 1.6s var(--ease-out);
  }

  .cinema__frame .scene { position: absolute; inset: 0; }

  .cinema__frame.is-active { opacity: 1; transform: none; }

  .cinema__hud {
    position: absolute;
    left: 1.5rem;
    right: 1.5rem;
    bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--bone);
  }

  .cinema__counter b { font-weight: 500; color: var(--ruby-glow); }

  .cinema__progress {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
  }

  .cinema__progress i {
    display: block;
    height: 100%;
    background: var(--ruby-glow);
    transform-origin: left;
    transform: scaleX(var(--p, 0.2));
    transition: transform 0.6s var(--ease-out);
    box-shadow: 0 0 10px var(--ruby-glow);
  }

  .cinema__steps { gap: 0; padding-block: 18svh 30svh; }

  .cinema__step {
    min-height: 62svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0;
    border: 0;
    background: none;
    opacity: 0.22;
    filter: blur(1.5px);
    transition: opacity 0.7s, filter 0.7s;
  }

  .cinema__step.is-active { opacity: 1; filter: none; }

  .cinema__mobile { display: none; }
}

.promo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 5rem;
  padding: 2.25rem;
  border-radius: var(--radius);
  border: 1px solid rgba(62, 240, 166, 0.25);
  background: radial-gradient(120% 140% at 0% 0%, rgba(23, 128, 90, 0.22), transparent 60%), rgba(8, 16, 17, 0.7);
}

.promo p:not(.kicker) {
  margin-top: 0.75rem;
  max-width: 40rem;
  color: var(--ash);
}

/* ── 4. Путь: горизонтальная панорама ───────────────────────── */

.journey {
  position: relative;
  height: calc(100svh * 3.2);
}

.journey__sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.journey__head {
  position: relative;
  z-index: 2;
  padding-top: 6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 3rem;
}

.journey__head .chapter__title {
  max-width: 18ch;
  font-size: clamp(2rem, 4.2vw, 3.6rem);
}

.journey__day {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ash);
}

.journey__day b {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(3.5rem, 8vw, 7rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--bone);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 40px rgba(158, 18, 38, 0.35);
}

.journey__track {
  position: relative;
  width: calc(var(--stages) * 32rem + 20vw);
  height: 100%;
  will-change: transform;
}

.journey__scene {
  position: absolute;
  inset: 8% 0 8% 0;
  border-block: 1px solid var(--line);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.milestone {
  position: absolute;
  left: calc(10vw + var(--at) * 32rem);
  bottom: 12%;
  width: min(26rem, 78vw);
  padding: 1.5rem 1.5rem 1.75rem;
  border-radius: var(--radius);
  background: var(--glass-strong);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.8s var(--ease-out), box-shadow 0.8s, border-color 0.8s;
}

.milestone:nth-of-type(even) { bottom: auto; top: 12%; }

.milestone.is-active {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 0 60px -10px color-mix(in srgb, var(--accent) 60%, transparent);
}

.milestone__pin {
  position: absolute;
  left: 1.5rem;
  top: -0.45rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 20%, transparent), 0 0 24px var(--accent);
}

.milestone__days {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.milestone h3 { margin-top: 0.6rem; font-size: 1.75rem; }

.milestone p:last-child {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ash);
}

.journey__foot {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-bottom: 2rem;
}

.journey__foot p { max-width: 38rem; color: var(--ash); font-size: 0.95rem; }

/* Без JS и на телефонах без места — вертикальный список */
@media (max-width: 720px), (prefers-reduced-motion: reduce) {
  .journey { height: auto; }
  .journey__sticky { position: relative; height: auto; overflow: visible; }
  .journey__track { width: auto; height: auto; display: grid; gap: 1rem; padding: 2rem 1.5rem; transform: none !important; }
  .journey__scene { position: absolute; inset: 0; opacity: 0.35; mask-image: none; }
  .milestone { position: relative; left: auto; top: auto !important; bottom: auto !important; width: auto; }
}

.no-js .journey { height: auto; }
.no-js .journey__sticky { position: relative; height: auto; }
.no-js .journey__track { width: auto; display: grid; gap: 1rem; padding: 2rem 1.5rem; }
.no-js .milestone { position: relative; left: auto; top: auto; bottom: auto; width: auto; }

/* ── 5. Консоль Хранителя ───────────────────────────────────── */

.oracle {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 960px) {
  .oracle { grid-template-columns: 0.9fr 1.1fr; gap: 5rem; }
}

.console {
  position: relative;
  border-radius: calc(var(--radius) * 1.2);
  border: 1px solid rgba(62, 240, 166, 0.22);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(158, 18, 38, 0.12), transparent 55%),
    radial-gradient(100% 80% at 0% 100%, rgba(23, 128, 90, 0.18), transparent 55%),
    rgba(4, 9, 10, 0.88);
  box-shadow: 0 40px 120px -40px rgba(62, 240, 166, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
  overflow: hidden;
}

.console::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
}

.console__bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.66rem;
  color: var(--ash);
}

.console__bar i {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: #1f2b2a;
}

.console__bar i:first-child { background: var(--ruby-core); }
.console__bar span { margin-left: 0.6rem; letter-spacing: 0.1em; }

.console__state {
  margin-left: auto;
  font-weight: 400;
  color: var(--emerald-glow);
}

.console__state::before {
  content: '●';
  margin-right: 0.4rem;
  animation: pulse-heat 2s ease-in-out infinite;
}

.console__log {
  display: grid;
  gap: 1rem;
  min-height: 15rem;
  max-height: 26rem;
  overflow-y: auto;
  padding: 1.5rem 1.4rem;
  font-size: 0.86rem;
  line-height: 1.75;
  scrollbar-width: thin;
}

.console__line--user { color: var(--emerald-mist); }
.console__line--user::before { content: '› '; color: var(--emerald-glow); }
.console__line--ai { color: var(--bone); font-family: var(--font-sans); font-size: 0.98rem; }
.console__line--err { color: #e6c78a; }

.console__line.is-typing::after {
  content: '▍';
  margin-left: 2px;
  color: var(--ruby-glow);
  animation: blink 0.9s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.console__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1.4rem 1rem;
}

.console__chips button,
.console__fallback {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 20, 21, 0.6);
  color: var(--ash);
  font: inherit;
  font-size: 0.7rem;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
}

.console__chips button:hover { color: var(--emerald-glow); border-color: var(--emerald-glow); }
.console__fallback { margin: 0 1.4rem 1.4rem; color: var(--emerald-mist); }

.console__form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--line);
}

.console__form span { color: var(--emerald-glow); }

.console__form input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--bone);
  font: inherit;
  font-size: 0.9rem;
}

.console__form button {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 0;
  background: var(--ruby-core);
  color: #fff;
  font: inherit;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.console__form button:disabled,
.console__form input:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── 6. Голоса ──────────────────────────────────────────────── */

.voices {
  margin-top: 3.5rem;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.voices__track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  animation: marquee 60s linear infinite;
}

.voices:hover .voices__track { animation-play-state: paused; }

.voice {
  width: min(24rem, 80vw);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(10, 18, 19, 0.75);
}

.voice blockquote {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.45;
  font-style: italic;
}

.voice figcaption {
  display: grid;
  gap: 0.25rem;
  margin-top: 1.5rem;
  font-size: 0.82rem;
}

.voice figcaption span { color: var(--ash); font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; }

/* ── 7. Этика ───────────────────────────────────────────────── */

.ethics {
  display: grid;
  gap: 3rem;
}

@media (min-width: 960px) {
  .ethics { grid-template-columns: 1fr 1.1fr; gap: 5rem; align-items: start; }
}

.codex {
  margin-top: 3rem;
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid rgba(62, 240, 166, 0.22);
  background: rgba(6, 14, 15, 0.7);
  backdrop-filter: blur(12px);
}

.codex ol {
  margin-top: 1.25rem;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.75rem;
  color: rgba(236, 231, 222, 0.85);
  font-size: 0.94rem;
}

.codex li::marker {
  font-family: var(--font-mono);
  color: var(--emerald-glow);
}

.accordion.glass { padding: 0.5rem 1.75rem; }

.accordion__trigger { font-family: var(--font-display); font-size: 1.35rem; }

/* ── Финал: рассвет ─────────────────────────────────────────── */

.dawn {
  position: relative;
  min-height: 92svh;
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}

.dawn__scene { position: absolute; inset: 0; z-index: -2; }

.dawn__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, var(--void) 0%, rgba(5, 8, 10, 0.2) 30%, rgba(5, 8, 10, 0.35) 70%, var(--void) 100%),
    radial-gradient(60% 50% at 50% 50%, rgba(5, 8, 10, 0.55), transparent 80%);
}

.dawn__content { display: grid; justify-items: center; padding-block: 8rem; }

.dawn__title {
  margin-top: 1.5rem;
  font-size: clamp(2.8rem, 7vw, 6.4rem);
  line-height: 1;
  max-width: 14ch;
}

.dawn .chapter__lead { color: rgba(236, 231, 222, 0.85); }
.dawn .portal__actions { justify-content: center; }

/* ── Подвал ─────────────────────────────────────────────────── */

.footer {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
}

.footer__aurora {
  position: absolute;
  inset: auto -20% -60% -20%;
  height: 120%;
  background: conic-gradient(from 200deg at 50% 100%, transparent, rgba(23, 128, 90, 0.25), rgba(200, 16, 46, 0.18), transparent 60%);
  filter: blur(60px);
  pointer-events: none;
}

.footer__brand {
  font-family: var(--font-display);
  font-size: 2.2rem;
  letter-spacing: 0.18em;
}

/* ── Курсор-светлячок ───────────────────────────────────────── */

.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 300;
  width: 2.25rem;
  height: 2.25rem;
  margin: -1.125rem 0 0 -1.125rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 200, 210, 0.55);
  pointer-events: none;
  opacity: 0;
  transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out), margin 0.35s var(--ease-out), opacity 0.3s, border-color 0.3s, background 0.3s;
  mix-blend-mode: screen;
}

.cursor i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px;
  border-radius: 999px;
  background: var(--ruby-glow);
  box-shadow: 0 0 12px 3px rgba(158, 18, 38, 0.8);
}

.cursor.is-on { opacity: 1; }

.cursor.is-link {
  width: 4rem;
  height: 4rem;
  margin: -2rem 0 0 -2rem;
  border-color: rgba(62, 240, 166, 0.7);
  background: rgba(62, 240, 166, 0.06);
}

@media (pointer: coarse) {
  .cursor { display: none; }
}

/* ── Чат ────────────────────────────────────────────────────── */

.chat {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 90;
}

.chat__orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 999px;
  border: 1px solid rgba(158, 18, 38, 0.45);
  background: radial-gradient(circle at 35% 30%, #2a0910, #0a0507 70%);
  box-shadow: 0 0 0 0 rgba(158, 18, 38, 0.5), 0 14px 40px -10px rgba(158, 18, 38, 0.7);
  cursor: pointer;
  animation: orb 3.2s ease-in-out infinite;
  transition: transform 0.4s var(--ease-out);
}

.chat__orb:hover { transform: scale(1.08); }

.chat__orb svg {
  width: 1.1rem;
  height: 2rem;
  fill: var(--ruby-glow);
  filter: drop-shadow(0 0 8px var(--ruby-glow));
}

@keyframes orb {
  50% { box-shadow: 0 0 0 10px rgba(158, 18, 38, 0), 0 14px 50px -6px rgba(158, 18, 38, 0.9); }
}

.chat__badge {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  min-width: 1.35rem;
  height: 1.35rem;
  padding-inline: 0.35rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--emerald-glow);
  color: #022;
  font: 600 0.7rem/1 var(--font-sans);
}

.chat__panel {
  position: absolute;
  right: 0;
  bottom: 4.75rem;
  width: min(25rem, calc(100vw - 2rem));
  height: min(37rem, calc(100svh - 7rem));
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: 1.4rem;
  background: rgba(6, 12, 13, 0.9);
  border: 1px solid var(--glass-edge);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(158, 18, 38, 0.08);
  overflow: hidden;
  transform-origin: bottom right;
  animation: panel-in 0.5s var(--ease-out);
}

.chat__panel[hidden] { display: none; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
}

.chat__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(120% 140% at 0% 0%, rgba(158, 18, 38, 0.14), transparent 60%);
}

.chat__title { font-family: var(--font-display); font-size: 1.35rem; }

.chat__status {
  margin-top: 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--ash);
}

.chat__status.is-online::before {
  content: '●';
  margin-right: 0.4rem;
  color: var(--emerald-glow);
}

.chat__close {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: none;
  color: var(--ash);
  font-size: 1.2rem;
  cursor: pointer;
}

.chat__log {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.1rem;
  overflow-y: auto;
  scrollbar-width: thin;
}

.chat__msg {
  max-width: 85%;
  padding: 0.7rem 0.95rem;
  border-radius: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: msg-in 0.45s var(--ease-out);
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
}

.chat__msg small {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}

.chat__msg time {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.62rem;
  opacity: 0.5;
}

.chat__msg--user {
  align-self: flex-end;
  background: linear-gradient(135deg, #a3112a, #6c0a1b);
  border-bottom-right-radius: 0.3rem;
  color: #fff;
}

.chat__msg--admin {
  align-self: flex-start;
  background: rgba(23, 128, 90, 0.22);
  border: 1px solid rgba(62, 240, 166, 0.25);
  border-bottom-left-radius: 0.3rem;
}

.chat__msg--ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 179, 71, 0.25);
  border-bottom-left-radius: 0.3rem;
}

.chat__msg--ai small { color: var(--amber); }

.chat__msg--system {
  align-self: center;
  max-width: 95%;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ash);
  background: none;
  padding: 0.25rem 0.5rem 0.75rem;
}

.chat__typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 0.8rem 1rem;
}

.chat__typing i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--amber);
  animation: typing 1.2s infinite;
}

.chat__typing i:nth-child(2) { animation-delay: 0.15s; }
.chat__typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
  30% { transform: translateY(-5px); opacity: 1; }
  0%, 60%, 100% { opacity: 0.35; }
}

.chat__form {
  padding: 0.75rem;
  border-top: 1px solid var(--line);
}

.chat__guest {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.chat__guest input,
.chat__row textarea {
  width: 100%;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 0.8rem;
  border: 1px solid var(--line-strong);
  background: rgba(2, 6, 7, 0.6);
  color: var(--bone);
  font: inherit;
  font-size: 0.85rem;
  outline: 0;
}

.chat__guest input:focus,
.chat__row textarea:focus { border-color: var(--emerald-glow); }

.chat__row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.chat__row textarea {
  resize: none;
  max-height: 8rem;
  field-sizing: content;
}

.chat__row button {
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  border: 0;
  background: var(--ruby-core);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ── Страницы-формы: вход, регистрация ──────────────────────── */

.auth-scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.55;
}

.auth-scene::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 60% at 50% 45%, rgba(5, 8, 10, 0.35), rgba(5, 8, 10, 0.92));
}

.is-inner .surface { box-shadow: 0 30px 100px -50px rgba(0, 0, 0, 0.9); }

/* ── Админка: аналитика ─────────────────────────────────────── */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
}

.kpi {
  position: relative;
  padding: 1.25rem 1.3rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(13, 24, 25, 0.85), rgba(6, 11, 12, 0.9));
  overflow: hidden;
}

.kpi::after {
  content: '';
  position: absolute;
  right: -30%;
  top: -60%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 999px;
  background: radial-gradient(var(--tone, rgba(62, 240, 166, 0.25)), transparent 70%);
}

.kpi__label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash);
}

.kpi__value {
  margin-top: 0.6rem;
  font-family: var(--font-display);
  font-size: 2.1rem;
  line-height: 1;
}

.kpi__delta {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
}

.kpi__delta.up { color: var(--emerald-glow); }
.kpi__delta.down { color: #e6c78a; }

.panel {
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(8, 14, 15, 0.8);
}

.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.panel__title { font-family: var(--font-display); font-size: 1.4rem; }

.panels {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 1100px) {
  .panels--2 { grid-template-columns: 1fr 1fr; }
  .panels--3 { grid-template-columns: 2fr 1fr; }
}

.chart {
  width: 100%;
  height: 220px;
  color: var(--emerald-glow);
  overflow: visible;
}

.chart--ruby { color: var(--ruby-glow); }
.chart__grid { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.chart__axis { fill: var(--ash); font: 10px var(--font-mono); }
.chart__line { fill: none; stroke: currentColor; stroke-width: 2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px currentColor); }
.chart__line--alt { stroke: var(--amber); stroke-dasharray: 4 4; filter: none; opacity: 0.8; }
.chart__hit { fill: transparent; }
.chart__hit:hover { fill: currentColor; fill-opacity: 0.25; }

.legend {
  display: flex;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--ash);
}

.legend i {
  display: inline-block;
  width: 0.75rem;
  height: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
  background: var(--emerald-glow);
}

.legend i.alt { background: var(--amber); }

.bars { display: grid; gap: 0.55rem; }

.bars__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  position: relative;
  padding: 0.45rem 0.6rem;
  font-size: 0.82rem;
  border-radius: 0.5rem;
  overflow: hidden;
}

.bars__row::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(62, 240, 166, 0.18), rgba(62, 240, 166, 0.04));
  transform: scaleX(var(--w));
  transform-origin: left;
}

.bars__row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars__row b { font-family: var(--font-mono); font-weight: 400; color: var(--bone); }

.funnel { display: grid; gap: 0.5rem; }

.funnel__step {
  position: relative;
  display: flex;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-radius: 0.6rem;
  font-size: 0.85rem;
  background: linear-gradient(90deg, rgba(158, 18, 38, 0.28), rgba(158, 18, 38, 0.05));
  width: max(62%, calc(var(--w) * 100%));
  white-space: nowrap;
  gap: 1rem;
}

.funnel__step em { font-style: normal; font-family: var(--font-mono); font-size: 0.7rem; color: var(--ash); }

.seg {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.seg a {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--ash);
}

.seg a.is-active { background: rgba(62, 240, 166, 0.14); color: var(--emerald-glow); }

.live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--emerald-glow);
}

.live::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  animation: pulse-heat 1.6s infinite;
}

/* Админ-чат */
.inbox { display: grid; gap: 0.5rem; }

.inbox__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  padding: 1rem 1.1rem;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  background: rgba(8, 14, 15, 0.7);
  transition: border-color 0.3s, background 0.3s;
}

.inbox__item:hover { border-color: var(--line-strong); background: rgba(12, 22, 23, 0.85); }
.inbox__item.is-unread { border-color: rgba(62, 240, 166, 0.45); }
.inbox__item.is-flagged { border-color: rgba(158, 18, 38, 0.6); }
.inbox__name { font-weight: 600; }
.inbox__preview { grid-column: 1 / -1; color: var(--ash); font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox__meta { font-family: var(--font-mono); font-size: 0.62rem; color: var(--ash); text-align: right; }

.dialog {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: min(60svh, 40rem);
  overflow-y: auto;
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(4, 9, 10, 0.75);
}

.dialog .chat__msg--user {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  color: var(--bone);
  border-radius: 1.1rem;
  border-bottom-left-radius: 0.3rem;
}

.dialog .chat__msg--admin {
  align-self: flex-end;
  background: rgba(23, 128, 90, 0.28);
  border-bottom-right-radius: 0.3rem;
  border-bottom-left-radius: 1.1rem;
}

.dialog .chat__msg--ai {
  align-self: flex-end;
  border-bottom-right-radius: 0.3rem;
  border-bottom-left-radius: 1.1rem;
}

.mod-flag {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  background: rgba(158, 18, 38, 0.2);
  color: #e6c78a;
}

.mod-flag--spam { background: rgba(255, 179, 71, 0.18); color: var(--amber); }

.composer {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.composer textarea { min-height: 6rem; }

.composer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Редактор контента: выбор картинки и кнопка Claude */
.field-wrap { position: relative; }

.ai-write {
  position: absolute;
  top: -0.15rem;
  right: 0;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 179, 71, 0.4);
  background: rgba(255, 179, 71, 0.08);
  color: var(--amber);
  font: 500 0.6rem/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.3s;
}

.field-wrap:hover .ai-write,
.ai-write:focus { opacity: 1; }

.ai-write.is-busy { animation: pulse-heat 1s infinite; pointer-events: none; }

.picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.6rem;
}

.picker__item {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: 0.6rem;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--carbon);
}

.picker__item input { position: absolute; opacity: 0; pointer-events: none; }
.picker__item img { width: 100%; height: 100%; object-fit: cover; }
.picker__item:has(input:checked) { border-color: var(--emerald-glow); box-shadow: 0 0 20px rgba(62, 240, 166, 0.35); }
.picker__item:has(input:focus-visible) { outline: 2px solid var(--emerald-glow); outline-offset: 2px; }

.picker__item--none {
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--ash);
  border: 1px dashed var(--line-strong);
}

.picker__badge {
  position: absolute;
  right: 0.35rem;
  top: 0.35rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
  background: rgba(0, 0, 0, 0.7);
  color: var(--emerald-glow);
  font: 600 0.55rem/1.4 var(--font-mono);
  font-style: normal;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 1rem;
}

.media-card {
  border-radius: 0.8rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(8, 14, 15, 0.8);
}

.media-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.media-card div { padding: 0.65rem 0.8rem; font-size: 0.72rem; color: var(--ash); display: flex; justify-content: space-between; gap: 0.5rem; align-items: center; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.tabs a {
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash);
}

.tabs a.is-active { border-color: var(--emerald-glow); color: var(--emerald-glow); background: rgba(62, 240, 166, 0.08); }

.switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.92rem;
}

.switch input {
  appearance: none;
  flex: none;
  width: 2.6rem;
  height: 1.5rem;
  border-radius: 999px;
  background: #1c2a29;
  border: 1px solid var(--line-strong);
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
}

.switch input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: var(--ash);
  transition: transform 0.35s var(--ease-out), background 0.3s;
}

.switch input:checked { background: rgba(62, 240, 166, 0.3); }
.switch input:checked::after { transform: translateX(1.1rem); background: var(--emerald-glow); }

/* Тестовый «банк» */
.demo-bank {
  max-width: 28rem;
  margin: 0 auto;
  padding: 2.25rem;
  border-radius: 1.5rem;
  border: 1px dashed rgba(255, 179, 71, 0.5);
  background: rgba(8, 14, 15, 0.85);
}

/* Меньше движения — по просьбе системы */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal { opacity: 1 !important; transform: none !important; filter: none !important; }
  .manifest .w { opacity: 1; }
}

/* Выбор способа оплаты */
.pay-option {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
}

.pay-option:has(input:checked) {
  border-color: rgba(158, 18, 38, 0.55);
  background: rgba(158, 18, 38, 0.07);
}

.pay-option input { margin-top: 0.3rem; accent-color: var(--ruby-glow); }
.pay-option b { display: block; font-weight: 600; }
.pay-option small { display: block; margin-top: 0.2rem; color: var(--ash); font-size: 0.82rem; line-height: 1.5; }

form:has(input[name="payment_method"]:not([value="BANK"]):checked) [data-bank-block] { display: none; }

/* Буквы внутри светящегося слова: градиент не переживает разбиение
   на inline-block, поэтому каждая буква светится сама */
.glow-text .split-char {
  color: #b81d36;
  -webkit-text-fill-color: #b81d36;
  text-shadow: 0 0 28px rgba(158, 18, 38, 0.65);
}

.glow-text--emerald .split-char {
  color: var(--emerald-glow);
  -webkit-text-fill-color: var(--emerald-glow);
  text-shadow: 0 0 24px rgba(62, 240, 166, 0.5);
}

.glow-text:has(.split-char) {
  filter: none;
  -webkit-text-fill-color: initial;
  background: none;
}

.inbox__name .nav-count {
  display: inline-grid;
  margin-left: 0.5rem;
  vertical-align: 0.1rem;
}

.footer li .linklike {
  font-size: 0.86rem;
  color: var(--ash);
  transition: color 0.3s;
}

.footer li .linklike:hover { color: var(--emerald-glow); }
