/* ==========================================================================
   MIPO AI Website — Stylesheet
   Bilingual (ZH/EN) · Light & Dark Themes · Zero External Dependencies
   ========================================================================== */

:root {
  --bg: #fbfaf8;
  --bg-elevated: #ffffff;
  --bg-muted: #f3efe9;
  --bg-code: #18181b;
  --text: #161514;
  --text-secondary: #524d47;
  --text-muted: #78716c;
  --text-code: #f4f4f5;
  --border: rgba(24, 22, 19, 0.1);
  --border-strong: rgba(24, 22, 19, 0.18);
  --accent: #d97706;
  --accent-hover: #b45309;
  --accent-soft: rgba(217, 119, 6, 0.11);
  --accent-glow: rgba(245, 158, 11, 0.16);
  --emerald: #059669;
  --emerald-soft: rgba(5, 150, 105, 0.12);
  --sky: #0284c7;
  --sky-soft: rgba(2, 132, 199, 0.12);
  --violet: #7c3aed;
  --violet-soft: rgba(124, 58, 237, 0.11);
  --shadow-sm: 0 1px 2px rgba(20, 16, 12, 0.05);
  --shadow-md: 0 10px 30px -10px rgba(24, 18, 10, 0.1), 0 4px 12px -4px rgba(24, 18, 10, 0.06);
  --shadow-lg: 0 24px 56px -16px rgba(24, 18, 10, 0.16);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --header-h: 68px;
}

[data-theme="dark"] {
  --bg: #0f1012;
  --bg-elevated: #17191d;
  --bg-muted: #1e2127;
  --bg-code: #0b0c0e;
  --text: #f3f1ed;
  --text-secondary: #b5b0a8;
  --text-muted: #8a857e;
  --text-code: #e4e4e7;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --accent-soft: rgba(245, 158, 11, 0.15);
  --accent-glow: rgba(245, 158, 11, 0.14);
  --emerald: #34d399;
  --emerald-soft: rgba(52, 211, 153, 0.13);
  --sky: #38bdf8;
  --sky-soft: rgba(56, 189, 248, 0.13);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.13);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 32px -10px rgba(0, 0, 0, 0.48);
  --shadow-lg: 0 28px 64px -16px rgba(0, 0, 0, 0.65);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.65;
  overflow-x: clip;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

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

img,
svg {
  display: block;
}

/* Container & Layout */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 88px 0;
  position: relative;
}

.section-alt {
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 720px;
  margin-bottom: 44px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(217, 119, 6, 0.22);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.section-title {
  margin: 0 0 12px;
  font-size: clamp(26px, 3.3vw, 38px);
  line-height: 1.22;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.section-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16.5px;
  line-height: 1.7;
}

/* Sticky Top Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.015em;
  flex-shrink: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.brand-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(217, 119, 6, 0.24);
}

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

.nav-links a {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--bg-muted);
}

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

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 11px;
  border-radius: 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.14s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
  white-space: nowrap;
}

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

.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 9px;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 6px 18px -6px rgba(217, 119, 6, 0.55);
}

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

.btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--bg-muted);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* Ambient Hero */
.hero {
  position: relative;
  padding: 68px 0 72px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -160px auto auto 50%;
  transform: translateX(-50%);
  width: 960px;
  height: 520px;
  background: radial-gradient(closest-side, var(--accent-glow), transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 44px;
  align-items: center;
}

.hero-title {
  margin: 0 0 18px;
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.14;
  letter-spacing: -0.028em;
  font-weight: 800;
}

.hero-title .highlight {
  color: var(--accent);
}

.hero-lead {
  margin: 0 0 26px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 560px;
}

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

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.hero-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border-strong);
}

.hero-meta .ver-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-soft);
}

/* Interactive Desktop Stage Mockup */
.hero-stage {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: perspective(1200px) rotateX(calc(var(--tilt-x, 0deg))) rotateY(calc(var(--tilt-y, 0deg)));
  transition: transform 0.25s ease;
}

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

.window-dots {
  display: flex;
  gap: 7px;
}

.window-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.window-dots span:nth-child(1) { background: #ef4444; }
.window-dots span:nth-child(2) { background: #f59e0b; }
.window-dots span:nth-child(3) { background: #22c55e; }

.stage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.stage-tab {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.stage-tab.active {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.stage-body {
  padding: 20px;
  min-height: 356px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.stage-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
  animation: fadePanel 0.22s ease;
}

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

@keyframes fadePanel {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.stage-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(217, 119, 6, 0.22);
}

.stage-banner strong {
  display: block;
  font-size: 13.5px;
}

.stage-banner span {
  font-size: 12px;
  color: var(--text-secondary);
}

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

.stage-mini-card {
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
}

.stage-mini-card .label {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stage-mini-card .val {
  font-size: 13.5px;
  font-weight: 700;
}

.stage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 12.5px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.pill-amber { background: var(--accent-soft); color: var(--accent); }
.pill-green { background: var(--emerald-soft); color: var(--emerald); }
.pill-sky { background: var(--sky-soft); color: var(--sky); }
.pill-violet { background: var(--violet-soft); color: var(--violet); }

/* Stats Bar */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 44px;
}

.stat-card {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.stat-num {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* Grids & Feature Cards */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card-accent {
  border-color: rgba(217, 119, 6, 0.34);
  background: linear-gradient(180deg, var(--accent-soft), var(--bg-elevated) 44%);
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 16px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

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

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.tag {
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* MCP Dual-Mode Showcase */
.mcp-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 24px;
}

.mode-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.mode-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 9px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
}

.agent-chip .badge-auto {
  font-size: 10.5px;
  color: var(--emerald);
  background: var(--emerald-soft);
  padding: 1px 6px;
  border-radius: 999px;
}

.agent-chip .badge-detect {
  font-size: 10.5px;
  color: var(--sky);
  background: var(--sky-soft);
  padding: 1px 6px;
  border-radius: 999px;
}

/* Code / Prompt Preview Box */
.code-box {
  background: var(--bg-code);
  color: var(--text-code);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 14px 0;
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #a1a1aa;
}

.copy-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #f4f4f5;
  font-size: 11.5px;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.copy-btn.copied {
  border-color: rgba(52, 211, 153, 0.5);
  color: #34d399;
}

.code-box pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 12.8px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Spec & App Cards */
.spec-banner {
  margin-top: 24px;
  padding: 26px 28px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: center;
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.perm-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  font-size: 12.5px;
}

.perm-item code {
  display: block;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 2px;
}

/* Skills Top 10 & Assembler */
.skills-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 22px;
  align-items: start;
}

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

.skill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.skill-item .rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.skill-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.skill-name {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Download Cards */
.download-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.dl-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.dl-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-md);
}

.dl-detect-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto 20px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.dl-detect-bar.is-detected {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 55%, var(--bg-elevated)), var(--bg-elevated));
  color: var(--text);
}

.dl-detect-bar.is-mobile {
  border-color: color-mix(in srgb, var(--sky) 45%, var(--border));
}

.dl-detect-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-soft);
  flex-shrink: 0;
}

.dl-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.dl-card-head h3 {
  margin: 0;
  font-size: 16.5px;
}

.dl-rec-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  background: var(--orbit-gradient, var(--accent));
  white-space: nowrap;
}

.dl-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.dl-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.dl-filename {
  overflow-wrap: anywhere;
  color: var(--text-secondary);
}

.dl-fileinfo {
  white-space: nowrap;
  color: var(--emerald);
  font-family: var(--font-sans);
  font-weight: 600;
}

/* Language Picker Dropdown */
.lang-picker {
  position: relative;
}

.lang-btn {
  padding: 0 10px;
  gap: 5px;
  white-space: nowrap;
}

.lang-globe {
  font-size: 14px;
  line-height: 1;
}

.lang-caret {
  font-size: 11px;
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.lang-picker.open .lang-caret {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 186px;
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  z-index: 200;
}

.lang-menu[hidden] {
  display: none;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.lang-option:hover {
  background: var(--bg-muted);
  color: var(--text);
}

.lang-option.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.lang-opt-check {
  opacity: 0;
  font-size: 12px;
}

.lang-option.active .lang-opt-check {
  opacity: 1;
}

/* First-Launch Security Prompt & Safety Guide */
.trust-guide {
  margin-top: 24px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.trust-guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.trust-guide-head > div {
  flex: 1 1 560px;
}

.trust-guide-head h3 {
  margin: 8px 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.trust-guide-head p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--emerald);
  background: var(--emerald-soft);
}

.trust-os-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.trust-os-card {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  border: 1px solid var(--border);
}

.trust-os-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.trust-os-title strong {
  font-size: 15px;
}

.trust-steps {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

@media (max-width: 820px) {
  .trust-os-grid {
    grid-template-columns: 1fr;
  }
}

.verify-note {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* Documentation Portal Layout */
.docs-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 36px;
  padding: 36px 0 88px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
}

.docs-search-wrap {
  margin-bottom: 14px;
}

.docs-search {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
}

.docs-search:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.docs-toc {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.docs-toc a {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.14s ease;
}

.docs-toc a:hover,
.docs-toc a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.docs-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.doc-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  box-shadow: var(--shadow-sm);
}

.doc-section.hidden-by-filter {
  display: none;
}

.doc-section h2 {
  margin: 0 0 12px;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.doc-section h3 {
  margin: 22px 0 8px;
  font-size: 17px;
  font-weight: 700;
}

.doc-section p,
.doc-section li {
  color: var(--text-secondary);
  font-size: 14.8px;
  line-height: 1.72;
}

.doc-table-wrap {
  overflow-x: auto;
  margin: 14px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
}

table.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.doc-table th,
table.doc-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.doc-table th {
  background: var(--bg-muted);
  font-weight: 700;
  color: var(--text);
}

table.doc-table tr:last-child td {
  border-bottom: none;
}

.step-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(217, 119, 6, 0.28);
  margin-top: 1px;
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-body strong {
  display: block;
  font-size: 14.5px;
  color: var(--text);
  margin-bottom: 4px;
}

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

.callout {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(217, 119, 6, 0.25);
  margin: 14px 0;
  font-size: 14px;
}

.callout strong {
  color: var(--accent);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 44px 0;
  color: var(--text-secondary);
  font-size: 13.5px;
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

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

/* Scroll Reveal (progressive: never traps elements invisible without JS) */
.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.js-ready [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Responsive */
@media (max-width: 1020px) {
  .hero-grid,
  .mcp-modes,
  .spec-banner,
  .skills-layout,
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4,
  .download-grid,
  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .docs-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }

  .section {
    padding: 60px 0;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .download-grid,
  .stats-strip,
  .skills-grid,
  .perm-grid,
  .stage-mini-grid {
    grid-template-columns: 1fr;
  }

  .doc-section {
    padding: 20px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-stage {
    transform: none !important;
  }
}
/* Orbital identity: the same midnight, electric blue and golden light as the app. */
:root {
  --bg: #f5f7ff; --bg-elevated: #ffffff; --bg-muted: #eaf0ff;
  --bg-code: #11182e; --text: #121d38; --text-secondary: #475a7b;
  --text-muted: #697c9c; --border: rgba(60, 93, 160, .14);
  --border-strong: rgba(58, 89, 163, .28); --accent: #344eb4;
  --accent-hover: #253c98; --accent-soft: rgba(76, 92, 205, .10);
  --accent-glow: rgba(75, 109, 233, .18); --sky: #1269c9; --violet: #6653ce;
  --shadow-sm: 0 4px 18px rgba(34, 64, 132, .06);
  --shadow-md: 0 16px 40px -16px rgba(36, 62, 140, .24);
  --shadow-lg: 0 30px 70px -20px rgba(25, 47, 113, .28);
  --orbit-gradient: linear-gradient(118deg, #4a409c 0%, #245dbb 75%, #297bc1 100%);
}
[data-theme="dark"] {
  --bg: #080e20; --bg-elevated: #111a33; --bg-muted: #0d162b;
  --bg-code: #080d1b; --text: #eef3ff; --text-secondary: #b5c4df;
  --text-muted: #91a3c5; --border: rgba(158, 185, 255, .13);
  --border-strong: rgba(145, 176, 255, .27); --accent: #9bb5ff;
  --accent-hover: #c4d3ff; --accent-soft: rgba(97, 130, 239, .15);
  --accent-glow: rgba(45, 95, 224, .23); --sky: #6ec8ff; --violet: #b4a8ff;
  --shadow-sm: 0 4px 18px rgba(0, 0, 0, .2);
  --shadow-md: 0 18px 45px -16px rgba(0, 0, 0, .58);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .7);
  --orbit-gradient: linear-gradient(118deg, #11182e, #253b7a 68%, #2957aa);
}
body { background-image: radial-gradient(ellipse at 50% -20%, var(--accent-glow), transparent 48%); }
.site-header { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 5px 18px rgba(41, 74, 169, .23); }
.brand { font-weight: 800; letter-spacing: -.035em; }
.brand-badge, .eyebrow { border-color: var(--border-strong); }
.eyebrow { background: color-mix(in srgb, var(--bg-elevated) 70%, var(--accent-soft)); box-shadow: var(--shadow-sm); }
.eyebrow .status-dot { background: #d89828; box-shadow: 0 0 0 3px rgba(239, 176, 53, .16), 0 0 14px #f4bd56; }
.btn-primary { background: var(--orbit-gradient); color: #fff; border-color: rgba(111, 145, 255, .45); box-shadow: 0 10px 26px -10px rgba(42, 73, 185, .65), inset 0 1px rgba(255,255,255,.18); }
.btn-primary:hover { background: var(--orbit-gradient); filter: brightness(1.12); box-shadow: 0 13px 32px -10px rgba(49, 93, 224, .7); }
.btn-secondary, .icon-btn { background: color-mix(in srgb, var(--bg-elevated) 84%, transparent); }
.hero { padding: 84px 0 80px; isolation: isolate; background: radial-gradient(ellipse at 80% 38%, rgba(81, 116, 238, .13), transparent 42%), radial-gradient(ellipse at 18% 0%, rgba(244, 187, 86, .12), transparent 30%); }
.hero::before { inset: -250px -250px auto auto; transform: none; width: 850px; height: 850px; background: radial-gradient(circle, rgba(84, 115, 235, .16), transparent 66%); }
.hero::after { content: ""; position: absolute; z-index: -1; width: 760px; height: 310px; right: -200px; top: 180px; border: 1px solid rgba(85, 123, 242, .28); border-radius: 50%; transform: rotate(-24deg); box-shadow: 0 0 0 1px rgba(225, 172, 74, .10), 0 0 65px rgba(61, 100, 233, .13), inset 0 0 65px rgba(62, 100, 222, .08); pointer-events: none; }
.hero-title { font-size: clamp(36px, 4.35vw, 55px); letter-spacing: -.045em; line-height: 1.17; }
.hero-title .highlight { color: #334fbb; background: linear-gradient(110deg, #5141b4, #116ac0 75%, #bd8d28); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
[data-theme="dark"] .hero-title .highlight { background-image: linear-gradient(110deg, #d2d4ff, #72b6ff 65%, #f4c364); }
.hero-stage { border-color: var(--border-strong); background: linear-gradient(145deg, var(--bg-elevated), var(--bg-muted)); box-shadow: var(--shadow-lg), 0 0 0 5px rgba(87, 116, 229, .05), 0 0 50px rgba(74, 101, 229, .12); }
.stage-chrome { background: color-mix(in srgb, var(--bg-elevated) 80%, var(--accent-soft)); }
.stage-tab.active { background: var(--orbit-gradient); color: #fff; box-shadow: 0 5px 18px rgba(49, 78, 174, .25); }
.stage-banner, .stage-mini-card, .stage-row { border-color: var(--border); }
.stat-card, .card, .mode-card, .skill-item, .dl-card, .doc-section { border-color: var(--border); box-shadow: var(--shadow-sm); }
.card, .stat-card, .dl-card { background: linear-gradient(145deg, var(--bg-elevated), color-mix(in srgb, var(--bg-elevated) 90%, var(--accent-soft))); }
.card:hover, .dl-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md), 0 0 28px rgba(71, 102, 219, .09); transform: translateY(-3px); }
.card-accent { border-color: var(--border-strong); background: linear-gradient(145deg, var(--accent-soft), var(--bg-elevated) 70%); }
.card-icon { color: var(--accent); background: linear-gradient(145deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 65%, #e4b660 10%)); }
.section-alt { background: linear-gradient(155deg, var(--bg-muted), var(--bg)); }
.stat-num { background: var(--orbit-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
[data-theme="dark"] .stat-num { background-image: linear-gradient(110deg, #c2d3ff, #73b5ff); }
:focus-visible { outline: 3px solid #6c93f8; outline-offset: 3px; }
@media (max-width: 720px) { .hero { padding: 48px 0 56px; } .hero::after { width: 480px; height: 220px; right: -280px; top: 260px; } .brand-mark { width: 34px; height: 34px; } }
@media (prefers-reduced-motion: reduce) { .card:hover, .dl-card:hover { transform: none; } }
