/* ==========================================
 * Hero Section - 120-Point Immersive Design
 * ========================================== */

/* Hero Container */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 80px 0 var(--spacing-lg);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(0, 212, 255, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(124, 58, 237, 0.15) 0%, transparent 50%);
  animation: gradientPulse 10s ease-in-out infinite;
}

@keyframes gradientPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* Hero Grid Layout */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 160px);
}

/* Left: Copy */
.hero-copy {
  max-width: 600px;
  animation: fadeInUp 0.8s ease-out 0.3s both;
  justify-self: end;
  padding-right: clamp(1rem, 3vw, 2rem);
}

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

.hero-badge {
  display: inline-block;
  padding: 8px 18px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 50px;
  color: var(--color-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
  backdrop-filter: blur(10px);
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
  letter-spacing: -0.02em;
}

.hero-title-line {
  display: block;
  white-space: nowrap;
  animation: fadeInUp 0.8s ease-out both;
}

.hero-title-line:nth-child(1) { animation-delay: 0.5s; }
.hero-title-line:nth-child(2) { animation-delay: 0.6s; }
.hero-title-line:nth-child(3) { animation-delay: 0.7s; }

/* Gradient Text with Animation */
.gradient-text-animated {
  background: linear-gradient(
    135deg,
    #fff 0%,
    #00D4FF 25%,
    #7c3aed 50%,
    #00D4FF 75%,
    #fff 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientFlow 8s ease infinite;
}

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

.highlight-text {
  color: var(--color-primary);
  text-shadow: 0 0 40px rgba(0, 212, 255, 0.5);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-md);
  line-height: 1.7;
  max-width: 95%;
  animation: fadeInUp 0.8s ease-out 0.9s both;
}

.mobile-break {
  display: none;
}

/* CTA Buttons */
.hero-cta {
  display: flex;
  gap: 1rem;
  margin-top: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
  animation: fadeInUp 0.8s ease-out 1s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
  isolation: isolate; /* Ensure ripple stacking context */
}

.btn-large {
  padding: 18px 40px;
  font-size: 1.125rem;
}

.btn-primary {
  background: var(--color-primary);
  color: #000;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 212, 255, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-glow {
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.btn-glow:hover {
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.6), 0 12px 32px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s;
}

.btn:hover .btn-icon {
  transform: translateX(4px);
}

/* Trust Indicators */
.hero-trust {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease-out 1.1s both;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
}

.trust-item svg {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
}

/* Right: 3D Visual */
.hero-visual {
  position: relative;
  height: clamp(450px, 70vh, 600px);
  animation: fadeInScale 1s ease-out 0.8s both;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.preview-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 39, 0.4);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(20px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(0, 212, 255, 0.1) inset;
}

.preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 39, 0.8);
  z-index: 1;
  transition: opacity 0.5s;
}

.preview-placeholder.hidden {
  opacity: 0;
  pointer-events: none;
}

.placeholder-content {
  text-align: center;
  color: var(--color-text-secondary);
}

.placeholder-icon {
  width: 80px;
  height: 80px;
  color: var(--color-primary);
  margin-bottom: 16px;
  animation: pulse 2s ease-in-out infinite;
}

.preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  opacity: 0;
  transition: opacity 0.5s;
}

.preview-iframe.loaded {
  opacity: 1;
}

/* Demo interaction hint overlay — visible only after iframe loads */
.demo-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease-out;
}

.preview-iframe.loaded ~ .demo-hint {
  opacity: 1;
}

/* Must match sibling selector specificity (0,3,0) to override */
.preview-iframe.loaded ~ .demo-hint.hidden {
  opacity: 0;
}

.demo-hint-content {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.demo-hint-icon {
  font-size: 1rem;
}

.preview-glow {
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(124, 58, 237, 0.2));
  border-radius: var(--radius-lg);
  opacity: 0;
  z-index: -1;
  filter: blur(20px);
  transition: opacity 0.5s;
}

.preview-container:hover .preview-glow {
  opacity: 1;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: fadeIn 1s ease-out 1.5s both;
  z-index: 10;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.scroll-icon {
  width: 24px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  position: relative;
}

.scroll-icon::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 2px;
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% {
    transform: translate(-50%, 0);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, 12px);
    opacity: 0.3;
  }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .hero-copy {
    max-width: 100%;
    text-align: center;
    margin: 0 auto;
  }

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

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

  .hero-visual {
    order: 2;
    height: 60vh;
  }

  .hero-title {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
  }
}

@media (max-width: 768px) {
  .hero {
    padding: calc(var(--spacing-lg) + 60px) 0 var(--spacing-md);
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero-subtitle {
    font-size: 1.125rem;
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

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

  .hero-visual {
    height: 50vh;
  }

  .mobile-break {
    display: inline;
  }

  .scroll-indicator {
    display: none;
  }
}

/* Reduce Motion */
@media (prefers-reduced-motion: reduce) {
  .hero-gradient,
  .gradient-text-animated,
  .placeholder-icon,
  .placeholder-spinner,
  .hyper-arcs,
  .hyper-glow,
  .hyper-arc-1,
  .hyper-arc-2,
  .hyper-arc-3,
  .cta-spinner,
  .scroll-icon::before,
  .hero-copy,
  .hero-badge,
  .hero-title-line,
  .hero-subtitle,
  .hero-cta,
  .hero-trust,
  .hero-visual,
  .scroll-indicator {
    animation: none !important;
  }

  .btn,
  .preview-glow {
    transition: none !important;
  }
}
