:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #151b23;
  --panel-strong: #1f2937;
  --text: #f8fafc;
  --muted: #9ca3af;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #2dd4bf;
  --warm: #f97316;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

.reeldb-page {
  min-height: 100vh;
}

/* ── Hero ─────────────────────────────────────── */

.hero {
  padding: 24px clamp(20px, 4vw, 64px) 80px;
  background:
    radial-gradient(circle, rgba(45, 212, 191, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(13, 17, 23, 0.82), rgba(13, 17, 23, 0.97)),
    url("hero.jpg");
  background-size: 28px 28px, cover, cover;
  background-position: center, center, center;
}

/* ── Topbar ───────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.brand,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  font-weight: 800;
  font-size: 20px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
}

.topbar-actions a,
.topbar-signout {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.topbar-actions a:hover,
.topbar-signout:hover {
  color: var(--text);
}

.topbar-signout {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

/* ── Hero grid ────────────────────────────────── */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
  max-width: 1180px;
  margin: 72px auto 0;
}

.hero-copy {
  display: flex;
  flex-direction: column;
}

/* ── Hero brand block ─────────────────────────── */

.hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.hero-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: contain;
}

.hero-brand-name {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
}

/* ── Headings ─────────────────────────────────── */

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(48px, 6vw, 80px);
  line-height: 1;
  letter-spacing: -1px;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
}

h3 {
  margin-bottom: 12px;
  font-size: 17px;
}

.accent-text {
  color: var(--accent);
}

.kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lede {
  max-width: 560px;
  color: #d1d5db;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.55;
  margin-bottom: 36px;
}

/* ── Features row ─────────────────────────────── */

.features-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  margin-bottom: 36px;
}

.feature {
  display: grid;
  grid-template-columns: 20px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 2px;
  align-items: start;
  color: var(--muted);
  min-width: 0;
}

.feature svg {
  grid-row: 1 / 3;
  margin-top: 2px;
  color: var(--accent);
  flex-shrink: 0;
}

.feature strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.feature span {
  font-size: 12px;
  line-height: 1.3;
}

/* ── CTA bar ──────────────────────────────────── */

.cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: 12px;
  background: rgba(45, 212, 191, 0.05);
}

.cta-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cta-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.cta-left strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.cta-left span {
  font-size: 13px;
  color: var(--muted);
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  min-height: 40px;
  padding: 0 20px;
  border-radius: 8px;
  background: var(--accent);
  color: #042f2e;
  font: inherit;
  font-weight: 750;
  font-size: 14px;
  flex-shrink: 0;
}

.cta-button:hover {
  background: #5eead4;
}

/* ── Buttons ──────────────────────────────────── */

.primary-action,
.secondary-action,
.copy-button,
.patreon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.primary-action {
  background: var(--accent);
  color: #042f2e;
}

.secondary-action {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line);
  color: var(--text);
}

.patreon-link {
  margin-top: 12px;
  background: var(--warm);
  color: #111827;
}

/* ── Terminal ─────────────────────────────────── */

.terminal,
.account-panel,
.examples-grid article {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 20, 28, 0.96);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.4);
}

.terminal {
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-red    { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green  { background: #22c55e; }

.terminal-label {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

pre {
  margin: 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.8;
}

.terminal pre {
  padding: 22px 20px;
}

.examples-grid pre {
  padding: 20px;
  color: #d1fae5;
}

/* Syntax highlight */
.syn-method  { color: #2dd4bf; font-weight: 700; }
.syn-url     { color: #e2e8f0; }
.syn-param   { color: #2dd4bf; }
.syn-punct   { color: #94a3b8; }
.syn-key     { color: #99f6e4; }
.syn-string  { color: #86efac; }
.syn-number  { color: #fb923c; }
.syn-muted   { color: #64748b; }

/* ── Content bands ────────────────────────────── */

.content-band {
  padding: 76px clamp(20px, 4vw, 64px);
}

.account-band {
  background: #0b1018;
}

.section-heading,
.account-panel,
.examples-grid {
  max-width: 1180px;
  margin: 0 auto;
}

.section-heading {
  margin-bottom: 28px;
}

.account-panel {
  padding: clamp(20px, 4vw, 36px);
}

.notice {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: #d1fae5;
  background: rgba(20, 184, 166, 0.12);
}

.notice--error {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

.account-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.account-summary > div {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.key-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
}

.key-box .label,
.key-box p {
  grid-column: 1 / -1;
}

.key-box code {
  overflow-x: auto;
  color: #99f6e4;
  white-space: nowrap;
}

.key-box p,
.upgrade-copy,
.account-intro {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.copy-button {
  min-height: 36px;
  background: var(--panel-strong);
  color: var(--text);
  border-color: var(--line);
}

.rotate-form {
  margin-top: 16px;
}

/* ── Docs section ─────────────────────────────── */

.docs-band {
  background: var(--bg);
}

.docs-wrap {
  max-width: 1180px;
  margin: 0 auto;
}

.docs-intro {
  color: var(--muted);
  font-size: 15px;
  margin-top: 6px;
}

.inline-code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--panel-strong);
  color: #99f6e4;
}

.doc-note {
  margin-bottom: 40px;
  padding: 16px 20px;
  border: 1px solid rgba(45, 212, 191, 0.18);
  border-radius: 10px;
  background: rgba(45, 212, 191, 0.05);
  font-size: 14px;
  color: #d1d5db;
  line-height: 1.6;
}

.doc-note strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.doc-note ul {
  margin: 8px 0 10px 0;
  padding-left: 18px;
}

.doc-note li {
  margin-bottom: 4px;
}

.doc-group {
  margin-bottom: 48px;
}

.doc-group-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.doc-endpoint {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.doc-endpoint-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--line);
}

.method-badge {
  flex-shrink: 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(45, 212, 191, 0.15);
  color: var(--accent);
  border: 1px solid rgba(45, 212, 191, 0.25);
}

.endpoint-path {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.path-param {
  color: var(--accent);
  font-style: italic;
}

.doc-desc {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  min-width: 160px;
}

.doc-body {
  padding: 16px 18px;
}

.param-table {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}

.param-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  line-height: 1.5;
}

.param-row:last-child {
  border-bottom: none;
}

.param-row--header {
  background: rgba(255,255,255,0.03);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.param-row code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  color: #99f6e4;
}

.param-row:not(.param-row--header) > span:last-child {
  color: #d1d5db;
}

.param-req {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fb923c;
  vertical-align: middle;
}

.doc-example {
  margin: 0;
  padding: 14px 16px;
  border-radius: 8px;
  background: #0b1220;
  border: 1px solid var(--line);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Responsive ───────────────────────────────── */

@media (max-width: 900px) {
  .hero {
    padding-bottom: 56px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    margin-top: 56px;
  }

  .account-summary {
    grid-template-columns: 1fr;
  }

  .param-row {
    grid-template-columns: 130px 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .key-box {
    grid-template-columns: 1fr;
  }

  .cta-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .features-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 22px;
    width: 100%;
  }

  .feature {
    grid-template-columns: 22px minmax(0, 1fr);
    column-gap: 10px;
  }

  .feature svg {
    width: 22px;
    height: 22px;
  }

  .feature strong,
  .feature span {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 430px) {
  .features-row {
    gap: 16px 16px;
  }

  .feature {
    grid-template-columns: 20px minmax(0, 1fr);
    column-gap: 9px;
  }

  .feature strong {
    font-size: 13px;
  }

  .feature span {
    font-size: 11px;
  }
}
