/* ═══════════════════════════════════════════════════════════
   HERO INSTITUCIONAL
   Hero full-bleed com imagem de fundo, overlay e CTA central.
   Usado no index.html (site portfolio para cliente final).
   ═══════════════════════════════════════════════════════════ */

.hero-institutional {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;          /* svh = não pula com URL bar no Safari iOS */
  max-width: 100%;
  margin: 0;
  /* Navbar height + safe-area: garante espaço pra navbar acima do conteúdo */
  padding: calc(var(--navbar-height) + var(--space-8) + env(safe-area-inset-top, 0))
           var(--section-padding-x)
           var(--space-16);
  display: flex;
  flex-direction: column;
  align-items: center;        /* centro horizontal */
  justify-content: center;     /* centro vertical */
  text-align: center;          /* tudo dentro fica centralizado */
  overflow: hidden;
  isolation: isolate;
}

/* Background image full-bleed */
.hero-institutional__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-institutional__bg img,
.hero-institutional__bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Overlay radial centralizado: máscara escura que destaca a logo no centro */
.hero-institutional__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    /* faixa superior levemente escura → navbar/menu legível sobre áreas claras do vídeo */
    linear-gradient(180deg,
      rgba(13, 40, 24, 0.55) 0%,
      rgba(13, 40, 24, 0.18) 12%,
      rgba(13, 40, 24, 0)    26%),
    /* corpo: vídeo vibrante (quase sem verde) + fade pro verde sólido no rodapé */
    linear-gradient(180deg,
      rgba(13, 40, 24, 0.05) 0%,
      rgba(13, 40, 24, 0.06) 50%,
      rgba(13, 40, 24, 0.42) 80%,
      rgba(13, 40, 24, 0.78) 92%,
      rgba(13, 40, 24, 1)    100%);
}

/* Grid topográfico decorativo no overlay */
.hero-institutional__overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(168, 240, 216, 0.5) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(168, 240, 216, 0.5) 40px);
  animation: gridDrift 30s linear infinite;
}

/* ── Content (coluna centralizada com logo protagonista) ── */
.hero-institutional__content {
  max-width: 880px;
  width: 100%;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  animation: heroEnter 800ms var(--ease-out) both;
}

/* ═══════════════════════════════════════════════════════════
   LOGO PROTAGONISTA — animações de asas + shimmer + glow
   ═══════════════════════════════════════════════════════════ */

.hero-institutional__logo {
  width: clamp(240px, 32vw, 420px);
  height: auto;
  margin-bottom: var(--space-2);
  /* Glow pulsante geral em toda a logo */
  animation: heroLogoGlow 4s ease-in-out infinite;
}

@keyframes heroLogoGlow {
  0%, 100% {
    /* contorno escuro justo (legibilidade sobre vídeo claro) + profundidade + glow verde */
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.9))
            drop-shadow(0 8px 32px rgba(0, 0, 0, 0.5))
            drop-shadow(0 0 22px rgba(29, 158, 117, 0.35));
  }
  50% {
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.9))
            drop-shadow(0 8px 32px rgba(0, 0, 0, 0.5))
            drop-shadow(0 0 44px rgba(29, 158, 117, 0.65));
  }
}

/* ── ASAS — spread on load + hover contínuo ──────────────── */

/* Asa ESQUERDA: começa comprimida (se origina do lado direito, onde encosta no A)
   e se abre para fora (esquerda) com fade-in. */
.hero-logo__wing--left {
  transform-origin: 100% 50%;
  animation:
    wingSpreadLeft 1.4s cubic-bezier(0.16, 1, 0.3, 1) 200ms both,
    wingHover 6s ease-in-out 1.6s infinite;
}

/* Asa DIREITA: começa comprimida no lado esquerdo, abre pra direita. */
.hero-logo__wing--right {
  transform-origin: 0% 50%;
  animation:
    wingSpreadRight 1.4s cubic-bezier(0.16, 1, 0.3, 1) 200ms both,
    wingHover 6s ease-in-out 1.6s infinite;
}

@keyframes wingSpreadLeft {
  0%   { transform: scaleX(0.05) translateY(20px); opacity: 0; }
  40%  { opacity: 0.5; }
  100% { transform: scaleX(1) translateY(0);     opacity: 1; }
}

@keyframes wingSpreadRight {
  0%   { transform: scaleX(0.05) translateY(20px); opacity: 0; }
  40%  { opacity: 0.5; }
  100% { transform: scaleX(1) translateY(0);     opacity: 1; }
}

/* Hover sutil contínuo — asas "respirando" */
@keyframes wingHover {
  0%, 100% { transform: translateY(0)    scaleX(1); }
  50%      { transform: translateY(-3px) scaleX(1.02); }
}

/* ── PENAS — shimmer cascata (brilho percorrendo as asas) ── */

.hero-logo__feather {
  animation: featherShimmer 3.5s ease-in-out infinite;
  transform-origin: center;
}

/* Stagger cascata — cada pena pulsa com pequeno atraso */
.hero-logo__wing--left .hero-logo__feather:nth-child(1)  { animation-delay: 0s;    }
.hero-logo__wing--left .hero-logo__feather:nth-child(2)  { animation-delay: 0.12s; }
.hero-logo__wing--left .hero-logo__feather:nth-child(3)  { animation-delay: 0.24s; }
.hero-logo__wing--left .hero-logo__feather:nth-child(4)  { animation-delay: 0.36s; }
.hero-logo__wing--left .hero-logo__feather:nth-child(5)  { animation-delay: 0.48s; }
.hero-logo__wing--left .hero-logo__feather:nth-child(6)  { animation-delay: 0.60s; }
.hero-logo__wing--left .hero-logo__feather:nth-child(7)  { animation-delay: 0.72s; }

/* Lado direito em mirror — começa do mesmo delay para sincronia visual */
.hero-logo__wing--right .hero-logo__feather:nth-child(1) { animation-delay: 0s;    }
.hero-logo__wing--right .hero-logo__feather:nth-child(2) { animation-delay: 0.12s; }
.hero-logo__wing--right .hero-logo__feather:nth-child(3) { animation-delay: 0.24s; }
.hero-logo__wing--right .hero-logo__feather:nth-child(4) { animation-delay: 0.36s; }
.hero-logo__wing--right .hero-logo__feather:nth-child(5) { animation-delay: 0.48s; }
.hero-logo__wing--right .hero-logo__feather:nth-child(6) { animation-delay: 0.60s; }
.hero-logo__wing--right .hero-logo__feather:nth-child(7) { animation-delay: 0.72s; }

@keyframes featherShimmer {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 0 transparent); }
  50%      { filter: brightness(2.2) drop-shadow(0 0 4px rgba(168, 240, 216, 0.8)); }
}

/* ── LETRA A — desenho on load (stroke draw-in) ──────────── */

.hero-logo__letter path,
.hero-logo__letter line {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: letterDraw 1.2s cubic-bezier(0.65, 0, 0.35, 1) 500ms forwards;
}

.hero-logo__letter line { animation-delay: 1.1s; }

@keyframes letterDraw {
  to { stroke-dashoffset: 0; }
}

/* ── WORDMARK — fade-in suave depois do A ────────────────── */

.hero-logo__wordmark {
  opacity: 0;
  animation: wordmarkFade 600ms ease-out 1.6s forwards;
}

@keyframes wordmarkFade {
  from { opacity: 0; letter-spacing: 16px; }
  to   { opacity: 1; letter-spacing: 8px;  }
}

/* Respeita usuários que pedem menos movimento */
@media (prefers-reduced-motion: reduce) {
  .hero-institutional__logo,
  .hero-logo__wing--left,
  .hero-logo__wing--right,
  .hero-logo__feather,
  .hero-logo__letter path,
  .hero-logo__letter line,
  .hero-logo__wordmark {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
    stroke-dashoffset: 0 !important;
  }
}

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

.hero-institutional__overline {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--color-mint);
  margin-bottom: var(--space-5);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid rgba(168, 240, 216, 0.25);
  background: rgba(13, 40, 24, 0.4);
  backdrop-filter: blur(8px);
}

.hero-institutional__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 4.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -2px;
  color: var(--color-white);
  margin: 0;
  text-shadow: 0 4px 32px rgba(0, 0, 0, 0.4);
  max-width: 880px;
}

.hero-institutional__title em {
  color: var(--color-mint);
  font-style: normal;
}

.hero-institutional__subtitle {
  font-size: clamp(var(--fs-base), 2vw, var(--fs-xl));
  color: rgba(255, 255, 255, 0.85);
  max-width: 640px;
  margin-inline: auto;
  line-height: 1.55;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.hero-institutional__cta {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--space-2);
}

/* ── Scroll indicator ── */
.hero-institutional__scroll {
  position: absolute;
  bottom: var(--space-10);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  animation: scrollHint 2.5s ease-in-out infinite;
  z-index: 1;
}

.hero-institutional__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--color-electric-green), transparent);
}

/* ── KPI strip (abaixo dos CTAs, centralizado em linha) ── */
.hero-institutional__kpis {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(168, 240, 216, 0.1);
  flex-wrap: wrap;
  justify-content: center;
  animation: heroEnter 1000ms var(--ease-out) 400ms both;
}

.hero-institutional__kpi {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: rgba(168, 240, 216, 0.04);
  border: 1px solid rgba(168, 240, 216, 0.12);
  border-radius: var(--radius-full);
  transition: border-color var(--duration-normal) var(--ease-out),
              background var(--duration-normal) var(--ease-out);
}

.hero-institutional__kpi:hover {
  background: rgba(168, 240, 216, 0.08);
  border-color: rgba(29, 158, 117, 0.4);
}

.hero-institutional__kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(29, 158, 117, 0.2);
  color: var(--color-mint);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-institutional__kpi-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-institutional__kpi-value {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--color-white);
  line-height: 1;
}

.hero-institutional__kpi-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(168, 240, 216, 0.7);
  line-height: 1;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .hero-institutional {
    min-height: 100vh;
    min-height: 100svh;
    /* Navbar é transparente no topo do hero — não precisa reservar espaço pra ela.
       Só o safe-area do iOS pro notch. */
    padding-top: calc(var(--space-12) + env(safe-area-inset-top, 0));
    padding-bottom: var(--space-10);
  }
  .hero-institutional__content {
    max-width: 100%;
    gap: var(--space-5);
  }
  /* Logo MAIOR no mobile — protagonista da experiência */
  .hero-institutional__logo {
    width: clamp(260px, 70vw, 380px);
    margin-bottom: 0;
  }
  .hero-institutional__cta {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    margin-inline: auto;
  }
  .hero-institutional__cta .btn { width: 100%; justify-content: center; }
  .hero-institutional__scroll { display: none; }
}

@media (max-width: 480px) {
  .hero-institutional {
    padding-top: calc(var(--space-10) + env(safe-area-inset-top, 0));
    padding-bottom: var(--space-8);
    /* BUG 5 — Reduz gap pra evitar elementos espalhados */
    gap: var(--space-4);
  }
  /* BUG 5 — Conteúdo com gap controlado */
  .hero-institutional__content {
    gap: var(--space-4);
  }
  /* Logo BEM grande no mobile — primeiro impacto visual */
  .hero-institutional__logo {
    width: clamp(220px, 65vw, 280px);
    margin-bottom: 0;
  }
  .hero-institutional__overline {
    padding: var(--space-2) var(--space-3);
    font-size: 10px;
    letter-spacing: 2px;
    margin-bottom: var(--space-3);
  }
  .hero-institutional__title {
    font-size: clamp(1.625rem, 7vw, 2rem);
    margin-bottom: var(--space-3);
  }
  .hero-institutional__subtitle {
    font-size: var(--fs-base);
    max-width: 320px;
    margin-bottom: var(--space-4);
  }
  /* KPIs empilhados verticalmente em telas bem pequenas */
  .hero-institutional__kpis {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 280px;
    margin-inline: auto;
  }
  .hero-institutional__kpi { justify-content: center; }
}

/* BUG 5 — iPhone SE / telas muito pequenas */
@media (max-width: 360px) {
  .hero-institutional__logo {
    width: clamp(180px, 60vw, 240px);
  }
  .hero-institutional__title {
    font-size: clamp(1.4rem, 6.5vw, 1.75rem);
  }
}

/* 3.6 — Landscape phone (altura curta) — hero compacto, sem quebrar */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-institutional {
    min-height: auto;
    padding-top: calc(var(--space-6) + var(--safe-top, 0px));
    padding-bottom: var(--space-6);
    gap: var(--space-3);
  }
  .hero-institutional__content {
    gap: var(--space-3);
    max-width: 90%;
  }
  .hero-institutional__logo {
    width: clamp(140px, 25vh, 200px);
  }
  .hero-institutional__title {
    font-size: clamp(1.2rem, 4vh, 1.75rem);
  }
  .hero-institutional__subtitle {
    display: none;          /* economiza altura crítica */
  }
  .hero-institutional__kpis {
    display: none;          /* mesmo motivo */
  }
  .hero-institutional__scroll {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════
   SOCIAL PROOF + URGENCY (CRO)
   ═══════════════════════════════════════════════════════════ */

.hero-institutional__proof {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-5);
  background: rgba(13, 40, 24, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(168, 240, 216, 0.18);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.9);
}

.hero-institutional__proof-stars {
  color: #FFD700;
  letter-spacing: 2px;
  font-size: var(--fs-sm);
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}

.hero-institutional__proof-text strong {
  color: var(--color-mint);
  font-weight: 600;
}

/* Microcopy de urgência abaixo dos CTAs */
.hero-institutional__cta-note {
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.3px;
  margin: 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

@media (max-width: 480px) {
  .hero-institutional__proof {
    font-size: var(--fs-xs);
    padding: var(--space-2) var(--space-4);
  }
  .hero-institutional__proof-stars { font-size: var(--fs-xs); }
}
