/* ZY小数学 Landing Page — Tech + 3D */

:root {
  --bg-deep: #06080f;
  --bg-card: rgba(14, 18, 32, 0.72);
  --border: rgba(120, 140, 255, 0.18);
  --accent: #7c6cff;
  --accent-2: #00d4aa;
  --accent-3: #ff6b9d;
  --glow: rgba(124, 108, 255, 0.45);
  --text: #eef0f8;
  --text-muted: #8b93b0;
  --radius: 20px;
  --phone-w: 260px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "SF Pro Display", "PingFang SC", "Helvetica Neue", system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Ambient background ── */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 108, 255, 0.22), transparent),
    radial-gradient(ellipse 60% 40% at 90% 60%, rgba(0, 212, 170, 0.1), transparent),
    radial-gradient(ellipse 50% 35% at 10% 80%, rgba(255, 107, 157, 0.08), transparent),
    var(--bg-deep);
  pointer-events: none;
}

.bg-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(124, 108, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 108, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, black, transparent);
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
  animation: float-orb 12s ease-in-out infinite;
}

.orb-1 { width: 420px; height: 420px; background: #7c6cff; top: -120px; right: -80px; }
.orb-2 { width: 320px; height: 320px; background: #00d4aa; bottom: 10%; left: -100px; animation-delay: -4s; }
.orb-3 { width: 260px; height: 260px; background: #ff6b9d; top: 45%; right: 5%; animation-delay: -8s; opacity: 0.3; }

@keyframes float-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -30px) scale(1.05); }
}

/* ── Layout ── */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(6, 8, 15, 0.65);
  border-bottom: 1px solid var(--border);
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 0 24px var(--glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.lang-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.lang-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ── Hero ── */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  min-height: calc(100vh - 80px);
  padding: 60px 0 80px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(124, 108, 255, 0.12);
  border: 1px solid rgba(124, 108, 255, 0.3);
  font-size: 0.8rem;
  color: #b8b0ff;
  margin-bottom: 20px;
}

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

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

.hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, #fff 0%, #b8b0ff 50%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 32px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #9b8cff);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 32px var(--glow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px var(--glow);
}

.btn-ghost {
  padding: 14px 24px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }

/* ── 3D Phone Stage ── */
.phone-stage {
  position: relative;
  height: 520px;
  perspective: 1400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-3d {
  position: relative;
  width: var(--phone-w);
  transform-style: preserve-3d;
  animation: phone-float 6s ease-in-out infinite;
  cursor: grab;
}

.phone-3d.dragging { animation: none; cursor: grabbing; }

@keyframes phone-float {
  0%, 100% { transform: rotateY(-18deg) rotateX(8deg) translateY(0); }
  50% { transform: rotateY(-12deg) rotateX(4deg) translateY(-14px); }
}

.phone-frame {
  position: relative;
  border-radius: 36px;
  padding: 10px;
  background: linear-gradient(145deg, #2a2d3a, #12141c);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 40px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(124, 108, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateZ(40px);
}

.phone-notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 22px;
  background: #000;
  border-radius: 0 0 14px 14px;
  z-index: 2;
}

.phone-screen {
  border-radius: 28px;
  overflow: hidden;
  display: block;
  width: 100%;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  object-position: top;
}

.phone-glow-ring {
  position: absolute;
  inset: -20px;
  border-radius: 48px;
  border: 1px solid rgba(124, 108, 255, 0.25);
  transform: translateZ(-20px);
  pointer-events: none;
}

/* Secondary floating phones */
.phone-secondary {
  position: absolute;
  width: 160px;
  opacity: 0.55;
  filter: blur(0.5px);
  transform-style: preserve-3d;
  transition: opacity 0.4s;
}

.phone-secondary:hover { opacity: 0.85; }

.phone-secondary.left {
  left: 0;
  top: 50%;
  transform: translateY(-50%) rotateY(25deg) rotateX(-5deg) translateZ(-60px);
  animation: float-left 7s ease-in-out infinite;
}

.phone-secondary.right {
  right: 0;
  top: 30%;
  transform: rotateY(-30deg) rotateX(10deg) translateZ(-40px);
  animation: float-right 8s ease-in-out infinite;
}

@keyframes float-left {
  0%, 100% { transform: translateY(-50%) rotateY(25deg) rotateX(-5deg) translateZ(-60px); }
  50% { transform: translateY(-55%) rotateY(20deg) rotateX(-2deg) translateZ(-50px); }
}

@keyframes float-right {
  0%, 100% { transform: rotateY(-30deg) rotateX(10deg) translateZ(-40px); }
  50% { transform: rotateY(-25deg) rotateX(6deg) translateZ(-30px) translateY(-10px); }
}

.phone-secondary .phone-frame {
  padding: 6px;
  border-radius: 24px;
}

.phone-secondary .phone-screen {
  border-radius: 18px;
}

/* ── Stats strip ── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: -40px 0 80px;
}

.stat-card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  text-align: center;
  transition: transform 0.3s, border-color 0.3s;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 108, 255, 0.4);
}

.stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Section common ── */
section {
  padding: 80px 0;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-desc {
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 48px;
}

/* ── Feature cards with 3D tilt ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.feature-card {
  position: relative;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  backdrop-filter: blur(12px);
  transform-style: preserve-3d;
  transition: transform 0.4s ease, box-shadow 0.4s;
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124, 108, 255, 0.08), transparent 60%);
  pointer-events: none;
}

.feature-card:hover {
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), 0 0 40px rgba(124, 108, 255, 0.1);
}

.feature-card-inner {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 0;
  align-items: stretch;
}

.feature-text {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.feature-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.feature-text h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.feature-text p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.feature-phone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  perspective: 800px;
}

.feature-phone img {
  width: 160px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  transform: rotateY(-8deg) rotateX(4deg);
  transition: transform 0.4s;
}

.feature-card:hover .feature-phone img {
  transform: rotateY(0deg) rotateX(0deg) scale(1.03);
}

/* ── AI Pipeline ── */
.pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  margin-top: 40px;
}

.pipeline-step {
  flex: 0 0 auto;
  padding: 20px 28px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-align: center;
  min-width: 140px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.3s;
}

.pipeline-step:hover {
  transform: translateZ(12px) scale(1.04);
  border-color: var(--accent);
}

.pipeline-step .icon {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.pipeline-step h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

.pipeline-arrow {
  color: var(--accent);
  font-size: 1.4rem;
  padding: 0 8px;
  opacity: 0.6;
}

/* ── QR Download ── */
.download-section {
  text-align: center;
  padding: 100px 0;
}

.download-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 64px;
  border-radius: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  box-shadow: 0 0 80px rgba(124, 108, 255, 0.12);
  transform-style: preserve-3d;
  transition: transform 0.4s;
}

.download-box:hover {
  transform: rotateX(2deg) rotateY(-2deg) translateZ(8px);
}

.qr-frame {
  position: relative;
  padding: 16px;
  background: #fff;
  border-radius: 20px;
  margin-bottom: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.qr-frame::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  z-index: -1;
}

.qr-frame img {
  width: 180px;
  height: 180px;
  display: block;
}

.download-box h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.download-box p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 12px;
  background: #000;
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.2s;
}

.store-badge:hover { transform: scale(1.03); }

.store-badge svg { width: 24px; height: 24px; }

/* ── Markets ── */
.markets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 40px;
}

.market-card {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.market-card h4 {
  font-size: 1rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.market-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ── Footer ── */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
}

footer a:hover { color: var(--text); }

/* ── Reveal animation ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ── Responsive ── */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    min-height: auto;
    padding-top: 40px;
  }

  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }

  .phone-stage { height: 400px; margin-top: 20px; }
  .phone-secondary { display: none; }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: 1fr; }
  .feature-card-inner { grid-template-columns: 1fr; }
  .feature-phone { order: -1; padding-bottom: 0; }

  .nav-links { display: none; }
  .markets { grid-template-columns: 1fr; }
  .pipeline { flex-direction: column; }
  .pipeline-arrow { transform: rotate(90deg); }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .download-box { padding: 32px 24px; width: 100%; }
}
