/* ─── Reset & base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ─── Design tokens — mirrored from landing/ for visual continuity ─── */
:root {
  --bg-deep:       #0d0e10;
  --bg-secondary:  #111214;
  --bg-card:       #1a1b1e;
  --bg-card-hover: #1f2023;
  --bg-input:      #252629;

  --accent:        #00c8ff;
  --accent-hover:  #7b2fff;
  --gradient:      linear-gradient(135deg, #00c8ff 0%, #7b2fff 100%);
  --gradient-text: linear-gradient(135deg, #00c8ff 0%, #b060ff 100%);

  --border:        rgba(0, 200, 255, 0.08);
  --border-mid:    rgba(0, 200, 255, 0.15);
  --border-bright: rgba(0, 200, 255, 0.30);
  --glow-cyan:     rgba(0, 200, 255, 0.20);
  --glow-purple:   rgba(123, 47, 255, 0.15);

  --text-normal:   #dbdee1;
  --text-muted:    #949ba4;
  --text-faint:    #5c5f66;

  --green:         #23a55a;
  --red:           #ed4245;

  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-normal);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Animated background — same recipe as landing/ ─── */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 800px 600px at 10% 90%,  rgba(0, 200, 255, .07) 0%, transparent 70%),
    radial-gradient(ellipse 700px 500px at 90% 10%,  rgba(123, 47, 255, .06) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 50% 50%,  rgba(0, 200, 255, .03) 0%, transparent 70%);
  animation: bgDrift 25s ease-in-out infinite alternate;
}
@keyframes bgDrift {
  0%   { opacity: 1; transform: scale(1) translate(0, 0); }
  50%  { transform: scale(1.05) translate(-20px, 15px); }
  100% { opacity: .8; transform: scale(1) translate(10px, -10px); }
}

.grid-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0,200,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,200,255,.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

.page { position: relative; z-index: 1; }

/* ─── Nav ─── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(13, 14, 16, .7);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.nav-logo img { display: block; height: 34px; width: auto; }
.nav-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-normal);
  letter-spacing: 0.5px;
}
.nav-right { display: flex; align-items: center; gap: 8px; }

/* Language switcher: pill with two buttons, no chrome until hover */
.lang-switch {
  display: inline-flex;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.lang-btn {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: color .15s, background .15s;
}
.lang-btn:hover { color: var(--text-normal); }
.lang-btn.active {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 0 12px var(--glow-cyan);
}

/* ─── Hero ─── */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 96px 32px 48px;
  text-align: center;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ─── Service cards grid ─── */
.services {
  max-width: 1100px;
  margin: 32px auto 80px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
@media (max-width: 800px) {
  .services { grid-template-columns: 1fr; }
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 400px 200px at 50% 0%, var(--glow-cyan) 0%, transparent 70%);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.service-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
}
.service-card:hover::before { opacity: 1; }

.service-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}
.service-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 18px var(--glow-cyan);
  flex-shrink: 0;
}
.service-icon svg { width: 26px; height: 26px; }
.service-title-block { flex: 1; min-width: 0; }
.service-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-normal);
  margin-bottom: 2px;
}
.service-host {
  font-size: 13px;
  color: var(--text-faint);
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
}

/* Online status badge — refreshed by ts-status.js. Three visual states:
 *  .online  — green dot, fetched counts
 *  .offline — red dot, "сервер недоступен"
 *  .loading — gray pulse while the very first fetch is in flight */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
  white-space: nowrap;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  box-shadow: 0 0 0 0 transparent;
}
.status-badge.online .status-dot {
  background: var(--green);
  box-shadow: 0 0 8px rgba(35, 165, 90, .6);
}
.status-badge.online { color: var(--text-normal); }
.status-badge.offline .status-dot { background: var(--red); }
.status-badge.offline { color: var(--text-muted); }
.status-badge.loading .status-dot { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: .35; }
  50%      { opacity: 1; }
}

.service-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-muted);
  position: relative;
}

.service-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  position: relative;
}
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  font-family: inherit;
  transition: transform .15s, box-shadow .2s, background .15s;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 16px var(--glow-cyan);
}
.btn-primary:hover { box-shadow: 0 6px 22px var(--glow-cyan); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary {
  background: rgba(255, 255, 255, .04);
  color: var(--text-normal);
  border: 1px solid var(--border-mid);
}
.btn-secondary:hover { background: rgba(255, 255, 255, .07); border-color: var(--border-bright); }

/* ─── AceCord CSS-mock preview ─── */
/* Mirrors the styles in landing/ but compact, fitting inside the service-card. */
.preview-mini {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  font-size: 11px;
  position: relative;
}
.preview-mini-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border);
}
.preview-mini-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.preview-mini-bar span:nth-child(1) { background: #ed4245; }
.preview-mini-bar span:nth-child(2) { background: #faa61a; }
.preview-mini-bar span:nth-child(3) { background: #23a55a; }
.preview-mini-body {
  display: flex;
  height: 140px;
}
.preview-mini-sidebar {
  width: 95px;
  background: rgba(0, 0, 0, .25);
  padding: 8px 6px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.preview-mini-ch {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}
.preview-mini-ch.active {
  background: rgba(0, 200, 255, .08);
  color: var(--text-normal);
}
.preview-mini-ch .ch-icon { color: var(--text-faint); }
.preview-mini-main {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.preview-mini-msg {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.preview-mini-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
}
.preview-mini-msg-body { flex: 1; min-width: 0; }
.preview-mini-msg-name { color: var(--accent); font-weight: 600; font-size: 10px; }
.preview-mini-msg-text { color: var(--text-normal); font-size: 11px; line-height: 1.35; }

/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}
footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--text-normal); }
