/*
  Hero — vídeo de fundo com scrubbing por scroll + menu simétrico (logo central),
  troca de idioma e CTA.
  A seção é alta (500vh) e o wrapper interno é sticky: o vídeo fica preso na tela
  enquanto o scroll avança/retrocede o playback (ver hero.js).
*/
.hero {
  position: relative;
  height: 500vh;               /* espaço de scroll para o scrubbing do vídeo */
  /* Sem background-color própria — o fundo vem do body (ver bg-swap.js). */
}

/* Wrapper que fica preso na tela durante o scroll da seção */
.hero__sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
}

/* Vídeo de fundo — currentTime controlado pelo scroll */
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Overlay escuro para legibilidade do texto sobre o vídeo */
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* O último stop termina na mesma cor de fundo da seção seguinte
     (--color-terra-mais-escura-bg), pra não haver corte entre as seções. */
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.35) 30%,
    rgba(0, 0, 0, 0.35) 70%,
    var(--color-terra-mais-escura-bg) 100%
  );
}

/* Gradiente com blur (frosted) na base — dá leitura aos highlights.
   A máscara faz o blur desvanecer para cima. */
.hero__sticky::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38%;
  z-index: 1;
  pointer-events: none;
  /* Mesma cor do overlay acima (não preto puro), pra a base ficar exatamente
     na cor de fundo da próxima seção. */
  background: linear-gradient(to top, rgba(32, 26, 24, 0.55) 0%, transparent 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to top, #000 30%, transparent 100%);
          mask-image: linear-gradient(to top, #000 30%, transparent 100%);
}

/* ══ Barra / menu sofisticado ══ */
.hero__bar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-8);
  width: 100%;
  padding: var(--sp-6) var(--grid-margin);
}

/* Nav (esquerda) */
.hero__nav { justify-self: start; }
.hero__list {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}
.hero__link {
  position: relative;
  color: var(--color-areia);
  text-transform: uppercase;
  padding-block: var(--sp-1);
  transition: color var(--t);
}
.hero__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background-color: var(--color-areia);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--t);
}
.hero__link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Logo (centro) */
.hero__logo {
  justify-self: center;
  display: block;
  height: 24px;
  aspect-ratio: 624.69 / 123.54;
  background-color: var(--color-areia);
  -webkit-mask: url('../../icons/11_Logotipo_HARA.svg') no-repeat center / contain;
          mask: url('../../icons/11_Logotipo_HARA.svg') no-repeat center / contain;
  transition: opacity var(--t);
}
.hero__logo:hover { opacity: 0.7; }

/* Ações (direita): idioma + CTA */
.hero__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}

/* Troca de idioma */
.hero__lang {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
.hero__lang-btn {
  position: relative;
  color: var(--color-areia);   /* sempre areia 100%; estado ativo via linha */
  background: transparent;
  border: none;
  text-transform: uppercase;
  padding: var(--sp-2);
}
/* Linha embaixo — sinaliza o idioma ativo (e aparece no hover) */
.hero__lang-btn::after {
  content: '';
  position: absolute;
  left: var(--sp-2);
  right: var(--sp-2);
  bottom: var(--sp-1);
  height: 1px;
  background-color: var(--color-areia);
  transform: scaleX(0);
  transition: transform var(--t);
}
.hero__lang-btn.is-active::after,
.hero__lang-btn:hover::after {
  transform: scaleX(1);
}
.hero__lang-sep { color: var(--color-areia); }

/* Botão CTA (pill) */
.hero__cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--sp-2) var(--sp-6);
  border: 1px solid var(--color-areia);
  border-radius: var(--radius-pill);
  color: var(--color-areia);
  font-weight: var(--weight-subtitle-strong);
  text-transform: uppercase;
  transition: background-color var(--t), color var(--t);
}
.hero__cta:hover {
  background-color: var(--color-areia);
  color: var(--color-bg);
}

/* ══ Conteúdo central ══ */
.hero__content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: var(--sp-6);
  padding-inline: var(--grid-margin);
}
.hero__headline {
  color: var(--color-areia);
}

/* Cada linha do título é revelada conforme o progresso do scroll (ver hero.js).
   nowrap: como cada linha é explícita, nenhuma pode quebrar sozinha. */
.hero__line {
  display: block;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(0.35em);
  transition: opacity 1.6s var(--ease), transform 1.6s var(--ease);
}
.hero__line.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ══ Rodapé: São Paulo/hora · scroll · ícone+temperatura ══ */
.hero__footer {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-6);
  padding: 0 var(--grid-margin) var(--sp-12);
  color: var(--color-areia);
}

/* Esquerda: São Paulo, horário (com ":" piscando) */
.hero__loc {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.4ch;
}

/* Centro: "Scroll" + seta pulsando */
.hero__scroll {
  justify-self: center;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  color: inherit;
  transition: opacity var(--t);
}
.hero__scroll:hover { opacity: 0.7; }
.hero__scroll-icon {
  width: 18px;
  height: 18px;
  animation: hero-scroll-bob 1.8s ease-in-out infinite;   /* seta pulsando p/ baixo */
}
@keyframes hero-scroll-bob {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50%      { transform: translateY(5px); opacity: 1; }
}

/* Direita: ícone (sol/gelo) + temperatura em tempo real */
.hero__temp {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
.hero__wx {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.hero__wx--ice { display: none; }
[data-weather].is-cold .hero__wx--sun { display: none; }
[data-weather].is-cold .hero__wx--ice { display: inline; }

/* Dois-pontos do relógio piscando a cada segundo (sinal de tempo real) */
.hara-colon {
  animation: hara-blink 1s ease-in-out infinite;
}
@keyframes hara-blink {
  50% { opacity: 0.15; }
}

/* Foco de teclado */
.hero__link:focus-visible,
.hero__logo:focus-visible,
.hero__lang-btn:focus-visible,
.hero__cta:focus-visible {
  outline: 2px solid var(--color-areia);
  outline-offset: 4px;
}

/* ══ SM ══ */
@media (max-width: 768px) {
  .hero__bar {
    grid-template-columns: auto 1fr;
    gap: var(--sp-4);
  }
  .hero__nav { display: none; }
  .hero__logo { justify-self: start; }
  .hero__actions {
    justify-self: end;
    gap: var(--sp-4);
  }
  .hero__cta { padding-inline: var(--sp-4); }
}
