:root {
  --primary: #0A84FF;
  --primary-dark: #005FCC;
  --on-primary: #FFFFFF;
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --surface-2: #FAFAFC;
  --dark: #0A0A0C;
  --dark-2: #151517;
  --text: #1D1D1F;
  --text-2: #3A3A3C;
  --text-3: #6E6E73;
  --text-dark: #F5F5F7;
  --text-dark-2: #A1A1A6;
  --border: #E5E5EA;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.14);
  --max-width: 1160px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A0A0C;
    --surface: #1C1C1E;
    --surface-2: #232325;
    --text: #F5F5F7;
    --text-2: #E5E5EA;
    --text-3: #A1A1A6;
    --border: #2C2C2E;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern";
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; height: auto; }

/* ---------- Language switching ---------- */
.lang-block, .lang-inline { display: none; }
html[data-lang="zh"] .lang-zh, html[data-lang="en"] .lang-en { display: block; }
html[data-lang="zh"] .lang-inline.lang-zh, html[data-lang="en"] .lang-inline.lang-en { display: inline; }
.shot-slide, .ipad-card { display: none; }
html[data-lang="zh"] .shot-slide.lang-zh, html[data-lang="zh"] .ipad-card.lang-zh { display: block; }
html[data-lang="en"] .shot-slide.lang-en, html[data-lang="en"] .ipad-card.lang-en { display: block; }

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

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1), transform 0.8s cubic-bezier(0.22,1,0.36,1); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--text); letter-spacing: -0.3px; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { font-size: 14px; font-weight: 600; color: var(--text-2); transition: color 0.2s; }
.nav-links a:hover { color: var(--primary); }
.lang-switch { display: flex; gap: 6px; align-items: center; margin-left: 6px; }
.lang-switch button {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  padding: 5px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: all 0.2s ease;
}
.lang-switch button:hover { border-color: var(--primary); color: var(--primary); }
.lang-switch button.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.menu-toggle { display: none; background: none; border: none; font-size: 24px; color: var(--text); cursor: pointer; }

/* ---------- Hero (dark, Apple-keynote style) ---------- */
.hero {
  position: relative;
  background: var(--dark);
  color: var(--text-dark);
  padding: 110px 0 0;
  overflow: hidden;
}
.hero-glow { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.5; pointer-events: none; }
.hero-glow-1 { width: 620px; height: 620px; background: radial-gradient(circle, #0A84FF 0%, transparent 70%); top: -180px; left: -140px; }
.hero-glow-2 { width: 560px; height: 560px; background: radial-gradient(circle, #5E5CE6 0%, transparent 70%); bottom: -120px; right: -120px; opacity: 0.4; }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 16px; border-radius: 30px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14);
  font-size: 13px; font-weight: 700; color: #9CCEFF; margin-bottom: 28px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #30D158; box-shadow: 0 0 0 0 rgba(48,209,88,0.6); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(48,209,88,0.55); }
  70% { box-shadow: 0 0 0 10px rgba(48,209,88,0); }
  100% { box-shadow: 0 0 0 0 rgba(48,209,88,0); }
}
.hero-title { font-size: 58px; line-height: 1.06; font-weight: 800; margin: 0 0 22px; letter-spacing: -1.2px; }
.gradient-text {
  background: linear-gradient(92deg, #0A84FF 0%, #5E5CE6 48%, #BF5AF2 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-sub { font-size: 20px; color: var(--text-dark-2); margin: 0 0 34px; max-width: 540px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-actions.center { justify-content: center; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 30px; border-radius: 999px; font-weight: 700; font-size: 16px;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 10px 28px rgba(10,132,255,0.4); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(10,132,255,0.5); }
.btn-ghost { background: rgba(255,255,255,0.08); color: var(--text-dark); border: 1px solid rgba(255,255,255,0.2); }
.btn-ghost:hover { background: rgba(255,255,255,0.14); transform: translateY(-2px); }

/* Phone mockup */
.hero-visual { display: flex; justify-content: center; perspective: 1200px; }
.phone-frame {
  background: #050507;
  border-radius: 44px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 40px 100px rgba(0,0,0,0.65), inset 0 0 0 2px rgba(255,255,255,0.05);
  max-width: 320px;
}
.phone-frame img { display: block; border-radius: 33px; width: 100%; }
.phone-frame.tilt { transform: rotateY(-9deg) rotateX(3deg); animation: floaty 7s ease-in-out infinite; }
.phone-frame.small { max-width: 280px; }
@keyframes floaty {
  0%, 100% { transform: rotateY(-9deg) rotateX(3deg) translateY(0); }
  50% { transform: rotateY(-6deg) rotateX(2deg) translateY(-14px); }
}

/* Marquee strip removed */

/* ---------- Sections ---------- */
.section { padding: 104px 0; }
.section-dark { background: var(--dark); color: var(--text-dark); position: relative; }
.section-title { text-align: center; margin-bottom: 64px; }
.section-title h2 { font-size: 44px; font-weight: 800; margin: 0 0 14px; letter-spacing: -0.8px; }
.section-title p { font-size: 19px; color: var(--text-3); margin: 0; }
.section-dark .section-title p { color: var(--text-dark-2); }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 28px;
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1), box-shadow 0.25s, border-color 0.25s;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.feature-icon {
  width: 52px; height: 52px; border-radius: 15px;
  background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; box-shadow: 0 8px 20px rgba(10,132,255,0.28);
}
.feature-icon svg { width: 24px; height: 24px; }
.feature-card h3 { font-size: 19px; font-weight: 800; margin: 0 0 10px; letter-spacing: -0.2px; }
.feature-card p { font-size: 15px; color: var(--text-3); margin: 0; line-height: 1.7; }

/* ---------- Story ---------- */
.story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.story-text h2 { font-size: 40px; font-weight: 800; margin: 0 0 22px; letter-spacing: -0.6px; }
.story-text p { font-size: 16.5px; color: var(--text-dark-2); margin: 0 0 16px; line-height: 1.9; }
.story-text p:last-child { margin-bottom: 0; }
.story-image { display: flex; justify-content: center; }

/* ---------- Screenshot carousel (native scroll-snap, robust) ---------- */
.shots-wrap {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  max-width: 1240px; margin: 0 auto; padding: 0 16px;
}
.shots-track {
  flex: 1;
  display: flex; gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 30px max(calc(50% - 155px), 24px) 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.shots-track::-webkit-scrollbar { display: none; }
.shot-slide {
  flex: none;
  scroll-snap-align: center;
  transition: transform 0.45s cubic-bezier(0.22,1,0.36,1), opacity 0.45s;
  transform: scale(0.86);
  opacity: 0.45;
  cursor: pointer;
}
.shot-slide.is-center { transform: scale(1); opacity: 1; }
.shot-device {
  width: 272px;
  background: #050507;
  border-radius: 42px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 0 0 2px rgba(255,255,255,0.05);
}
.shot-device img { display: block; width: 100%; border-radius: 32px; }
.cf-btn {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
  color: var(--text-dark); font-size: 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s;
  z-index: 5;
}
.cf-btn:hover { background: rgba(255,255,255,0.16); transform: scale(1.08); }
.cf-caption { text-align: center; margin-top: 26px; font-size: 17px; font-weight: 700; color: var(--text-dark-2); letter-spacing: 0.4px; min-height: 26px; }
.cf-dots { display: flex; justify-content: center; gap: 9px; margin-top: 16px; }
.cf-dot {
  width: 8px; height: 8px; border-radius: 50%; border: none; padding: 0;
  background: rgba(255,255,255,0.24); cursor: pointer; transition: all 0.3s ease;
}
.cf-dot.active { background: var(--primary); width: 26px; border-radius: 5px; }

/* ---------- iPad gallery strip ---------- */
.ipad-section { padding-bottom: 110px; }
.ipad-strip {
  display: flex; gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 10px max(calc(50% - 340px), 24px) 26px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ipad-strip::-webkit-scrollbar { display: none; }
.ipad-card {
  flex: none;
  width: min(660px, 82vw);
  scroll-snap-align: center;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), box-shadow 0.35s;
  background: #0D1426;
}
.ipad-card:hover { transform: translateY(-6px) scale(1.015); box-shadow: 0 32px 80px rgba(0,0,0,0.55); }
.ipad-card img { display: block; width: 100%; }

/* ---------- CTA ---------- */
.cta { text-align: center; background: var(--dark); color: var(--text-dark); border-top: 1px solid rgba(255,255,255,0.08); }
.cta h2 { font-size: 46px; font-weight: 800; margin: 0 0 18px; letter-spacing: -0.8px; line-height: 1.12; }
.cta p { font-size: 19px; color: var(--text-dark-2); margin: 0 0 36px; }

/* ---------- Legal pages ---------- */
.legal-hero { padding: 72px 0 44px; background: var(--surface); border-bottom: 1px solid var(--border); }
.legal-hero h1 { font-size: 38px; font-weight: 800; margin: 0; letter-spacing: -0.6px; }
.legal-content { max-width: 800px; margin: 0 auto; padding: 48px 24px 88px; }
.legal-content h2 { font-size: 22px; font-weight: 800; margin: 36px 0 14px; color: var(--text); }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p, .legal-content li { font-size: 16px; color: var(--text-2); line-height: 1.85; }
.legal-content ul { padding-left: 22px; }
.legal-content li { margin-bottom: 9px; }

/* ---------- Footer ---------- */
.footer { background: var(--surface); border-top: 1px solid var(--border); padding: 52px 0; }
.footer-grid { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; }
.footer-brand { max-width: 340px; }
.footer-brand p { font-size: 14px; color: var(--text-3); margin: 12px 0 0; }
.footer-links { display: flex; gap: 64px; }
.footer-links h4 { font-size: 14px; font-weight: 800; margin: 0 0 14px; color: var(--text); }
.footer-links a { display: block; font-size: 14px; color: var(--text-3); margin-bottom: 9px; transition: color 0.2s; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { text-align: center; padding-top: 32px; margin-top: 32px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner, .story-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 72px; }
  .hero-visual { order: 2; }
  .hero-title { font-size: 42px; }
  .features { grid-template-columns: 1fr 1fr; }
  .hero { padding-bottom: 56px; }
}
@media (max-width: 720px) {
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 4px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 16px 24px 20px; box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 10px 0; font-size: 16px; }
  .menu-toggle { display: block; }
  .hero-title { font-size: 34px; }
  .hero-sub { font-size: 17px; }
  .section { padding: 64px 0; }
  .section-title h2 { font-size: 30px; }
  .features { grid-template-columns: 1fr; }
  .cta h2 { font-size: 32px; }
  .shot-device { width: 224px; }
  .shots-track { padding: 20px max(calc(50% - 122px), 18px) 10px; gap: 20px; }
  .cf-btn { display: none; }
  .ipad-card { width: 86vw; }
  .footer-grid { flex-direction: column; }
  .footer-links { gap: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  .phone-frame.tilt, .pulse-dot { animation: none; }
  .shots-track { scroll-behavior: auto; }
}

/* ---------- Hero screenshot crossfade stack ---------- */
.hero-stack { position: relative; }
.hero-stack .hs-group { position: relative; }
.hero-stack .hs {
  display: block; width: 100%; border-radius: 33px;
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 1.1s ease;
}
.hero-stack .hs:first-child { position: relative; }
.hero-stack .hs.active { opacity: 1; }

/* ---------- App Store highlights strip ---------- */
.store-strip {
  display: flex; gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 10px max(calc(50% - 175px), 24px) 30px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.store-strip::-webkit-scrollbar { display: none; }
.store-card {
  flex: none;
  width: min(340px, 74vw);
  scroll-snap-align: center;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), box-shadow 0.35s;
  background: #0D1426;
}
.store-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 32px 80px rgba(0,0,0,0.55); }
.store-card img { display: block; width: 100%; }

/* ---------- Deploy stamp ---------- */
.deploy-stamp { margin-top: 10px; font-size: 12px; color: var(--text-3); opacity: 0.85; }

@media (max-width: 720px) {
  .store-card { width: 70vw; }
}

/* ---------- Hero: iPhone + iPad editor ---------- */
.hero-visual { display: flex; flex-direction: column; gap: 30px; }
.tablet-frame {
  border-radius: 20px;
  border: 10px solid #1C1C1E;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0,0,0,0.55);
  background: #0A0A0C;
}
.tablet-frame img { display: block; width: 100%; }

/* ---------- ICP filing link ---------- */
a.icp { display: block; margin-top: 8px; font-size: 12px; color: var(--text-3); text-decoration: none; opacity: 0.85; }
a.icp:hover { color: var(--primary); }
