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

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-dark: #2563eb;
  --radius: 12px;

  /* Badge colors */
  --badge-js-bg: #fef9c3;     --badge-js-text: #854d0e;
  --badge-ts-bg: #dbeafe;     --badge-ts-text: #1d4ed8;
  --badge-php-bg: #ede9fe;    --badge-php-text: #6d28d9;
  --badge-go-bg: #d1fae5;     --badge-go-text: #065f46;
  --badge-py-bg: #fef9c3;     --badge-py-text: #92400e;
  --badge-java-bg: #fee2e2;   --badge-java-text: #991b1b;
  --badge-net-bg: #ede9fe;    --badge-net-text: #4c1d95;
  --badge-fw-bg: #f1f5f9;     --badge-fw-text: #334155;   --badge-fw-border: #cbd5e1;

  /* Featured card */
  --featured-bg: #eff6ff;
  --featured-border: #bfdbfe;
  --featured-label-color: #2563eb;
  --featured-label-border: #bfdbfe;

  /* Inline code */
  --code-bg: #dbeafe;   --code-text: #1d4ed8;
  --faq-code-bg: #f1f5f9;  --faq-code-text: #334155;
}

/* ─── Dark mode: media query (no-JS fallback) ────────── */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #0f172a;
    --surface: #1e293b;
    --border: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #60a5fa;
    --accent-dark: #93c5fd;

    --badge-js-bg: #422006;     --badge-js-text: #fde68a;
    --badge-ts-bg: #1e3a5f;     --badge-ts-text: #93c5fd;
    --badge-php-bg: #2e1065;    --badge-php-text: #c4b5fd;
    --badge-go-bg: #064e3b;     --badge-go-text: #6ee7b7;
    --badge-py-bg: #422006;     --badge-py-text: #fde68a;
    --badge-java-bg: #450a0a;   --badge-java-text: #fca5a5;
    --badge-net-bg: #2e1065;    --badge-net-text: #c4b5fd;
    --badge-fw-bg: #0f172a;     --badge-fw-text: #94a3b8;  --badge-fw-border: #475569;

    --featured-bg: #172554;
    --featured-border: #1d4ed8;
    --featured-label-color: #93c5fd;
    --featured-label-border: #1d4ed8;

    --code-bg: #1e3a5f;    --code-text: #93c5fd;
    --faq-code-bg: #0f172a;  --faq-code-text: #94a3b8;

    color-scheme: dark;
  }
}

/* ─── Dark mode: manual toggle ───────────────────────── */
html[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #60a5fa;
  --accent-dark: #93c5fd;

  --badge-js-bg: #422006;     --badge-js-text: #fde68a;
  --badge-ts-bg: #1e3a5f;     --badge-ts-text: #93c5fd;
  --badge-php-bg: #2e1065;    --badge-php-text: #c4b5fd;
  --badge-go-bg: #064e3b;     --badge-go-text: #6ee7b7;
  --badge-py-bg: #422006;     --badge-py-text: #fde68a;
  --badge-java-bg: #450a0a;   --badge-java-text: #fca5a5;
  --badge-net-bg: #2e1065;    --badge-net-text: #c4b5fd;
  --badge-fw-bg: #0f172a;     --badge-fw-text: #94a3b8;  --badge-fw-border: #475569;

  --featured-bg: #172554;
  --featured-border: #1d4ed8;
  --featured-label-color: #93c5fd;
  --featured-label-border: #1d4ed8;

  --code-bg: #1e3a5f;    --code-text: #93c5fd;
  --faq-code-bg: #0f172a;  --faq-code-text: #94a3b8;

  color-scheme: dark;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Hero ─────────────────────────────────────────── */
.hero {
  padding: 72px 24px 56px;
  max-width: 900px;
  margin: 0 auto;
}

.hero-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero-text {
  flex: 1;
}

.hero-logo {
  width: 220px;
  height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(59, 130, 246, 0.15));
  flex-shrink: 0;
  border-radius: 5px;
}

.hero-logo--mobile { display: none; }
.hero-logo--desktop { display: block; }

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 12px;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 480px;
}

/* ─── About ─────────────────────────────────────────── */
.about {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 48px 24px;
}

.about-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.about-inner h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.about-inner p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ─── Integrations ──────────────────────────────────── */
.integrations {
  padding: 64px 24px;
  flex: 1;
}

.integrations-inner {
  max-width: 960px;
  margin: 0 auto;
}

.integrations h2 {
  font-size: 1.375rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.integrations-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 40px;
  font-size: 0.95rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* ─── Card ───────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

/* Language badges */
.badge-js   { background: var(--badge-js-bg);   color: var(--badge-js-text); }
.badge-ts   { background: var(--badge-ts-bg);   color: var(--badge-ts-text); }
.badge-php  { background: var(--badge-php-bg);  color: var(--badge-php-text); }
.badge-go   { background: var(--badge-go-bg);   color: var(--badge-go-text); }
.badge-py   { background: var(--badge-py-bg);   color: var(--badge-py-text); }
.badge-java { background: var(--badge-java-bg); color: var(--badge-java-text); }
.badge-net  { background: var(--badge-net-bg);  color: var(--badge-net-text); }

/* Framework badges */
.badge-fw {
  background: var(--badge-fw-bg);
  color: var(--badge-fw-text);
  border: 1px solid var(--badge-fw-border);
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

.card-desc a:hover {
  text-decoration: underline;
}

/* ─── Frameworks list ────────────────────────────────── */
.card-frameworks-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.card-frameworks {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-top: auto;
}

.card-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.card-link svg {
  flex-shrink: 0;
}

/* ─── Use cases ──────────────────────────────────────── */
.usecases {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 64px 24px;
}

.usecases-inner {
  max-width: 860px;
  margin: 0 auto;
}

.usecases h2 {
  font-size: 1.375rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.usecases-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 40px;
}

.uc-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.uc-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.uc-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1.4;
}

.uc-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.uc-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─── Featured E2E card ──────────────────────────────── */
.uc-card--featured {
  flex-direction: column;
  gap: 24px;
  background: var(--featured-bg);
  border-color: var(--featured-border);
}

.uc-featured-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.uc-featured-header h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.uc-featured-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.uc-featured-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--featured-label-color);
  padding-top: 4px;
  border-top: 1px solid var(--featured-label-border);
}

.uc-reasons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.uc-reason {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.uc-reason h4 {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.uc-reason p {
  font-size: 0.85rem;
}

.uc-reason code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.8em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ─── WIP card ───────────────────────────────────────── */
.card--wip {
  position: relative;
  overflow: hidden;
}

.card--wip::after {
  content: "Work in Progress";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.65);
  color: #92400e;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius);
  backdrop-filter: blur(2px);
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .card--wip::after {
    background: rgba(15, 23, 42, 0.72);
    color: #fb923c;
  }
}

html[data-theme="dark"] .card--wip::after {
  background: rgba(15, 23, 42, 0.72);
  color: #fb923c;
}

/* ─── Getting Started ────────────────────────────────── */
.getting-started {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 64px 24px;
}

.gs-inner {
  max-width: 780px;
  margin: 0 auto;
}

.getting-started h2 {
  font-size: 1.375rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.gs-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 48px;
}

.gs-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.gs-step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  position: relative;
  padding-bottom: 40px;
}

.gs-step:last-child {
  padding-bottom: 0;
}

.gs-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.gs-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.gs-body {
  flex: 1;
  padding-top: 8px;
}

.gs-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.gs-body > p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.gs-body > p:last-child {
  margin-bottom: 0;
}

.gs-body > p code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.8em;
  background: var(--faq-code-bg);
  color: var(--faq-code-text);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ─── Language tabs ─── */
.gs-tabs {
  margin-top: 4px;
}

.gs-tab-list {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.gs-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.1s;
}

.gs-tab:hover {
  color: var(--text);
}

.gs-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.gs-panel {
  display: none;
}

.gs-panel.is-active {
  display: block;
}

.gs-panel-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.gs-panel-hint code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.8em;
  background: var(--faq-code-bg);
  color: var(--faq-code-text);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ─── Command blocks ─── */
.gs-cmd-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gs-cmd {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gs-cmd-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.gs-panel pre {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  margin: 0;
}

.gs-panel pre code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  background: none;
  color: inherit;
  padding: 0;
  border: none;
  border-radius: 0;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .gs-panel pre {
    background: #0f172a;
  }
}

html[data-theme="dark"] .gs-panel pre {
  background: #0f172a;
}

/* ─── Env vars ─── */
.gs-env-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.gs-env-var {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-size: 0.875rem;
  flex-wrap: wrap;
}

.gs-env-var code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.82rem;
  background: var(--faq-code-bg);
  color: var(--faq-code-text);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}

.gs-env-var span {
  color: var(--text-muted);
}

/* ─── Coming soon card ───────────────────────────────── */
.card-coming {
  opacity: 0.55;
  border-style: dashed;
}

.card-coming .card-link {
  display: none;
}

/* ─── CLI Output ─────────────────────────────────────── */
.cli-output {
  padding: 64px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.cli-inner {
  max-width: 720px;
  margin: 0 auto;
}

.cli-output h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.cli-subtitle {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.terminal {
  background: #0d1117;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #30363d;
  margin-top: 16px;
}

.terminal-bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
}

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

.terminal-bar span:nth-child(1) { background: #ff5f57; }
.terminal-bar span:nth-child(2) { background: #febc2e; }
.terminal-bar span:nth-child(3) { background: #28c840; }

.terminal pre {
  margin: 0;
  padding: 20px 24px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, "Cascadia Code", monospace;
  font-size: 0.815rem;
  line-height: 1.65;
  color: #cdd9e5;
  background: transparent;
  overflow-x: auto;
  white-space: pre;
}

.t-pass  { color: #3fb950; }
.t-skip  { color: #d29922; }
.t-skipper { color: #58a6ff; font-weight: 600; }
.t-muted { color: #6e7681; }

/* ─── FAQ ────────────────────────────────────────────── */
.faq {
  padding: 64px 24px;
  background: var(--bg);
}

.faq-inner {
  max-width: 720px;
  margin: 0 auto;
}

.faq h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 36px;
  text-align: center;
}

.faq-item {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item:last-child {
  border-bottom: 1px solid var(--border);
}

.faq-item h3 {
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--text);
}

.faq-item p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.faq-item code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.8em;
  background: var(--faq-code-bg);
  color: var(--faq-code-text);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.faq-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-top: 4px;
}

.faq-link:hover {
  text-decoration: underline;
}

/* ─── Footer ─────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 32px 24px;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

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

footer a:hover {
  text-decoration: underline;
}

/* ─── Theme toggle button ────────────────────────────── */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  padding: 0;
  transition: background-color 0.15s, color 0.15s;
}

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

.theme-toggle svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Show/hide icons based on current theme */
.icon-sun { display: none; }
.icon-moon { display: block; }

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

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .icon-sun { display: block; }
  html:not([data-theme="light"]) .icon-moon { display: none; }
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { text-align: center; padding: 48px 24px 40px; }
  .hero-body { flex-direction: column-reverse; gap: 24px; }
  .hero-logo--mobile { display: block; width: 130px; height: 130px; margin: 0 auto; }
  .hero-logo--desktop { display: none; }
  .hero h1 { font-size: 2rem; }
  .hero p { max-width: 100%; }
}
