:root {
  --bg: #090a0f;
  --bg-elevated: #11131b;
  --bg-surface: #151823;
  --bg-surface-hover: #1b1f2e;
  --bg-code: #0d0f16;
  --bg-header: rgba(9, 10, 15, 0.76);

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(113, 54, 231, 0.42);

  --text: #f3f5f9;
  --text-secondary: #a1a8bc;
  --text-muted: #6e768c;

  --accent: #7c5cff;
  --accent-strong: #6d4aff;
  --accent-cyan: #22c7e5;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --accent-glow: rgba(113, 54, 231, 0.22);
  --cyan-glow: rgba(21, 155, 239, 0.16);

  --btn-primary-bg: #f3f5f9;
  --btn-primary-text: #090a0f;
  --btn-primary-hover: #ffffff;

  --kbd-bg: rgba(255, 255, 255, 0.06);
  --kbd-border: rgba(255, 255, 255, 0.14);
  --kbd-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);

  --status-working: #34d399;
  --status-working-bg: rgba(52, 211, 153, 0.12);
  --status-input: #fbbf24;
  --status-input-bg: rgba(251, 191, 36, 0.14);
  --status-done: #60a5fa;
  --status-done-bg: rgba(96, 165, 250, 0.12);
  --status-error: #f87171;
  --status-error-bg: rgba(248, 113, 113, 0.12);
  --status-idle: #94a3b8;
  --status-idle-bg: rgba(148, 163, 184, 0.12);

  --syntax-key: #7dd3fc;
  --syntax-str: #86efac;
  --syntax-num: #fbbf24;
  --syntax-sec: #c4b5fd;
  --syntax-cmt: #64748b;

  --shadow-window: 0 28px 80px -20px rgba(0, 0, 0, 0.78), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-card: 0 12px 36px -16px rgba(0, 0, 0, 0.55);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", system-ui, sans-serif;
  --font-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --container: 1120px;
}

[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-elevated: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f0f2f8;
  --bg-code: #f1f3f9;
  --bg-header: rgba(246, 247, 251, 0.8);

  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.16);
  --border-accent: rgba(109, 74, 255, 0.35);

  --text: #0f1320;
  --text-secondary: #475069;
  --text-muted: #6c758d;

  --accent: #5b3df5;
  --accent-strong: #4c2de6;
  --accent-cyan: #0284c7;
  --accent-soft: rgba(91, 61, 245, 0.09);
  --accent-glow: rgba(113, 54, 231, 0.12);
  --cyan-glow: rgba(21, 155, 239, 0.1);

  --btn-primary-bg: #11131b;
  --btn-primary-text: #ffffff;
  --btn-primary-hover: #1e2230;

  --kbd-bg: #ffffff;
  --kbd-border: rgba(15, 23, 42, 0.15);
  --kbd-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);

  --status-working: #059669;
  --status-working-bg: rgba(5, 150, 105, 0.1);
  --status-input: #b45309;
  --status-input-bg: rgba(217, 119, 6, 0.12);
  --status-done: #2563eb;
  --status-done-bg: rgba(37, 99, 235, 0.1);
  --status-error: #dc2626;
  --status-error-bg: rgba(220, 38, 38, 0.1);
  --status-idle: #475569;
  --status-idle-bg: rgba(71, 85, 105, 0.1);

  --syntax-key: #0369a1;
  --syntax-str: #15803d;
  --syntax-num: #b45309;
  --syntax-sec: #6d28d9;
  --syntax-cmt: #64748b;

  --shadow-window: 0 24px 64px -20px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.09);
  --shadow-card: 0 10px 30px -16px rgba(15, 23, 42, 0.12);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 48% at 50% -10%, var(--accent-glow), transparent 70%),
    radial-gradient(ellipse 50% 35% at 85% 8%, var(--cyan-glow), transparent 65%);
  background-repeat: no-repeat;
  overflow-x: hidden;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-header);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 9px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
}

.lang-switch a,
.lang-switch span {
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1.2;
}

.lang-switch span.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.lang-switch a {
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.lang-switch a:hover {
  color: var(--text);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

[data-theme="dark"] .icon-moon,
:root:not([data-theme="light"]) .icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: none;
}

/* Hero */
.hero {
  padding: 72px 0 56px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.hero h1 {
  margin: 0 auto 20px;
  max-width: 820px;
  font-size: clamp(38px, 5.6vw, 62px);
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: -0.035em;
}

.hero-subtitle {
  margin: 0 auto 32px;
  max-width: 650px;
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-secondary);
  line-height: 1.55;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

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

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

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

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-accent);
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* macOS Window Frame */
.window-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-window);
  border: 1px solid var(--border);
  text-align: left;
}

.window-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.traffic-lights {
  display: flex;
  gap: 7px;
}

.traffic-lights span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: block;
}

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

.window-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.window-spacer {
  width: 47px;
}

.window-body img {
  width: 100%;
}

/* Sections */
.section {
  padding: 68px 0;
}

.section-header {
  max-width: 680px;
  margin-bottom: 36px;
}

.section-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.section-header h2 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.section-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16.5px;
}

/* 4-Pillar Grid */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.pillar-card {
  padding: 26px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

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

.pillar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 16px;
}

.pillar-icon svg {
  width: 20px;
  height: 20px;
}

.pillar-card h3 {
  margin: 0 0 10px;
  font-size: 18.5px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.pillar-card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Deep-Dive Alternating & Wide Showcase */
.deep-dive {
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.feature-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 44px;
  align-items: center;
}

.feature-split.reverse .feature-copy {
  order: 2;
}

.feature-split.reverse .feature-media {
  order: 1;
}

.feature-copy h3 {
  margin: 0 0 14px;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.feature-copy p {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 15.5px;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-list li {
  position: relative;
  padding-left: 20px;
  font-size: 14.5px;
  color: var(--text-secondary);
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.feature-list strong {
  color: var(--text);
  font-weight: 600;
}

.media-card {
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-card img {
  border-radius: 10px;
  border: 1px solid var(--border);
}

.media-card.compact img {
  max-width: 420px;
  width: 100%;
}

.media-card.wide {
  padding: 16px;
}

.media-card.wide img {
  width: 100%;
}

.feature-wide {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.feature-wide-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 36px;
  align-items: start;
}

/* Keyboard Shortcuts Grid */
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  background: var(--kbd-bg);
  border: 1px solid var(--kbd-border);
  border-radius: 6px;
  box-shadow: var(--kbd-shadow);
  white-space: nowrap;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 13.5px;
}

.shortcut-item span {
  color: var(--text-secondary);
}

/* Status Pills & Agent Chips */
.status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid transparent;
}

.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.pill-working {
  color: var(--status-working);
  background: var(--status-working-bg);
  border-color: rgba(52, 211, 153, 0.25);
}

.pill-input {
  color: var(--status-input);
  background: var(--status-input-bg);
  border-color: rgba(251, 191, 36, 0.28);
}

.pill-done {
  color: var(--status-done);
  background: var(--status-done-bg);
  border-color: rgba(96, 165, 250, 0.25);
}

.pill-error {
  color: var(--status-error);
  background: var(--status-error-bg);
  border-color: rgba(248, 113, 113, 0.25);
}

.pill-idle {
  color: var(--status-idle);
  background: var(--status-idle-bg);
  border-color: rgba(148, 163, 184, 0.22);
}

.agent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.agent-chip {
  padding: 5px 11px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
}

.agent-chip.native {
  border-color: var(--border-accent);
  background: var(--accent-soft);
}

/* Install & Config Section */
.install-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.step-card {
  padding: 22px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 12px;
}

.step-card h3 {
  margin: 0 0 8px;
  font-size: 15.5px;
  font-weight: 650;
}

.step-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.step-card a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.code-panel {
  border-radius: var(--radius-md);
  background: var(--bg-code);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.code-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

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

.copy-btn.copied {
  color: var(--status-working);
  border-color: rgba(52, 211, 153, 0.35);
}

.code-panel pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.code-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tok-k { color: var(--syntax-key); }
.tok-s { color: var(--syntax-str); }
.tok-n { color: var(--syntax-num); }
.tok-sec { color: var(--syntax-sec); font-weight: 600; }
.tok-c { color: var(--syntax-cmt); }

.inline-code {
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.9em;
  background: var(--bg-code);
  border: 1px solid var(--border);
  color: var(--text);
}

/* Footer */
.site-footer {
  margin-top: 40px;
  padding: 32px 0 44px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.footer-links a {
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

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

/* Responsive */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .pillars-grid,
  .feature-split,
  .feature-wide-grid,
  .install-steps,
  .code-grid {
    grid-template-columns: 1fr;
  }

  .feature-split.reverse .feature-copy,
  .feature-split.reverse .feature-media {
    order: initial;
  }

  .hero {
    padding: 52px 0 36px;
  }

  .section {
    padding: 48px 0;
  }

  .deep-dive {
    gap: 56px;
  }
}

@media (max-width: 560px) {
  .shortcuts-grid {
    grid-template-columns: 1fr;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .window-title {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .pillar-card,
  .btn {
    transition: none;
  }
}
