/* ============================================
   Hero Section Component - Audio Waveform Theme
   ============================================ */

.hero {
  position: relative;
  width: 100%;
  max-width: var(--container-max);
  margin: var(--space-10) auto 0;
  padding: var(--space-12) var(--space-6) var(--space-10);
  min-height: 45vh;
  overflow: hidden;
  border-radius: var(--radius-3xl);
  border: 1px solid var(--color-border);
  background: var(--gradient-hero-bg);
  box-shadow: var(--shadow-hero);
}

/* Decorative blobs - fully static for GPU performance */
.hero__blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero__blob--top-right {
  top: -150px;
  right: -150px;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(107, 63, 255, 0.25) 0%, rgba(138, 43, 226, 0.12) 25%, transparent 55%);
}

.hero__blob--bottom-left {
  bottom: -140px;
  left: -140px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 77, 138, 0.22) 0%, rgba(255, 10, 201, 0.1) 25%, transparent 55%);
}

.hero__blob--center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(75, 0, 130, 0.1) 0%, transparent 45%);
}

/* Waveform background at bottom of hero */
.hero__waveform {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  padding: 0 var(--space-8);
  opacity: 0.15;
  pointer-events: none;
}

.hero__waveform-bar {
  width: 4px;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  transform-origin: bottom center;
  animation: wave-pulse var(--wave-duration, 1.5s) ease-in-out infinite;
  animation-delay: var(--wave-delay, 0s);
}

/* Content */
.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
  color: var(--color-text);
}

/* Staggered reveal animation */
.hero__content > * {
  opacity: 0;
  animation: hero-reveal 0.8s ease-out forwards;
}

.hero__content > *:nth-child(1) { animation-delay: 0.1s; }
.hero__content > *:nth-child(2) { animation-delay: 0.25s; }
.hero__content > *:nth-child(3) { animation-delay: 0.4s; }
.hero__content > *:nth-child(4) { animation-delay: 0.55s; }
.hero__content > *:nth-child(5) { animation-delay: 0.7s; }

/* Title - Display font with glow, espacement aéré */
.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: var(--font-black);
  line-height: 1.1;
  letter-spacing: 0.02em;
  word-spacing: 0.06em;
  margin-bottom: var(--space-4);
  text-shadow: 0 0 80px rgba(107, 63, 255, 0.3);
}

.hero__title-gradient {
  display: block;
  background: var(--gradient-audio);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Subtitle */
.hero__subtitle {
  font-size: var(--text-2xl);
  color: var(--color-text-muted);
  max-width: 600px;
}

/* Hero badge */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.hero__badge-icon {
  width: 16px;
  height: 16px;
  color: var(--color-accent);
}

/* CTA container */
.hero__cta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
}

/* Demo button */
.btn-demo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-text);
  font-weight: var(--font-medium);
  font-size: 15px;
  cursor: pointer;
  transition: transform var(--transition-fast),
              background var(--transition-fast),
              border-color var(--transition-fast);
}

.btn-demo:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--color-text);
}

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

.btn-demo:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 3px;
}

.icon-play {
  width: 18px;
  height: 18px;
}

/* Animations */
@keyframes hero-reveal {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes wave-pulse {
  0%, 100% {
    transform: scaleY(0.3);
    opacity: 0.6;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* Responsive */
@media (min-width: 768px) {
  .hero {
    padding: var(--space-12) var(--space-8) var(--space-10);
    min-height: 50vh;
  }

  .hero__subtitle {
    font-size: var(--text-3xl);
  }

  .hero__blob--top-right {
    width: 600px;
    height: 600px;
  }

  .hero__blob--bottom-left {
    width: 550px;
    height: 550px;
  }
}

@media (min-width: 1024px) {
  .hero {
    min-height: 55vh;
  }

  .hero__blob--center {
    width: 800px;
    height: 800px;
  }
}

/* ============================================
   Hero Demo - Icone animee + typewriter
   ============================================ */

.hero__demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.hero__demo-icon {
  flex-shrink: 0;
}

.hero__demo-text {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-3) var(--space-4);
  min-height: 48px;
  min-width: 240px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  backdrop-filter: blur(8px);
}

.hero__demo-phrase {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: var(--leading-normal);
  min-height: 1.5em;
  font-family: var(--font-sans);
}

/* Curseur clignotant pendant la frappe */
.hero__demo-phrase.hero__demo-typing::after {
  content: '|';
  color: var(--color-magenta);
  font-weight: var(--font-bold);
  animation: heroCursorBlink 0.6s steps(2) infinite;
}

@keyframes heroCursorBlink {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* Mot-cle "Maestro" en couleur accent */
.hero__demo-maestro {
  color: var(--color-accent);
  font-weight: var(--font-semibold);
}

/* Highlight de correction semantique */
.hero__demo-highlight {
  padding: 0 2px;
  margin: 0 -2px;
  border-radius: var(--radius-sm, 4px);
  background: transparent;
  transition: background 0.3s ease;
}

.hero__demo-highlight--active {
  background: rgba(107, 63, 255, 0.2);
}

/* Cross-fade vers le texte corrige */
.hero__demo-correcting {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Lignes de transcription (dicte / ecrit) */
.hero__demo-line {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.hero__demo-line-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  align-self: center;
}

.hero__demo-line-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 48px;
}

.hero__demo-line--dictated .hero__demo-line-text {
  color: var(--color-text-faint);
}

.hero__demo-line--written .hero__demo-line-text {
  color: var(--color-text);
  font-weight: var(--font-medium);
}

/* Curseur clignotant sur les lignes de transcription */
.hero__demo-line-text.hero__demo-typing::after {
  content: '|';
  color: var(--color-magenta);
  font-weight: var(--font-bold);
  animation: heroCursorBlink 0.6s steps(2) infinite;
}

/* Zone action : chips et pipeline */
.hero__demo-action {
  min-height: 0;
}

/* Nom de la Smart Action */
.hero__demo-sa-name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

/* Pipeline d'etapes (chips + fleches) */
.hero__demo-pipeline {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.hero__demo-pipeline .sa-recipe__arrow {
  flex-shrink: 0;
}

.hero__demo-chip {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hero__demo-chip--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fade-out du contenu */
.hero__demo-fadeout {
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* Desktop : layout horizontal */
@media (min-width: 768px) {
  .hero__demo {
    flex-direction: row;
    justify-content: center;
    gap: var(--space-4);
  }

  .hero__demo-text {
    min-width: 320px;
    max-width: 480px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero__waveform-bar,
  .hero__content > * {
    animation: none;
  }

  .hero__content > * {
    opacity: 1;
  }

  .hero__waveform-bar {
    transform: scaleY(0.5);
  }

  .hero__demo-phrase.hero__demo-typing::after {
    animation: none;
    opacity: 1;
  }

  .hero__demo-chip {
    transition: none;
    opacity: 1;
    transform: none;
  }
}
