/* ==========================================================================
   VW Presença Digital — Motion Styles & Lenis Integration
   css/motion.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Estilos Obrigatórios do Lenis (Scroll Suave)
   -------------------------------------------------------------------------- */

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   2. Estados Iniciais de Animação (APENAS sob a classe .js)
   Garante 100% de visibilidade caso o JavaScript falhe ou esteja desligado
   -------------------------------------------------------------------------- */

.js [data-reveal="fade-up"] {
  will-change: transform, opacity;
}

.js [data-reveal="lines"] {
  will-change: opacity;
}

.js .line-mask {
  overflow: clip;
  display: block;
}

.js .line-mask > span {
  display: block;
  transform: translateY(115%);
  will-change: transform;
}

.js [data-reveal="stagger"] > * {
  will-change: transform, opacity;
}

/* --------------------------------------------------------------------------
   3. Barra de Progresso Global & Telemetria de Scroll
   -------------------------------------------------------------------------- */

.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-ice) 100%);
  box-shadow: 0 0 14px rgba(187, 238, 248, 0.65);
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 9999;
  pointer-events: none;
  will-change: transform;
}

.scroll-telemetry {
  position: fixed;
  bottom: 1.75rem;
  left: 1.5rem;
  z-index: 85;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: rgba(6, 8, 11, 0.82);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

@media (min-width: 1180px) {
  .scroll-telemetry {
    display: inline-flex;
  }
}

.scroll-telemetry.is-active {
  opacity: 1;
  transform: translateY(0);
}

.scroll-telemetry-label {
  color: var(--text-secondary);
}

.scroll-telemetry-track {
  width: 36px;
  height: 2px;
  background: rgba(238, 240, 244, 0.14);
  position: relative;
  overflow: hidden;
}

.scroll-telemetry-fill {
  position: absolute;
  inset: 0;
  background: var(--accent-ice);
  transform-origin: left center;
  transform: scaleX(0);
}

.scroll-telemetry-val {
  color: var(--accent-ice);
  min-width: 3.2ch;
  text-align: right;
}

/* --------------------------------------------------------------------------
   4. Indicador de Rolagem no Hero (.hero-scroll-cue)
   -------------------------------------------------------------------------- */

.hero-bottom-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .hero-bottom-bar {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.hero-scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
  user-select: none;
}

.hero-scroll-cue-line {
  position: relative;
  width: 44px;
  height: 1px;
  background: rgba(238, 240, 244, 0.22);
  overflow: hidden;
}

.hero-scroll-cue-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 100%;
  background: var(--accent-ice);
  animation: scrollCuePulse 2.2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes scrollCuePulse {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(300%);
  }
}

/* --------------------------------------------------------------------------
   5. Manifesto Parallax & Barra de Leitura
   -------------------------------------------------------------------------- */

.manifesto-section {
  overflow: hidden;
}

.manifesto-bg-parallax {
  position: absolute;
  inset: -20% 0;
  background-image: url('/media/faixa-manifesto.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.13;
  filter: grayscale(40%) contrast(1.15);
  pointer-events: none;
  z-index: 1;
  will-change: transform;
}

.manifesto-word {
  will-change: opacity, transform, color;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.manifesto-word.is-highlight {
  color: var(--accent-ice);
  text-shadow: 0 0 28px rgba(187, 238, 248, 0.35);
}

.manifesto-progress-track {
  margin-top: var(--space-2xl);
  width: 100%;
  max-width: 320px;
  height: 1px;
  background: rgba(238, 240, 244, 0.12);
  position: relative;
  overflow: hidden;
}

.manifesto-progress-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-ice));
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
}

/* --------------------------------------------------------------------------
   6. Faixa Cinética Reativa à Velocidade (Velocity Marquee)
   -------------------------------------------------------------------------- */

.kinetic-marquee {
  position: relative;
  overflow: hidden;
  background-color: #070a0f;
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.1rem 0;
  user-select: none;
}

.kinetic-marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.kinetic-marquee-group {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  padding-right: 2.25rem;
}

.kinetic-marquee-item {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.kinetic-marquee-sep {
  color: var(--accent-ice);
  font-size: 0.65rem;
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
   7. Barra de Progresso da Vitrine Horizontal (Portfólio)
   -------------------------------------------------------------------------- */

.portfolio-progress-wrapper {
  margin-top: var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.portfolio-progress-track {
  flex-grow: 1;
  max-width: 420px;
  height: 2px;
  background: rgba(238, 240, 244, 0.12);
  position: relative;
  overflow: hidden;
}

.portfolio-progress-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-ice));
  transform-origin: left center;
  transform: scaleX(0.15);
  will-change: transform;
}

.portfolio-progress-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   8. Feixe de Luz Progressivo na Seção de Processo (#processo)
   -------------------------------------------------------------------------- */

.process-beam-track {
  width: 100%;
  height: 2px;
  background: rgba(238, 240, 244, 0.1);
  margin-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.process-beam-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-ice) 100%);
  box-shadow: 0 0 16px var(--accent-ice);
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
}

.process-step {
  transition: border-color 0.45s ease, box-shadow 0.45s ease, background-color 0.45s ease;
  will-change: transform, opacity;
}

.process-step::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-ice);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.process-step.is-lit {
  border-color: rgba(187, 238, 248, 0.32);
  background-color: rgba(16, 21, 28, 0.95);
  box-shadow: 0 18px 42px -10px rgba(0, 0, 0, 0.75), 0 0 28px -8px rgba(26, 114, 188, 0.25);
}

.process-step.is-lit::before {
  transform: scaleX(1);
}

.process-step .process-number {
  transition: color 0.45s ease, text-shadow 0.45s ease, transform 0.45s ease;
  display: inline-block;
  transform-origin: left center;
}

.process-step.is-lit .process-number {
  color: var(--accent-ice);
  text-shadow: 0 0 22px rgba(187, 238, 248, 0.45);
  transform: translateX(4px);
}

/* Profundidade 3D em Grids Reativos ao Scroll */
.problem-grid,
.niche-grid,
.process-grid {
  perspective: 1200px;
}

.problem-card,
.niche-card {
  will-change: transform, opacity;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

/* --------------------------------------------------------------------------
   9. Respeito Universal a prefers-reduced-motion (WCAG 2.1 AA)
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js [data-reveal],
  .js [data-reveal="fade-up"],
  .js [data-reveal="stagger"] > *,
  .js [data-reveal="lines"] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    visibility: visible !important;
  }

  .js .line-mask > span {
    transform: none !important;
  }

  .custom-cursor {
    display: none !important;
  }

  .hero-media-wrapper {
    transform: none !important;
    opacity: 0.45 !important;
  }
}

