/* Synthwave cyber palette + texture */
:root {
  --color-text: #e2e8f0;
  --color-muted: #94a3b8;
  --color-rose: #f43f5e;
  --color-violet: #a955f7ad;
  --color-rose-light: #f87171;
  --color-red-dark: #b91c1c;
  --color-panel-rgb: 16, 16, 24;
  --color-status: #f97316;
}

html {
  font-family: "Space Grotesk", system-ui, sans-serif;
  scrollbar-gutter: stable;
}

.font-display {
  font-family: "Orbitron", system-ui, sans-serif;
  letter-spacing: 0.04em;
}

.bg-tex {
  background-image:
    radial-gradient(rgba(239, 68, 68, 0.16) 1px, transparent 1px),
    radial-gradient(rgba(168, 85, 247, 0.18) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 15, 20, 0.6), rgba(4, 4, 8, 0.9));
  background-size: 28px 28px, 34px 34px, 100% 100%;
  background-position: 0 0, 17px 17px, 0 0;
}

.glass-panel {
  background: rgba(var(--color-panel-rgb), 0.82);
  border: 1px solid rgba(239, 68, 68, 0.2);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
}

.link,
a {
  color: var(--color-violet);
  text-decoration: none;
}

.link:hover,
a:hover {
  color: var(--color-rose);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.link:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-violet);
  outline-offset: 2px;
}

.mono-icon {
  font-weight: 700;
  letter-spacing: 0.06em;
}

.sidebar {
  position: sticky;
  top: 1.5rem;
  align-self: flex-start;
  font-size: 0.98rem;
}

.sidebar-card {
  max-height: calc(100vh - 3rem);
  overflow: auto;
}

.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  border-radius: 1.25rem;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(var(--color-panel-rgb), 0.75);
  padding: 0.75rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item[open] {
  border-color: rgba(248, 113, 113, 0.6);
  box-shadow: 0 0 18px rgba(248, 113, 113, 0.15);
}

.faq-item[open] .faq-content {
  animation: faq-reveal 360ms ease-out;
}

.faq-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  list-style: none;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary::after {
  content: "+";
  margin-left: auto;
  font-size: 1.25rem;
  color: var(--color-rose);
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-summary::after {
  transform: rotate(45deg);
}

.faq-index {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: rgba(248, 113, 113, 0.8);
}

.faq-content {
  margin-left: 2.4rem;
  padding: 0.5rem 0 0.25rem;
  color: rgba(148, 163, 184, 0.8);
  font-size: 0.9rem;
}

@keyframes faq-reveal {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.now-playing {
  display: grid;
  gap: 1.25rem;
}

.now-playing-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.now-playing-kicker {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.65rem;
  color: rgba(248, 113, 113, 0.9);
}

.now-playing-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, var(--color-rose-light), var(--color-red-dark));
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.6);
}

.now-playing-link {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(248, 113, 113, 0.7);
}

.now-playing-link:hover {
  color: var(--color-rose);
}

.now-playing-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
}

.now-playing-art {
  width: 72px;
  height: 72px;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(var(--color-panel-rgb), 0.9);
  box-shadow: 0 0 24px rgba(248, 113, 113, 0.2);
}

.now-playing-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.now-playing-meta {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.now-playing-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.now-playing-artist {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.8);
}

.track-scroll {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.track-scroll-inner {
  display: inline-flex;
  gap: 2rem;
  width: max-content;
  will-change: transform;
}

.track-scroll-inner span {
  display: inline-block;
}

.now-playing-cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: rgba(248, 113, 113, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.now-playing-cta:hover {
  color: var(--color-rose);
  border-color: rgba(248, 113, 113, 0.6);
  box-shadow: 0 0 18px rgba(248, 113, 113, 0.25);
}

.track-scroll.is-overflow .track-scroll-inner {
  animation: track-marquee 12s linear infinite;
}

@keyframes track-marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ── Page transition ────────────────────────────────────────────────────────── */

@keyframes page-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-entering { animation: page-enter 0.18s ease-out; }

/* ── Mobile sidebar ─────────────────────────────────────────────────────────── */

@media (max-width: 1023px) {
  .mobile-header { display: flex; }

  .sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    z-index: 45;
    width: 20rem;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    display: block !important;
  }
  .sidebar-card {
    max-height: calc(100vh - 56px) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  body.sidebar-open { overflow: hidden; }
}

/* ── Docs category collapse ─────────────────────────────────────────────────── */

.docs-cat-toggle { cursor: pointer; }
.docs-cat-toggle:hover .docs-cat-chevron { color: oklch(var(--bc) / 0.7); }

.docs-cat-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.docs-cat-chevron-collapsed { transform: rotate(-90deg); }

.docs-cat-items {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.2s ease;
}
.docs-cat-items.collapsed { grid-template-rows: 0fr; }
.docs-cat-items > div { overflow: hidden; }

/* ── Docs nav links ─────────────────────────────────────────────────────────── */

.doc-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s, color 0.15s;
  color: oklch(var(--bc) / 0.7);
  text-decoration: none;
}
.doc-link:hover {
  background: rgba(255,255,255,0.06);
  color: oklch(var(--bc) / 0.95);
  text-decoration: none;
}
.doc-link-active {
  background: oklch(var(--p) / 0.15);
  color: oklch(var(--p));
}
.doc-link-active::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: oklch(var(--p));
  flex-shrink: 0;
}

/* ── Markdown rendered content ──────────────────────────────────────────────── */

.md-content { line-height: 1.75; color: #e2e8f0; }

.md-h1, .md-h2, .md-h3, .md-h4, .md-h5, .md-h6 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  color: #f1f5f9;
  margin-top: 1.75em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}
.md-h1 { font-size: 1.875rem; }
.md-h2 { font-size: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.07); padding-bottom: 0.4em; }
.md-h3 { font-size: 1.25rem; }
.md-h4 { font-size: 1.1rem; }

.md-content .md-h1:first-child,
.md-content .md-h2:first-child { margin-top: 0; }

.md-p { margin: 0.9em 0; }

.md-ul, .md-ol { margin: 0.9em 0; padding-left: 1.5rem; }
.md-ul { list-style: disc; }
.md-ol { list-style: decimal; }
.md-ul li, .md-ol li { margin: 0.3em 0; }

.md-blockquote {
  margin: 1em 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid oklch(var(--p));
  background: rgba(255,255,255,0.04);
  border-radius: 0 8px 8px 0;
  color: #94a3b8;
}
.md-blockquote p { margin: 0; }

.md-pre {
  margin: 1.25em 0;
  padding: 1rem 1.25rem;
  background: #0d0d1a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
}
.md-pre code { background: none; padding: 0; font-size: inherit; color: #a78bfa; }

.md-code {
  background: rgba(167,139,250,0.12);
  color: #a78bfa;
  padding: 0.15em 0.45em;
  border-radius: 4px;
  font-size: 0.875em;
}

.md-link { color: oklch(var(--p)); text-decoration: underline; text-underline-offset: 3px; }
.md-link:hover { opacity: 0.8; }

.md-hr { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 1.5em 0; }

.md-img { max-width: 100%; border-radius: 12px; margin: 1em 0; }

.md-table-wrap { overflow-x: auto; margin: 1.25em 0; }
.md-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.md-table th {
  text-align: left;
  padding: 0.6rem 0.9rem;
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-weight: 600;
  color: #f1f5f9;
}
.md-table td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: #94a3b8;
}
.md-table tr:last-child td { border-bottom: none; }
