/* ========== Variables ========== */
:root {
  --bg: #0a0a0f;
  --bg-card: #14141e;
  --bg-card-hover: #1e1e2a;
  --border: #1e1e2e;
  --text: #e4e4ef;
  --text-dim: #9a9ab4;
  --text-muted: #55556a;
  --accent: #d4a017;
  --accent-glow: rgba(212, 160, 23, 0.15);
  --green: #22c55e;
  --blue: #3b82f6;
  --purple: #a855f7;
  --orange: #f59e0b;
  --red: #ef4444;
  --cyan: #06b6d4;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  /* Spacing scale */
  --gap-xs: 0.5rem;   /* within items */
  --gap-sm: 1rem;     /* tight grids */
  --gap-md: 1.5rem;   /* section grids */
  --gap-lg: 2rem;     /* section spacing */
  --gap-xl: 3rem;     /* section padding */
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ========== Particle Canvas ========== */
#particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ========== Scroll Animations ========== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ========== Nav ========== */
/* ========== Scroll Progress Bar ========== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  z-index: 102;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(212, 160, 23, 0.4);
}

nav {
  position: fixed;
  top: 0; width: 100%;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  padding: 0 2rem;
  transition: background 0.4s, box-shadow 0.4s;
}

nav.scrolled {
  background: rgba(10, 10, 15, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

nav .nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

nav .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

nav .logo .icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

nav .logo .icon img {
  width: 100%; height: 100%;
  object-fit: cover;
}

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

nav .links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

nav .links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

nav .links a:not(.btn-github)::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}

nav .links a:not(.btn-github):hover::after { width: 100%; }
nav .links a:hover { color: var(--text); }
nav .links a.active { color: var(--accent); }
nav .links a.active::after { width: 100%; background: var(--accent); }

nav .links .btn-github {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s;
}

nav .links .btn-github:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(212, 160, 23, 0.2);
}

/* ========== Hero ========== */
.hero {
  padding: 8rem 2rem 6rem;
  text-align: center;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 100vw;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

.hero-video-wrap {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  z-index: -1;
}

.hero-video-wrap video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.hero-video-wrap::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    linear-gradient(to bottom, rgba(10,10,15,0.4) 0%, rgba(10,10,15,0.2) 25%, rgba(10,10,15,0.15) 50%, var(--bg) 100%),
    linear-gradient(to bottom, rgba(212,160,23,0.03) 0%, transparent 50%);
  pointer-events: none;
}

.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(18,18,26,0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 2rem;
  animation: badgeSlideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes badgeSlideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero .badge .dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  max-width: 900px;
  margin: 0 auto 1.5rem;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 0, 0, 0.3);
  animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

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

.hero h1 .gradient {
  background: linear-gradient(135deg, #f5c842 0%, #d4a017 40%, #f5d76e 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease-in-out infinite;
  position: relative;
  display: inline-block;
}

/* Shimmer sweep light band */
.hero h1 .gradient::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,248,220,0.25), transparent);
  animation: shimmerSweep 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shimmerSweep {
  0%, 100% { left: -100%; opacity: 0; }
  10% { opacity: 1; }
  50% { left: 140%; opacity: 1; }
  60% { opacity: 0; }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero .subtitle {
  font-size: 1.25rem;
  color: var(--text);
  max-width: 650px;
  margin: 0 auto 3rem;
  line-height: 1.7;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
  animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

.hero-rotate-text {
  color: var(--accent);
  font-weight: 600;
  border-right: 2px solid var(--accent);
  padding-right: 2px;
  animation: heroTextCursor 1s step-end infinite;
}

@keyframes heroTextCursor {
  0%, 100% { border-color: var(--accent); }
  50% { border-color: transparent; }
}

.hero .cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

/* ========== Buttons ========== */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #b8860b);
  color: white;
  padding: 0.85rem 2rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before { left: 100%; }

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(212, 160, 23, 0.35);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.85rem 2rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  border-color: var(--text-dim);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

/* ========== Install Bar ========== */
.install-bar {
  max-width: 600px;
  margin: 3rem auto 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.9rem;
  animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
  transition: border-color 0.3s;
}

.install-bar--cta { margin: 2rem auto 1.5rem; animation: none; }
.install-bar:hover { border-color: var(--accent); }
.install-bar code { color: var(--green); }

.install-bar .copy-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--font);
  transition: all 0.2s;
}

.install-bar .copy-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(212, 160, 23, 0.1);
}

/* ========== Sections ========== */
section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Alternating section backgrounds for visual rhythm */
.benchmark-section,
.cta-bottom {
  max-width: 100%;
  padding-left: 2rem;
  padding-right: 2rem;
}
.benchmark-section > *,
.cta-bottom > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.benchmark-section {
  background: linear-gradient(180deg, #0d0d14 0%, var(--bg) 100%);
}
#features {
  background: linear-gradient(180deg, transparent 0%, rgba(13,13,20,0.5) 50%, transparent 100%);
  border-radius: 0;
}

.section-label {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
}

section h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

section .section-desc {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 600px;
  margin-bottom: 3rem;
  line-height: 1.7;
}

/* ========== Feature Grid ========== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-md);
}

.feature-card:nth-child(1),
.feature-card:nth-child(2) {
  grid-column: span 2;
}

.feature-card:nth-child(1) h3,
.feature-card:nth-child(2) h3 {
  font-size: 1.3rem;
}

.feature-card:nth-child(1) .icon-wrap,
.feature-card:nth-child(2) .icon-wrap {
  width: 56px;
  height: 56px;
  font-size: 1.6rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}

.feature-card::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.feature-card:hover {
  border-color: rgba(212, 160, 23, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 20px rgba(212, 160, 23, 0.08);
}

.feature-card:hover::before { opacity: 1; }
.feature-card:hover::after { opacity: 1; }

.feature-card .icon-wrap {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
  transition: transform 0.3s;
}

.feature-card:hover .icon-wrap {
  transform: scale(1.1);
  background: rgba(212, 160, 23, 0.15);
  color: var(--accent);
  border-color: rgba(212, 160, 23, 0.3);
  box-shadow: 0 0 16px rgba(212, 160, 23, 0.2);
  transition: all 0.3s;
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Feature hero cards — subtle inner gradient to differentiate from smaller cards */
.feature-card:nth-child(1),
.feature-card:nth-child(2) {
  background: linear-gradient(180deg, rgba(212, 160, 23, 0.04) 0%, var(--bg-card) 40%);
}

/* Feature cards: gold for hero (large) cards, cyan for supporting (small) cards */
.icon-visual { background: rgba(212, 160, 23, 0.12); }
.icon-skill { background: rgba(212, 160, 23, 0.12); }
.icon-agnostic { background: rgba(6, 182, 212, 0.1); }
.icon-search { background: rgba(6, 182, 212, 0.1); }
.icon-dedup { background: rgba(6, 182, 212, 0.1); }
.icon-tactile { background: rgba(6, 182, 212, 0.1); }

/* ========== Section Divider Glow ========== */
.how-it-works,
.code-demo,
.comparison {
  border-top: 1px solid var(--border);
  position: relative;
}

.how-it-works::before,
.code-demo::before,
.comparison::before {
  content: '';
  position: absolute;
  top: -1px; left: 50%;
  transform: translateX(-50%);
  width: 300px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 160, 23, 0.4), transparent);
  pointer-events: none;
}

/* Center diamond decoration on section dividers */
.how-it-works::after,
.code-demo::after,
.comparison::after {
  content: '';
  position: absolute;
  top: -4px; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 7px; height: 7px;
  background: var(--accent);
  opacity: 0.6;
  box-shadow: 0 0 12px rgba(212, 160, 23, 0.5);
  pointer-events: none;
  z-index: 2;
}

/* ========== Integrations ========== */
.integrations-section { padding-bottom: 4rem; }

.integrations-count {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.integrations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-lg);
  align-items: start;
}

.integrations-group-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.integrations-group-header h3 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
  line-height: inherit;
}

.integrations-group-header svg {
  color: var(--accent);
  flex-shrink: 0;
}

.integrations-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.integrations-item:hover {
  background: var(--bg-card-hover);
}

.integrations-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.integrations-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integrations-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, color 0.2s, transform 0.2s;
}

.integrations-item:hover .integrations-arrow,
.integrations-item:focus-visible .integrations-arrow {
  opacity: 1;
  color: var(--accent);
  transform: translateX(0);
}

/* ========== How It Works ========== */
.how-it-works { padding-bottom: 4rem; }

.steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 1rem;
  position: relative;
  align-items: start;
}

.step-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 16px;
  color: var(--accent);
  opacity: 0.5;
}

.steps::before {
  content: '';
  position: absolute;
  top: 40px;
  left: 15%; right: 15%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--purple), var(--cyan));
  opacity: 0.3;
}

.steps::after {
  content: '';
  position: absolute;
  top: 36px;
  left: 15%;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(212, 160, 23, 0.8), 0 0 28px rgba(212, 160, 23, 0.4);
  animation: flowDot 5s ease-in-out infinite;
  z-index: 2;
}

@keyframes flowDot {
  0% { left: 15%; opacity: 0; background: var(--accent); box-shadow: 0 0 12px rgba(212, 160, 23, 0.8), 0 0 28px rgba(212, 160, 23, 0.4); }
  8% { opacity: 1; }
  50% { background: var(--purple); box-shadow: 0 0 12px rgba(168, 85, 247, 0.8), 0 0 28px rgba(168, 85, 247, 0.4); }
  92% { opacity: 1; }
  100% { left: calc(85% - 10px); opacity: 0; background: var(--cyan); box-shadow: 0 0 12px rgba(6, 182, 212, 0.8), 0 0 28px rgba(6, 182, 212, 0.4); }
}

.step { text-align: center; position: relative; }

.step .step-num {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 auto 1.5rem;
  position: relative;
  z-index: 1;
  transition: all 0.4s;
}

.step .step-num::before {
  content: '';
  position: absolute;
  top: -3px; left: -3px; right: -3px; bottom: -3px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: rgba(212, 160, 23, 0.4);
  animation: stepHalo 3s linear infinite;
  opacity: 0;
  transition: opacity 0.4s;
}

.step.visible .step-num::before { opacity: 1; }

@keyframes stepHalo {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.step:hover .step-num {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 30px rgba(212, 160, 23, 0.4);
  transform: scale(1.1);
}

.step h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.75rem; }
.step p { color: var(--text-dim); font-size: 0.9rem; line-height: 1.6; }

/* ========== Code Demo ========== */
.code-demo .section-desc { margin-bottom: 1.5rem; }

.code-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  max-width: 800px;
  transition: all 0.4s;
}

.code-block:hover {
  border-color: rgba(212, 160, 23, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.code-block .code-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.code-block .code-header .dot { width: 12px; height: 12px; border-radius: 50%; }
.code-block .code-header .dot-r { background: #ef4444; }
.code-block .code-header .dot-y { background: #f59e0b; }
.code-block .code-header .dot-g { background: #22c55e; }

.code-block .code-header .tab {
  margin-left: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(212, 160, 23, 0.08);
  border: 1px solid rgba(212, 160, 23, 0.15);
  border-radius: 6px 6px 0 0;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-family: var(--mono);
  color: var(--accent);
  position: relative;
}

.code-block .code-header .tab::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: var(--bg-card);
}

.code-block .code-header .tab .py-icon {
  width: 14px; height: 14px;
  opacity: 0.8;
}

.code-copy-btn {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--mono);
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

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

.code-block .code-header span {
  margin-left: 0.75rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-family: var(--mono);
}

.code-block pre {
  padding: 1.5rem;
  padding-left: 4rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.7;
  position: relative;
}

/* Code scanning line — slow sweep from top to bottom */
.code-block pre::after {
  content: '';
  position: absolute;
  top: 0; left: 4rem; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), rgba(212,160,23,0.4), transparent);
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(212,160,23,0.4), 0 4px 12px rgba(212,160,23,0.15);
}

.code-block.scanning pre::after {
  animation: codeScan 4s ease-in-out 1;
}

@keyframes codeScan {
  0% { top: 0; opacity: 0; }
  5% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { top: 100%; opacity: 0; }
}

.code-block .line-numbers {
  position: absolute;
  top: 0; left: 0;
  width: 3.2rem;
  height: 100%;
  padding-top: 1.5rem;
  padding-right: 0.5rem;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-muted);
  user-select: none;
  pointer-events: none;
  border-right: 1px solid var(--border);
  opacity: 0.5;
}

.code-block pre .comment { color: var(--text-muted); }
.code-block pre .keyword { color: var(--purple); }
.code-block pre .string { color: var(--green); }
.code-block pre .func { color: var(--blue); }
.code-block pre .param { color: var(--orange); }
.code-block pre .bracket { color: var(--text-dim); }

.code-placeholder {
  color: var(--text-muted);
  opacity: 0.3;
  font-style: italic;
}

.typing-cursor {
  display: inline-block;
  width: 2px; height: 1.1em;
  background: var(--accent);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ========== Code Output ========== */
.code-output {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  max-width: 800px;
  margin-top: 1rem;
  transition: all 0.4s;
}

.code-output {
  border-bottom: 2px solid rgba(34, 197, 94, 0.3);
}

.code-output:hover {
  border-color: rgba(34, 197, 94, 0.3);
  border-bottom-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.code-block {
  border-top: 2px solid rgba(212, 160, 23, 0.3);
}

.code-output .code-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(34, 197, 94, 0.03);
}

.code-output .code-header .dot { width: 12px; height: 12px; border-radius: 50%; }
.code-output .code-header .dot-r { background: #ef4444; }
.code-output .code-header .dot-y { background: #f59e0b; }
.code-output .code-header .dot-g { background: #22c55e; }

.code-output .code-header span {
  margin-left: 0.75rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-family: var(--mono);
}

.code-output pre {
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-dim);
}

.code-output .out-success { color: var(--green); }
.code-output .out-dim { color: var(--text-muted); }
.code-output .out-accent { color: var(--accent); }
.code-output .out-data { color: var(--cyan); }

/* ========== Comparison ========== */
.comparison { }

.comparison-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 2rem;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

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

.comparison-table th {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--bg);
}

.comparison-table td { font-size: 0.95rem; }
.comparison-table tr:hover td { background: rgba(212, 160, 23, 0.06); }
.comparison-table .highlight { color: var(--accent); font-weight: 600; }
.comparison-table th:nth-child(2),
.comparison-table td:nth-child(2) {
  background: rgba(212, 160, 23, 0.06);
  border-left: 1px solid rgba(212, 160, 23, 0.15);
  border-right: 1px solid rgba(212, 160, 23, 0.15);
}
.comparison-table thead th:nth-child(2) {
  background: rgba(212, 160, 23, 0.12);
}
.comparison-table thead th:nth-child(2)::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.check {
  color: var(--green);
  font-weight: 700;
  transition: text-shadow 0.3s, background 0.3s;
  background: rgba(34, 197, 94, 0.08);
  border-radius: 4px;
  padding: 2px 8px;
  display: inline-block;
}
.cross {
  color: var(--text-muted);
  display: inline-block;
  padding: 2px 8px;
}
.comparison-table tr:hover td:nth-child(2) .check {
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.6), 0 0 16px rgba(34, 197, 94, 0.3);
}

/* Column-wide glow: all RobotMem checkmarks glow on any row hover */
.comparison-table:hover td:nth-child(2) .check {
  text-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
  transition: text-shadow 0.3s;
}

/* Summary row */
.comparison-table tfoot .summary-row td {
  border-top: 2px solid rgba(212, 160, 23, 0.2);
  border-bottom: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dim);
  padding: 1rem 1.5rem;
}
.comparison-table tfoot .summary-row td:nth-child(2) {
  color: var(--accent);
  font-size: 1rem;
  background: rgba(212, 160, 23, 0.1);
  text-shadow: 0 0 8px rgba(212, 160, 23, 0.3);
}

/* ========== Stats Counter ========== */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-lg);
  padding: var(--gap-lg);
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.stat-item {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1rem;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-item:hover {
  border-color: rgba(212, 160, 23, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2), 0 0 24px var(--accent-glow);
}

.stat-num {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #f5d76e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.6s;
}

/* Gold flash when counter completes */
.stat-num.counted {
  animation: statFlash 0.6s ease-out;
}

@keyframes statFlash {
  0% { transform: scale(1); filter: brightness(1); }
  30% { transform: scale(1.15); filter: brightness(1.5) drop-shadow(0 0 12px rgba(212,160,23,0.6)); }
  100% { transform: scale(1); filter: brightness(1); }
}

.stat-label {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* ========== Benchmark Results ========== */
.benchmark-section {
  text-align: center;
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.benchmark-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-md);
  margin-top: 3rem;
}
.benchmark-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.benchmark-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}
.benchmark-card:hover {
  border-color: rgba(212, 160, 23, 0.25);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), 0 0 16px rgba(212, 160, 23, 0.06);
}
.benchmark-card:hover::before { opacity: 1; }
.benchmark-num {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.75rem;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
/* .visible added by IntersectionObserver in main.js (.reveal class) */
.benchmark-card.visible .benchmark-num {
  animation: numPop 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}
@keyframes numPop {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.benchmark-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.benchmark-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}
@media (max-width: 768px) {
  .benchmark-grid { grid-template-columns: repeat(2, 1fr); gap: var(--gap-sm); }
  .benchmark-num { font-size: 2rem; }
  .benchmark-card { padding: 1.5rem 1rem; }
}
@media (max-width: 480px) {
  .benchmark-grid { grid-template-columns: 1fr; }
}

/* ========== CTA Bottom ========== */
.cta-bottom {
  text-align: center;
  padding: 6rem 2rem;
  position: relative;
  z-index: 1;
}

.cta-bottom::before {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 1000px; height: 500px;
  background: radial-gradient(ellipse, rgba(212, 160, 23, 0.15) 0%, rgba(184, 134, 11, 0.08) 30%, rgba(245, 200, 66, 0.04) 55%, transparent 75%);
  pointer-events: none;
  animation: ctaGlow 6s ease-in-out infinite alternate;
}

.cta-bottom::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 400px; height: 400px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(212, 160, 23, 0.08);
  animation: ctaRing 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes ctaGlow {
  0% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  100% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

@keyframes ctaRing {
  0% { width: 200px; height: 200px; opacity: 0.6; border-color: rgba(212, 160, 23, 0.15); }
  50% { width: 500px; height: 500px; opacity: 0; border-color: rgba(212, 160, 23, 0.02); }
  51% { width: 200px; height: 200px; opacity: 0; }
  100% { width: 200px; height: 200px; opacity: 0.6; border-color: rgba(212, 160, 23, 0.15); }
}

.cta-bottom h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text) 30%, var(--accent) 60%, var(--text) 90%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: ctaTextShimmer 6s ease-in-out infinite;
}

@keyframes ctaTextShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.cta-bottom p {
  color: var(--text-dim);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ========== Footer ========== */
footer {
  border-top: 1px solid var(--border);
  padding: 4rem 2rem 2rem;
  position: relative;
  z-index: 1;
  background: radial-gradient(ellipse at 50% 0%, rgba(212, 160, 23, 0.04) 0%, transparent 70%);
}

footer::before {
  content: '';
  position: absolute;
  top: -1px; left: 50%;
  transform: translateX(-50%);
  width: 300px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 160, 23, 0.4), transparent);
  pointer-events: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--gap-xl);
  max-width: 1200px;
  margin: 0 auto;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
  margin-top: 0.75rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-logo img {
  border-radius: 6px;
}

.footer-logo span {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.footer-col h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
  transition: color 0.3s, padding-left 0.3s;
}

.footer-col a:hover {
  color: var(--accent);
  padding-left: 4px;
}

.footer-divider {
  max-width: 1200px;
  margin: 2.5rem auto 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 160, 23, 0.2), var(--border), rgba(212, 160, 23, 0.2), transparent);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-tagline {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

footer .copyright {
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

footer .heart {
  display: inline-block;
  color: #ef4444;
  animation: heartbeat 1.5s ease-in-out infinite;
  font-size: 0.75rem;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.2); }
  28% { transform: scale(1); }
  42% { transform: scale(1.15); }
  56% { transform: scale(1); }
}

/* ========== Hamburger Menu ========== */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: all 0.3s;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ========== Hero Proof (data highlight) ========== */
.hero-proof {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-xs);
  background: rgba(212, 160, 23, 0.1);
  border: 1px solid rgba(212, 160, 23, 0.3);
  border-radius: 100px;
  padding: 0.4rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-top: 1.5rem;
  animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

/* ========== Responsive: Tablet (768px) ========== */
@media (max-width: 768px) {
  nav { padding: 0 1.25rem; background: rgba(10, 10, 15, 0.95); }
  .hamburger {
    display: block;
    background: rgba(30, 30, 46, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.6rem 0.5rem;
  }

  nav .links {
    display: none;
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border);
  }

  nav .links.open { display: flex; }

  .hero {
    padding: 6rem 1.5rem 4rem;
    width: 100%;
    max-width: 100%;
    margin: 0;
  }
  .hero h1 {
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 0, 0, 0.6);
  }
  .hero .subtitle {
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 0, 0, 0.5);
    background: rgba(10, 10, 15, 0.35);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
  }
  .hero .hero-proof {
    background: rgba(10, 10, 15, 0.6);
    border-color: rgba(212, 160, 23, 0.4);
    backdrop-filter: blur(8px);
  }
  .hero-video-wrap::after {
    background:
      linear-gradient(to bottom, rgba(10,10,15,0.75) 0%, rgba(10,10,15,0.55) 25%, rgba(10,10,15,0.45) 45%, rgba(10,10,15,0.25) 65%, var(--bg) 100%);
  }
  .hero-video-wrap {
    left: 0;
    right: 0;
    width: 100%;
  }

  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-card:nth-child(1),
  .feature-card:nth-child(2) { grid-column: span 1; }
  .feature-card:nth-child(1) h3,
  .feature-card:nth-child(2) h3 { font-size: 1.15rem; }
  .feature-card:nth-child(1) .icon-wrap,
  .feature-card:nth-child(2) .icon-wrap { width: 48px; height: 48px; font-size: 1.4rem; }
  .integrations-grid { grid-template-columns: 1fr; gap: var(--gap-lg); }
  .integrations-arrow { opacity: 1; }
  .steps { grid-template-columns: 1fr; }
  .steps::before { display: none; }
  .step-arrow { display: none; }
  .steps::after { display: none; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }

  /* Comparison table: scrollable with fade hint */
  .comparison-wrap { position: relative; }
  .comparison-wrap::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 40px; height: 100%;
    background: linear-gradient(to right, transparent, rgba(10, 10, 15, 0.8));
    pointer-events: none;
    border-radius: 0 12px 12px 0;
    z-index: 2;
  }
  .comparison-table { font-size: 0.85rem; overflow-x: auto; display: block; }
  .comparison-table th, .comparison-table td { padding: 0.75rem; white-space: nowrap; }

  .code-block pre { padding-left: 1.5rem; }
  .code-block pre::after { left: 1.5rem; }
  .code-block .line-numbers { display: none; }
  .code-output pre { font-size: 0.75rem; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--gap-lg); }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
  .install-bar { flex-direction: column; gap: 0.75rem; text-align: center; }

  section { padding: 4rem 1.5rem; }
}

/* ========== Responsive: iPad Pro (1024px) ========== */
@media (max-width: 1024px) {
  .hero h1 {
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 0, 0, 0.4);
  }
  .hero .subtitle {
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
    background: rgba(10, 10, 15, 0.3);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
  }
  .hero .hero-proof {
    background: rgba(10, 10, 15, 0.5);
    backdrop-filter: blur(6px);
  }
  .integrations-grid { gap: var(--gap-md); }
  .integrations-name { font-size: 0.9rem; }
  .integrations-desc { font-size: 0.75rem; }
}

/* ========== Responsive: Mobile (480px) ========== */
@media (max-width: 480px) {
  .hero { padding: 5rem 1.5rem 3rem; min-height: auto; width: 100%; max-width: 100%; margin: 0; }
  .hero h1 { font-size: 2.2rem; margin-bottom: 1rem; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.9), 0 0 60px rgba(0, 0, 0, 0.7); }
  .hero .subtitle { font-size: 1.0rem; margin-bottom: 2rem; line-height: 1.6; }
  .hero .badge { font-size: 0.75rem; padding: 0.3rem 0.8rem; margin-bottom: 1.5rem; }
  .hero-proof { font-size: 0.8rem; padding: 0.3rem 1rem; margin-bottom: 1.5rem; }

  .stats-bar { gap: 0.75rem; padding: 1.5rem 1rem; }
  .stat-num { font-size: 2rem; }
  .stat-item { padding: 1.25rem 0.5rem; }
  .stat-label { font-size: 0.8rem; }

  section { padding: 3rem 1.5rem; }
  section h2 { font-size: 1.5rem; }
  section .section-desc { font-size: 0.95rem; }

  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { padding: 1rem 1.25rem; }
  .feature-card p { font-size: 0.85rem; line-height: 1.5; margin-top: 0.4rem; }

  .step .step-num { width: 44px; height: 44px; font-size: 1rem; }

  .code-block pre { font-size: 0.8rem; padding: 1rem; line-height: 1.6; }
  .code-output pre { font-size: 0.7rem; padding: 1rem; }
  .code-block .code-header { padding: 0.75rem 1rem; }

  .install-bar { margin: 2rem auto 0; padding: 0.75rem 1rem; }
  .install-bar code { font-size: 0.8rem; }

  .btn-primary, .btn-secondary { padding: 0.75rem 1.5rem; font-size: 0.9rem; }

  .footer-grid { grid-template-columns: 1fr; gap: var(--gap-md); }
  footer { padding: 2.5rem 1.25rem 1.5rem; }

  .cta-bottom { padding: 4rem 1rem; }
  .cta-bottom h2 { font-size: 1.5rem; }
}

/* ========== Chinese Typography ========== */
:lang(zh), :lang(zh-CN) {
  line-height: 1.85;
}
:lang(zh) p, :lang(zh-CN) p,
:lang(zh) li, :lang(zh-CN) li {
  line-height: 1.9;
}
:lang(zh) h1, :lang(zh-CN) h1,
:lang(zh) h2, :lang(zh-CN) h2,
:lang(zh) h3, :lang(zh-CN) h3 {
  line-height: 1.4;
}
