/* ============================================================
   blaid. — design tokens
   Near-black + deep wine red, Space Grotesk display / Inter body.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0A0A0B;
  --bg-raised: #131316;
  --bg-raised-2: #1A1A1E;
  --border: #232326;
  --border-soft: #1A1A1D;

  --red: #8B1E2F;
  --red-bright: #B23A4C;
  --red-dim: #4A1219;

  --text: #F2F0EE;
  --text-muted: #9A989C;
  --text-faint: #616166;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius: 10px;
  --radius-sm: 6px;

  --shadow-soft: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--red-dim); color: var(--text); }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 900px 500px at 50% -10%, rgba(139, 30, 47, 0.16), transparent 60%),
    radial-gradient(ellipse 700px 400px at 90% 100%, rgba(139, 30, 47, 0.08), transparent 60%);
  pointer-events: none;
}

/* Loading screen */

.loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.4rem;
  letter-spacing: -0.01em;
  color: var(--text);
  animation: loader-blink 1.1s ease-in-out infinite;
}

@keyframes loader-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

.page {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.page.revealed { opacity: 1; transform: translateY(0); }

/* Top navigation */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  background: rgba(10, 10, 11, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.topbar-right { display: flex; align-items: center; gap: 18px; position: relative; }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.icon-btn:hover { color: var(--text); border-color: var(--red); background: rgba(139, 30, 47, 0.1); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.menu-toggle:hover { border-color: var(--red); background: rgba(139, 30, 47, 0.1); transform: translateY(-1px); }

.menu-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  margin: 0 auto;
  background: var(--text-muted);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.nav-panel {
  position: fixed;
  top: 78px;
  right: 40px;
  z-index: 45;
  min-width: 220px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 8px;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.nav-panel a {
  display: block;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-panel a:hover { background: var(--bg-raised-2); color: var(--text); }

.dot-panel {
  position: absolute;
  top: 48px;
  right: 0;
  min-width: 160px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 6px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.dot-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.dot-panel a {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  color: var(--text-muted);
}

.dot-panel a:hover { background: var(--bg-raised-2); color: var(--text); }

/* Homepage hero */

.hero {
  max-width: 780px;
  margin: 0 auto;
  padding: 140px 24px 100px;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 22px;
}

.hero .lead {
  color: var(--text-muted);
  font-size: 1.06rem;
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.65;
}

.hero .actions { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-bright); transform: translateY(-1px); }

.btn.secondary { background: transparent; border-color: var(--border); color: var(--text); }
.btn.secondary:hover { border-color: var(--text-faint); transform: translateY(-1px); }

/* Docs layout */

.docs-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  max-width: 1180px;
  margin: 0 auto;
  min-height: calc(100vh - 79px);
}

.docs-sidebar { border-right: 1px solid var(--border-soft); padding: 28px 20px; transition: max-height 0.2s ease; }
.docs-sidebar .docs-nav-group { overflow: hidden; }
.docs-sidebar.sidebar-collapsed .docs-nav-group { display: none; }

.docs-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 40px;
  font-size: 0.85rem;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border-soft);
}

.docs-crumb .sep { color: var(--text-faint); }
.docs-crumb .current { color: var(--text-muted); }

.docs-nav-group { margin-bottom: 22px; }

.docs-nav-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0.03em;
  margin: 0 0 8px 10px;
}

.docs-nav-group a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}

.docs-nav-group a:hover { background: var(--bg-raised); color: var(--text); }
.docs-nav-group a.active { background: var(--bg-raised); color: var(--text); border-left: 2px solid var(--red); padding-left: 8px; }

.docs-content { padding: 48px 56px; max-width: 680px; }
.docs-content h1 { font-family: var(--font-display); font-size: 2rem; margin: 0 0 6px; }
.docs-content .docs-sub { color: var(--text-muted); margin: 0 0 32px; }
.docs-content h2 { font-family: var(--font-display); font-size: 1.25rem; margin: 36px 0 12px; }
.docs-content p { color: var(--text-muted); margin: 0 0 16px; }

.docs-content code {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.88em;
  color: var(--red-bright);
}

/* Commands page */

.cmd-header {
  max-width: 1000px;
  margin: 0 auto;
  padding: 44px 24px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cmd-header h1 { font-family: var(--font-display); font-size: 1.9rem; margin: 0; }

.cmd-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  width: 280px;
}

.cmd-search svg { width: 16px; height: 16px; color: var(--text-faint); flex-shrink: 0; }

.cmd-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.9rem;
  width: 100%;
  font-family: var(--font-body);
}

.cmd-search input::placeholder { color: var(--text-faint); }

.cmd-body { max-width: 1000px; margin: 0 auto; padding: 24px 24px 100px; }

.category-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  margin: 28px 0 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.category-bar .count { font-family: var(--font-body); font-weight: 500; color: var(--text-faint); font-size: 0.82rem; }

.cmd-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 12px;
  background: var(--bg-raised);
}

.cmd-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.cmd-name { font-family: 'Space Grotesk', monospace; font-weight: 600; font-size: 1.02rem; color: var(--text); }

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-faint);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.copy-btn:hover { border-color: var(--red); color: var(--text); }
.copy-btn svg { width: 13px; height: 13px; }

.cmd-desc { color: var(--text-muted); font-size: 0.92rem; margin: 10px 0 0; }

.cmd-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.cmd-meta-block .label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0.02em;
  margin: 0 0 6px;
}

.cmd-meta-block .value { font-size: 0.86rem; color: var(--text-muted); font-family: 'Space Grotesk', monospace; }
.cmd-meta-block .value.perm { font-family: var(--font-body); color: var(--red-bright); }

/* Scroll-reveal (one appearance per element, respects reduced motion).
   IMPORTANT: content is visible by default - JS only ADDS a
   "reveal-armed" class right before observing, so if JS fails for any
   reason, nothing on the page is ever permanently hidden. */

.reveal.reveal-armed {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.reveal-armed.in-view { opacity: 1; transform: translateY(0); }

/* Category chip bar - horizontal, swipeable on mobile, sticky under topbar */

.chip-bar-wrap {
  position: sticky;
  top: 79px;
  z-index: 30;
  background: rgba(10, 10, 11, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
  padding: 14px 24px;
}

.chip-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  max-width: 1000px;
  margin: 0 auto;
  scrollbar-width: none;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px;
}

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

.chip {
  scroll-snap-align: start;
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.chip:hover { color: var(--text); background: var(--bg-raised-2); }

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

/* Discord-style embed preview (used by the embed builder) */

.discord-preview-shell {
  background: #17181C;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.discord-embed {
  background: #232326;
  border-left: 4px solid var(--red);
  border-radius: 8px;
  padding: 14px 16px;
  max-width: 460px;
  font-size: 0.9rem;
  color: #DBDEE1;
}

.de-author { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 600; font-size: 0.86rem; color: #fff; }
.de-author img { width: 20px; height: 20px; border-radius: 50%; }
.de-title { font-weight: 700; color: #fff; margin-bottom: 6px; font-size: 1rem; }
.de-desc { white-space: pre-wrap; line-height: 1.4; color: #DBDEE1; }
.de-thumb { float: right; width: 76px; height: 76px; border-radius: 6px; object-fit: cover; margin-left: 12px; }
.de-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.de-field-name { font-weight: 600; color: #fff; font-size: 0.83rem; margin-bottom: 3px; }
.de-field-value { color: #DBDEE1; font-size: 0.86rem; }
.de-image { width: 100%; border-radius: 6px; margin-top: 10px; }
.de-footer { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 0.76rem; color: #9298A0; }
.de-footer img { width: 18px; height: 18px; border-radius: 50%; }

/* Embed builder layout */

.builder-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 44px 24px 100px;
}

.builder-shell h1 { font-family: var(--font-display); font-size: 1.9rem; margin: 0 0 8px; }
.builder-shell .lead { color: var(--text-muted); margin: 0 0 32px; max-width: 620px; }

.builder-grid { display: grid; grid-template-columns: 1fr 380px; gap: 28px; align-items: start; }

.field-group { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.field-group input, .field-group textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.field-group input:focus, .field-group textarea:focus { border-color: var(--red); }
.field-group textarea { resize: vertical; }

.color-field { display: flex; align-items: flex-end; gap: 10px; }
.color-field input[type="color"] {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  padding: 0;
  background: none;
  cursor: pointer;
  overflow: hidden;
}

.preview-sticky { position: sticky; top: 100px; }

.json-output {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 14px;
}

/* Status page */

.status-shell { max-width: 800px; margin: 0 auto; padding: 60px 24px 100px; }
.status-shell h1 { font-family: var(--font-display); font-size: 2rem; margin: 0 0 24px; }

.status-hero {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 20px;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
}

.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 10px; background: var(--text-faint); }
.status-dot.online { background: #3BA55D; box-shadow: 0 0 8px rgba(59, 165, 93, 0.6); }
.status-dot.offline { background: var(--red-bright); }

.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.status-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.status-card .value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; }
.status-card .label { color: var(--text-faint); font-size: 0.8rem; margin-top: 4px; }

/* Premium page */

.premium-shell { max-width: 980px; margin: 0 auto; padding: 60px 24px 100px; text-align: center; }
.premium-shell h1 { font-family: var(--font-display); font-size: 2.2rem; margin: 0 0 12px; }
.premium-shell .lead { color: var(--text-muted); max-width: 560px; margin: 0 auto 48px; }

.plans-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; text-align: left; }

.plan-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
}

.plan-card.featured { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }

.plan-card h2 { font-family: var(--font-display); font-size: 1.3rem; margin: 0 0 6px; }
.plan-card .plan-sub { color: var(--text-muted); font-size: 0.88rem; margin: 0 0 20px; }

.plan-price-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.plan-price-row .amount { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.plan-price-row .period { color: var(--text-faint); font-size: 0.82rem; }

.plan-list { list-style: none; padding: 0; margin: 20px 0 24px; }
.plan-list li {
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-list li:last-child { border-bottom: none; }
.plan-list li svg { width: 14px; height: 14px; color: var(--red-bright); flex-shrink: 0; }

/* Responsive */

@media (max-width: 860px) {
  .docs-shell { grid-template-columns: 1fr; }

  .docs-sidebar {
    display: block;
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 82vw;
    background: var(--bg);
    z-index: 50;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-soft);
  }

  .docs-sidebar.mobile-open { transform: translateX(0); }
  .docs-sidebar .docs-nav-group { display: block !important; }

  .docs-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 49;
    background: rgba(0, 0, 0, 0.5);
  }

  .docs-overlay.visible { display: block; }

  .docs-mobile-trigger {
    display: flex !important;
  }

  .docs-content { padding: 32px 24px; }
  .cmd-header { flex-direction: column; align-items: flex-start; }
  .cmd-search { width: 100%; }
  .cmd-meta { grid-template-columns: 1fr; }
  .topbar { padding: 18px 20px; }
  .builder-grid { grid-template-columns: 1fr; }
  .preview-sticky { position: static; }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .plans-grid { grid-template-columns: 1fr; }
}

.docs-mobile-trigger { display: none; }

@media (prefers-reduced-motion: reduce) {
  .loader-mark { animation: none; }
  .page { transition: none; }
}

