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

:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --bg-card: #161622;
  --text: #e0e0e8;
  --text-dim: #8888a0;
  --accent: #a855f7;
  --accent2: #06b6d4;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent2));
  --gradient-text: linear-gradient(135deg, #c084fc, #22d3ee);
  --border: rgba(255,255,255,0.06);
  --radius: 8px;
  --radius-lg: 16px;
  --nav-height: 72px;
  --max-width: 1200px;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

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

.section { scroll-snap-align: start; }
.hero { scroll-snap-align: start; }
.footer { scroll-snap-align: none; }

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

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; width: 100%; }
.section {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 100px 0;
}

.section-tag {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-desc {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 480px;
}

.section-header { margin-bottom: 40px; }

.gradient-text { background: var(--gradient-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 600; letter-spacing: 0.02em;
  transition: all 0.3s ease; cursor: pointer; border: none;
}

.btn-primary {
  background: var(--gradient); color: #fff;
  box-shadow: 0 0 24px rgba(168,85,247,0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 36px rgba(168,85,247,0.4); }

.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-outline:hover { border-color: var(--accent); background: rgba(168,85,247,0.08); }

.btn-full { width: 100%; justify-content: center; }

/* ====== NAVIGATION ====== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-height);
  background: rgba(10,10,15,0.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.3s;
}
.nav.hidden { transform: translateY(-100%); }

.nav-container {
  max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.95rem; font-weight: 700; letter-spacing: 0.05em;
  color: #fff;
}
.nav-logo svg { color: var(--accent); }

.nav-links { display: flex; gap: 36px; }
.nav-links a {
  font-size: 0.85rem; letter-spacing: 0.05em; color: var(--text-dim);
  transition: color 0.3s; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 1px; background: var(--accent); transition: width 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); transition: 0.3s; }

/* ====== HERO ====== */
.hero {
  position: relative; height: 100vh; min-height: 700px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
}

#heroCanvas {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

.hero-content {
  position: relative; z-index: 1; max-width: 800px; padding: 0 24px;
  animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-subtitle {
  font-size: 0.75rem; letter-spacing: 0.5em; color: var(--text-dim); margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800; line-height: 1.15; margin-bottom: 24px;
  text-shadow: 0 0 80px rgba(168,85,247,0.15);
}

.hero-desc {
  font-size: 1.1rem; color: var(--text-dim); line-height: 1.8; margin-bottom: 40px;
}

.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.hero-scroll {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  z-index: 1;
}
.hero-scroll span { font-size: 0.65rem; letter-spacing: 0.3em; color: var(--text-dim); }
.scroll-line { width: 1px; height: 48px; background: linear-gradient(to bottom, var(--accent), transparent); animation: scrollPulse 2s infinite; }

/* ====== PORTFOLIO ====== */

/* Carousel */
.gallery-carousel {
  position: relative;
}

.gallery-viewport {
  overflow: hidden; position: relative;
}
.gallery-track {
  display: flex; gap: 0; align-items: center;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.gallery-item {
  flex-shrink: 0;
  border-radius: var(--radius-lg); overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--bg-card);
  cursor: pointer;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease-out, filter 0.6s ease-out;
}
.gallery-item:not(.active) {
  filter: brightness(0.45);
  transform: scale(0.9);
}
.gallery-item.active {
  filter: brightness(1);
  transform: scale(1);
  box-shadow: 0 0 48px rgba(168,85,247,0.15);
}

.gallery-img { width: 100%; height: 100%; }
.gallery-img img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}

/* Carousel caption */
.carousel-caption {
  text-align: center; margin-top: 20px; min-height: 28px;
}
.carousel-caption span {
  display: inline-block;
  padding: 6px 24px;
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: 20px;
  font-size: 0.85rem; color: var(--accent);
  letter-spacing: 0.05em;
}

/* Arrows */
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(22,22,34,0.85); border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10; transition: all 0.3s;
  backdrop-filter: blur(8px);
}
.carousel-arrow:hover {
  background: rgba(168,85,247,0.2); border-color: var(--accent);
  color: #fff;
}
.carousel-arrow:disabled {
  opacity: 0.2; cursor: default; pointer-events: none;
}

.carousel-prev { left: -8px; }
.carousel-next { right: -8px; }

/* Dots */
.carousel-dots {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 16px;
}

.carousel-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.2); border: none;
  cursor: pointer; padding: 0;
  transition: all 0.3s;
}
.carousel-dot:hover { background: rgba(255,255,255,0.4); }
.carousel-dot.active {
  background: var(--accent);
  width: 20px; border-radius: 3px;
}

/* ====== SERVICES ====== */
.services { background: var(--bg-elevated); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px 32px;
  transition: all 0.3s; position: relative;
}
.service-card.featured { border-color: rgba(168,85,247,0.3); background: linear-gradient(180deg, rgba(168,85,247,0.06), transparent); }
.service-card:hover { transform: translateY(-6px); border-color: rgba(168,85,247,0.4); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.service-icon { margin-bottom: 24px; color: var(--accent); }
.service-card h3 { font-size: 1.3rem; margin-bottom: 12px; }
.service-card p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 20px; }
.service-card ul { display: flex; flex-direction: column; gap: 8px; }
.service-card li { font-size: 0.85rem; padding-left: 16px; position: relative; color: var(--text-dim); }
.service-card li::before { content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ====== ABOUT ====== */
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
}

.about-content .section-title { margin-bottom: 24px; }
.about-content p { color: var(--text-dim); margin-bottom: 16px; max-width: 500px; }

.about-visual { display: flex; justify-content: center; align-items: center; }
.about-img {
  width: 100%;
  max-width: 520px;
  border-radius: var(--radius-lg);
  object-fit: contain;
  border: 1px solid var(--border);
}

/* ====== PROCESS ====== */
.process { background: var(--bg-elevated); }

.process-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.process-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  transition: all 0.3s;
  position: relative;
}

.process-step:hover {
  transform: translateY(-4px);
  border-color: rgba(168,85,247,0.3);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.process-num {
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.process-step h4 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: #fff;
}

.process-step p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.7;
}

/* ====== CONTACT ====== */
.contact-grid { display: grid; grid-template-columns: 1fr 380px; gap: 56px; }

.contact-form { display: flex; flex-direction: column; gap: 20px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 0.8rem; letter-spacing: 0.05em; color: var(--text-dim);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); font-size: 0.95rem; font-family: inherit;
  transition: border-color 0.3s; outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168,85,247,0.1); }

.form-group textarea { resize: vertical; min-height: 120px; }

.contact-info {
  display: flex; flex-direction: column; gap: 28px;
  padding: 36px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); height: fit-content;
}

.info-item h4 { font-size: 0.75rem; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 6px; }
.info-item p { color: var(--text-dim); font-size: 0.9rem; }

/* ====== FOOTER ====== */
.footer { background: var(--bg-elevated); border-top: 1px solid var(--border); padding: 64px 0 32px; }

.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 48px;
  margin-bottom: 48px;
}

.footer-brand p { color: var(--text-dim); font-size: 0.85rem; margin-top: 12px; line-height: 1.8; }

.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-links h4 { font-size: 0.8rem; letter-spacing: 0.1em; color: #fff; margin-bottom: 4px; }
.footer-links a { color: var(--text-dim); font-size: 0.85rem; transition: color 0.3s; }
.footer-links a:hover { color: var(--accent); }

.footer-bottom { padding-top: 24px; border-top: 1px solid var(--border); }
.footer-bottom p { font-size: 0.8rem; color: var(--text-dim); }

/* ====== LIGHTBOX ====== */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.92); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.lightbox.active { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 90vw; max-height: 75vh; border-radius: var(--radius-lg); object-fit: contain; }
.lightbox-caption { margin-top: 16px; font-size: 1rem; color: var(--text-dim); }
.lightbox-close {
  position: absolute; top: 32px; right: 32px;
  font-size: 2rem; background: none; border: none; color: #fff; cursor: pointer;
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background 0.3s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.08); }

/* ====== ANIMATIONS ====== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.reveal {
  opacity: 0;
  transition: opacity 0.9s ease-out, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-up    { transform: translateY(40px); }
.reveal-left  { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal-scale { transform: scale(0.92); }
.reveal.visible { opacity: 1; transform: translate(0) scale(1); }

/* Stagger delays */
.reveal.d1 { transition-delay: 0.05s; }
.reveal.d2 { transition-delay: 0.15s; }
.reveal.d3 { transition-delay: 0.25s; }
.reveal.d4 { transition-delay: 0.35s; }

/* ====== RESPONSIVE ====== */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-visual { order: -1; }
  .about-img { max-width: 360px; }
  .contact-grid { grid-template-columns: 1fr; }
  .process-steps { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
}

@media (max-width: 768px) {
  .nav-links { display: none; position: fixed; top: var(--nav-height); left: 0; right: 0; background: rgba(10,10,15,0.95); backdrop-filter: blur(20px); flex-direction: column; padding: 24px; gap: 20px; border-bottom: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .carousel-arrow { width: 36px; height: 36px; }
  .carousel-prev { left: -4px; }
  .carousel-next { right: -4px; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-title { font-size: clamp(2rem, 7vw, 3rem); }
}
