/* ===== Tokens ===== */
:root {
  --bg: #08080c;
  --bg-elevated: #131318;
  --bg-elevated-2: #1a1a21;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f0f1f5;
  --text-muted: #9a9ba8;
  --text-faint: #6b6c78;
  --accent: #f5f6fa;
  --accent-dim: rgba(245, 246, 250, 0.10);
  --accent-text-on: #0b0b0f;
  --radius: 14px;
  --radius-sm: 9px;
  --font-display: "Sora", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

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

/* A void with white specks: two tiled star layers (far = smaller/dimmer/
   slower, near = bigger/brighter/faster) that drift on scroll instead of
   animating every frame -- cheap, since it's just a background-position
   nudge on actual scroll events, not a constant loop. See base.html's
   scroll handler for the drift itself; these just paint the tiles. Sized
   past the viewport on every edge so the drift range never reveals an
   edge. .bg-scrim on top keeps a constant dark haze over all of it. */
.star-layer {
  position: fixed;
  inset: -200px;
  z-index: -3;
  pointer-events: none;
  background-repeat: repeat;
  filter: blur(0.6px);
  transition: filter 0.4s ease;
}
/* While actively scrolling (base.html toggles this, debounced off ~180ms
   after the last scroll event) each individual speck stretches into a
   vertical streak in place -- a directional (Y-only) blur from the inline
   SVG filter below, not a transform on the layer itself, so the tile's
   scale and dot spacing never move, only each point smears. */
.star-layer.warping { filter: blur(0.6px) url(#star-streak-far); }
.star-near.warping { filter: blur(0.6px) url(#star-streak-near); }
.bg-scrim {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(5, 5, 9, 0.4);
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.star-far {
  background-image: url('/static/img/stars_far.png');
  background-size: 600px 600px;
  opacity: 0.65;
}
.star-near {
  background-image: url('/static/img/stars_near.png');
  background-size: 700px 700px;
  opacity: 0.8;
}
.bg-field {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 20% 15%, rgba(245, 246, 250, 0.05), transparent 45%),
    radial-gradient(circle at 85% 30%, rgba(245, 246, 250, 0.035), transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(245, 246, 250, 0.03), transparent 60%);
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  /* purely structural now -- no background/blur/border of its own. That
     used to paint a full-viewport-width blurred strip behind the pill
     (visible as a ghost gradient band above it); the pill below carries
     100% of the visual chrome instead, in both its big and shrunk sizes. */
}
.header-inner {
  /* an explicit resolvable length (not max-width + auto width), so the
     transition below has a real number to tween from at both ends */
  width: min(1100px, 100% - 56px);
  margin: 16px auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(19, 19, 24, 0.78);
  backdrop-filter: blur(14px);
  /* a shadow sized for this small pill, not the page-section --shadow-soft
     token (60px blur) -- that read as an oversized hazy cloud around a
     compact bar instead of a crisp contained lift. */
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  /* width (not max-width) so this can actually tween between two real
     pixel values -- --pill-width is measured by JS from the shrunk
     content's natural size, since "fit-content" is a keyword the browser
     can't animate toward and would otherwise just snap instantly. */
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1), padding 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    margin 0.4s cubic-bezier(0.22, 1, 0.36, 1), gap 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Past the hero, the big pill shrinks into a smaller floating one (JS
   toggles this class once the page has scrolled a bit) -- same nav items,
   just condensed, so nothing about wayfinding changes, only scale. */
.site-header.scrolled .header-inner {
  width: var(--pill-width, 640px);
  margin: 10px auto;
  padding: 8px 14px 8px 8px;
  gap: 22px;
}
.site-header.scrolled .main-nav { gap: 20px; }
.site-header.scrolled .brand { margin-right: 0; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin-right: auto;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}
.footer-brand .brand-mark { width: 26px; height: 26px; }
.main-nav {
  display: flex;
  gap: 28px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
}
.main-nav a { transition: color 0.15s ease; }
.main-nav a:hover, .main-nav a.active { color: var(--text); }
.header-right { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 6px 10px 6px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.user-avatar { width: 22px; height: 22px; border-radius: 50%; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  color: #14151c;
  /* "Silver Surfer" chrome -- cool blue-steel, not neutral gray: a bright
     blue-white sheen up top diving into a deep slate-blue base, so it
     reads as polished metal under a light source rather than flat paint. */
  background: linear-gradient(180deg, #eef2f8 0%, #b7c0d1 30%, #6d7893 65%, #444c60 100%);
  border: 1px solid rgba(221, 230, 245, 0.9);
  /* real depth, like it's sitting proud of the page waiting to be pushed
     in: a sharp bright sliver top-edge, a much heavier inner shadow along
     the bottom/sides pooling the metal, and a grounded drop shadow. */
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.95),
    inset 0 -6px 10px rgba(10, 12, 20, 0.55),
    inset 6px 0 10px -8px rgba(10, 12, 20, 0.4),
    inset -6px 0 10px -8px rgba(10, 12, 20, 0.4),
    0 14px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary:hover {
  background: linear-gradient(180deg, #f8fafd 0%, #c8d0e0 30%, #7c87a3 65%, #4e5771 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 1),
    inset 0 -6px 10px rgba(10, 12, 20, 0.5),
    inset 6px 0 10px -8px rgba(10, 12, 20, 0.35),
    inset -6px 0 10px -8px rgba(10, 12, 20, 0.35),
    0 18px 38px rgba(0, 0, 0, 0.5);
}
.btn-primary:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 4px rgba(10, 12, 20, 0.6),
    inset 0 -1px 0 rgba(255, 255, 255, 0.4),
    0 4px 10px rgba(0, 0, 0, 0.35);
}
.discord-icon { width: 19px; height: 19px; flex-shrink: 0; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--accent-dim); }
.btn-ghost { background: var(--bg-elevated); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-elevated-2); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.arrow { transition: transform 0.15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ===== Hero ===== */
.hero { padding: 110px 28px 90px; text-align: center; }
.hero-inner { max-width: 780px; margin: 0 auto; }
.hero-eyebrow {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 18px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  text-wrap: balance;
}
.hero-title .accent {
  color: var(--accent);
  position: relative;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 40px;
  text-wrap: balance;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 64px;
}
.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding: 18px 34px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.78rem; color: var(--text-faint); }
.stat-divider { width: 1px; height: 30px; background: var(--border-strong); }

/* ===== Features ===== */
.features { padding: 40px 28px 100px; }
.features-inner { max-width: 1080px; margin: 0 auto; text-align: center; }
.section-badge {
  width: 44px;
  height: 44px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 1.1rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  margin: 0 0 12px;
}
.accent-underline {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-dim);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}
.section-sub { color: var(--text-muted); font-size: 0.98rem; margin: 0 0 48px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 20px;
  text-align: left;
  padding-bottom: 36px;
  /* one shadow grounding the whole mosaic, rather than each card floating
     with no sense of a surface beneath it */
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.5));
}
/* Asymmetric bento mosaic instead of a flat uniform grid -- the two
   "headline" cards (moderation, customization) run wide, everything else
   sits as a single cell, zig-zagging row to row. */
.feature-card:nth-child(1) { grid-column: span 2; }
.feature-card:nth-child(5) { grid-column: span 2; }
.feature-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.feature-card:hover {
  border-color: var(--accent);
  background: var(--bg-elevated-2);
  transform: translateY(-4px) scale(1.03);
  z-index: 1;
  position: relative;
}
.feature-card:hover h3 { color: var(--accent); }
.feature-icon { font-size: 1.6rem; display: block; margin-bottom: 14px; }
.feature-card h3 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 8px; transition: color 0.2s ease; }
.feature-card p { font-size: 0.92rem; color: var(--text-muted); margin: 0; }

@media (max-width: 860px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card:nth-child(1), .feature-card:nth-child(5) { grid-column: span 1; }
}

/* ===== CTA ===== */
.cta {
  padding: 90px 28px;
  text-align: center;
  border-top: 1px solid var(--border);
}
.cta h2 { font-family: var(--font-display); font-size: 1.8rem; margin: 0 0 12px; }
.cta p { color: var(--text-muted); margin: 0 0 32px; }

/* ===== Commands page ===== */
.commands-page { max-width: 1080px; margin: 0 auto; padding: 60px 28px 100px; }
.commands-header { display: flex; align-items: center; gap: 18px; margin-bottom: 32px; }
.page-icon {
  font-size: 1.4rem;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.commands-header h1 { font-family: var(--font-display); font-size: 1.7rem; margin: 0 0 4px; }
.page-sub { color: var(--text-muted); margin: 0; font-size: 0.92rem; }

.commands-toolbar { margin-bottom: 20px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  width: 100%;
}
.search-box input::placeholder { color: var(--text-faint); }

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
.pill {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pill:hover { border-color: var(--border-strong); color: var(--text); }
.pill.active { background: var(--accent); color: var(--accent-text-on); border-color: var(--accent); }
.pill-count { opacity: 0.6; font-variant-numeric: tabular-nums; }
.pill.active .pill-count { opacity: 0.55; }

.command-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.command-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  transition: border-color 0.15s ease;
}
.command-card:hover { border-color: var(--border-strong); }
.command-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.command-card h3 { font-family: var(--font-display); font-size: 1rem; margin: 0; }
.command-category-tag { font-size: 1rem; opacity: 0.8; }
.command-desc { font-size: 0.87rem; color: var(--text-muted); margin: 0 0 14px; min-height: 2.6em; }
.command-meta { display: flex; gap: 8px; font-size: 0.78rem; padding-top: 8px; border-top: 1px solid var(--border); }
.command-meta + .command-meta { border-top: none; padding-top: 4px; }
.meta-label { color: var(--text-faint); flex-shrink: 0; }
.meta-value { color: var(--text-muted); font-family: "SF Mono", "Consolas", monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no-results { text-align: center; color: var(--text-faint); padding: 60px 0; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); padding: 36px 28px; }
.footer-inner { max-width: 1160px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; }
.footer-copy { color: var(--text-faint); font-size: 0.85rem; margin: 0; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .command-grid { grid-template-columns: repeat(2, 1fr); }
  .main-nav { display: none; }
}
@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
  .command-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; gap: 16px; padding: 18px; }
  .stat-divider { display: none; }
}
