@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  --bg: #121214;
  --panel: #1e1e21;
  --panel-hi: #232327;
  --ink: #e0e0e0;
  --muted: #8a8a90;
  --rule: #2a2a2e;
  --accent: #4da6ff;
  --signal: #1a5cff;
  --alert: #e53935;
  --ok: #3ddc84;

  /* Псевдонимы для старой разметки, чтобы ничего не поехало. */
  --paper: var(--bg);

  --measure: 62ch;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;

  /* Миллиметровка как на задней панели студийной стойки. */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
}

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 0.6rem;
}

h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
h2 { font-size: 1.3rem; letter-spacing: -0.02em; }
h3 { font-size: 1rem; }

p { margin: 0 0 1rem; max-width: var(--measure); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 34rem; }

.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

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

.top { border-bottom: 1px solid var(--rule); }

.top-in {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 4rem;
}

.mark {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Индикатор питания у логотипа. */
.mark::after {
  content: '';
  width: 13px;
  height: 13px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
}

.top nav {
  display: flex;
  gap: 1.1rem;
  align-items: center;
  font-size: 0.92rem;
}

.top nav a { color: var(--ink); text-decoration: none; }
.top nav a:hover { color: var(--accent); }

main { padding: 2.5rem 0 8rem; }

.head { margin-bottom: 2rem; }
.head p { color: var(--muted); }

/* ------------------------------------------------------- строки-каналы */

.strips { border-top: 1px solid var(--rule); }

.strip {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr) 9rem 6.5rem;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.strip:hover { background: var(--panel); }

.strip input[type='checkbox'] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--signal);
}

.strip-name { font-weight: 600; }

.strip-meta {
  color: var(--muted);
  font-size: 0.86rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0 0.35rem;
  background: var(--panel);
}

.nav-badge {
  display: inline-block;
  min-width: 1.1rem;
  padding: 0 0.3rem;
  margin-left: 0.3rem;
  border-radius: 999px;
  background: var(--alert);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3rem;
  text-align: center;
}

/* Шкала уровня. */
.meter {
  height: 8px;
  background: #000;
  border: 1px solid #333;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.meter span {
  position: absolute;
  inset: 1px auto 1px 1px;
  background: linear-gradient(90deg, var(--ok) 60%, #ffeb3b 90%);
  border-radius: 2px;
}

.meter-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.price {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1rem;
}

/* ------------------------------------------------ транспортная панель */

.transport {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0b0b0d;
  border-top: 1px solid var(--rule);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
}

.transport-in {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 4rem;
}

.transport .count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--muted);
}

.transport .total {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ok);
}

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

label { display: block; margin-bottom: 1.1rem; max-width: var(--measure); }

.label-text {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='url'],
input[type='number'],
input[type='file'],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #131316;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.6rem 0.7rem;
}

textarea { min-height: 8rem; resize: vertical; }

input::placeholder, textarea::placeholder { color: #55555c; }

input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn {
  font: inherit;
  font-weight: 600;
  background: var(--signal);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(26, 92, 255, 0.35);
  transition: transform 0.1s, box-shadow 0.1s;

  /* Кнопкой бывает и ссылка — она не должна тянуть подчёркивание. */
  display: inline-block;
  text-decoration: none;
  line-height: 1.2;
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 10px rgba(26, 92, 255, 0.35);
}

.btn[disabled] {
  background: #2a2a2e;
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid #444;
  box-shadow: none;
}

.btn-quiet:hover { background: var(--panel-hi); border-color: #666; }

.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 1.5rem;
}

.filters label { margin: 0; width: auto; min-width: 9rem; }

/* ------------------------------------------------------------ блоки */

.notice {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  margin-bottom: 1.5rem;
  max-width: var(--measure);
}

.notice-alert { border-left-color: var(--alert); }

.errors { color: #ff8a85; margin-bottom: 1.2rem; }
.errors ul { margin: 0; padding-left: 1.1rem; }

.status-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #444;
  margin-right: 0.4rem;
  vertical-align: 0.05rem;
}

.is-live { background: var(--accent); box-shadow: 0 0 8px rgba(77, 166, 255, 0.6); }
.is-done { background: var(--ok); box-shadow: 0 0 8px rgba(61, 220, 132, 0.5); }
.is-bad { background: var(--alert); box-shadow: 0 0 8px rgba(229, 57, 53, 0.6); }

.pitch { border-bottom: 1px solid var(--rule); padding: 1.3rem 0; }

.pitch-head {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.pitch-head .who { font-weight: 600; }
.pitch-head .when { color: var(--muted); font-size: 0.84rem; margin-left: auto; }

.feedback-body {
  white-space: pre-wrap;
  max-width: var(--measure);
  margin: 0.6rem 0 0.8rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.9rem 1rem;
}

.rate {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--muted);
}

.rate input[type='radio'] { accent-color: var(--accent); }

.empty {
  border: 1px dashed var(--rule);
  border-radius: 8px;
  padding: 2.5rem;
  text-align: center;
  color: var(--muted);
}

.muted { color: var(--muted); }

audio { filter: invert(0.9) hue-rotate(180deg); border-radius: 6px; }

/* ------------------------------------------------------------- админка */

.tabs {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.5rem;
  padding-bottom: 0.6rem;
  font-size: 0.92rem;
}

.tabs a { color: var(--muted); text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-current { color: var(--accent); font-weight: 600; }

.gauges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.75rem 2.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
}

.gauge-label { font-size: 0.88rem; color: var(--muted); }

.gauge-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 2.3rem;
  line-height: 1.1;
  margin: 0.15rem 0 0.55rem;
  color: var(--ok);
}

.gauge .meter { overflow: visible; }

.gauge .meter i {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--accent);
}

.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

.inline-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.inline-form input { width: auto; min-width: 6rem; }

code {
  background: #000;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.86em;
  color: var(--ok);
}

/* -------------------------------------------------- главная: стойка */

.hero { text-align: center; position: relative; padding: 2rem 0 1rem; }
.hero h1 { margin-bottom: 0.6rem; }
.hero .subtitle { font-size: 1.2rem; color: var(--muted); margin: 0 auto 1.5rem; }
.hero .lead { color: var(--muted); font-size: 0.94rem; margin: 0 auto 2rem; max-width: 38rem; }

/* Абзацы внутри первого экрана центрируются как блоки, а не только текстом:
   иначе общий max-width для p прижимает их влево. */
.hero p { margin-left: auto; margin-right: auto; }

.daw-side-left, .daw-side-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  opacity: 0.6;
}

.daw-side-left { left: 0; }
.daw-side-right { right: 0; align-items: flex-end; }

.timecode, .play-indicator, .input-label {
  font-family: 'JetBrains Mono', monospace;
  height: 24px;
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  border-radius: 4px;
  width: fit-content;
  box-sizing: border-box;
}

.timecode { font-size: 0.82rem; background: #000; border: 1px solid #333; color: var(--ok); }

.play-indicator {
  gap: 0.35rem;
  font-size: 0.68rem;
  background: #001a00;
  border: 1px solid #004d00;
  color: var(--ok);
  animation: pulsePlay 1.2s infinite ease-in-out;
}

.play-indicator::before { content: '▶'; font-size: 0.55rem; }

@keyframes pulsePlay {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(61, 220, 132, 0.3); }
  50% { opacity: 0.4; box-shadow: 0 0 2px rgba(61, 220, 132, 0.1); }
}

.vu-meter {
  width: 60px;
  height: 24px;
  background: #000;
  border: 1px solid #333;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.vu-fill {
  position: absolute;
  top: 4px;
  left: 2px;
  bottom: 4px;
  width: 0;
  background: linear-gradient(90deg, var(--ok) 60%, #ffeb3b 90%);
  border-radius: 2px;
  transition: width 0.1s ease-out;
}

.input-label {
  font-size: 0.68rem;
  color: var(--muted);
  background: #111;
  border: 1px solid #333;
  animation: pulseInput 2s infinite ease-in-out;
}

@keyframes pulseInput {
  0%, 100% { color: var(--muted); border-color: #333; }
  50% { color: var(--accent); border-color: rgba(77, 166, 255, 0.4); }
}

.signal-chain {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0 2.5rem;
}

.rack-unit {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.02), 0 4px 12px rgba(0, 0, 0, 0.25);
}

.rack-unit::before {
  content: attr(data-en);
  position: absolute;
  top: -1.4rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.rack-unit::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 12px;
  width: 6px;
  height: 6px;
  background: #333;
  border-radius: 50%;
}

.rack-unit:hover::after { background: var(--alert); box-shadow: 0 0 8px var(--alert); }

.rack-unit span { font-weight: 600; }

.arrow { color: var(--rule); font-size: 1.4rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.4rem;
}

.card h3 { margin: 0 0 0.6rem; }
.card p { font-size: 0.88rem; color: var(--muted); margin: 0; }

.curator-track {
  background: linear-gradient(145deg, #18181a, #1f1f22);
  border: 1px solid #3a2222;
  border-left: 4px solid var(--alert);
  border-radius: 8px;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.curator-track h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
}

.record-indicator {
  width: 12px;
  height: 12px;
  background: var(--alert);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(229, 57, 53, 0.8);
}

.curator-track p { color: #a0a0a0; font-size: 0.94rem; margin: 0 0 0.5rem; }

.tg-notice { color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: 0.84rem; }

@media (max-width: 48rem) {
  .daw-side-left, .daw-side-right { display: none; }
  .signal-chain { flex-direction: column; }
  .arrow { transform: rotate(90deg); }
  .cards { grid-template-columns: 1fr; }
  .curator-track { flex-direction: column; align-items: flex-start; }
  .strip { grid-template-columns: 1.75rem 1fr auto; row-gap: 0.5rem; }
  .strip .reach { grid-column: 2 / 4; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.support-widget {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 40;
}

.support-fab {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--accent);
  color: #08131f;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.support-fab:hover { filter: brightness(1.08); }

.support-panel {
  position: absolute;
  right: 0;
  bottom: 3.8rem;
  width: min(20rem, calc(100vw - 2.5rem));
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 0.6rem;
  padding: 1rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.support-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.support-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.support-close:hover { color: var(--ink); }

.support-panel label { display: block; margin-bottom: 0.6rem; }
.support-panel textarea { resize: vertical; }

@media (max-width: 30rem) {
  .support-widget { right: 1rem; bottom: 1rem; }
}
