/* ============================================================
   MagnetHits — Global Styles
   ============================================================ */

:root {
  --bg:           #090909;
  --bg-surface:   #111111;
  --bg-card:      #141414;
  --border:       #1e1e1e;
  --border-light: #2a2a2a;

  --text-primary:   #f0f0f0;
  --text-secondary: #888888;
  --text-muted:     #555555;

  --accent:         #00d4ff;
  --accent-dim:     rgba(0, 212, 255, 0.12);
  --accent-glow:    rgba(0, 212, 255, 0.25);
  --green:          #22c55e;
  --green-dim:      rgba(34, 197, 94, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  --transition: 150ms ease;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.2rem; }

p { color: var(--text-secondary); line-height: 1.75; }

.label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── Layout ─────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 100px 0; }

/* ── Nav ─────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 9, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav-logo .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--text-primary); }

.nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  font-weight: 600;
}
.btn-primary:hover {
  background: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
.btn-ghost:hover {
  color: var(--text-primary);
  border-color: #444;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent-dim);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.95rem;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  padding: 160px 0 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(0,212,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero .label { margin-bottom: 20px; display: block; }

.hero h1 {
  margin-bottom: 20px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  max-width: 520px;
  margin: 0 auto 36px;
}

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

/* ── Terminal / Demo ─────────────────────────────────────── */
.terminal {
  background: #0d0d0d;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-align: left;
  position: relative;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: #111;
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.terminal-dot.red   { background: #ff5f57; }
.terminal-dot.yellow{ background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.terminal-body {
  padding: 24px;
  line-height: 1.8;
}

.t-comment { color: var(--text-muted); }
.t-method  { color: #f97316; }
.t-url     { color: var(--accent); }
.t-key     { color: #a78bfa; }
.t-val     { color: var(--green); }
.t-str     { color: #facc15; }
.t-prompt  { color: var(--text-muted); user-select: none; }
.t-brace   { color: var(--text-secondary); }
.t-arrow   { color: var(--text-muted); }

/* ── Code block ──────────────────────────────────────────── */
.code-block {
  background: #0d0d0d;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #111;
  border-bottom: 1px solid var(--border);
}

.code-lang {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-family: var(--font-sans);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.copy-btn:hover {
  background: var(--border-light);
  color: var(--text-primary);
}
.copy-btn.copied {
  color: var(--green);
  border-color: var(--green);
}

.code-block pre {
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.8;
}

/* ── Section headers ─────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: 64px;
}
.section-header .label { margin-bottom: 12px; display: block; }
.section-header h2 { margin-bottom: 16px; }
.section-header p { max-width: 500px; margin: 0 auto; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--border-light); }

.card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.card h3 { margin-bottom: 8px; font-size: 1rem; }
.card p  { font-size: 0.875rem; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ── Feature list ────────────────────────────────────────── */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.feature-item .check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green-dim);
  border: 1px solid rgba(34, 197, 94, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 0.65rem;
  color: var(--green);
}

/* ── Steps ───────────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.step {
  background: var(--bg-card);
  padding: 40px 32px;
  position: relative;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 16px;
  display: block;
  letter-spacing: 0.1em;
}

.step h3 { margin-bottom: 10px; }

/* ── Dual column layout ──────────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.split--reverse { direction: rtl; }
.split--reverse > * { direction: ltr; }

/* ── Snippet section ─────────────────────────────────────── */
.snippet-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ── CTA section ─────────────────────────────────────────── */
.cta-section {
  text-align: center;
  padding: 120px 0;
}
.cta-section h2 { margin-bottom: 16px; }
.cta-section p  { margin-bottom: 36px; }
.cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--text-secondary); }

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Docs layout ─────────────────────────────────────────── */
.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  min-height: 100vh;
  padding-top: 60px;
}

.docs-sidebar {
  position: fixed;
  top: 60px;
  width: 240px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 32px 20px;
  border-right: 1px solid var(--border);
}

.docs-sidebar-section {
  margin-bottom: 28px;
}

.docs-sidebar-section .label {
  font-size: 0.68rem;
  margin-bottom: 8px;
  display: block;
}

.docs-sidebar-section a {
  display: block;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.845rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  margin-bottom: 2px;
}

.docs-sidebar-section a:hover,
.docs-sidebar-section a.active {
  background: var(--accent-dim);
  color: var(--text-primary);
}

.docs-content {
  margin-left: 240px;
  padding: 60px 64px;
  max-width: 860px;
}

.docs-content h1 { margin-bottom: 12px; }
.docs-content h2 {
  font-size: 1.4rem;
  margin: 52px 0 16px;
  padding-top: 52px;
  border-top: 1px solid var(--border);
}
.docs-content h3 { font-size: 1rem; margin: 28px 0 12px; }
.docs-content p  { margin-bottom: 16px; }
.docs-content ul { margin: 12px 0 20px 0; }
.docs-content ul li {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 4px 0 4px 20px;
  position: relative;
}
.docs-content ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}
.docs-content .code-block { margin: 20px 0; }

.docs-lead {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.8;
}

/* ── API page ────────────────────────────────────────────── */
.api-endpoint {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  overflow: hidden;
}

.api-endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.method-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}
.method-badge.post { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.method-badge.get  { background: rgba(0, 212, 255, 0.12); color: var(--accent); }

.api-path {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.api-endpoint-body { padding: 20px; }

.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 12px;
}

.param-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.param-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

.param-table td:first-child {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.param-table td .badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(249,115,22,0.15);
  color: #f97316;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ── Inline code ─────────────────────────────────────────── */
code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--accent);
}

/* ── Status badge ────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--green-dim);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: var(--green);
  font-weight: 500;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Tab switcher ────────────────────────────────────────── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.tab-btn {
  padding: 10px 16px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
}

.tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Misc ────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.text-accent  { color: var(--accent); }
.text-green   { color: var(--green); }
.text-muted   { color: var(--text-muted); }
.font-mono    { font-family: var(--font-mono); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .split  { grid-template-columns: 1fr; gap: 40px; }
  .split--reverse { direction: ltr; }
  .steps  { grid-template-columns: 1fr; }

  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { display: none; }
  .docs-content { margin-left: 0; padding: 40px 24px; }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .grid-2  { grid-template-columns: 1fr; }
  .grid-4  { grid-template-columns: 1fr; }
  section  { padding: 64px 0; }
  .hero    { padding: 120px 0 64px; }

  .footer-inner { flex-direction: column; gap: 16px; }
  .footer-links { flex-wrap: wrap; gap: 16px; }
}
