/* =========================================================================
   PRISMA — фирменная тема
   Тёмная база + иридесцентный спектр (преломление призмы)
   ========================================================================= */

:root {
  /* Фоны */
  --bg:          #06060a;
  --bg-elev:     #0b0b12;
  --surface:     rgba(255, 255, 255, .025);
  --surface-2:   rgba(255, 255, 255, .045);
  --border:      rgba(255, 255, 255, .08);
  --border-2:    rgba(255, 255, 255, .14);

  /* Текст */
  --text:        #ececf5;
  --text-dim:    #b7b7c9;
  --muted:       #7d7d93;

  /* Спектр призмы */
  --violet:      #38bdf8;   /* (имя историческое) теперь голубой */
  --indigo:      #3b82f6;
  --blue:        #2563eb;
  --cyan:        #22d3ee;
  --green:       #34d399;   /* только для статуса «онлайн» */
  --amber:       #fbbf24;   /* для предупреждений/рангов */

  --spectrum:    linear-gradient(110deg, #22d3ee, #38bdf8, #3b82f6, #2563eb);
  --spectrum-soft: linear-gradient(110deg, rgba(34,211,238,.85), rgba(56,189,248,.85), rgba(59,130,246,.85), rgba(37,99,235,.85));

  /* Радиусы / тени */
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --shadow:     0 10px 40px -12px rgba(0, 0, 0, .7);
  --glow:       0 0 0 1px rgba(255,255,255,.06), 0 8px 50px -10px rgba(59, 130, 246, .35);

  --header-h: 70px;
  --maxw: 1180px;
}

/* ----------------------------------------------------------------- reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Спектральные «блобы» фона */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 15% 0%,   rgba(56, 189, 248, .18), transparent 70%),
    radial-gradient(50% 45% at 90% 10%,  rgba(34, 211, 238, .14), transparent 70%),
    radial-gradient(45% 45% at 60% 100%, rgba(59, 130, 246, .10), transparent 70%);
  filter: blur(10px);
  animation: drift 22s ease-in-out infinite alternate;
}
/* Тонкая сетка */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}
@keyframes drift {
  0%   { transform: translate3d(0,0,0)        scale(1); }
  100% { transform: translate3d(-3%, 2%, 0)   scale(1.08); }
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

::selection { background: rgba(56, 189, 248, .35); color: #fff; }

/* Скроллбар */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--indigo), var(--violet));
  border-radius: 99px;
  border: 3px solid var(--bg);
}

/* ----------------------------------------------------------------- layout */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.section { padding: 92px 0; }
.section-sm { padding: 56px 0; }
main { min-height: 60vh; }

/* Утилиты */
.grad-text {
  background: var(--spectrum);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-dim);
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
}
.eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 99px;
  background: var(--spectrum);
}
.section-head { text-align: center; max-width: 640px; margin: 0 auto 52px; }
.section-head h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: -.02em; margin: 18px 0 12px; }
.section-head p { color: var(--text-dim); font-size: 17px; }

/* ----------------------------------------------------------------- header */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(8, 8, 14, .6);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
  transition: background .3s, border-color .3s;
}
.site-header.scrolled { background: rgba(8, 8, 14, .85); border-color: var(--border-2); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; letter-spacing: .02em; }
.brand img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 2px 10px rgba(59,130,246,.5)); }
.brand span { background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative; padding: 9px 14px; border-radius: var(--r-sm);
  color: var(--text-dim); font-weight: 500; font-size: 15px;
  transition: color .2s, background .2s;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: var(--text); }
.nav a.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px;
  background: var(--spectrum); border-radius: 2px;
}

.header-actions { display: flex; align-items: center; gap: 10px; }

/* Бургер */
.burger { display: none; background: none; border: 1px solid var(--border); border-radius: var(--r-sm);
  width: 42px; height: 42px; cursor: pointer; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.burger span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: .25s; }
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 20px; border-radius: var(--r-sm);
  font-weight: 600; font-size: 15px; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s, box-shadow .25s, background .25s, border-color .25s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { color: #fff; position: relative; background: #111; }
.btn-primary {
  background:
    linear-gradient(#0b0b12, #0b0b12) padding-box,
    var(--spectrum) border-box;
  border: 1.5px solid transparent;
  box-shadow: 0 6px 30px -8px rgba(59, 130, 246, .55);
}
.btn-primary:hover { box-shadow: 0 10px 40px -6px rgba(56, 189, 248, .7); transform: translateY(-2px); }
.btn-fill { color: #0a0a0f; background: var(--spectrum); font-weight: 700; }
.btn-fill:hover { transform: translateY(-2px); box-shadow: 0 12px 40px -8px rgba(59, 130, 246, .55); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-2); transform: translateY(-2px); }
.btn-discord { background: #5865F2; color: #fff; }
.btn-discord:hover { background: #4853e0; transform: translateY(-2px); box-shadow: 0 10px 30px -8px rgba(88,101,242,.6); }
.btn-sm { padding: 8px 14px; font-size: 14px; }

/* ----------------------------------------------------------------- hero */
.hero { position: relative; padding: calc(var(--header-h) + 70px) 0 90px; text-align: center; overflow: hidden; }
.hero-logo {
  width: 150px; height: 150px; margin: 0 auto 26px; object-fit: contain;
  filter: drop-shadow(0 8px 50px rgba(59, 130, 246, .6));
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.hero h1 { font-size: clamp(44px, 8vw, 92px); font-weight: 900; letter-spacing: -.03em; line-height: 1; margin-bottom: 22px; }
.hero h1 .grad-text { background-size: 200% auto; animation: shimmer 6s linear infinite; }
@keyframes shimmer { to { background-position: 200% center; } }
.hero .lead { font-size: clamp(16px, 2.2vw, 21px); color: var(--text-dim); max-width: 620px; margin: 0 auto 36px; }

.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; }

/* IP-плашка */
.ip-pill {
  display: inline-flex; align-items: center; gap: 0; margin: 0 auto;
  border: 1px solid var(--border-2); border-radius: 99px;
  background: var(--surface); overflow: hidden; backdrop-filter: blur(10px);
}
.ip-pill .ip-label { padding: 12px 8px 12px 20px; color: var(--muted); font-size: 14px; }
.ip-pill .ip-val   { padding: 12px 6px; font-weight: 700; font-size: 16px; font-family: ui-monospace, "Cascadia Code", monospace; letter-spacing: .02em; }
.ip-pill button {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 12px 18px; margin-left: 6px; border: none; cursor: pointer;
  background: var(--spectrum); color: #0a0a0f; font-weight: 700; font-size: 14px;
  transition: filter .2s;
}
.ip-pill button:hover { filter: brightness(1.12); }
.ip-pill button.copied { background: var(--green); }

/* ----------------------------------------------------------------- статус */
.status-pill {
  display: inline-flex; align-items: center; gap: 11px;
  padding: 9px 18px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface); font-size: 15px; font-weight: 500;
}
.status-dot { width: 9px; height: 9px; border-radius: 99px; background: var(--muted); flex-shrink: 0; }
.status-pill.online  .status-dot { background: var(--green); box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 2s infinite; }
.status-pill.offline .status-dot { background: #ef4444; }
.status-pill .s-count { color: var(--text); font-weight: 700; }
.status-pill .s-count b { color: var(--green); }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
  70%  { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ----------------------------------------------------------------- cards / grid */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  position: relative; padding: 26px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .25s, border-color .25s, background .25s;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--spectrum); opacity: 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  transition: opacity .3s;
}
.card:hover { transform: translateY(-5px); background: var(--surface-2); }
.card:hover::before { opacity: .9; }
.card .icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  font-size: 26px; margin-bottom: 18px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.card h3 { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.card p { color: var(--text-dim); font-size: 15px; }
.card .card-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; font-weight: 600; font-size: 14px; color: var(--cyan); }
.card .card-link::after { content: "→"; transition: transform .2s; }
.card:hover .card-link::after { transform: translateX(4px); }

/* ----------------------------------------------------------------- news */
.news-card { display: flex; flex-direction: column; padding: 0; }
.news-card .news-body { padding: 24px; }
.news-card .news-date { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.news-card h3 { margin: 10px 0; font-size: 20px; }
.news-card p { color: var(--text-dim); font-size: 15px; }
.tag { display: inline-block; padding: 3px 11px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim); }

/* ----------------------------------------------------------------- team */
.member { text-align: center; padding: 30px 22px; }
.member .avatar {
  width: 96px; height: 96px; margin: 0 auto 16px; border-radius: 24px; object-fit: cover;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
}
.member .role-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px;
  padding: 4px 12px; border-radius: 99px; font-size: 13px; font-weight: 600;
}
.member .role-badge img { width: 15px; height: 15px; }
.member h3 { font-size: 18px; margin-bottom: 4px; }
.member p { color: var(--muted); font-size: 14px; }

/* ----------------------------------------------------------------- two-col docs (вики/правила) */
.doc-layout { display: grid; grid-template-columns: 250px 1fr; gap: 40px; align-items: start; padding-top: calc(var(--header-h) + 40px); }
.doc-sidebar { position: sticky; top: calc(var(--header-h) + 24px); }
.doc-sidebar .sb-group { margin-bottom: 24px; }
.doc-sidebar .sb-title { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; margin-bottom: 10px; padding-left: 12px; }
.doc-sidebar a {
  display: block; padding: 8px 12px; border-radius: var(--r-sm); color: var(--text-dim);
  font-size: 15px; border-left: 2px solid transparent; transition: .2s;
}
.doc-sidebar a:hover { color: var(--text); background: var(--surface); }
.doc-sidebar a.active { color: var(--text); border-left-color: var(--violet); background: var(--surface); }

/* ----------------------------------------------------------------- article (рендер markdown) */
.page-head { padding: calc(var(--header-h) + 50px) 0 0; }
.page-head h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 900; letter-spacing: -.02em; }
.page-head p { color: var(--text-dim); font-size: 18px; margin-top: 12px; max-width: 680px; }

.prose { font-size: 16.5px; color: var(--text-dim); max-width: 820px; }
.prose > *:first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--text); font-weight: 800; line-height: 1.25; letter-spacing: -.01em; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h1 { font-size: 32px; margin: 40px 0 18px; }
.prose h2 { font-size: 26px; margin: 36px 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.prose h3 { font-size: 20px; margin: 28px 0 12px; }
.prose p { margin: 14px 0; }
.prose a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(34,211,238,.4); }
.prose a:hover { text-decoration-color: var(--cyan); }
.prose ul, .prose ol { margin: 14px 0 14px 24px; }
.prose li { margin: 7px 0; }
.prose ul li::marker { color: var(--violet); }
.prose strong { color: var(--text); font-weight: 700; }
.prose blockquote {
  margin: 20px 0; padding: 14px 20px; border-left: 3px solid var(--violet);
  background: var(--surface); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text-dim);
}
.prose code { font-family: ui-monospace, "Cascadia Code", monospace; font-size: .9em;
  background: var(--surface-2); border: 1px solid var(--border); padding: 2px 7px; border-radius: 6px; color: var(--cyan); }
.prose pre { background: #07070d; border: 1px solid var(--border); border-radius: var(--r); padding: 18px 20px; overflow-x: auto; margin: 18px 0; }
.prose pre code { background: none; border: none; padding: 0; color: var(--text-dim); }
.prose img { border-radius: var(--r); border: 1px solid var(--border); margin: 22px 0; }
.prose hr { border: none; height: 1px; background: var(--border); margin: 32px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 15px; }
.prose th, .prose td { padding: 10px 14px; border: 1px solid var(--border); text-align: left; }
.prose th { background: var(--surface-2); color: var(--text); font-weight: 700; }

/* Колбек: пустой/загрузка */
.muted-box { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--r); }
.spinner { width: 26px; height: 26px; border: 3px solid var(--border); border-top-color: var(--violet); border-radius: 99px; animation: spin .8s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------- rules images */
.rule-block { margin-bottom: 18px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.rule-block img { width: 100%; display: block; }

/* ----------------------------------------------------------------- CTA band */
.cta-band {
  text-align: center; padding: 70px 30px; border-radius: var(--r-lg);
  background:
    linear-gradient(var(--bg-elev), var(--bg-elev)) padding-box,
    var(--spectrum) border-box;
  border: 1.5px solid transparent;
  position: relative; overflow: hidden;
}
.cta-band::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(60% 120% at 50% 0%, rgba(59,130,246,.22), transparent 70%);
}
.cta-band h2 { font-size: clamp(26px, 4vw, 40px); font-weight: 800; margin-bottom: 14px; }
.cta-band p { color: var(--text-dim); margin-bottom: 28px; font-size: 17px; }

/* ----------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 56px 0 30px; position: relative; }
.site-footer::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 2px; background: var(--spectrum); opacity: .7; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { color: var(--muted); font-size: 15px; max-width: 320px; }
.footer-col h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .1em; color: var(--text); margin-bottom: 16px; }
.footer-col a { display: block; color: var(--text-dim); font-size: 15px; padding: 5px 0; transition: color .2s; }
.footer-col a:hover { color: var(--cyan); }
.footer-bottom { padding-top: 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }

/* ----------------------------------------------------------------- reveal-анимация */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].in { opacity: 1; transform: none; }

/* ----------------------------------------------------------------- адаптив */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .doc-layout { grid-template-columns: 1fr; }
  .doc-sidebar { position: static; margin-bottom: 20px; padding: 16px; border: 1px solid var(--border); border-radius: var(--r); }
}
@media (max-width: 720px) {
  .nav, .header-actions .btn-desktop { display: none; }
  .nav.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    position: absolute; top: var(--header-h); left: 0; right: 0; padding: 16px 22px 22px;
    background: rgba(8,8,14,.97); backdrop-filter: blur(18px); border-bottom: 1px solid var(--border);
  }
  .nav.open a { padding: 13px 14px; font-size: 16px; }
  .burger { display: flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .section { padding: 64px 0; }
  .ip-pill { flex-wrap: wrap; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, body::before { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
