/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary-h: 200;
  --primary-s: 80%;
  --primary-l: 50%;
  --primary: var(--primary-h), var(--primary-s), var(--primary-l);
  --primary-fg: 0, 0%, 100%;
  --bg: 0, 0%, 100%;
  --fg: 215, 28%, 17%;
  --secondary-bg: hsl(200, 60%, 97%);
  --muted: hsl(215, 16%, 47%);
  --border: hsl(200, 20%, 90%);
  --card: hsl(0, 0%, 100%);
  --radius: 1rem;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: hsl(var(--bg));
  color: hsl(var(--fg));
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* ===== Loading Screen ===== */
#loading-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, hsl(215, 28%, 12%), hsl(220, 25%, 18%));
  transition: opacity 0.5s ease;
}

#loading-screen.hidden { opacity: 0; pointer-events: none; }

#loading-screen .brand {
  font-size: 1.875rem; font-weight: 700; color: #fff; margin-bottom: 2rem;
  animation: pulse-text 1.5s ease-in-out infinite;
}

.loader-dots { display: flex; gap: 0.5rem; }

.loader-dots span {
  width: 12px; height: 12px; border-radius: 50%;
  background: hsl(var(--primary));
  animation: bounce-dot 0.6s ease-in-out infinite;
}

.loader-dots span:nth-child(2) { animation-delay: 0.15s; }
.loader-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes pulse-text {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes bounce-dot {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ===== Navbar ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: hsla(215, 28%, 10%, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid hsla(255, 255, 255, 0.05);
  transition: background 0.3s ease;
}

.navbar.scrolled { background: hsla(215, 28%, 8%, 0.92); }

.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
  position: relative;
}

.navbar .logo {
  color: #fff; font-weight: 700; font-size: 1.35rem; letter-spacing: -0.02em; z-index: 10;
  display: flex; align-items: center; gap: 0.5rem;
}

.logo-icon {
  width: 32px; height: 32px; border-radius: 0.5rem;
  background: hsl(var(--primary));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem; font-weight: 800;
}

.nav-links {
  display: flex; align-items: center; gap: 2rem; font-size: 0.9375rem; color: rgba(255,255,255,0.85);
  position: absolute; left: 50%; transform: translateX(-50%);
  white-space: nowrap;
}

.nav-links a { transition: color 0.2s; }
.nav-links a:hover { color: hsl(var(--primary)); }

.mobile-toggle { display: none; background: none; border: none; color: #fff; cursor: pointer; z-index: 10; padding: 4px; }

.mobile-nav {
  display: none;
  background: hsla(215, 28%, 10%, 0.95); backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 1.5rem;
}

.mobile-nav.open { display: block; }

.mobile-nav a {
  display: block; padding: 0.75rem 0; color: rgba(255,255,255,0.9); font-size: 1rem;
  transition: color 0.2s;
}

.mobile-nav a:hover { color: hsl(var(--primary)); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-toggle { display: block; }
}

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden;
  background-color: #060a10;
}

/* Layer 1: Deep gradient base */
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, hsla(var(--primary), 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 60%, hsla(190, 70%, 50%, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, hsla(210, 80%, 60%, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #060a10 0%, #0a1018 40%, #0c1420 100%);
  animation: hero-bg-pulse 8s ease-in-out infinite;
}

@keyframes hero-bg-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* Layer 2: Tech grid overlay */
.hero-bg::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black 30%, transparent 80%);
  -webkit-mask-image: linear-gradient(to bottom, black 30%, transparent 80%);
}

/* Layer 3: Flowing light beams */
.hero-beam {
  position: absolute; pointer-events: none;
  width: 200%; height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    transparent 25%,
    hsla(var(--primary), 0.3) 40%,
    hsla(var(--primary), 0.7) 48%,
    hsla(190, 80%, 60%, 1) 50%,
    hsla(var(--primary), 0.7) 52%,
    hsla(var(--primary), 0.3) 60%,
    transparent 75%,
    transparent 100%
  );
  filter: blur(1.5px);
  animation: beam-pulse 3s ease-in-out infinite;
}

.hero-beam::after {
  content: ''; position: absolute; inset: -6px 0;
  background: inherit;
  filter: blur(12px);
  opacity: 0.6;
}

.hero-beam-1 {
  top: 18%;
  transform: rotate(-22deg) translateX(-50%);
  animation: beam-slide-1 5s linear infinite, beam-pulse 2.5s ease-in-out infinite;
}

.hero-beam-2 {
  top: 38%;
  transform: rotate(-12deg) translateX(-50%);
  animation: beam-slide-2 6s linear infinite, beam-pulse 3.5s ease-in-out infinite 0.5s;
}

.hero-beam-3 {
  top: 58%;
  transform: rotate(-30deg) translateX(-50%);
  width: 180%;
  animation: beam-slide-3 7s linear infinite, beam-pulse 2.8s ease-in-out infinite 1s;
}

.hero-beam-4 {
  top: 72%;
  transform: rotate(-18deg) translateX(-50%);
  animation: beam-slide-4 5.5s linear infinite, beam-pulse 3.2s ease-in-out infinite 0.3s;
}

.hero-beam-5 {
  top: 88%;
  transform: rotate(-28deg) translateX(-50%);
  width: 220%;
  animation: beam-slide-5 8s linear infinite, beam-pulse 4s ease-in-out infinite 1.5s;
}

@keyframes beam-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes beam-slide-1 {
  0% { transform: rotate(-22deg) translateX(-100%); }
  100% { transform: rotate(-22deg) translateX(100%); }
}

@keyframes beam-slide-2 {
  0% { transform: rotate(-12deg) translateX(100%); }
  100% { transform: rotate(-12deg) translateX(-100%); }
}

@keyframes beam-slide-3 {
  0% { transform: rotate(-30deg) translateX(-80%); }
  100% { transform: rotate(-30deg) translateX(80%); }
}

@keyframes beam-slide-4 {
  0% { transform: rotate(-18deg) translateX(90%); }
  100% { transform: rotate(-18deg) translateX(-90%); }
}

@keyframes beam-slide-5 {
  0% { transform: rotate(-28deg) translateX(-70%); }
  100% { transform: rotate(-28deg) translateX(70%); }
}

/* Layer 4: Floating particles */
.hero-particles {
  position: absolute; inset: 0; pointer-events: none;
}

.hero-particles::before,
.hero-particles::after {
  content: ''; position: absolute;
  border-radius: 50%;
  background: hsla(var(--primary), 0.7);
  filter: blur(1px);
  box-shadow: 0 0 8px hsla(var(--primary), 0.8), 0 0 20px hsla(190, 80%, 60%, 0.4);
}

.hero-particles::before {
  width: 3px; height: 3px;
  animation: particle-float-1 6s ease-in-out infinite;
}

.hero-particles::after {
  width: 2px; height: 2px;
  animation: particle-float-2 8s ease-in-out infinite 1s;
}

@keyframes particle-float-1 {
  0%   { top: 70%; left: 20%; opacity: 0; }
  20%  { opacity: 1; }
  50%  { top: 30%; left: 80%; }
  80%  { opacity: 1; }
  100% { top: 70%; left: 20%; opacity: 0; }
}

@keyframes particle-float-2 {
  0%   { top: 40%; left: 80%; opacity: 0; }
  20%  { opacity: 1; }
  50%  { top: 80%; left: 15%; }
  80%  { opacity: 1; }
  100% { top: 40%; left: 80%; opacity: 0; }
}

/* Center the text */
.hero-grid {
  position: relative; z-index: 10;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-text { animation: fade-up 0.7s ease forwards; }

.hero-text h1 {
  font-size: clamp(2.5rem, 5vw, 3.75rem); font-weight: 800; color: #fff;
  line-height: 1.15; margin-bottom: 1.5rem; text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.hero-text h1 span {
  background: linear-gradient(90deg, hsl(var(--primary)), #4dc9f6);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text p {
  color: rgba(255,255,255,0.8); font-size: 1.125rem; margin-bottom: 2rem;
  max-width: 36rem; margin-left: auto; margin-right: auto;
}

.hero-buttons {
  display: flex; gap: 1rem; justify-content: center;
}

.btn-hero {
  padding: 0.75rem 2rem; border-radius: 9999px; font-weight: 600; font-size: 0.875rem;
  border: none; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-hero-primary {
  background: hsl(var(--primary)); color: #fff;
  box-shadow: 0 8px 24px hsla(var(--primary), 0.4), inset 0 1px 0 hsla(0,0%,100%,0.2);
}

.btn-hero-primary:hover {
  transform: translateY(-3px); box-shadow: 0 12px 32px hsla(var(--primary), 0.5);
  filter: brightness(1.1);
}

.btn-hero-outline {
  background: hsla(0,0%,100%,0.05); backdrop-filter: blur(8px); color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}

.btn-hero-outline:hover {
  background: hsla(0,0%,100%,0.15); border-color: rgba(255,255,255,0.5);
  transform: translateY(-3px);
}

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

@media (max-width: 768px) {
  .hero { min-height: 90vh; }
  .hero-grid { text-align: center; }
  .hero-text p { margin-left: auto; margin-right: auto; }
  .hero-buttons { justify-content: center; }
  .hero-beam-1 { top: 20%; }
  .hero-beam-2 { top: 50%; }
  .hero-beam-3 { top: 80%; }
}

/* ===== Sections Common ===== */
section { padding: 5rem 0; }

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 700;
  color: hsl(var(--fg)); margin-bottom: 1rem; text-align: center;
}

.section-desc {
  color: var(--muted); max-width: 36rem; margin: 0 auto 4rem; text-align: center;
}

.bg-secondary { background: var(--secondary-bg); }

/* Dark section variant — used for tech-themed sections */
.bg-dark {
  background: #060a10;
  position: relative;
}

.bg-dark::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.bg-dark .section-title { color: #fff; }
.bg-dark .section-desc { color: rgba(255,255,255,0.6); }

/* Scroll reveal */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ===== Features ===== */
.features-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
}

.feature-card {
  background: hsla(215, 28%, 12%, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid hsla(var(--primary), 0.15);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem; text-align: center;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: hsla(var(--primary), 0.5);
  box-shadow: 0 16px 40px rgba(0,0,0,0.3), 0 0 30px hsla(var(--primary), 0.08);
}

.feature-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: hsla(215, 28%, 15%, 0.6);
  border: 1px solid hsla(var(--primary), 0.25);
  color: hsl(var(--primary));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 0 20px hsla(var(--primary), 0.15), inset 0 0 12px hsla(var(--primary), 0.05);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.08);
  box-shadow: 0 0 32px hsla(var(--primary), 0.35), inset 0 0 20px hsla(var(--primary), 0.1);
  border-color: hsla(var(--primary), 0.5);
}

.feature-icon svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.feature-card h3 { font-weight: 700; margin-bottom: 0.75rem; font-size: 1.125rem; color: #fff; }

.feature-card p { color: rgba(255,255,255,0.55); font-size: 0.875rem; line-height: 1.65; }

@media (max-width: 768px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .features-grid { grid-template-columns: 1fr; }
}

#how-it-works.bg-dark { background: #080e16; }

/* ===== How It Works ===== */
.steps-container {
  display: flex; align-items: flex-start; justify-content: center;
  max-width: 64rem; margin: 0 auto;
}

.step-card {
  flex: 1; text-align: center; padding: 2.5rem 1rem 2rem; position: relative;
  background: hsla(215, 28%, 12%, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid hsla(var(--primary), 0.15);
  border-radius: var(--radius);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.step-card:hover {
  transform: translateY(-6px);
  border-color: hsla(var(--primary), 0.5);
  box-shadow: 0 16px 40px rgba(0,0,0,0.3), 0 0 30px hsla(var(--primary), 0.08);
}

.step-number {
  font-size: 3rem; font-weight: 800;
  color: hsla(var(--primary), 0.08);
  position: absolute; top: 0.25rem; left: 50%; transform: translateX(-50%);
  line-height: 1; pointer-events: none;
  transition: color 0.35s ease;
}

.step-card:hover .step-number { color: hsla(var(--primary), 0.15); }

.step-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: hsla(215, 28%, 15%, 0.6);
  border: 1px solid hsla(var(--primary), 0.25);
  color: hsl(var(--primary));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 0 20px hsla(var(--primary), 0.15), inset 0 0 12px hsla(var(--primary), 0.05);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  position: relative; z-index: 1;
}

.step-card:hover .step-icon {
  transform: scale(1.08);
  box-shadow: 0 0 32px hsla(var(--primary), 0.35), inset 0 0 20px hsla(var(--primary), 0.1);
  border-color: hsla(var(--primary), 0.5);
}

.step-icon svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.step-card h3 { font-weight: 700; margin-bottom: 0.5rem; font-size: 1.125rem; color: #fff; }

.step-card p { color: rgba(255,255,255,0.55); font-size: 0.875rem; line-height: 1.6; }

/* Glowing connectors */
.step-connector {
  display: flex; align-items: center; justify-content: center;
  padding: 0 0.25rem; min-width: 40px; align-self: stretch;
  position: relative; z-index: 1;
}

.step-connector::after {
  content: '';
  display: block; width: 36px; height: 2px;
  background: hsla(var(--primary), 0.4);
  border-radius: 1px;
  box-shadow: 0 0 8px hsla(var(--primary), 0.4), 0 0 20px hsla(var(--primary), 0.15);
}

.step-connector::before {
  content: ''; position: absolute; right: 4px; top: 50%;
  width: 8px; height: 8px;
  border-top: 2px solid hsla(var(--primary), 0.5);
  border-right: 2px solid hsla(var(--primary), 0.5);
  transform: translateY(-50%) rotate(45deg);
  box-shadow: 2px -2px 6px hsla(var(--primary), 0.3);
}

@media (max-width: 768px) {
  .steps-container { flex-direction: column; align-items: center; }
  .step-card { width: 100%; max-width: 360px; margin-bottom: 0; }
  .step-connector { padding: 0.25rem 0; }
  .step-connector::after { width: 2px; height: 28px; }
  .step-connector::before { right: auto; top: auto; bottom: 0;
    transform: translateX(-50%) rotate(135deg); left: 50%; }
}

#faq.bg-dark { background: #060a10; }

/* ===== FAQ ===== */
.faq-list { max-width: 48rem; margin: 0 auto; display: flex; flex-direction: column; gap: 2rem; }

.faq-item { padding: 0 0 1.5rem; border-bottom: 1px solid hsla(var(--primary), 0.1); }

.faq-q {
  font-size: 1.125rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem;
  display: flex; align-items: center; gap: 0.625rem;
}

.faq-q-icon {
  width: 20px; height: 20px; stroke: hsl(var(--primary)); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

.faq-a {
  color: rgba(255,255,255,0.55); font-size: 0.9375rem; line-height: 1.7;
}

/* ===== Contact ===== */
.contact-list {
  max-width: 48rem; margin: 0 auto;
  display: flex; flex-direction: column; gap: 1rem;
}

.contact-row {
  display: flex; align-items: center; gap: 1rem;
  color: rgba(255,255,255,0.7); font-size: 0.9375rem;
  padding: 0.75rem 0;
}

.contact-svg {
  width: 20px; height: 20px; stroke: hsl(var(--primary)); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
  opacity: 0.7;
}

.contact-label {
  color: rgba(255,255,255,0.4); font-size: 0.8125rem;
  min-width: 4.5rem; flex-shrink: 0;
}

@media (max-width: 768px) {
  .contact-row { flex-wrap: wrap; gap: 0.25rem 0.75rem; }
  .contact-label { min-width: auto; }
}

/* ===== Footer ===== */
.footer {
  background: hsl(var(--fg)); padding: 3rem 0;
}

.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2rem;
  color: rgba(255,255,255,0.7); font-size: 0.875rem;
}

.footer h3 { color: #fff; font-weight: 700; font-size: 1.125rem; margin-bottom: 1rem; }

.footer h4 { color: #fff; font-weight: 600; margin-bottom: 0.75rem; }

.footer ul { list-style: none; }

.footer ul li { margin-bottom: 0.5rem; }

.footer a { transition: color 0.2s; }
.footer a:hover { color: hsl(var(--primary)); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); margin-top: 2rem; padding-top: 2rem;
  text-align: center; color: rgba(255,255,255,0.4); font-size: 0.75rem;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Back to Top ===== */
#back-to-top {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 50;
  width: 48px; height: 48px; border-radius: 50%;
  background: hsl(var(--primary)); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px hsla(var(--primary), 0.4);
  opacity: 0; transform: scale(0.5); transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

#back-to-top.show { opacity: 1; transform: scale(1); pointer-events: auto; }

#back-to-top:hover { transform: scale(1.1); }

#back-to-top svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
