/* ---------- design tokens ---------- */
:root,
[data-theme="dark"] {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-elev-2: #1c2129;
  --border: #30363d;
  --border-strong: #484f58;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #fbbf24;
  --accent-fg: #0d1117;
  --accent-hover: #fcd34d;
  --accent-soft: rgba(251, 191, 36, 0.12);
  --accent-wash-2: rgba(121, 192, 255, 0.08);
  --header-bg: rgba(13, 17, 23, 0.85);
  --code-bg: #0b0f14;
  --code-fg: #e6edf3;
  --tok-kw: #ff7b72;
  --tok-str: #a5d6ff;
  --tok-fn: #d2a8ff;
  --tok-num: #79c0ff;

  --radius: 10px;
  --radius-sm: 6px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Light theme — bernoulli.live-inspired: near-white bg, dark charcoal text,
   light gray borders, flat surfaces. Yellow accent retained for brand
   consistency, darkened to pass contrast on white. */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: #fafbfc;
  --bg-elev-2: #f3f5f7;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #1a1a1a;
  --muted: #6b7280;
  --accent: #a16207;
  --accent-fg: #ffffff;
  --accent-hover: #854d0e;
  --accent-soft: rgba(161, 98, 7, 0.08);
  --accent-wash-2: rgba(14, 165, 233, 0.06);
  --header-bg: rgba(255, 255, 255, 0.85);
  /* Code blocks stay dark in both themes — classic dev-site contrast. */
}

/* ---------- reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--bg-elev-2);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

/* ---------- layout ---------- */
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 72px 0;
  border-top: 1px solid var(--border);
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-family: var(--mono);
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  font-size: 20px;
  line-height: 1;
}

.brand-name {
  font-size: 16px;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  margin-left: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--bg-elev);
}

.theme-toggle .icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

/* ---------- hero ---------- */
.hero {
  padding: 96px 0 72px;
  background:
    radial-gradient(1200px 400px at 20% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(900px 300px at 80% 0%, var(--accent-wash-2), transparent 60%);
}

.hero-title {
  font-size: clamp(36px, 5.5vw, 60px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.hero-title-alt {
  color: var(--muted);
}

.hero-pitch {
  font-size: clamp(16px, 1.5vw, 19px);
  color: var(--text);
  max-width: 680px;
  margin-bottom: 32px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  transition: transform 80ms ease, border-color 120ms ease, background 120ms ease;
  font-family: var(--sans);
}

.cta:hover {
  text-decoration: none;
  border-color: var(--border-strong);
  background: var(--bg-elev-2);
}

.cta:active {
  transform: translateY(1px);
}

.cta-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
  font-weight: 600;
}

.cta-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-fg);
}

.cta-secondary code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: 14px;
}

.copy-hint {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.copy-btn.copied .copy-hint {
  color: var(--accent);
  border-color: var(--accent);
}

.hero-meta {
  color: var(--muted);
  font-size: 14px;
}

.hero-meta a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

.hero-meta a:hover {
  color: var(--text);
}

/* ---------- section headings ---------- */
.section h2 {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.015em;
}

.section-lede {
  color: var(--muted);
  max-width: 680px;
  margin-bottom: 40px;
}

/* ---------- cards (stack) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 120ms ease, transform 120ms ease;
}

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

.card-tag {
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.card h3 {
  font-size: 20px;
  margin-bottom: 10px;
  font-family: var(--mono);
}

.card h3 code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: inherit;
}

.card p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
}

.card p code {
  font-size: 0.88em;
}

.stack-footer {
  margin-top: 32px;
  padding: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
}

/* ---------- code block ---------- */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
}

.code-block code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: var(--text);
}

.tok-kw {
  color: var(--tok-kw);
}
.tok-str {
  color: var(--tok-str);
}
.tok-fn {
  color: var(--tok-fn);
}
.tok-num {
  color: var(--tok-num);
}

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

.feature h3 {
  font-size: 17px;
  margin-bottom: 8px;
  color: var(--text);
}

.feature p {
  color: var(--muted);
  font-size: 14.5px;
}

/* ---------- install ---------- */
.install-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.install-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.install-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.snippet {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font-family: var(--sans);
  transition: border-color 120ms ease;
}

.snippet:hover {
  border-color: var(--border-strong);
}

.snippet code {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text);
  font-size: 13px;
  overflow-x: auto;
  white-space: nowrap;
  max-width: 100%;
}

.install-note {
  color: var(--muted);
  font-size: 14px;
}

/* ---------- footer ---------- */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.footer-row p {
  color: var(--muted);
}

.footer-row a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

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

/* ---------- responsive tweaks ---------- */
@media (max-width: 640px) {
  .nav-links {
    gap: 14px;
  }
  .nav-links a {
    font-size: 13px;
  }
  .hero {
    padding: 64px 0 48px;
  }
  .section {
    padding: 56px 0;
  }
  .cta {
    width: 100%;
    justify-content: center;
  }
}
