/* Main Stylesheet - Page-specific styles */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Combined Hero + Demo Section - High-Assurance Infrastructure */
.hero-demo {
  background: var(--color-canvas-base);
  color: var(--color-text-on-dark);
  position: relative;
}

/* Subtle noise texture overlay for tactility */
.hero-demo::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

/* Subtle vignette for depth - "heavy surface" feel */
.hero-demo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 120% 100% at 50% 0%,
    transparent 40%,
    rgba(0, 0, 0, 0.3) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Tablet adjustments (768-1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-demo__layout {
    grid-template-columns: 35fr 65fr;
    gap: 2.5rem;
  }

  .hero-demo__content {
    max-width: 400px;  /* Wide enough for headline to fit */
    padding-top: 0;  /* Match desktop - align with grid top */
  }

  .hero-demo__title {
    font-size: 2.25rem;
    line-height: 1.1;
    min-height: 4.4rem;  /* Reserve space for 2 lines: 2 × 2rem × 1.1 */
  }

  .hero-demo__features {
    gap: 1rem;
    margin-top: 0.9rem;
  }

  .feature-control {
    padding: 1.125rem;
  }

  .hero-demo__cta {
    margin-top: 1.5rem;
  }

  .hero-demo__video-container {
    min-width: 0;
    min-height: 360px;
    max-height: min(70vh, 520px);
    margin-top: 0;  /* Match desktop - align with grid top */
  }

  /* Adjust connector length for tablet gap (2.5rem instead of 5rem) */
  .feature-control::after {
    width: calc(2.5rem + 1rem);  /* 2.5rem gap + 1rem offset = 3.5rem */
  }

  /* Adjust indicator positions for tablet layout */
  :root {
    --indicator-position-queue: 124px;
    --indicator-position-outlook: 220px;
    --indicator-position-accuracy: 316px;
  }

}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  .hero-demo__layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    min-height: auto;
    padding: 1rem 0;
  }

  .hero-demo__video-container {
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: 60vh;
    order: -1;
    margin-top: 0;
    border-radius: var(--radius-lg);
  }

  .hero-demo__content {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    padding: 0;
    padding-top: 0;
    max-width: 100%;
  }

  .hero-demo__title {
    font-size: 1.75rem;
    line-height: 1.15;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    min-height: 4rem;  /* Reserve space for 2 lines: 2 × 1.75rem × 1.15 */
  }

  .hero-demo__features {
    flex-direction: column;
    gap: 0.875rem;
    margin-top: 1.5rem;
    width: 100%;
  }

  .feature-control {
    flex: none;
    text-align: left;
    padding: 1rem;
  }

  .feature-control__value-prop {
    font-size: 0.9375rem;
  }

  .feature-control__description {
    font-size: 0.8125rem;
    line-height: 1.5;
  }

  .hero-demo__cta {
    margin-top: 1.5rem;
  }

  /* Remove connector lines on mobile */
  .feature-control::after {
    display: none;
  }

  /* Hide video indicators on mobile (matches hidden connectors) */
  .hero-demo__video-container::before {
    display: none;
  }
}

/* Loading state for videos - "Visualizing AI Work" */
.video-loading {
  position: relative;
}

.video-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    var(--color-green-signal),
    transparent
  );
  animation: scanLine 1.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  z-index: 10;
}

@keyframes scanLine {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh);
    opacity: 0;
  }
}

/* Legacy spin animation (fallback) */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Video pulse when switching */
.hero-demo__video-container.video-switching {
  animation: videoPulse 0.4s ease-out;
}

@keyframes videoPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.005); }
  100% { transform: scale(1); }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus styles */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .hero-demo,
  .footer {
    display: none;
  }
}
