:root {
  --bg: #090c12;
  --surface: #111622;
  --surface-2: #171e2e;
  --border: rgba(255, 255, 255, 0.09);
  --text: #eef2ff;
  --muted: #94a3b8;
  --red: #e11d48;
  --red-glow: rgba(225, 29, 72, 0.28);
  --green: #16a34a;
  --purple: #9333ea;
  --cyan: #0ea5e9;
  --teal: #14b8a6;
  --amber: #f59e0b;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle at 15% 10%, rgba(225, 29, 72, 0.14), transparent 38%),
    radial-gradient(circle at 85% 25%, rgba(20, 184, 166, 0.11), transparent 36%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: auto, auto, 42px 42px, 42px 42px;
}

.container {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(9, 12, 18, 0.78);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.metro-m {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 0 24px var(--red-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 22px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav a:hover {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-sm {
  padding: 8px 13px;
  font-size: 13px;
}

.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 8px 24px var(--red-glow);
}

.btn-primary:hover {
  background: #be123c;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.09);
}

.hero {
  padding-top: 34px;
}

.hero-card {
  background: linear-gradient(145deg, rgba(23, 30, 46, 0.92), rgba(14, 18, 28, 0.96));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.hero-profile {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
}

.avatar-wrap {
  position: relative;
  width: 120px;
  height: 120px;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.16);
}

.status-dot {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #22c55e;
  border: 3px solid var(--surface);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge-red {
  background: rgba(225, 29, 72, 0.18);
  color: #fda4af;
  border: 1px solid rgba(225, 29, 72, 0.35);
}

.badge-mono {
  font-family: "JetBrains Mono", monospace;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px solid var(--border);
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.1;
}

.hero-desc {
  margin: 0 0 18px;
  color: var(--muted);
  max-width: 68ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.kpi-grid {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kpi {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}

.kpi-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.kpi-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 24px;
  font-weight: 700;
}

.section {
  padding-top: 56px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.eyebrow {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: #fb7185;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
}

.section-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input,
.select-input {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
}

.search-input {
  min-width: 240px;
}

.select-sm {
  padding: 6px 10px;
  font-size: 13px;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tab {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.tab.active {
  background: var(--red);
  color: #fff;
  border-color: transparent;
}

.addons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

.addon-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.addon-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.22);
}

.addon-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #06080d;
  overflow: hidden;
}

.addon-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.addon-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(9, 12, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.addon-size {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(9, 12, 18, 0.85);
}

.addon-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.addon-title {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.3;
}

.addon-summary {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13.5px;
  flex: 1;
}

.addon-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: #cbd5e1;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.addon-actions {
  display: flex;
  gap: 8px;
}

.addon-actions .btn {
  flex: 1;
}

.metro-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
}

.line-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.line-btn {
  width: 100%;
  text-align: left;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.line-btn.active {
  background: var(--surface-2);
  border-color: rgba(255, 255, 255, 0.28);
}

.line-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.line-detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.station-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 0;
  margin: 22px 0;
}

.station-node {
  display: flex;
  align-items: center;
}

.station-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
}

.station-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.station-link {
  width: 24px;
  height: 4px;
}

.line-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.meta-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.cab-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.cab-ars,
.cab-informator {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.cab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}

.mono-pill {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
  padding: 3px 8px;
  border-radius: 6px;
}

.ars-lamps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.lamp {
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0a0d14;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

.lamp.active {
  background: rgba(34, 197, 94, 0.22);
  border-color: #22c55e;
  color: #86efac;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.25);
}

.lamp.warn.active {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
  color: #fde68a;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.25);
}

.lamp.danger.active {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.3);
}

.speed-readout {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #07090e;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.speed-digits {
  font-family: "JetBrains Mono", monospace;
  font-size: 32px;
  font-weight: 700;
  color: #4ade80;
  white-space: nowrap;
}

.speed-digits small {
  font-size: 13px;
  color: var(--muted);
}

.ars-desc {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

.inf-top-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-xs {
  padding: 5px 9px;
  font-size: 12px;
  border-radius: 8px;
}

.inf-screen {
  background: #07090e;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  min-height: 132px;
  margin-bottom: 14px;
}

.inf-screen-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.inf-route {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: #38bdf8;
}

.inf-eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
  opacity: 0.25;
}

.inf-eq span {
  width: 3px;
  height: 4px;
  border-radius: 2px;
  background: #38bdf8;
}

.inf-screen.is-playing .inf-eq {
  opacity: 1;
}

.inf-screen.is-playing .inf-eq span {
  animation: eqPulse 0.6s ease-in-out infinite alternate;
}

.inf-screen.is-playing .inf-eq span:nth-child(2) { animation-delay: 0.15s; }
.inf-screen.is-playing .inf-eq span:nth-child(3) { animation-delay: 0.3s; }
.inf-screen.is-playing .inf-eq span:nth-child(4) { animation-delay: 0.45s; }

@keyframes eqPulse {
  from { height: 4px; }
  to { height: 14px; }
}

.inf-phase-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.inf-phase {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: #4ade80;
}

.inf-track-name {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
}

.inf-current {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

.inf-progress {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 12px;
}

.inf-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #4ade80);
  transition: width 0.12s linear;
}

.inf-stations-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inf-st-chip {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  cursor: pointer;
}

.inf-st-chip.active {
  background: rgba(56, 189, 248, 0.18);
  color: #e0f2fe;
  border-color: #38bdf8;
}

.inf-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.inf-vol-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

.inf-vol-wrap input[type="range"] {
  width: 78px;
  accent-color: #38bdf8;
  cursor: pointer;
}

.inf-audio-status {
  margin-top: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
}

.inf-controls .btn[aria-pressed="true"] {
  border-color: #22c55e;
  color: #86efac;
  background: rgba(34, 197, 94, 0.15);
}

.contact-banner {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.14), rgba(17, 22, 34, 0.96));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  align-items: center;
}

.contact-banner p {
  color: var(--muted);
  margin: 8px 0 0;
}

.contact-links {
  display: grid;
  gap: 10px;
}

.contact-tile {
  background: rgba(9, 12, 18, 0.72);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.contact-k {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
}

.mono {
  font-family: "JetBrains Mono", monospace;
}

.footer {
  padding: 36px 0 44px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.78);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 60;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: min(720px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 24px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.modal-img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
}

.modal-desc {
  white-space: pre-line;
  color: #cbd5e1;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin: 14px 0;
}

@media (max-width: 900px) {
  .nav {
    display: none;
  }
  .hero-profile,
  .metro-layout,
  .cab-panel,
  .contact-banner {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .line-meta {
    grid-template-columns: 1fr;
  }
}
