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

:root {
  --bg: #f0f6ff;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8faff;
  --border: #d4e0f0;
  --border-light: #e8eff8;
  --text: #1a2b4a;
  --text-dim: #4a6080;
  --text-muted: #7a90aa;
  --accent: #2563eb;
  --accent-dim: #1d4ed8;
  --accent-light: #dbeafe;
  --accent-lighter: #eff6ff;
  --green: #059669;
  --green-light: #d1fae5;
  --red: #dc2626;
  --red-light: #fee2e2;
  --terminal-bg: #1e293b;
  --terminal-border: #334155;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* === Nav === */
nav {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  z-index: 100;
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.logo span { color: var(--accent); }

nav .links { display: flex; gap: 24px; align-items: center; }
nav .links a { color: var(--text-dim); font-size: 14px; transition: color 0.15s; }
nav .links a:hover { color: var(--text); text-decoration: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dim);
  text-decoration: none;
}

.btn-outline {
  background: var(--bg-white);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  padding: 8px 12px;
}

.btn-ghost:hover { color: var(--accent); text-decoration: none; }

/* === Hero === */
.hero {
  padding: 100px 0 80px;
  text-align: center;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 20px;
  color: var(--text);
}

.hero h1 .gradient {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 36px;
}

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

/* === Terminal block === */
.terminal {
  background: var(--terminal-bg);
  border: 1px solid var(--terminal-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: left;
  max-width: 640px;
  margin: 48px auto 0;
  box-shadow: var(--shadow-md);
}

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

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-dot.r { background: #f87171; }
.terminal-dot.y { background: #fbbf24; }
.terminal-dot.g { background: #34d399; }

.terminal-title {
  font-family: var(--mono);
  font-size: 12px;
  color: #94a3b8;
  margin-left: 8px;
}

.terminal pre {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
  padding: 20px;
  overflow-x: auto;
  color: #e2e8f0;
}

.terminal .prompt { color: #34d399; }
.terminal .cmd { color: #e2e8f0; }
.terminal .output { color: #94a3b8; }
.terminal .url { color: #38bdf8; }

/* === Sections === */
section { padding: 80px 0; }

section h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  color: var(--text);
}

section .subtitle {
  color: var(--text-dim);
  font-size: 16px;
  margin-bottom: 48px;
}

/* === How it works === */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.step:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }

.step-number {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.step h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* === Features === */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.feature {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.feature:hover { background: var(--accent-lighter); }

.feature-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  border-radius: var(--radius);
}

.feature h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.feature p { font-size: 13px; color: var(--text-dim); }

/* === Code blocks === */
.code-block {
  background: var(--terminal-bg);
  border: 1px solid var(--terminal-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 12px 0;
  overflow-x: auto;
}

.code-block code {
  font-family: var(--mono);
  font-size: 13px;
  color: #e2e8f0;
}

/* === Quickstart tabs === */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; }

.tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--sans);
  transition: all 0.15s;
}

.tab:hover { color: var(--accent); }
.tab.active { color: var(--accent); background: var(--accent-light); border-color: var(--accent-light); }

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

/* === Footer === */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

footer a { color: var(--text-dim); }

/* === Artifact viewer === */
.artifact-page {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.artifact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-md);
}

.artifact-card h2 {
  font-size: 20px;
  margin-bottom: 4px;
  word-break: break-all;
}

.artifact-card .meta {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 24px;
}

.artifact-info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: 14px;
  margin-bottom: 28px;
}

.artifact-info dt { color: var(--text-muted); }
.artifact-info dd { color: var(--text); }

.artifact-card .btn { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }

/* Loading / Error states */
.loading, .error-state {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error-state h2 { color: var(--red); font-size: 20px; }
.error-state p { color: var(--text-dim); margin-top: 8px; }

/* === Auth pages === */
.auth-page {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  text-align: center;
  padding: 60px 40px;
  max-width: 420px;
}

.auth-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.auth-card h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

.auth-card p {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 8px;
}

.auth-card .code-block {
  margin-top: 24px;
  text-align: left;
}

/* === Responsive === */
@media (max-width: 640px) {
  .hero { padding: 60px 0 48px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  section { padding: 48px 0; }
  section h2 { font-size: 24px; }
  .terminal { margin: 32px -12px 0; border-radius: 0; }
  .artifact-card { margin: 0 12px; padding: 28px; }
}
