* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #000;
  color: #fafafa;
  overflow: hidden;
}

/* Three.js canvas background */
#canvas-container {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

/* Slide - full viewport centered */
.slide {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  padding: 60px 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  animation: fadeIn 0.7s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typography - bigger */
h1 { font-size: 4.5rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 1.2rem; }
h2 { font-size: 2.8rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 0.8rem; }
h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; color: #fafafa; }
p { font-size: 1.3rem; color: rgba(255,255,255,0.6); max-width: 700px; line-height: 1.8; }
.subtitle { font-size: 1.5rem; color: rgba(255,255,255,0.4); margin-bottom: 1.5rem; }
.url { font-size: 1.1rem; color: rgba(255,255,255,0.35); margin-top: 1.5rem; letter-spacing: 1px; }

.badge {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
  margin-bottom: 1.5rem;
  letter-spacing: 0.5px;
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #71717a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Feature cards */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 2.5rem;
  max-width: 960px;
}
.feature-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 28px 22px;
  text-align: left;
  backdrop-filter: blur(8px);
  transition: border-color 0.3s, transform 0.3s;
}
.feature-card:hover {
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}
.feature-card p { font-size: 0.95rem; color: rgba(255,255,255,0.45); line-height: 1.5; }
.feature-card .icon {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  color: rgba(255,255,255,0.7);
}

/* Tech tags */
.tech-stack { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 2rem; }
.tech-tag {
  padding: 10px 20px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
}

/* Stats */
.stats { display: flex; gap: 60px; margin-top: 2.5rem; }
.stat { text-align: center; }
.stat-num { font-size: 3.2rem; font-weight: 700; color: #fafafa; }
.stat-label { font-size: 1rem; color: rgba(255,255,255,0.4); margin-top: 6px; }

/* Architecture */
.arch-diagram { display: flex; align-items: center; gap: 28px; margin-top: 2.5rem; flex-wrap: wrap; justify-content: center; }
.arch-box {
  padding: 22px 30px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 1.05rem;
  text-align: center;
  backdrop-filter: blur(8px);
}
.arch-arrow { color: rgba(255,255,255,0.25); font-size: 1.6rem; }

/* ===== 3D Rotating Carousel ===== */
.carousel-wrapper {
  width: 100%;
  height: 60vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 1rem;
}
.carousel-inner {
  --w: 320px;
  --h: 200px;
  --translateZ: 500px;
  --rotateX: -10deg;
  --perspective: 1400px;
  position: absolute;
  width: var(--w);
  height: var(--h);
  transform-style: preserve-3d;
  transform: perspective(var(--perspective));
  animation: carousel-rotate 30s linear infinite;
}
@keyframes carousel-rotate {
  from { transform: perspective(var(--perspective)) rotateX(var(--rotateX)) rotateY(0); }
  to { transform: perspective(var(--perspective)) rotateX(var(--rotateX)) rotateY(1turn); }
}
.carousel-card {
  position: absolute;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  overflow: hidden;
  inset: 0;
  transform: rotateY(calc((360deg / var(--quantity)) * var(--index))) translateZ(var(--translateZ));
  cursor: pointer;
  transition: border-color 0.3s;
}
.carousel-card:hover { border-color: rgba(255,255,255,0.4); }
.carousel-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.carousel-card .card-label {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  padding: 8px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  font-size: 0.75rem;
  color: rgba(255,255,255,0.8);
}

/* ===== Typewriter effect ===== */
.typewriter {
  overflow: hidden;
  border-right: 2px solid rgba(255,255,255,0.6);
  white-space: nowrap;
  animation: typing 1.2s steps(20, end), blink-caret 0.6s step-end infinite;
  display: inline-block;
}
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}
@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: rgba(255,255,255,0.6); }
}

/* ===== SVG Handwriting stroke effect ===== */
.stroke-title {
  margin-bottom: 1.2rem;
}
.stroke-title svg text {
  font-size: 72px;
  font-weight: 700;
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.5;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: stroke-loop 4s ease infinite;
}
@keyframes stroke-loop {
  0% { stroke-dashoffset: 600; fill: transparent; stroke-width: 1.5; }
  40% { stroke-dashoffset: 0; fill: transparent; stroke-width: 1.5; }
  60% { stroke-dashoffset: 0; fill: #ffffff; stroke-width: 0; }
  80% { stroke-dashoffset: 0; fill: #ffffff; stroke-width: 0; }
  100% { stroke-dashoffset: 600; fill: transparent; stroke-width: 1.5; }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.94);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  backdrop-filter: blur(12px);
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.8);
  animation: fadeIn 0.3s ease-out;
}
.lightbox-caption {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  color: rgba(255,255,255,0.5);
}
.lightbox-close {
  position: fixed;
  top: 28px;
  right: 36px;
  font-size: 2.2rem;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: color 0.2s;
  z-index: 201;
}
.lightbox-close:hover { color: #fff; }

/* Navigation - left/right sides */
.nav-left, .nav-right {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
}
.nav-left { left: 24px; }
.nav-right { right: 24px; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.5);
  color: #fafafa;
  font-size: 1.4rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s;
  backdrop-filter: blur(8px);
}
.nav-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
}
.nav-btn.disabled {
  opacity: 0.2;
  pointer-events: none;
}

.page-num {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.2);
  letter-spacing: 2px;
  z-index: 100;
}

/* Start button */
.start-btn {
  display: inline-block;
  margin-top: 2.5rem;
  padding: 14px 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  color: #fafafa;
  font-size: 1.1rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  animation: pulse-glow 2s ease-in-out infinite;
}
.start-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.4);
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(255,255,255,0.1);
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(255,255,255,0); }
  50% { box-shadow: 0 0 20px rgba(255,255,255,0.08); }
}
