/* ============================================================
   Shockwave Docs — Design tokens
   ============================================================ */
:root {
  /* Pulled directly from the Shockwave crest artwork */
  --ink: #150B22;
  --surface: #1E1330;
  --surface-raised: #29193F;
  --surface-hover: #32204D;
  --hairline: #3A2952;
  --hairline-strong: #4C3768;

  --gold: #EDC643;
  --gold-dim: #B28E2B;
  --gold-glow: rgba(237, 198, 67, 0.22);
  --spark: #6EFFFF;

  --text: #F3EFFA;
  --muted: #A79BC2;
  --muted-dim: #766A94;

  --team-blue: #3498DB;
  --team-red: #E74C3C;
  --team-purple: #9B59B6;

  --font-display: 'Chakra Petch', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --sidebar-w: 264px;
  --content-max: 780px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--ink);
  background-image:
    radial-gradient(720px 420px at 85% -10%, rgba(237,198,67,0.12), transparent 60%),
    radial-gradient(600px 360px at -10% 20%, rgba(110,255,255,0.05), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

::selection { background: var(--gold-glow); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--spark);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 0.5em;
  color: var(--text);
}

code, .mono {
  font-family: var(--font-mono);
}

p { margin: 0 0 1em; color: var(--text); }
p.muted, .muted { color: var(--muted); }

/* ============================================================
   Layout shell
   ============================================================ */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  border-right: 1px solid var(--hairline);
  padding: 28px 22px 40px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 6px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--text);
}

.brand-tag {
  display: block;
  font-size: 0.72rem;
  color: var(--muted-dim);
  font-family: var(--font-mono);
  margin-bottom: 28px;
  padding-left: 38px;
  letter-spacing: 0.03em;
}

.nav-group {
  margin-bottom: 22px;
}

.nav-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--muted-dim);
  text-transform: uppercase;
  padding: 0 10px;
  margin-bottom: 6px;
}

.nav-link {
  display: block;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.89rem;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover {
  background: var(--surface-raised);
  color: var(--text);
}

.nav-link.active {
  color: var(--text);
  background: var(--surface-raised);
  border-left-color: var(--gold);
}

.sidebar-foot {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  font-size: 0.75rem;
  color: var(--muted-dim);
  font-family: var(--font-mono);
  padding-left: 10px;
}

/* Mobile top bar */
.topbar {
  display: none;
}

/* ---------- Main content ---------- */
main {
  padding: 56px 48px 120px;
  min-width: 0;
}

.content {
  max-width: var(--content-max);
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--spark);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  content: '';
  width: 16px;
  height: 1px;
  background: var(--spark);
}

.hero-row {
  display: flex;
  align-items: center;
  gap: 40px;
  justify-content: space-between;
}

.hero-copy {
  flex: 1 1 420px;
  min-width: 0;
}

.hero-mark {
  flex: none;
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-mark::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, var(--gold-glow) 0%, rgba(110,255,255,0.08) 45%, transparent 72%);
  border-radius: 50%;
  filter: blur(2px);
}

.hero-mark img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,0.45));
}

@media (max-width: 780px) {
  .hero-row {
    flex-direction: column-reverse;
    gap: 24px;
  }
  .hero-mark {
    width: 170px;
    height: 170px;
  }
}

.page-header {
  margin-bottom: 44px;
}

.page-header h1 {
  font-size: clamp(2rem, 3.4vw, 2.6rem);
}

.page-header .lede {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 62ch;
}

section.block {
  margin-bottom: 56px;
  scroll-margin-top: 24px;
}

section.block h2 {
  font-size: 1.5rem;
  margin-bottom: 14px;
}

section.block h3 {
  font-size: 1.1rem;
  margin: 24px 0 10px;
}

hr.rule {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 48px 0;
}

/* ============================================================
   Buttons / CTAs
   ============================================================ */
.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color .15s ease;
}

.btn-primary {
  background: var(--gold);
  color: #150B22;
}
.btn-primary:hover {
  box-shadow: 0 0 0 3px var(--gold-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--hairline-strong);
}
.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ============================================================
   Feature grid
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}

.card h3 {
  font-size: 1rem;
  margin: 0 0 6px;
}

.card p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 10px;
}

.card a.card-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--gold);
  text-decoration: none;
}
.card a.card-link:hover { text-decoration: underline; }

/* ============================================================
   Ordered walkthrough (draft-night flow) — order is real here
   ============================================================ */
.flow {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

.flow-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--hairline);
}
.flow-step:last-child { border-bottom: none; }

.flow-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted-dim);
  padding-top: 2px;
}

.flow-body {
  /* Without this, a long unbroken line inside a child <pre.codeblock>
     (e.g. an OAuth invite URL) forces this grid track to grow to fit it
     instead of respecting 1fr, and .flow's own overflow:hidden then
     clips the excess instead of the codeblock's own overflow-x:auto
     ever getting a chance to scroll it. */
  min-width: 0;
}

.flow-body h4 {
  font-size: 0.98rem;
  margin: 0 0 4px;
  font-family: var(--font-body);
  font-weight: 600;
}

.flow-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.flow-body code.inline {
  font-size: 0.85rem;
}

/* ============================================================
   Inline code + code blocks
   ============================================================ */
code.inline {
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.86em;
  color: var(--spark);
}

pre.codeblock {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--text);
}
pre.codeblock .c { color: var(--muted-dim); }
pre.codeblock .s { color: var(--spark); }
pre.codeblock .v { color: var(--gold); }

.codeblock-wrap {
  position: relative;
}
.codeblock-wrap pre.codeblock {
  /* room for the button so it never sits on top of the last characters
     of a long unwrapped line before overflow-x scrolling kicks in */
  padding-right: 84px;
}
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--surface-raised);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.copy-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
}
.copy-btn.copied {
  color: var(--spark);
  border-color: var(--spark);
}

/* ============================================================
   Command cards
   ============================================================ */
.cmd-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  margin-bottom: 20px;
  scroll-margin-top: 24px;
}

.cmd-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.cmd-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}
.cmd-name .slash { color: var(--gold); }

.cmd-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-dim);
  border: 1px solid var(--hairline-strong);
  border-radius: 20px;
  padding: 3px 10px;
}

.cmd-desc {
  color: var(--muted);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

table.params {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin-bottom: 4px;
}

table.params th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-dim);
  font-weight: 500;
  padding: 6px 10px 8px 0;
  border-bottom: 1px solid var(--hairline);
}

table.params td {
  padding: 9px 10px 9px 0;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
  color: var(--text);
}

table.params td.param-name {
  font-family: var(--font-mono);
  color: var(--spark);
  white-space: nowrap;
}

table.params td.param-type {
  color: var(--muted);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

table.params tr:last-child td { border-bottom: none; }

.cmd-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 2px solid var(--spark);
  background: rgba(110, 255, 255, 0.06);
  border-radius: 0 6px 6px 0;
  font-size: 0.87rem;
  color: var(--muted);
}
.cmd-note strong { color: var(--text); }

/* ============================================================
   Signature element: Discord-embed preview
   ============================================================ */
.embed-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.discord-embed {
  --bar-color: var(--team-blue);
  background: #2B2D31;
  border-radius: 8px;
  border-left: 4px solid var(--bar-color);
  padding: 12px 16px;
  max-width: 420px;
  font-family: var(--font-body);
  opacity: 0;
  transform: translateY(10px);
  animation: embedIn 0.5s ease forwards;
}

@keyframes embedIn {
  to { opacity: 1; transform: translateY(0); }
}

.discord-embed.blue { --bar-color: var(--team-blue); }
.discord-embed.red { --bar-color: var(--team-red); }
.discord-embed.purple { --bar-color: var(--team-purple); }

.discord-embed .embed-title {
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.discord-embed .embed-desc {
  color: #DBDEE1;
  font-size: 0.86rem;
  line-height: 1.7;
  white-space: pre-line;
}

.embed-caption {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted-dim);
  margin-top: 10px;
}

/* ============================================================
   FAQ accordion
   ============================================================ */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  scroll-margin-top: 24px;
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 44px 16px 20px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
  position: relative;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 1.1rem;
}

.faq-item[open] summary::after { content: "\2212"; }

.faq-item summary:hover { background: var(--surface-hover); }

.faq-item .faq-body {
  padding: 0 20px 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.faq-item .faq-body p:last-child { margin-bottom: 0; }

/* ============================================================
   Footer
   ============================================================ */
.page-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  color: var(--muted-dim);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 25% 0 0;
    z-index: 40;
    background: var(--ink);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 20px 0 40px rgba(0,0,0,0.4);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hairline);
    position: sticky;
    top: 0;
    background: var(--ink);
    z-index: 30;
  }

  .menu-btn {
    background: var(--surface-raised);
    border: 1px solid var(--hairline-strong);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
  }

  .scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 35;
  }
  .scrim.show { display: block; }

  main {
    padding: 32px 20px 90px;
  }

  .grid { grid-template-columns: 1fr; }
}
