:root {
  --bg: #fafafa;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-muted: #f2f4f3;
  --border: rgba(12, 20, 17, 0.08);
  --border-strong: rgba(12, 20, 17, 0.14);
  --text: #0c1411;
  --text-muted: #5d6963;
  --accent: #0d8a62;
  --accent-bright: #10b981;
  --accent-soft: rgba(13, 138, 98, 0.1);
  --glow-1: rgba(16, 185, 129, 0.16);
  --glow-2: rgba(56, 189, 248, 0.12);
  --shadow: 0 32px 80px rgba(12, 20, 17, 0.09), 0 4px 16px rgba(12, 20, 17, 0.04);
}

:root[data-theme="dark"] {
  --bg: #070a09;
  --surface: rgba(18, 24, 21, 0.72);
  --surface-solid: #111714;
  --surface-muted: #18201c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eef3f0;
  --text-muted: #92a098;
  --accent: #22c58b;
  --accent-bright: #34d399;
  --accent-soft: rgba(34, 197, 139, 0.14);
  --glow-1: rgba(34, 197, 139, 0.2);
  --glow-2: rgba(59, 130, 246, 0.15);
  --shadow: 0 36px 90px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #070a09;
    --surface: rgba(18, 24, 21, 0.72);
    --surface-solid: #111714;
    --surface-muted: #18201c;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #eef3f0;
    --text-muted: #92a098;
    --accent: #22c58b;
    --accent-bright: #34d399;
    --accent-soft: rgba(34, 197, 139, 0.14);
    --glow-1: rgba(34, 197, 139, 0.2);
    --glow-2: rgba(59, 130, 246, 0.15);
    --shadow: 0 36px 90px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  position: relative;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Motion */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  will-change: transform;
}

.glow-1 {
  width: 680px;
  height: 460px;
  top: -180px;
  left: 50%;
  background: radial-gradient(circle, var(--glow-1), transparent 70%);
  animation: driftA 14s ease-in-out infinite alternate;
}

.glow-2 {
  width: 560px;
  height: 420px;
  top: -100px;
  left: 50%;
  background: radial-gradient(circle, var(--glow-2), transparent 70%);
  animation: driftB 18s ease-in-out infinite alternate;
}

@keyframes driftA {
  0% { transform: translate(-68%, 0) scale(1); }
  100% { transform: translate(-52%, 28px) scale(1.08); }
}

@keyframes driftB {
  0% { transform: translate(2%, 0) scale(1); }
  100% { transform: translate(-14%, 36px) scale(1.06); }
}

/* Entrance & Scroll Reveal */
.animate-in {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0ms);
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.container {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 650;
}

.brand-icon {
  border-radius: 7px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.brand-name {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

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

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

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn.active {
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

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

.hero-icon-wrap {
  margin-bottom: 24px;
}

.hero-app-icon {
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(13, 138, 98, 0.24), 0 4px 12px rgba(0, 0, 0, 0.12);
  animation: iconFloat 5s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.hero-title {
  margin: 0 auto 18px;
  max-width: 760px;
  font-size: clamp(38px, 5.6vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 750;
}

.gradient-text {
  background: linear-gradient(120deg, var(--accent) 0%, #0ea5e9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 0 auto 30px;
  max-width: 540px;
  font-size: 17px;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  justify-content: center;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-bright) 0%, var(--accent) 100%);
  color: #ffffff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(13, 138, 98, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease;
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.26) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(13, 138, 98, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover::after {
  transform: translateX(120%);
}

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

/* Interactive Preview */
.app-preview-shell {
  margin: 52px auto 0;
  padding: 8px;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--border-strong), var(--border));
  box-shadow: var(--shadow);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-preview-shell:hover {
  transform: translateY(-3px);
}

.app-preview {
  border-radius: 16px;
  background: var(--surface-solid);
  overflow: hidden;
  text-align: left;
}

.window-chrome {
  height: 42px;
  padding: 0 14px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.traffic-lights { display: flex; gap: 7px; }
.tl { width: 11px; height: 11px; border-radius: 50%; }
.tl.red { background: #ff5f57; }
.tl.yellow { background: #febc2e; }
.tl.green { background: #28c840; }

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

.window-segmented {
  display: inline-flex;
  padding: 2px;
  border-radius: 8px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
}

.seg {
  border: 0;
  background: transparent;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.window-body {
  display: grid;
  grid-template-columns: 210px 1fr 220px;
  min-height: 296px;
}

.pane-left,
.pane-right {
  padding: 14px;
  background: color-mix(in srgb, var(--surface-muted) 50%, var(--surface-solid));
}

.pane-left { border-right: 1px solid var(--border); }
.pane-right { border-left: 1px solid var(--border); }

.roster-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.roster-item:hover {
  background: color-mix(in srgb, var(--surface-solid) 60%, transparent);
}

.roster-item.active {
  background: var(--surface-solid);
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.avatar {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}

.avatar.sm { width: 20px; height: 20px; border-radius: 6px; }
.avatar.emerald { background: linear-gradient(135deg, #0d8a62, #34d399); }
.avatar.indigo { background: linear-gradient(135deg, #4f46e5, #60a5fa); }
.avatar.amber { background: linear-gradient(135deg, #d97706, #fbbf24); }

.live-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--surface-solid);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.75; }
}

.roster-name { font-size: 13px; font-weight: 600; }
.roster-sub { font-size: 11px; color: var(--text-muted); }

.pane-center {
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.chat-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.chat-stream.switching {
  opacity: 0;
  transform: translateY(4px);
}

.msg-user {
  align-self: flex-end;
  max-width: 80%;
  padding: 9px 14px;
  border-radius: 14px;
  background: var(--accent-soft);
  font-size: 13px;
}

.msg-bot {
  padding: 13px 15px;
  border-radius: 14px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.msg-bot-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 6px;
}

.typing-dots {
  margin-left: auto;
  display: inline-flex;
  gap: 3px;
}

.typing-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.35;
  animation: dotBlink 1.4s infinite ease-in-out;
}

.typing-dots i:nth-child(2) { animation-delay: 0.2s; }
.typing-dots i:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBlink {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.9); }
  40% { opacity: 1; transform: scale(1.15); }
}

.msg-bot p {
  margin: 0 0 10px;
  font-size: 13px;
}

.tool-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

.composer-mock {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  font-size: 12px;
  color: var(--text-muted);
}

.pane-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.tab {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 7px;
  color: var(--text-muted);
}

.tab.active {
  background: var(--surface-solid);
  color: var(--text);
  border: 1px solid var(--border);
}

.context-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ctx-card {
  padding: 11px;
  border-radius: 11px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
}

.ctx-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

.ctx-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Pillars */
.pillars {
  padding: 72px 0 40px;
}

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

.pillar-card {
  padding: 26px 24px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.22s ease;
}

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

.pillar-line {
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-bright), #0ea5e9);
  margin-bottom: 16px;
}

.pillar-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.pillar-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* Bottom CTA */
.bottom-cta {
  padding: 56px 0 72px;
  text-align: center;
}

.bottom-cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.bottom-cta h2 {
  margin: 0;
  font-size: clamp(24px, 3.2vw, 32px);
  letter-spacing: -0.025em;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 36px;
  font-size: 13px;
  color: var(--text-muted);
}

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

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-left a,
.footer-link-btn {
  color: var(--text-muted);
  text-decoration: none;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.footer-left a:hover,
.footer-link-btn:hover {
  color: var(--text);
}

.checksum-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.checksum-box.hidden { display: none; }

.checksum-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--text);
  word-break: break-all;
}

.copy-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
}

@media (max-width: 860px) {
  .window-body { grid-template-columns: 1fr; }
  .pane-left, .pane-right { border: 0; border-top: 1px solid var(--border); }
  .pillars-grid { grid-template-columns: 1fr; }
}
