:root {
  color-scheme: light;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --body-bg: #fdfdfc;
  --body-color: #2c2c2b;
  --heading-color: #111110;
  --subtitle-color: #4a4946;
  --muted-color: #73726e;
  --subtle-color: rgba(0, 0, 0, 0.42);
  --section-heading: rgba(0, 0, 0, 0.7);
  --marker-color: rgba(0, 0, 0, 0.25);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --surface-tint: #f6f5f3;
  --card-bg: #ffffff;
  --hover-tint: rgba(0, 0, 0, 0.04);
  --code-bg: rgba(0, 0, 0, 0.045);
  --code-color: #1f2937;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --logo-bg: #ffffff;
  --logo-border: rgba(17, 17, 16, 0.12);
  --logo-signal: #2563eb;
  --logo-pointer: #111110;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --body-bg: #0f1012;
  --body-color: #d6d6d3;
  --heading-color: #f4f4f2;
  --subtitle-color: #a6a5a0;
  --muted-color: #93928d;
  --subtle-color: rgba(255, 255, 255, 0.42);
  --section-heading: rgba(255, 255, 255, 0.72);
  --marker-color: rgba(255, 255, 255, 0.28);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);
  --surface-tint: #17181c;
  --card-bg: #1e2025;
  --hover-tint: rgba(255, 255, 255, 0.06);
  --code-bg: rgba(255, 255, 255, 0.08);
  --code-color: #e5e7eb;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --logo-bg: #111113;
  --logo-border: rgba(255, 255, 255, 0.12);
  --logo-signal: #3b82f6;
  --logo-pointer: #f4f4f2;
}

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

html {
  background: var(--body-bg);
  color: var(--body-color);
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: var(--code-color);
}

/* Page container */
.page {
  max-width: 700px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.8rem;
}

/* Top Header */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: block;
  flex-shrink: 0;
}

.logo-mark .logo-bg {
  fill: var(--logo-bg);
}

.logo-mark .logo-border {
  stroke: var(--logo-border);
}

.logo-mark .logo-signal {
  stroke: var(--logo-signal);
}

.logo-mark .logo-pointer {
  fill: var(--logo-pointer);
  stroke: var(--logo-pointer);
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--heading-color);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.lang-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted-color);
  background: transparent;
  transition: all 0.15s ease;
}

.lang-btn:not(:last-child) {
  border-right: 1px solid var(--border-color);
}

.lang-btn.active {
  background: var(--heading-color);
  color: var(--body-bg);
}

.lang-btn:hover:not(.active) {
  background: var(--hover-tint);
}

.theme-btn {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--muted-color);
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.theme-btn:hover {
  color: var(--heading-color);
  background: var(--hover-tint);
}

.theme-btn .icon-sun {
  display: none;
}

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

:root[data-theme="dark"] .theme-btn .icon-moon {
  display: none;
}

.version-badge {
  font-size: 0.72rem;
  color: var(--muted-color);
}

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero h1 {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--heading-color);
  line-height: 1.35;
}

.subtitle {
  font-size: 0.93rem;
  color: var(--subtitle-color);
  line-height: 1.65;
}

/* Quickstart Tabs */
.quickstart {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.qs-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
}

.qs-tab {
  padding: 0.4rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted-color);
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  margin-bottom: -1px;
}

.qs-tab.active {
  color: var(--heading-color);
  border-bottom-color: var(--accent);
}

.qs-tab:hover:not(.active) {
  color: var(--heading-color);
}

.qs-panel {
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.65rem 0;
}

.qs-panel.active { display: flex; }

.qs-note {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted-color);
}

.code-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface-tint);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.code-block code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.copy-btn {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.68rem;
  color: var(--muted-color);
  transition: background 0.15s ease;
}

.copy-btn:hover {
  background: var(--hover-tint);
}

/* Sections */
section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--section-heading);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.section-desc {
  font-size: 0.9rem;
  color: var(--body-color);
  line-height: 1.65;
}

/* Sandbox Card */
.sandbox-card {
  background: var(--surface-tint);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sandbox-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.demo-btn {
  padding: 0.42rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--heading-color);
  color: var(--body-bg);
  transition: all 0.2s ease;
}

.demo-btn.secondary {
  background: var(--card-bg);
  color: var(--heading-color);
  border: 1px solid var(--border-strong);
}

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

.demo-btn.outline {
  background: transparent;
  color: var(--muted-color);
  border: 1px solid var(--border-color);
}

.demo-btn.outline:hover {
  background: var(--hover-tint);
}

.demo-feature-box {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.8rem 0.95rem;
  transition: all 0.25s ease;
}

.demo-feature-box h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--heading-color);
  margin-bottom: 0.15rem;
}

.demo-feature-box p {
  font-size: 0.8rem;
  color: var(--muted-color);
  line-height: 1.55;
}

/* Simulated Terminal Window */
.terminal-window {
  background: #0d0e12;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.48rem 0.75rem;
  background: #16181f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #8b8d98;
  user-select: none;
}

.terminal-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-title {
  color: #9ca3af;
  font-size: 0.68rem;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.06);
  color: #a1a1aa;
}

.terminal-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.terminal-status[data-state="running"] {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
}

.terminal-status[data-state="running"] .terminal-status-dot {
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
}

.terminal-status[data-state="done"] {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.terminal-status[data-state="done"] .terminal-status-dot {
  background: #10b981;
}

.live-cue-log {
  background: #0d0e12;
  color: #d4d4d8;
  padding: 0.8rem 0.95rem;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
}

.term-line {
  display: inline;
}

.term-prompt {
  color: #60a5fa;
  font-weight: 600;
}

.term-cmd {
  color: #f4f4f5;
  font-weight: 500;
}

.term-brand {
  color: #22d3ee;
  font-weight: 700;
}

.term-bold {
  color: #fafafa;
  font-weight: 600;
}

.term-dim {
  color: #71717a;
}

.term-ok {
  color: #34d399;
  font-weight: 600;
}

.term-info {
  color: #38bdf8;
  font-weight: 600;
}

.term-running {
  color: #fbbf24;
}

.term-comment {
  color: #6b7280;
}

.term-payload {
  display: block;
  margin: 0.35rem 0;
  padding: 0.45rem 0.65rem;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid rgba(56, 189, 248, 0.45);
  border-radius: 0 4px 4px 0;
  color: #a1a1aa;
  font-size: 0.7rem;
  line-height: 1.5;
}

.term-cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  margin-left: 5px;
  vertical-align: -2px;
  background: #38bdf8;
  opacity: 0.85;
  animation: term-blink 1.05s steps(2, start) infinite;
}

@keyframes term-blink {
  to {
    visibility: hidden;
  }
}

/* Steps */
.steps {
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.steps li {
  font-size: 0.9rem;
  color: var(--body-color);
  line-height: 1.6;
}

.steps li::marker {
  color: var(--marker-color);
}

/* Tables */
.shortcut-table,
.agent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.shortcut-table th,
.shortcut-table td,
.agent-table th,
.agent-table td {
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border-color);
}

.shortcut-table th,
.agent-table th {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted-color);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Footer */
.footer {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--subtle-color);
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 520px) {
  .page { padding: 1.5rem 1rem 3rem; gap: 2.2rem; }
  .hero h1 { font-size: 1.2rem; }
  .sandbox-actions { flex-direction: column; }
  .shortcut-table, .agent-table { font-size: 0.76rem; }
}
