/* ==========================================================================
   INSTITUTO REVIVER: HERO SCROLLYTELLING CINEMATOGRÁFICO
   Controle por Rolagem Vertical • Canvas com Atmosfera Quente e Tensão Editorial
   ========================================================================== */

/* --------------------------------------------------------------------------
   ESTADO INICIAL OCULTO (CSS-FIRST PARA EVITAR FOUC)
   Navbar e Informações do Hero iniciam ocultas no carregamento inicial
   -------------------------------------------------------------------------- */
body.scrolly-hero-active .top-utility-bar {
  display: none !important;
}

body.scrolly-hero-active .site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-24px);
  transition: opacity 850ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 850ms cubic-bezier(0.22, 1, 0.36, 1),
              visibility 850ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
  z-index: 1000;
}

body.scrolly-hero-active .hero-content-wrapper,
body.scrolly-hero-active .hero-pure-content {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-20px);
  transition: opacity 800ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 800ms cubic-bezier(0.22, 1, 0.36, 1),
              visibility 800ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

body.scrolly-hero-active .hero-brand-emblem,
body.scrolly-hero-active .hero-brand-symbol,
body.scrolly-hero-active .hero-badge,
body.scrolly-hero-active .hero-pure-content .eyebrow,
body.scrolly-hero-active .hero-title,
body.scrolly-hero-active .hero-description,
body.scrolly-hero-active .hero-actions {
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity 800ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

body.scrolly-hero-active .hero-scroll-indicator {
  opacity: 0.95;
  visibility: visible;
  pointer-events: auto;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   1. HERO CONTEÚDO CARREGADO (AO COMEÇAR A ROLAR A PÁGINA PARA BAIXO)
   Revela o logo oficial, título, subtítulo e botões de ação
   -------------------------------------------------------------------------- */
body.hero-content-revealed .hero-content-wrapper,
body.hero-content-revealed .hero-pure-content,
body.hero-content-revealed .hero-phase {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

body.hero-content-revealed .hero-brand-emblem,
body.hero-content-revealed .hero-brand-symbol,
body.hero-content-revealed .hero-badge {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition-delay: 50ms !important;
}

body.hero-content-revealed .hero-title {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition-delay: 150ms !important;
}

body.hero-content-revealed .hero-description {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition-delay: 260ms !important;
}

body.hero-content-revealed .hero-actions {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition-delay: 380ms !important;
}

/* --------------------------------------------------------------------------
   2. NAVBAR E TOPO REVELADOS (SOMENTE AO ROLAR A TELA PARA CIMA)
   -------------------------------------------------------------------------- */
body.navbar-revealed .top-utility-bar {
  display: none !important;
}

body.navbar-revealed .site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
  transition-delay: 0ms !important;
}

/* Compatibilidade com top-revealed */
body.top-revealed .top-utility-bar {
  display: none !important;
}
body.top-revealed .site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}
body.top-revealed .hero-content-wrapper,
body.top-revealed .hero-pure-content,
body.top-revealed .hero-phase {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}
body.top-revealed .hero-brand-emblem,
body.top-revealed .hero-brand-symbol,
body.top-revealed .hero-title,
body.top-revealed .hero-description,
body.top-revealed .hero-actions {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* --------------------------------------------------------------------------
   TEXTO MINIMALISTA NO HERO ("INSTITUTO REVIVER")
   Apenas o texto tipográfico puro em marrom escuro nobre, sem forma ou fundo
   -------------------------------------------------------------------------- */
.hero-brand-emblem {
  display: inline-block;
  margin: 0 auto 1.6rem;
  padding: 0;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.hero-brand-emblem::before,
.hero-brand-emblem::after {
  display: none !important;
  content: none !important;
}

.hero-brand-text {
  font-family: var(--font-sans);
  font-size: clamp(0.72rem, 0.92vw, 0.82rem);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--color-charcoal-soft); /* Marrom escuro refinado (#2B2622) */
  display: inline-block;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .hero-brand-emblem {
    margin-bottom: 1.2rem;
  }
  .hero-brand-text {
    font-size: 0.7rem;
    letter-spacing: 0.26em;
  }
}

.hero-scrollytelling {
  position: relative;
  height: 240vh;
  background-color: var(--color-ivory);
  z-index: 2;
  margin-bottom: 0 !important;
}

.hero-sticky-frame {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-ivory);
  will-change: transform;
}

/* Canvas de Alta Resolução */
.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* Overlay Suave de Iluminação Champagne */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(250, 247, 242, 0.08) 0%, rgba(250, 247, 242, 0.45) 85%);
  z-index: 2;
  pointer-events: none;
}

/* Container de Conteúdo Narrativo Editorial */
.hero-content-wrapper {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  pointer-events: none;
}

.hero-content-wrapper a,
.hero-content-wrapper button {
  pointer-events: auto;
}

/* Fases do Scrollytelling */
.hero-phase {
  position: absolute;
  max-width: 980px;
  opacity: 0;
  transform: translateY(35px) scale(0.97);
  transition: opacity 0.8s var(--ease-cinematic), transform 0.8s var(--ease-cinematic);
  pointer-events: none;
}

.hero-phase.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.hero-phase.exit {
  opacity: 0;
  transform: translateY(-30px) scale(1.02);
  pointer-events: none;
}

/* Emblema Superior do Hero */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-gold-dark);
  margin-bottom: 1.8rem;
  padding: 0.45rem 1.6rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--color-gold-hairline);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 15px rgba(28, 25, 23, 0.04);
}

.hero-badge::before {
  content: '✦';
  font-size: 0.65rem;
  color: var(--color-gold);
}

.hero-title {
  font-size: clamp(3rem, 6.4vw, 5.4rem);
  font-weight: 300;
  line-height: 1.1;
  color: var(--color-charcoal);
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.hero-title strong,
.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--color-gold-dark);
  font-family: var(--font-serif);
}

.hero-description {
  font-size: clamp(1.15rem, 1.9vw, 1.45rem);
  font-weight: 400;
  color: #000000;
  max-width: 820px;
  margin: 0 auto 2.8rem;
  line-height: 1.75;
  font-family: var(--font-serif);
  letter-spacing: 0.01em;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Indicador de Scroll Dinâmico */
.hero-scroll-indicator {
  position: absolute;
  bottom: 2.8rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  opacity: 0.85;
  transition: opacity 400ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 400ms cubic-bezier(0.22, 1, 0.36, 1),
              visibility 400ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
  cursor: pointer;
}

.hero-scroll-indicator.hidden,
body.scrolly-hero-active .hero-scroll-indicator.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translate(-50%, 14px) !important;
}

.hero-scroll-text {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-taupe);
  font-weight: 600;
}

.hero-scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--color-gold), transparent);
  position: relative;
  overflow: hidden;
}

.hero-scroll-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: var(--color-gold-dark);
  animation: scrollDownLuxury 2.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

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

/* Barra de Progresso em Ouro Fino */
.hero-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(201, 161, 87, 0.15);
  z-index: 4;
}

.hero-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-gold-light), var(--color-gold));
  transition: width 0.1s linear;
}

/* Transição Sem Espaço em Branco para Seção Apresentação */
#apresentacao {
  padding-top: 3.5rem !important;
  margin-top: 0 !important;
  position: relative;
  z-index: 3;
}

@media (max-width: 768px) {
  .hero-scrollytelling {
    height: 200vh !important;
    margin-bottom: 0 !important;
  }
  #apresentacao {
    padding-top: 2.2rem !important;
  }
}

/* Redução de Movimento (Acessibilidade WCAG) */
@media (prefers-reduced-motion: reduce) {
  body.scrolly-hero-active .site-header,
  body.scrolly-hero-active .hero-content-wrapper,
  body.scrolly-hero-active .hero-pure-content,
  body.scrolly-hero-active .hero-phase,
  body.scrolly-hero-active .hero-brand-emblem,
  body.scrolly-hero-active .hero-brand-symbol,
  body.scrolly-hero-active .hero-badge,
  body.scrolly-hero-active .hero-pure-content .eyebrow,
  body.scrolly-hero-active .hero-title,
  body.scrolly-hero-active .hero-description,
  body.scrolly-hero-active .hero-actions {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-scrollytelling {
    height: auto !important;
  }
  .hero-sticky-frame {
    position: relative !important;
    height: auto !important;
    min-height: 80vh !important;
    padding: 7rem 0 4rem !important;
    display: flex !important;
    align-items: center !important;
  }
  .hero-content-wrapper {
    position: relative !important;
    height: auto !important;
  }
  .hero-phase {
    position: relative !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }
  .hero-phase:not(#hero-phase-1) {
    display: none !important; /* Exibe a apresentação monumental sem confusão de sobreposição */
  }
  .hero-scroll-indicator,
  .hero-progress-bar {
    display: none !important;
  }
}
