:root {
  --bg:        #0d0d0d;
  --surface:   #141414;
  --border:    #222;
  --gold:      #d4a847;
  --gold-dim:  #8a6e2e;
  --text:      #c8c8c8;
  --muted:     #666;
  --green:     #4caf7d;
  --red:       #e06c75;
  --blue:      #61afef;
  --radius:    8px;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,13,13,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); }

.nav-cta {
  background: var(--gold);
  color: #0d0d0d;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: opacity 0.2s;
}

.nav-cta:hover { opacity: 0.85; }

/* ── Hero ── */
.hero {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212,168,71,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.ascii-logo {
  font-family: var(--font-mono);
  font-size: clamp(0.45rem, 1.4vw, 0.75rem);
  color: var(--gold);
  line-height: 1.2;
  letter-spacing: 0.05em;
  margin-bottom: 2.5rem;
  opacity: 0.9;
  white-space: pre;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(212,168,71,0.1);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 0.3rem 0.9rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero-badge .dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; }

h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  color: #f0f0f0;
}

h1 span { color: var(--gold); }

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 3.5rem;
}

.btn-primary {
  background: var(--gold);
  color: #0d0d0d;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
}

.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.15s;
}

.btn-outline:hover { border-color: var(--gold-dim); transform: translateY(-1px); }

.install-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 380px;
}

.install-box .prompt { color: var(--gold); user-select: none; }
.install-box code { color: var(--text); }

.copy-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.copy-btn:hover { color: var(--text); border-color: var(--gold-dim); }

/* ── Sections ── */
section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: #f0f0f0;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 0.5rem;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin-bottom: 3rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ── Feature grid ── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s;
}

.feature-card:hover { border-color: var(--gold-dim); }

.feature-icon {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

/* ── Terminal demo ── */
.terminal {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 2rem 0;
}

.terminal-bar {
  background: #1a1a1a;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}

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

.terminal-title {
  margin-left: auto;
  margin-right: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
}

.t-prompt { color: var(--gold); }
.t-input  { color: #f0f0f0; }
.t-output { color: var(--muted); }
.t-ai     { color: var(--text); }
.t-tool   { color: var(--gold-dim); }
.t-ok     { color: var(--green); }
.t-cmd    { color: var(--blue); }
.t-dim    { color: #444; }

/* ── Provider grid ── */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.provider-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.provider-card .name {
  font-weight: 700;
  color: #f0f0f0;
  margin-bottom: 0.4rem;
}

.provider-card .free-badge {
  display: inline-block;
  background: rgba(76,175,125,0.12);
  border: 1px solid rgba(76,175,125,0.3);
  color: var(--green);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.1rem 0.5rem;
  border-radius: 100px;
  margin-bottom: 0.5rem;
}

.provider-card p {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Docs layout ── */
.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 72px;
}

.docs-sidebar a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  margin-bottom: 0.1rem;
}

.docs-sidebar a:hover { color: var(--text); background: var(--surface); }
.docs-sidebar a.active { color: var(--gold); background: rgba(212,168,71,0.08); }

.docs-sidebar .nav-group-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: #444;
  text-transform: uppercase;
  padding: 0.75rem 0.75rem 0.25rem;
}

.doc-section { margin-bottom: 3rem; }

.doc-section h3 {
  font-size: 1.1rem;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}

.cmd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.cmd-table tr { border-bottom: 1px solid var(--border); }
.cmd-table tr:last-child { border-bottom: none; }

.cmd-table td {
  padding: 0.6rem 0.75rem;
  vertical-align: top;
}

.cmd-table td:first-child {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--gold);
  white-space: nowrap;
  width: 40%;
}

.cmd-table td:last-child { color: var(--muted); }

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  overflow-x: auto;
  line-height: 1.7;
  margin: 0.75rem 0;
}

pre .c  { color: var(--muted); }
pre .kw { color: var(--gold); }
pre .str { color: var(--green); }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(212,168,71,0.08);
  color: var(--gold);
  padding: 0.1em 0.4em;
  border-radius: 3px;
}

pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

p { margin-bottom: 0.75rem; }

/* ── Install steps ── */
.steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 1rem;
  align-items: start;
}

.step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(212,168,71,0.1);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-left span { color: var(--gold); }

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--text); }

/* ── Page summary cards (home) ── */
.page-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.page-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem 1.5rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.15s;
}

.page-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
}

.page-card-icon {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.page-card h3 {
  color: #f0f0f0;
  margin-bottom: 0.4rem;
}

.page-card p {
  color: var(--muted);
  font-size: 0.875rem;
  flex: 1;
  margin-bottom: 0;
}

.page-card-link {
  color: var(--gold);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  margin-top: 1.25rem;
  display: block;
  transition: opacity 0.15s;
}

.page-card:hover .page-card-link { opacity: 0.75; }

/* ── Responsive ── */
@media (max-width: 720px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { display: none; }
  nav .nav-links { display: none; }
}
