/* ==========================================================================
   Melon Control — базовая тема.
   Тёмный фон, тяжёлая узкая антиква в заголовках, моноширинные подписи-метки,
   один акцентный цвет. Всё через переменные, чтобы перекраска была в одном месте.
   ========================================================================== */

:root {
  --bg:        #0a0a0b;
  --bg-elev:   #101012;
  --bg-hover:  #17171a;
  --line:      #1e1e23;
  --line-soft: #16161a;

  --text:      #ececee;
  --text-dim:  #a0a0a8;
  --muted:     #75757e;

  --accent:      #ff0a50;
  --accent-hard: #ff2e68;
  --ok:          #3ddc84;
  --warn:        #ffb020;
  --danger:      #ff5252;

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --cond: 'Roboto Condensed', 'Arial Narrow', var(--sans);
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --gutter: clamp(20px, 4vw, 64px);
  --maxw: 1600px;
  --header-h: 68px;
}

* { box-sizing: border-box; }

/* --- полосы прокрутки ------------------------------------------------------
   Firefox понимает только scrollbar-*, у остальных ::-webkit-scrollbar-*.
   Задаём оба: правило, которое браузер не знает, он просто пропустит. */

html {
  scrollbar-color: #2a2a31 transparent;
  scrollbar-width: thin;
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }

::-webkit-scrollbar-thumb {
  background: #26262d;
  /* Рамка того же цвета, что фон, — так ползунок выглядит уже дорожки
     и не липнет к её краям. */
  border: 3px solid var(--bg);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover  { background: #35353e; }
::-webkit-scrollbar-thumb:active { background: #43434e; }

/* Внутри панелей фон другой — подгоняем рамку под него, иначе виден ободок. */
.panel ::-webkit-scrollbar-thumb,
.preview ::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb {
  border-color: var(--bg-elev);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* --- типографика ---------------------------------------------------------- */

.h-display {
  font-family: var(--cond);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(40px, 6.5vw, 92px);
  line-height: 0.88;
  letter-spacing: -0.005em;
  margin: 0;
}

.h-section {
  font-family: var(--cond);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 0.92;
  margin: 0;
}

.label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 46ch;
  margin: 24px 0 0;
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* --- шапка ---------------------------------------------------------------- */

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 var(--gutter);
  background: rgba(10, 10, 11, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }

.brand__mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid #2c2c33;
  border-radius: 9px;
  background: #141418;
  font-family: var(--cond);
  font-weight: 900;
  font-size: 18px;
}

.brand__name { font-weight: 700; font-size: 14px; letter-spacing: 0.01em; }
/* Подпись длинная, поэтому разрядка меньше обычных меток — иначе она
   отжимает навигацию. Ниже 1240px прячется целиком. */
.brand__sub  {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.11em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.nav { display: flex; gap: 26px; margin-left: auto; }

.nav a {
  font-size: 14px;
  color: var(--text-dim);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current='page'] { color: var(--text); border-bottom-color: var(--accent); }

.header__right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.nav + .header__right { margin-left: 28px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  font-size: 13px;
}
.user-chip img { width: 24px; height: 24px; border-radius: 50%; display: block; }
.user-chip__fallback {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: #26262c; font-size: 11px; font-weight: 700;
}

/* --- кнопки --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  background: var(--bg-elev);
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-hard); }

.btn--outline { border-color: var(--line); background: transparent; }
.btn--outline:hover { border-color: #33333b; background: var(--bg-elev); }

.btn--sm { padding: 8px 16px; font-size: 13px; }
.btn--ghost { background: transparent; color: var(--text-dim); }
.btn--ghost:hover { color: var(--text); background: var(--bg-elev); }
.btn--danger { color: var(--danger); border-color: #3a1d22; background: transparent; }
.btn--danger:hover { background: #1d1113; }

/* --- каркас страницы ------------------------------------------------------ */

.page { flex: 1 0 auto; padding: 0 var(--gutter); max-width: var(--maxw); width: 100%; margin: 0 auto; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 0;
  padding: clamp(56px, 9vw, 120px) 0 clamp(48px, 7vw, 96px);
}

.hero__main { padding-right: clamp(24px, 5vw, 72px); }

/* Экран без правого рельса — колонка одна, отступ справа не нужен. */
.hero--solo { grid-template-columns: minmax(0, 1fr); }
.hero--solo .hero__main { padding-right: 0; }

/* Рабочая страница, а не витрина: шапка ужимается, чтобы не отжимать содержимое
   ниже сгиба. Заголовок остаётся тем же по духу, просто меньше. */
.hero--compact { padding: clamp(28px, 3.5vw, 44px) 0 clamp(18px, 2.5vw, 28px); }
.hero--compact .h-display { font-size: clamp(26px, 3.4vw, 44px); line-height: 0.94; }
.hero--compact .hero__eyebrow { margin-bottom: 12px; }
.hero--compact .lead { margin-top: 14px; font-size: 14.5px; max-width: 60ch; }
.hero--compact .hero__actions { margin-top: 20px; }
.hero__rail {
  border-left: 1px solid var(--line);
  padding-left: clamp(24px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hero__eyebrow { margin-bottom: 22px; display: block; }
.hero__actions { display: flex; align-items: center; gap: 24px; margin-top: 40px; flex-wrap: wrap; }

.rail__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 34px; }

.status-dot {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
}
.status-dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.status-dot--ok     { color: var(--ok); }
.status-dot--warn   { color: var(--warn); }
.status-dot--danger { color: var(--danger); }

.rail__number {
  font-size: clamp(44px, 5.2vw, 76px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0 0 34px;
}

.rail__rows { border-top: 1px solid var(--line); }
.rail__row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.rail__row b { font-weight: 700; font-size: 15px; }
.rail__note { font-family: var(--mono); font-size: 11px; color: var(--muted); padding-top: 16px; }

/* --- секции со списком строк ---------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  padding: clamp(40px, 6vw, 88px) 0;
  border-top: 1px solid var(--line);
}

.rows { border-top: 1px solid var(--line); }
.row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.row__title { font-weight: 600; font-size: 16px; margin: 0 0 6px; }
.row__desc  { color: var(--muted); font-size: 14px; margin: 0; }

/* --- карточки и панели ---------------------------------------------------- */

.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elev);
}
.panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.panel__body { padding: 20px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tile { background: var(--bg-elev); padding: 22px; }
.tile__value { font-size: 34px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; margin: 12px 0 4px; }
.tile__note  { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* --- плитки-переходы на «Обзоре» ------------------------------------------ */

.tiles-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.nav-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elev);
  transition: border-color .15s, background .15s, transform .15s;
}
.nav-card:hover {
  border-color: #33333b;
  background: var(--bg-hover);
  transform: translateY(-2px);
}

.nav-card__icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #141418;
  color: var(--accent);
}
.nav-card__icon svg { width: 21px; height: 21px; display: block; }

.nav-card__body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.nav-card__title { font-weight: 600; font-size: 16px; }
.nav-card__text  { color: var(--muted); font-size: 13.5px; line-height: 1.5; }

.nav-card__go {
  margin-left: auto;
  align-self: center;
  color: var(--muted);
  font-size: 18px;
  transition: color .15s, transform .15s;
}
.nav-card:hover .nav-card__go { color: var(--accent); transform: translateX(3px); }

/* --- бейдж роли ------------------------------------------------------------ */

.role-badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.role-badge--curator {
  color: var(--accent);
  border-color: #3a1220;
  background: #1a0d12;
}

/* --- формы ---------------------------------------------------------------- */

.field { display: block; margin-bottom: 16px; }
.field > .label { display: block; margin-bottom: 8px; }

.input, .select, .textarea {
  width: 100%;
  padding: 11px 13px;
  background: #0d0d0f;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: #3a3a44; }
.textarea { min-height: 96px; resize: vertical; font-family: var(--sans); }
.input--mono { font-family: var(--mono); font-size: 13px; }

/* Поле пин-кода: крупно и вразрядку — символы должно быть видно по одному. */
.input--pin {
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: 0.5em;
  text-align: center;
  padding: 14px 13px;
  text-indent: 0.5em;   /* компенсирует разрядку после последнего символа */
}

/* Чекбокс рисуем сами: системный не покрасить под тему, а accent-color
   меняет только заливку — рамка и размер остаются чужими. */
.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.checkbox:hover { color: var(--text); }

.checkbox input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 0;
  border: 1px solid #34343d;
  border-radius: 5px;
  background: #0d0d0f;
  cursor: pointer;
  position: relative;
  transition: background .14s, border-color .14s;
}
.checkbox input[type='checkbox']:hover { border-color: #46464f; }

.checkbox input[type='checkbox']::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0.4);
  opacity: 0;
  transition: opacity .12s, transform .12s;
}

.checkbox input[type='checkbox']:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox input[type='checkbox']:checked::after { opacity: 1; transform: rotate(45deg) scale(1); }

.checkbox input[type='checkbox']:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.checkbox input[type='checkbox']:disabled { opacity: .4; cursor: not-allowed; }

.checkbox b { color: var(--text); font-weight: 600; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

/* --- таблицы -------------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); font-weight: 400;
  padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tr:hover td { background: #131317; }
.table__time { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.table__meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); word-break: break-word; }

.tag {
  display: inline-block;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--text-dim);
}
.tag--ok     { color: var(--ok);     border-color: #14301f; background: #0d1a12; }
.tag--denied { color: var(--warn);   border-color: #322612; background: #1a1409; }
.tag--error  { color: var(--danger); border-color: #341a1c; background: #1a0f11; }

/* --- сообщения ------------------------------------------------------------ */

.notice {
  border: 1px solid var(--line);
  border-left: 2px solid var(--muted);
  border-radius: 6px;
  padding: 14px 18px;
  font-size: 14px;
  background: var(--bg-elev);
  margin-bottom: 20px;
}
.notice--error { border-left-color: var(--danger); }
.notice--ok    { border-left-color: var(--ok); }
.notice--warn  { border-left-color: var(--warn); }
.notice__title { font-weight: 600; margin: 0 0 4px; }
.notice p { margin: 0; color: var(--text-dim); }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* --- модальное окно --------------------------------------------------------
   Нативный <dialog>: ловушка фокуса, закрытие по Esc и подложка достаются
   даром, писать это руками незачем. */

.modal {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}
.modal::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); }
.modal[open] { animation: modal-in 0.16s ease-out; }

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal__body { padding: 20px; }
.modal__body .field:last-of-type { margin-bottom: 12px; }
.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}

@keyframes modal-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* --- всплывающие уведомления ---------------------------------------------- */

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(400px, calc(100vw - 40px));
  pointer-events: none;
}

.toast {
  position: relative;
  pointer-events: auto;
  border: 1px solid var(--line);
  border-left: 2px solid var(--muted);
  border-radius: 8px;
  background: #141418;
  padding: 14px 42px 14px 18px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
  animation: toast-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.toast--ok    { border-left-color: var(--ok); }
.toast--error { border-left-color: var(--danger); }
.toast--leaving { animation: toast-out 0.18s ease-in forwards; }

.toast__title { margin: 0 0 4px; font-weight: 600; font-size: 14px; }
.toast__text  { margin: 0; color: var(--text-dim); font-size: 13.5px; word-break: break-word; }

.toast__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.toast__close:hover { color: var(--text); background: var(--bg-hover); }

@keyframes toast-in  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

@media (max-width: 520px) {
  .toast-stack { right: 12px; left: 12px; bottom: 12px; width: auto; }
}

/* --- подвал --------------------------------------------------------------- */

.footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  padding: 26px var(--gutter);
  display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  max-width: var(--maxw); width: 100%; margin: 0 auto;
}

/* --- билдер --------------------------------------------------------------- */

.builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 24px; align-items: start; padding-bottom: 64px; }

.block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elev);
  margin-bottom: 12px;
}
.block__head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.block__kind { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.block__tools { margin-left: auto; display: flex; gap: 4px; }
.block__body { padding: 14px; }
.block__nested { border-left: 1px solid var(--line); padding-left: 14px; margin-left: 4px; }

.icon-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 5px;
  background: transparent; color: var(--muted); cursor: pointer;
  font-size: 13px; line-height: 1;
}
.icon-btn:hover { color: var(--text); background: var(--bg-hover); }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; }

.add-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 24px; }

.preview {
  position: sticky; top: calc(var(--header-h) + 20px);
}
.preview pre {
  margin: 0; padding: 16px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.55;
  color: var(--text-dim);
  white-space: pre-wrap; word-break: break-word;
  max-height: 60vh; overflow: auto;
}

/* Приблизительный вид сообщения в Discord — чтобы не гадать по JSON. */
.dc { padding: 16px; background: #0d0d0f; }
.dc__container {
  border-left: 4px solid #4f545c;
  background: #131417;
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.dc__text { font-size: 14px; white-space: pre-wrap; word-break: break-word; margin: 0 0 8px; }
.dc__text:last-child { margin-bottom: 0; }
.dc__sep { height: 1px; background: #2b2d31; margin: 12px 0; }
.dc__sep--blank { background: transparent; }
.dc__section { display: flex; gap: 12px; align-items: flex-start; }
.dc__section > div:first-child { flex: 1 1 auto; min-width: 0; }
.dc__btn {
  display: inline-block; padding: 8px 14px; border-radius: 4px;
  background: #4e5058; color: #fff; font-size: 13px; font-weight: 500;
}
.dc__btn--link { background: transparent; border: 1px solid #4e5058; }
.dc__gallery { display: flex; gap: 6px; flex-wrap: wrap; }
.dc__gallery img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; background: #1e1f22; }
.dc__row { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- адаптив -------------------------------------------------------------- */

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .hero__main { padding-right: 0; }
  .hero__rail { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 40px; margin-top: 48px; }
  .split { grid-template-columns: 1fr; }
  .builder { grid-template-columns: 1fr; }
  .preview { position: static; }
}

@media (max-width: 1240px) {
  .brand__sub { display: none; }
}

@media (max-width: 720px) {
  .nav { display: none; }
  .row { grid-template-columns: 1fr; gap: 6px; }
  .table-scroll { overflow-x: auto; }
}

.table-scroll { overflow-x: auto; }

/* ==========================================================================
   Эффекты: глитч, развёртка, зерно.
   Всё на CSS, без единого скрипта — гонять таймеры в JS ради декора незачем.
   Системную настройку «уменьшить движение» здесь сознательно игнорируем —
   выключатель оставлен закомментированным в конце файла.
   ========================================================================== */

:root { --cyan: #00e5ff; }

/* --- глитч заголовка -------------------------------------------------------
   Разъезд каналов через text-shadow, а не через дубли в ::before/::after:
   заголовок содержит <br>, а псевдоэлемент из content его не воспроизведёт.
   steps(1) вместо плавных переходов — глитч должен щёлкать, а не перетекать. */

@keyframes glitch-rgb {
  0%, 86%, 100% { transform: none; text-shadow: none; }
  87% { transform: translate3d(-2px, 1px, 0); text-shadow: 3px 0 var(--accent), -3px 0 var(--cyan); }
  89% { transform: translate3d(3px, -1px, 0); text-shadow: -4px 0 var(--accent), 2px 0 var(--cyan); }
  91% { transform: translate3d(-1px, 0, 0); text-shadow: 2px 0 var(--cyan), -2px 0 var(--accent); }
  93% { transform: translate3d(1px, 1px, 0); text-shadow: none; }
  95% { transform: translate3d(-3px, 0, 0); text-shadow: 5px 0 var(--accent), -1px 0 var(--cyan); }
  97% { transform: none; text-shadow: 1px 0 var(--cyan); }
}

.glitch {
  animation: glitch-rgb 7s steps(1, end) infinite;
  will-change: transform;
}

/* Срез: узкая полоса заголовка на миг уезжает вбок. Отдельным слоем, чтобы
   не спорить с transform самого заголовка. */
.glitch-slice { position: relative; }
.glitch-slice::after {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  height: 14%;
  top: 38%;
  background: var(--bg);
  border-top: 1px solid rgba(255, 10, 80, 0.55);
  opacity: 0;
  pointer-events: none;
  animation: glitch-band 7s steps(1, end) infinite;
}

@keyframes glitch-band {
  0%, 87%, 100% { opacity: 0; }
  88% { opacity: 1; top: 30%; transform: translateX(-9px); }
  90% { opacity: 0; }
  94% { opacity: 1; top: 62%; transform: translateX(7px); }
  96% { opacity: 0; }
}

/* --- логотип и мелочи ------------------------------------------------------ */

/* Плашка логотипа изредка «моргает» — жизнь без назойливости. */
@keyframes mark-flicker {
  0%, 90%, 100% { opacity: 1; border-color: #2c2c33; }
  92%  { opacity: 0.55; border-color: var(--accent); }
  93%  { opacity: 1; }
  95%  { opacity: 0.7; border-color: var(--cyan); }
  96%  { opacity: 1; border-color: #2c2c33; }
}

.brand__mark { animation: mark-flicker 9s steps(1, end) infinite; }
.brand:hover .brand__mark { animation-duration: 1.4s; }

/* Пульсирующий ореол у индикатора состояния. */
.status-dot::before { position: relative; }
.status-dot--ok::before { animation: dot-pulse 2.4s ease-out infinite; }

@keyframes dot-pulse {
  0%   { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  70%  { box-shadow: 0 0 0 6px transparent; opacity: 0.85; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}

/* Курсор у надстрочной метки — будто строка ещё печатается. */
.hero__eyebrow::after {
  content: '_';
  margin-left: 6px;
  color: var(--accent);
  animation: caret 1.15s steps(1, end) infinite;
}

@keyframes caret {
  0%, 45%  { opacity: 1; }
  50%, 95% { opacity: 0; }
  100%     { opacity: 1; }
}

/* Акцентная кнопка изредка ловит блик. */
.btn--accent { position: relative; overflow: hidden; }
.btn--accent::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  left: -50%;
  pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  animation: shine 6s ease-in-out infinite;
}

@keyframes shine {
  0%, 70%  { left: -50%; }
  85%      { left: 120%; }
  100%     { left: 120%; }
}

/* Системное «уменьшить движение» намеренно не учитывается: панель внутренняя,
   на двоих, и эффекты здесь — часть оформления, а не украшение поверх контента.
   Если понадобится вернуть уважение к настройке, достаточно раскомментировать
   блок ниже — все декоративные слои гасятся им целиком.

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .glitch-slice::after,
  .btn--accent::after,
  .hero__eyebrow::after { display: none; }
}
*/
