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

:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --text: #e8e8f0;
  --text-muted: #8a8a9a;
  --accent: #7c5cff;
  --accent-2: #00d4ff;
  --accent-3: #ff5c8a;
  --glow: rgba(124, 92, 255, 0.4);
  --radius: 16px;
  --font: 'Inter', system-ui, sans-serif;
  --display: 'Orbitron', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ========== PARTICLES CANVAS ========== */
#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ========== NAVBAR ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 5%;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: padding 0.3s ease, background 0.3s ease;
}

.navbar.scrolled {
  padding: 0.8rem 5%;
  background: rgba(10, 10, 15, 0.92);
}

.logo {
  position: relative;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.15em;
  color: var(--text);
}

.logo-line {
  position: absolute;
  bottom: -4px;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.logo:hover .logo-line {
  width: 100%;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-link {
  position: relative;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.nav-link:hover::after {
  width: 100%;
}

.nav-cta {
  padding: 0.6rem 1.4rem;
  background: transparent;
  border: 1px solid rgba(124, 92, 255, 0.5);
  color: var(--text);
  border-radius: 999px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
}

.nav-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 0.3s;
}

.nav-cta:hover {
  border-color: transparent;
  box-shadow: 0 0 20px var(--glow);
  transform: translateY(-1px);
}

.nav-cta:hover::before {
  opacity: 1;
}

.nav-cta span {
  position: relative;
  z-index: 1;
}

/* ========== HERO ========== */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  padding: 8rem 5% 4rem;
}

.hero-tagline {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-2);
  margin-bottom: 1.2rem;
  opacity: 0;
  transform: translateY(20px);
}

.hero-title {
  font-family: var(--display);
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-title .line {
  display: block;
  overflow: hidden;
}

.hero-title .line span,
.hero-title .line {
  display: block;
  opacity: 0;
  transform: translateY(100%);
  animation: slideUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-title .line:nth-child(1) {
  animation-delay: 0.2s;
}

.hero-title .line:nth-child(2) {
  animation-delay: 0.4s;
}

.hero-title .accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: slideUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards,
             gradientShift 6s ease infinite 1.3s;
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateY(20px);
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
}

/* Buttons */
.btn {
  position: relative;
  padding: 1rem 2rem;
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s ease;
}

.btn span {
  position: relative;
  z-index: 2;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5a3fff);
  color: white;
  box-shadow: 0 4px 24px var(--glow);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 32px rgba(124, 92, 255, 0.55);
}

.btn-primary:active {
  transform: translateY(-1px) scale(0.98);
}

.btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.35),
    transparent
  );
  transform: skewX(-20deg);
  transition: none;
}

.btn-primary:hover .btn-shine {
  animation: shine 0.7s ease;
}

@keyframes shine {
  to { left: 140%; }
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  border-color: var(--accent-2);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.25);
  transform: translateY(-2px);
}

/* Hero visual */
.hero-visual {
  position: relative;
  height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  animation: float 8s ease-in-out infinite;
}

.orb-1 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.5;
  animation-delay: 0s;
}

.orb-2 {
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
  opacity: 0.4;
  top: 20%;
  right: 10%;
  animation-delay: -2s;
  animation-duration: 10s;
}

.orb-3 {
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, var(--accent-3) 0%, transparent 70%);
  opacity: 0.35;
  bottom: 15%;
  left: 15%;
  animation-delay: -4s;
  animation-duration: 9s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.05); }
  66% { transform: translate(-15px, 15px) scale(0.95); }
}

.floating-card {
  position: absolute;
  background: rgba(18, 18, 26, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  animation: cardFloat 5s ease-in-out infinite;
}

.card-1 {
  top: 18%;
  left: 5%;
  animation-delay: 0s;
}

.card-2 {
  bottom: 22%;
  right: 8%;
  animation-delay: -2.5s;
}

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

.card-icon {
  font-size: 1.4rem;
}

.card-text {
  font-weight: 600;
  font-size: 0.95rem;
}

/* ========== DIVIDER ========== */
.section-divider {
  position: relative;
  z-index: 1;
  padding: 0 5%;
  margin: 2rem 0;
}

.divider-line {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(124, 92, 255, 0.5),
    rgba(0, 212, 255, 0.5),
    transparent
  );
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.divider-line.visible {
  transform: scaleX(1);
}

/* ========== FEATURES ========== */
.features {
  position: relative;
  z-index: 1;
  padding: 6rem 5%;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 0.8rem;
  opacity: 0;
  transform: translateY(30px);
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
  opacity: 0;
  transform: translateY(20px);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.8rem;
}

.feature-card {
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 2rem;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.35s,
              box-shadow 0.35s;
  opacity: 0;
  transform: translateY(40px);
}

.feature-card:hover {
  transform: translateY(-8px);
  border-color: rgba(124, 92, 255, 0.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 30px rgba(124, 92, 255, 0.1);
}

.feature-icon {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.4rem;
  font-family: var(--display);
  font-weight: 700;
  color: var(--accent);
}

.icon-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(124, 92, 255, 0.3);
  border-radius: 50%;
  animation: ringPulse 2.5s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Demo button inside feature */
.demo-btn {
  padding: 0.7rem 1.6rem;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: color 0.3s, transform 0.2s;
}

.demo-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
}

.demo-btn:hover {
  color: white;
  transform: scale(1.05);
}

.demo-btn:hover::before {
  transform: scaleX(1);
}

.demo-btn {
  z-index: 1;
}

/* Drawing line demo */
.demo-line-container {
  margin-top: 0.5rem;
}

.demo-line {
  width: 100%;
  height: 4px;
}

.demo-line line {
  stroke: url(#lineGradient);
  stroke: var(--accent-2);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.feature-card:hover .demo-line line {
  stroke-dashoffset: 0;
}

/* Gradient text */
.gradient-text {
  font-weight: 700;
  font-size: 1.15rem;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: textGradient 4s linear infinite;
}

@keyframes textGradient {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* Scroll indicator */
.scroll-indicator {
  width: 24px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  position: relative;
  margin-top: 0.5rem;
}

.scroll-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-2);
  border-radius: 50%;
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  animation: scrollBounce 1.6s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { top: 8px; opacity: 1; }
  50% { top: 24px; opacity: 0.4; }
}

/* ========== TIMELINE ========== */
.timeline-section {
  position: relative;
  z-index: 1;
  padding: 5rem 5%;
}

.timeline {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.timeline-track {
  position: absolute;
  top: 28px;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.timeline-progress {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.timeline.visible .timeline-progress {
  width: 100%;
}

.timeline-items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  position: relative;
}

.timeline-item {
  text-align: center;
  opacity: 0;
  transform: translateY(30px);
}

.timeline-dot {
  width: 18px;
  height: 18px;
  background: var(--bg);
  border: 3px solid var(--accent);
  border-radius: 50%;
  margin: 0 auto 1.2rem;
  position: relative;
  z-index: 2;
  transition: transform 0.3s, box-shadow 0.3s;
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.3);
  box-shadow: 0 0 16px var(--glow);
}

.timeline-item h4 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.timeline-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========== GALLERY ========== */
.gallery {
  position: relative;
  z-index: 1;
  padding: 6rem 5%;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.gallery-card {
  position: relative;
  height: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translateY(40px);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-card:hover {
  transform: translateY(-10px) scale(1.02);
}

.gallery-bg {
  position: absolute;
  inset: 0;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-card:hover .gallery-bg {
  transform: scale(1.1);
}

.bg-1 {
  background: linear-gradient(145deg, #7c5cff, #3a1f9e);
  animation: pulseBg 4s ease-in-out infinite;
}

.bg-2 {
  background: linear-gradient(145deg, #00d4ff, #0066aa);
}

.bg-3 {
  background: linear-gradient(145deg, #ff5c8a, #aa2040);
}

.bg-4 {
  background: linear-gradient(145deg, #ffb347, #ff6b00);
}

@keyframes pulseBg {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}

.gallery-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  transform: translateY(10px);
  opacity: 0.9;
  transition: transform 0.35s, opacity 0.35s;
}

.gallery-card:hover .gallery-content {
  transform: translateY(0);
  opacity: 1;
}

.gallery-content h3 {
  font-size: 1.4rem;
  margin-bottom: 0.2rem;
}

.gallery-content p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

/* ========== CONTACT ========== */
.contact {
  position: relative;
  z-index: 1;
  padding: 6rem 5% 4rem;
  display: flex;
  justify-content: center;
}

.contact-box {
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 3.5rem 3rem;
  text-align: center;
  max-width: 560px;
  width: 100%;
  opacity: 0;
  transform: translateY(40px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.contact-box h2 {
  font-family: var(--display);
  font-size: 1.9rem;
  margin-bottom: 0.8rem;
}

.contact-box > p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.contact-form {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.animated-input {
  flex: 1;
  min-width: 200px;
  padding: 1rem 1.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.animated-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.2);
}

.animated-input::placeholder {
  color: var(--text-muted);
}

.social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.social-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.3s, border-color 0.3s, transform 0.25s, box-shadow 0.3s;
}

.social-btn:hover {
  background: var(--accent);
  border-color: transparent;
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 20px var(--glow);
}

/* ========== FOOTER ========== */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2.5rem 5%;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  margin-bottom: 1.5rem;
}

/* ========== REVEAL ANIMATION ========== */
.reveal.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Stagger children */
.features-grid .feature-card:nth-child(1) { transition-delay: 0.05s; }
.features-grid .feature-card:nth-child(2) { transition-delay: 0.15s; }
.features-grid .feature-card:nth-child(3) { transition-delay: 0.25s; }
.features-grid .feature-card:nth-child(4) { transition-delay: 0.35s; }

.timeline-items .timeline-item:nth-child(1) { transition-delay: 0.1s; }
.timeline-items .timeline-item:nth-child(2) { transition-delay: 0.25s; }
.timeline-items .timeline-item:nth-child(3) { transition-delay: 0.4s; }
.timeline-items .timeline-item:nth-child(4) { transition-delay: 0.55s; }

.gallery-grid .gallery-card:nth-child(1) { transition-delay: 0.05s; }
.gallery-grid .gallery-card:nth-child(2) { transition-delay: 0.15s; }
.gallery-grid .gallery-card:nth-child(3) { transition-delay: 0.25s; }
.gallery-grid .gallery-card:nth-child(4) { transition-delay: 0.35s; }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 7rem;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-visual {
    height: 320px;
    order: -1;
  }

  .nav-links {
    display: none;
  }

  .timeline-items {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .timeline-track {
    display: none;
  }
}

@media (max-width: 560px) {
  .timeline-items {
    grid-template-columns: 1fr;
  }

  .contact-form {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}