/* Design tokens, reset and shared primitives. */

:root {
  /* Warm, slightly lifted darks: pure near-black read as cold and empty. */
  --bg: #0d0a12;
  --bg-1: #14101b;
  --bg-2: #1c1725;
  --bg-3: #251e30;
  --bg-hover: #2e2539;

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --text: #f7f4f8;
  --text-2: #b4adbd;
  --text-3: #7b7488;

  --pink: #ff2d78;
  --pink-soft: #ff5fa2;
  --violet: #a838ff;
  --accent-grad: linear-gradient(135deg, #ff2d78 0%, #c13bff 100%);
  --online: #35d07f;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;

  --sidebar-w: 248px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 68px;

  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 18px 44px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 10px 34px rgba(255, 45, 120, 0.35);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --font-display: "Poppins", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

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

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Ambient glow. Three sources instead of two, so the page never falls away into
   flat black at the bottom or along the edges. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(980px 680px at 10% -10%, rgba(255, 45, 120, 0.26), transparent 68%),
    radial-gradient(880px 620px at 98% 4%, rgba(168, 56, 255, 0.24), transparent 70%),
    radial-gradient(1100px 700px at 50% 108%, rgba(193, 59, 255, 0.16), transparent 72%);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.6rem);
}

h2 {
  font-size: clamp(1.3rem, 1.05rem + 1vw, 1.85rem);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

/* Images carry width/height attributes only to reserve layout space; the
   rendered box must come from CSS (aspect-ratio or the intrinsic ratio). */
img {
  height: auto;
}

::selection {
  background: rgba(255, 45, 120, 0.35);
}

:focus-visible {
  outline: 2px solid var(--pink-soft);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Wordmark ---------- */

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  color: #fdfbfd;
}

.wordmark__dotted {
  position: relative;
}

.wordmark__dotted::after {
  content: "";
  position: absolute;
  top: -0.24em;
  right: 0.02em;
  width: 0.2em;
  height: 0.2em;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 12px rgba(255, 45, 120, 0.85);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease),
    box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}

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

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn--primary:hover {
  box-shadow: 0 14px 40px rgba(255, 45, 120, 0.5);
}

.btn--ghost {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

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

.btn--quiet {
  color: var(--text-2);
  padding: 10px 14px;
}

.btn--quiet:hover {
  color: var(--text);
}

.btn--lg {
  padding: 14px 26px;
  font-size: 0.98rem;
}

.btn--block {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-2);
  background: rgba(16, 14, 22, 0.6);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  transition: color 0.18s var(--ease), background 0.18s var(--ease),
    transform 0.18s var(--ease);
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(40, 34, 52, 0.85);
  transform: scale(1.06);
}

.icon-btn.is-active {
  color: var(--pink);
  border-color: rgba(255, 45, 120, 0.5);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

/* ---------- Badges & chips ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 45, 120, 0.16);
  border: 1px solid rgba(255, 45, 120, 0.32);
  color: #ffc4dc;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* A counter with nothing to count should not leave an empty pill behind. */
.badge:empty {
  display: none;
}

.badge--neutral {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line);
  color: var(--text-2);
}

.dot-online {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 10px rgba(53, 208, 127, 0.9);
  flex: none;
}

.dot-online--off {
  background: #6b6478;
  box-shadow: none;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  padding: 7px 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font-size: 0.82rem;
  white-space: nowrap;
  transition: all 0.18s var(--ease);
}

.chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.chip.is-active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  font-weight: 500;
}

.chip:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.chip:disabled:hover {
  color: var(--text-2);
  border-color: var(--line);
}

/* ---------- Forms ---------- */

.field {
  display: block;
  margin-bottom: 14px;
}

.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: var(--text-2);
}

.field__input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.field__input::placeholder {
  color: var(--text-3);
}

.field__input:focus {
  outline: none;
  border-color: rgba(255, 45, 120, 0.6);
  background: rgba(255, 255, 255, 0.07);
}

/* ---------- Scrollbars ---------- */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--r-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.26);
  background-clip: content-box;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
