/* ══════════════════════════════════════════
   HERO — vídeo curto em loop (cinemagrafia), tom escuro e acolhedor
   O poster WebP é o LCP; o vídeo entra por cima com fade quando começa a tocar.
══════════════════════════════════════════ */
#hero {
  position: relative;
  /* Cresce com o conteúdo em telas baixas e com zoom, sem invadir a nav fixa. */
  min-height: max(640px, 100vh);
  min-height: max(640px, 100svh);
  padding: 0 60px;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: #0b2624;
}

.hero-image,
.hero-video-el {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
}
.hero-image {
  z-index: 0;
  animation: heroImageScale 30s ease-in-out infinite alternate;
}
@keyframes heroImageScale {
  from { transform: scale(1.0); }
  to   { transform: scale(1.05); }
}
.hero-video-el {
  z-index: 1;
  opacity: 0;
  transition: opacity 1.8s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
#hero.is-playing .hero-video-el { opacity: 1; }
#hero.is-playing .hero-image { animation: none; }

/* Véu: escurece a base (leitura do texto) e o topo (leitura do logo e do menu) */
.hero-overlay {
  position: absolute; inset: 0; z-index: 2;
  background:
    linear-gradient(to top,
      rgba(0, 52, 47, 0.88) 0%,
      rgba(0, 52, 47, 0.58) 28%,
      rgba(0, 45, 41, 0.24) 58%,
      rgba(0, 40, 37, 0.10) 100%),
    linear-gradient(to bottom,
      rgba(0, 30, 27, 0.62) 0%,
      rgba(0, 30, 27, 0.30) 110px,
      rgba(0, 30, 27, 0) 260px);
}

.hero-grain {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: 0.35;
}

/* Logo e menu sobre o vídeo: sombra suave e véu no topo enquanto a nav está transparente */
#navbar:not(.scrolled) {
  background: linear-gradient(to bottom, rgba(0, 30, 27, 0.28), rgba(0, 30, 27, 0));
}
#navbar:not(.scrolled) .nav-logo { filter: drop-shadow(0 2px 12px rgba(0, 20, 18, 0.55)); }
#navbar:not(.scrolled) .nav-link-btn { color: rgba(248, 244, 239, 0.88); }

.hero-content {
  position: relative; z-index: 4;
  flex-shrink: 0;
  padding: 160px 60px 110px;
  max-width: 820px;
}
.hero-tag {
  font-family: 'Prompt', sans-serif;
  font-size: 0.66rem; font-weight: 500;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--verde-menta);
  margin-bottom: 30px;
  display: flex; align-items: center; gap: 16px;
  opacity: 0;
  animation: fadeUp 1s 0.3s forwards;
}
.hero-tag::before {
  content: '';
  display: block; width: 40px; height: 1px;
  background: var(--verde-menta);
  opacity: 0.7;
}

/* Título: Fraunces 300, palavra a palavra, entrando como se fosse escrito */
.hero-title {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-size: clamp(2.9rem, 6.4vw, 5.6rem);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--cream);
  margin-bottom: 30px;
  text-wrap: balance;
}
.hero-title .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.32em);
  filter: blur(10px);
  animation: wordIn 1.1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: calc(0.4s + var(--i, 0) * 0.16s);
}
@keyframes wordIn {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
.hero-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--verde-menta);
}
/* deriva lenta, no mesmo compasso do loop do vídeo (~10 s) */
#hero.is-playing .hero-title { animation: heroDrift 10s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate; }
@keyframes heroDrift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(0, -5px, 0); }
}

.hero-subtitle {
  font-family: 'Noto Sans', sans-serif;
  font-size: 0.92rem; font-weight: 300;
  letter-spacing: 0.02em;
  color: rgba(248, 244, 239, 0.74);
  max-width: 440px;
  line-height: 1.8;
  margin-bottom: 44px;
  opacity: 0;
  animation: fadeUp 1s 1.4s forwards;
}
.hero-actions {
  display: flex; align-items: center; gap: 40px;
  opacity: 0;
  animation: fadeUp 1s 1.7s forwards;
}

/* pausar/retomar o movimento (WCAG 2.2.2) — discreto, canto inferior direito */
.hero-pause {
  position: absolute; right: 60px; bottom: 30px; z-index: 5;
  display: none; align-items: center; gap: 8px;
  background: none; border: 1px solid rgba(248, 244, 239, 0.28); border-radius: 999px;
  padding: 8px 14px;
  font-family: 'Noto Sans', sans-serif; font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(248, 244, 239, 0.75);
  cursor: none;
  transition: color 0.3s, border-color 0.3s;
}
.hero-pause:hover, .hero-pause:focus-visible { color: var(--cream); border-color: rgba(248, 244, 239, 0.7); outline: none; }
#hero.is-playing .hero-pause, #hero.is-paused .hero-pause { display: inline-flex; }
.hero-pause .lbl-pause { display: inline; } .hero-pause .lbl-play { display: none; }
#hero.is-paused .hero-pause .lbl-pause { display: none; } #hero.is-paused .hero-pause .lbl-play { display: inline; }
.btn-primary {
  display: inline-block;
  font-family: 'Noto Sans', sans-serif;
  font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  text-decoration: none;
  color: var(--verde-escuro);
  background: var(--cream);
  padding: 16px 40px;
  border-radius: 999px;
  transition: background 0.3s, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
}
.btn-primary:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 20, 18, 0.35); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: 'Noto Sans', sans-serif;
  font-size: 0.68rem; font-weight: 400;
  letter-spacing: 0.2em; text-transform: uppercase;
  text-decoration: none;
  color: rgba(248, 244, 239, 0.82);
  transition: color 0.3s;
}
.btn-ghost:hover { color: var(--verde-menta); }
.btn-ghost .arrow {
  width: 32px; height: 1px; background: currentColor;
  position: relative; transition: width 0.3s;
}
.btn-ghost:hover .arrow { width: 48px; }

/* indicador de rolagem */
.hero-scroll {
  position: absolute; right: 60px; bottom: 80px;
  z-index: 4;
  writing-mode: vertical-lr;
  font-size: 0.6rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(248, 244, 239, 0.4);
  display: flex; align-items: center; gap: 16px;
  opacity: 0;
  animation: fadeIn 1s 2.4s forwards;
}
.hero-scroll::after {
  content: '';
  display: block; width: 1px; height: 60px;
  background: linear-gradient(to bottom, rgba(185, 220, 210, 0.7), transparent);
  animation: scrollLine 2s 2.6s ease-in-out infinite;
}

@media (max-width: 900px) {
  #hero { min-height: 100svh; padding: 0 24px; }
  .hero-content { padding: 120px 24px 88px; max-width: 100%; }
  .hero-title { font-size: clamp(2.7rem, 12vw, 3.6rem); }
  .hero-image, .hero-video-el { object-position: 50% 40%; }
  .hero-actions { gap: 22px; }
  .hero-pause { right: 20px; bottom: 22px; padding: 7px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-image { animation: none; }
  .hero-video-el { transition: none; }
  .hero-title .w { opacity: 1; transform: none; filter: none; animation: none; }
  #hero.is-playing .hero-title { animation: none; }
  .hero-tag, .hero-subtitle, .hero-actions, .hero-scroll { opacity: 1; animation: none; }
  .hero-scroll::after { animation: none; }
}
