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

/* ===== THEME TOKENS ===== */
:root {
  --accent: #E84B3A;
  --accent-light: #F06050;
  --accent-glow: rgba(232, 75, 58, 0.18);
  --accent-soft: rgba(232, 75, 58, 0.08);
  --accent-gradient: linear-gradient(135deg, #E84B3A 0%, #F28C60 50%, #F0C050 100%);

  /* dark (default) */
  --bg-1: #0e0e12;
  --bg-2: #13131a;
  --bg-3: #1a1a22;
  --surface: #1c1c26;
  --surface-hover: #222230;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --text: #eeeef4;
  --text-2: #8c8ca4;
  --text-3: #5a5a70;
  --card-shadow: 0 12px 40px rgba(0,0,0,0.35);
  --nav-bg: rgba(14, 14, 18, 0.82);
  --grain-opacity: 0.025;
}

/* ===== LIGHT MODE ===== */
[data-theme="light"] {
  --bg-1: #ffffff;
  --bg-2: #f7f7f9;
  --bg-3: #f0f0f4;
  --surface: #ffffff;
  --surface-hover: #f5f5f8;
  --border: rgba(0,0,0,0.06);
  --border-hover: rgba(0,0,0,0.1);
  --text: #1a1a2e;
  --text-2: #555570;
  --text-3: #8888a0;
  --card-shadow: 0 8px 30px rgba(0,0,0,0.06);
  --nav-bg: rgba(255, 255, 255, 0.85);
  --grain-opacity: 0.015;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Sora', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-1);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s, color 0.4s;
}

a { color: inherit; text-decoration: none; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* GRAIN */
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px;
}

/* GRADIENT TEXT */
.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== NAV ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s, border-color 0.4s;
}
.nav.scrolled { border-bottom-color: var(--border-hover); }
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo { width: 30px; height: 30px; border-radius: 8px; }
.nav-name { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.5px; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 0.88rem; color: var(--text-2); }
.nav-links a { transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  background: var(--accent); color: #fff !important; font-weight: 600;
  padding: 8px 20px; border-radius: 8px;
  transition: opacity 0.2s, box-shadow 0.2s;
}
.nav-cta:hover { opacity: 0.9; box-shadow: 0 4px 16px var(--accent-glow); }

/* Theme toggle */
.theme-toggle {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  font-size: 1rem;
}
.theme-toggle:hover { border-color: var(--border-hover); color: var(--text); background: var(--surface); }

/* Mobile toggle */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span {
  display: block; width: 20px; height: 2px; background: var(--text); margin: 5px 0;
  transition: transform 0.2s, opacity 0.2s;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 28px; border-radius: 10px;
  font-size: 0.92rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all 0.25s; border: none; text-decoration: none;
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
  box-shadow: 0 8px 32px rgba(232, 75, 58, 0.3);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border-hover);
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
[data-theme="light"] .btn-ghost:hover { border-color: rgba(0,0,0,0.15); }
.btn-block { width: 100%; text-align: center; }
.btn-disabled { opacity: 0.4; pointer-events: none; }

/* ===== HERO ===== */
.hero {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 120px 24px 80px;
  overflow: hidden;
  background: var(--bg-1);
}
.hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 100%);
}
.hero-glow {
  position: absolute;
  width: 700px; height: 700px;
  top: -150px; right: -150px;
  background: radial-gradient(circle, rgba(232, 75, 58, 0.12) 0%, transparent 65%);
  filter: blur(60px);
}
.hero-glow-2 {
  position: absolute;
  width: 500px; height: 500px;
  bottom: -100px; left: -100px;
  background: radial-gradient(circle, rgba(240, 192, 80, 0.06) 0%, transparent 65%);
  filter: blur(80px);
}
.hero-content {
  position: relative; z-index: 1;
  max-width: 1080px; width: 100%; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center;
  gap: 48px;
}
.hero-text { text-align: center; }
.hero-desc { margin-left: auto; margin-right: auto; }
.hero-actions { justify-content: center; }
.hero-stats { justify-content: center; }
.hero-visual { width: 100%; max-width: 960px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft); border: 1px solid rgba(232, 75, 58, 0.18);
  padding: 6px 16px; border-radius: 24px;
  font-size: 0.78rem; color: var(--accent); font-weight: 600;
  margin-bottom: 24px;
}
.badge-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(232, 75, 58, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(232, 75, 58, 0); }
}
.hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  font-weight: 800; line-height: 1.12;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}
.hero-desc {
  color: var(--text-2); font-size: 1rem; max-width: 480px;
  margin-bottom: 32px; line-height: 1.75;
}
.hero-actions { display: flex; gap: 12px; margin-bottom: 40px; flex-wrap: wrap; }
.hero-stats { display: flex; align-items: center; gap: 20px; }
.stat strong {
  display: block; font-size: 1.1rem; font-weight: 800; color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}
.stat span { font-size: 0.75rem; color: var(--text-3); }
.stat-sep { width: 1px; height: 28px; background: var(--border-hover); }

/* CAROUSEL */
.carousel {
  position: relative;
}
.carousel-track {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow), 0 0 60px rgba(232, 75, 58, 0.06);
  border: 1px solid var(--border-hover);
  transition: box-shadow 0.4s, border-color 0.4s;
  aspect-ratio: 1372 / 862;
  background: var(--surface);
}
.carousel-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.carousel-slide.active { opacity: 1; }
.carousel-slide img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
}
.carousel-dots {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 16px;
}
.carousel-dots .dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: none; padding: 0; cursor: pointer;
  background: var(--text-3); opacity: 0.3;
  transition: opacity 0.3s, background 0.3s, transform 0.3s;
}
.carousel-dots .dot.active {
  opacity: 1; background: var(--accent);
  transform: scale(1.3);
}
.carousel-labels {
  display: flex; justify-content: center; gap: 16px;
  margin-top: 10px;
}
.carousel-label {
  font-size: 0.72rem; color: var(--text-3);
  cursor: pointer; padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.3s, border-color 0.3s;
  font-family: 'JetBrains Mono', monospace;
}
.carousel-label:hover { color: var(--text-2); }
.carousel-label.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== SECTIONS ===== */
.section {
  padding: 100px 24px;
  position: relative;
  transition: background 0.4s;
}

/* GRADIENT TRANSITIONS BETWEEN SECTIONS */
.section-grad {
  background: var(--bg-1);
}
.section-alt {
  background: var(--bg-2);
}

/* Smooth gradient edges on alternating sections */
.section-alt::before,
.section-alt::after {
  content: '';
  position: absolute; left: 0; right: 0;
  height: 160px;
  pointer-events: none;
  z-index: 1;
}
.section-alt::before {
  top: 0;
  background: linear-gradient(to bottom, var(--bg-1), transparent);
}
.section-alt::after {
  bottom: 0;
  background: linear-gradient(to top, var(--bg-1), transparent);
}

/* Divider line between same-bg sections */
.section:not(.section-alt) + .section:not(.section-alt) {
  border-top: 1px solid var(--border);
}

.section-header { text-align: center; margin-bottom: 56px; }
.section-tag {
  display: inline-block;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 2px; color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 14px;
}
.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800; letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.section-header p { color: var(--text-2); font-size: 0.95rem; max-width: 540px; margin: 0 auto; }

/* FEATURES */
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s, background 0.4s;
}
.feature-card:hover {
  border-color: rgba(232, 75, 58, 0.2);
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
}
.feature-icon { font-size: 1.8rem; margin-bottom: 16px; }
.feature-card h3 { font-size: 0.98rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--text-2); font-size: 0.85rem; line-height: 1.65; }

/* SKILLS */
.skills-cloud { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.skill {
  background: var(--surface); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 10px;
  font-size: 0.84rem; color: var(--text-2); cursor: default;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.skill:hover {
  border-color: rgba(232, 75, 58, 0.25);
  color: var(--text);
  background: var(--accent-soft);
}

/* SCENARIOS */
.scenarios-grid { display: flex; flex-direction: column; gap: 16px; }
.scenario {
  display: flex; gap: 24px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px;
  transition: border-color 0.3s, background 0.4s;
}
.scenario:hover { border-color: var(--border-hover); }
.scenario-idx {
  font-size: 2.5rem; font-weight: 900; line-height: 1;
  font-family: 'JetBrains Mono', monospace;
  background: var(--accent-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  opacity: 0.2;
  flex-shrink: 0; min-width: 60px;
}
.scenario-body h3 { font-size: 0.98rem; font-weight: 700; margin-bottom: 8px; }
.scenario-quote {
  font-size: 0.85rem; color: var(--accent); font-style: italic;
  margin-bottom: 6px; line-height: 1.6;
}
.scenario-desc { font-size: 0.82rem; color: var(--text-3); }

/* COMPARE */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare-col {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 32px;
  transition: background 0.4s, border-color 0.4s;
}
.compare-us { border-color: rgba(232, 75, 58, 0.2); background: var(--accent-soft); }
.compare-label {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; margin-bottom: 20px;
  font-family: 'JetBrains Mono', monospace;
}
.compare-us .compare-label { color: var(--accent); }
.compare-them .compare-label { color: var(--text-3); }
.compare-col ul { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.compare-col li { font-size: 0.88rem; color: var(--text-2); display: flex; gap: 10px; }
.compare-us li { color: var(--text); }
.check { color: var(--accent); font-weight: 700; flex-shrink: 0; }
.cross { color: var(--text-3); flex-shrink: 0; }
.neutral { color: var(--text-3); flex-shrink: 0; }

/* SECURITY */
.security-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
}
.security-text h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 800;
  letter-spacing: -0.5px; margin-bottom: 16px;
}
.security-text p { color: var(--text-2); font-size: 0.92rem; margin-bottom: 14px; line-height: 1.75; }
.security-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sec-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 0.84rem; color: var(--text-2);
  transition: border-color 0.3s, background 0.4s;
}
.sec-card:hover { border-color: var(--border-hover); }
.sec-card span { font-size: 1.6rem; }

/* DOWNLOAD */
.download-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.dl-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 32px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: border-color 0.3s, transform 0.3s, background 0.4s;
}
.dl-card:hover { border-color: var(--border-hover); transform: translateY(-4px); }
.dl-icon { font-size: 2.5rem; }
.dl-name { font-size: 1.05rem; font-weight: 700; }
.dl-meta { font-size: 0.78rem; color: var(--text-3); margin-bottom: 8px; }

/* COMMUNITY */
.community-layout {
  display: flex; align-items: center; justify-content: center; gap: 64px;
}
.community-text h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 800;
  letter-spacing: -0.5px; margin-bottom: 12px;
}
.community-text p { color: var(--text-2); font-size: 0.92rem; line-height: 1.75; max-width: 400px; }
.community-qr {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.community-qr img {
  width: 300px; height: auto; border-radius: 16px;
  border: 1px solid var(--border-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.community-qr span { font-size: 0.78rem; color: var(--text-3); }

@media (max-width: 768px) {
  .community-layout { flex-direction: column; text-align: center; gap: 32px; }
  .community-text p { margin: 0 auto; }
}

/* FOOTER */
.footer {
  background: var(--bg-2); border-top: 1px solid var(--border);
  padding: 48px 24px 24px;
  transition: background 0.4s, border-color 0.4s;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 32px;
}
.footer-brand p { color: var(--text-3); font-size: 0.82rem; margin-top: 10px; }
.footer-links { display: flex; gap: 28px; font-size: 0.85rem; color: var(--text-3); }
.footer-links a:hover { color: var(--text-2); }
.footer-bottom {
  color: var(--text-3); font-size: 0.75rem;
  border-top: 1px solid var(--border); padding-top: 20px;
}

/* ===== ANIMATIONS ===== */
[data-reveal] {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .download-grid { grid-template-columns: repeat(2, 1fr); }
  .compare { grid-template-columns: 1fr; }
  .security-layout { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 768px) {
  .hero { padding-top: 100px; }
  .features-grid { grid-template-columns: 1fr; }
  .download-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .footer-inner { flex-direction: column; gap: 24px; }
  .scenario { flex-direction: column; gap: 12px; }
  .scenario-idx { font-size: 1.5rem; }
}
