/* ==========================================================================
   DevStudioRBX Design System – foundation layer
   Токены и базовые компоненты. Подключается ПЕРВЫМ на каждой странице,
   постраничные стили только дополняют его.
   ========================================================================== */

:root {
  /* --- Color: surfaces --- */
  --bg: #0a0b0e;
  --surface: #111318;
  --surface-2: #171a21;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* --- Color: text --- */
  --text: #f2f4f8;
  --text-secondary: #9ba3b4;
  --text-tertiary: #7d8598;

  /* --- Color: accent & status ---
     accent      – заливки и ссылки (белый текст поверх: 4.5:1)
     accent-deep – hover/active заливок
     accent-text – акцентный текст на тёмном фоне (6:1+) */
  --accent: #356fee;
  --accent-deep: #2b5fd9;
  --accent-text: #5b90ff;
  --accent-soft: rgba(61, 123, 253, 0.13);
  --ok: #30d158;
  --danger: #ff453a;
  --discord: #5865f2;

  /* --- Radius --- */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-full: 999px;

  /* --- Spacing scale (4px base) --- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  /* --- Elevation --- */
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 10px 32px rgba(0, 0, 0, 0.35);

  /* --- Typography --- */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  font-feature-settings: "cv05", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: var(--accent);
  text-decoration: none;
}
::selection {
  background: var(--accent);
  color: #fff;
}

/* --- Layout --- */
.wrap {
  width: min(1080px, calc(100vw - 48px));
  margin: 0 auto;
}
.section {
  padding: var(--sp-9) 0 0;
  /* Якорь не прячется под sticky-шапкой */
  scroll-margin-top: 72px;
}

/* --- Type scale --- */
.display {
  font-size: clamp(2.4rem, 5.5vw, 3.9rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.032em;
  margin: 0;
}
.h2 {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.022em;
  margin: 0;
}
.h3 {
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0;
}
.lead {
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}
.eyebrow {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 var(--sp-3);
}
.muted {
  color: var(--text-secondary);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 46px;
  padding: 0.7rem 1.35rem;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  color: var(--text);
  background: transparent;
  transition: background 0.18s ease, border-color 0.18s ease,
    color 0.18s ease, opacity 0.18s ease;
  white-space: nowrap;
}
.btn:active {
  opacity: 0.82;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-deep);
}
.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.btn-ghost {
  color: var(--text-secondary);
}
.btn-ghost:hover {
  color: var(--text);
  background: var(--surface);
}
.btn .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

/* --- Focus (keyboard) --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* --- Card --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  transition: border-color 0.2s ease, background 0.2s ease,
    transform 0.2s ease;
}
.card:hover {
  border-color: var(--border-strong);
}

/* --- Pills / chips --- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.38rem 0.85rem;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.pill-accent {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* --- Status dot --- */
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex: 0 0 auto;
}
.status-dot--pulse {
  animation: ds-pulse 2s ease-out infinite;
}
@keyframes ds-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(48, 209, 88, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(48, 209, 88, 0);
  }
}

/* --- Scroll reveal (активируется классом js на <html>) --- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* --- Legacy aliases (страницы на старых токенах: TOS, privacy) --- */
:root {
  --paper: var(--surface);
  --paper-2: var(--surface-2);
  --muted: var(--text-secondary);
  --accent-2: var(--accent-deep);
  --radius: var(--r-lg);
  --shadow: var(--shadow-md);
}
.paper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  color: var(--accent-text);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .status-dot--pulse {
    animation: none;
  }
  .btn,
  .card {
    transition: none;
  }
}
