/* Header + menu — hover com seta + texto que “gira/sobe”; highlight pill 100% */

#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: clamp(16px, 2.2vw, 28px) clamp(20px, 3.5vw, 48px);
  pointer-events: none;
  color: #000;
  font-family: "Aeonik", system-ui, Segoe UI, sans-serif;
}

#header-container {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: clamp(12px, 2vw, 28px);
  pointer-events: none;
}

/* frase central — mesma linha do logo e botões, peso normal */
#header-center {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* bloco colado à esquerda (junto do logo) */
  gap: clamp(10px, 1.2vw, 16px);
  min-width: 0;
  padding: 0 clamp(4px, 1vw, 12px) 0 0;
  pointer-events: none;
  z-index: 2;
}

/* separador | entre logo e frase */
#header-tagline-sep {
  flex: 0 0 auto;
  display: block;
  font-weight: 300;
  font-size: clamp(14px, 1.35vw, 18px);
  line-height: 1;
  color: rgba(0, 0, 0, 0.35);
  user-select: none;
  will-change: transform, opacity;
}

#header-tagline {
  margin: 0;
  margin-right: auto;
  max-width: min(560px, 46vw);
  min-width: 0;
  flex: 1 1 auto;
  font-family: inherit;
  font-weight: 400; /* sem negrito */
  font-size: clamp(12.5px, 1.2vw, 15.5px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-align: left;
  text-align-last: left;
  color: #111; /* preto no fundo claro */
  will-change: transform, opacity;
}

/* ainda no preloader: esconde a frase e o | */
html.is-preloading #header-tagline,
html.is-preloading #header-tagline-sep {
  opacity: 0;
}

/* fundo escuro (faixa das bolas / vídeo) → texto branco */
#header-center.--on-dark #header-tagline {
  color: #fff;
}

#header-center.--on-dark #header-tagline-sep {
  color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 900px) {
  #header-tagline {
    max-width: min(320px, 40vw);
    font-size: clamp(11.5px, 1.65vw, 13.5px);
  }
}

@media (max-width: 520px) {
  #header-tagline {
    max-width: min(200px, 38vw);
    font-size: 11px;
  }

  #header-tagline-sep {
    font-size: 13px;
  }
}

#header-logo {
  pointer-events: auto;
  display: flex;
  align-items: center;
  z-index: 3;
  text-decoration: none;
  color: #000;
}

/* padrão: logo escuro (fundo claro) */
#header-logo img {
  height: clamp(44px, 4.4vw, 64px);
  width: auto;
  display: block;
  transition: filter 0.25s ease;
  /* se a arte for colorida, força preto limpo no fundo claro */
  filter: none;
}

/* fundo escuro detectado → logo branco */
#header-logo.--on-dark {
  color: #fff;
}
#header-logo.--on-dark img {
  /* qualquer logo escuro vira branco */
  filter: brightness(0) invert(1);
}

#header-logo .header-logo-text {
  font-weight: 700;
  font-size: clamp(1.65rem, 2.6vw, 2.2rem);
  letter-spacing: -0.03em;
  color: inherit;
  transition: color 0.25s ease;
}

#header-right {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 3;
}

/* —— Fill laranja direcional (Som + Fale conosco; NÃO no Menu) —— */
.header-fill-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  --fill-origin: 50% 50%;
}

.header-fill-layer {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #ff6a00;
  transform: scaleX(0);
  transform-origin: var(--fill-origin);
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.1, 1);
  z-index: 0;
  pointer-events: none;
}

/* entrada pela esquerda/direita → scaleX; cima/baixo → scaleY */
.header-fill-btn[data-entry="left"] .header-fill-layer,
.header-fill-btn[data-entry="right"] .header-fill-layer {
  transform: scaleX(0);
  transform-origin: var(--fill-origin);
}
.header-fill-btn[data-entry="top"] .header-fill-layer,
.header-fill-btn[data-entry="bottom"] .header-fill-layer {
  transform: scaleY(0);
  transform-origin: var(--fill-origin);
}

.header-fill-btn:hover .header-fill-layer,
.header-fill-btn:focus-visible .header-fill-layer {
  transform: scaleX(1) scaleY(1);
}

.header-fill-btn[data-entry="left"]:hover .header-fill-layer,
.header-fill-btn[data-entry="right"]:hover .header-fill-layer,
.header-fill-btn[data-entry="left"]:focus-visible .header-fill-layer,
.header-fill-btn[data-entry="right"]:focus-visible .header-fill-layer {
  transform: scaleX(1);
}

.header-fill-btn[data-entry="top"]:hover .header-fill-layer,
.header-fill-btn[data-entry="bottom"]:hover .header-fill-layer,
.header-fill-btn[data-entry="top"]:focus-visible .header-fill-layer,
.header-fill-btn[data-entry="bottom"]:focus-visible .header-fill-layer {
  transform: scaleY(1);
}

/* conteúdo acima do fill */
.header-fill-btn > *:not(.header-fill-layer) {
  position: relative;
  z-index: 1;
}

/* —— Pill branco (Voltar + Falar com especialista) + fill laranja —— */
.header-pill-cta,
#header-right-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 44px;
  padding: 0 1rem 0 0.85rem;
  border-radius: 999px;
  border: none;
  background: #fff;
  color: #0a0a0a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s,
    color 0.25s ease;
}
/* afasta Voltar um pouco do botão de música */
#header-right-back-btn {
  margin-right: 6px;
}
.header-pill-cta:hover,
#header-right-back-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  color: #fff; /* texto / ícone brancos sobre o fill laranja */
}
.header-pill-cta:hover .header-pill-cta-icon,
.header-pill-cta:hover .header-pill-cta-dot {
  color: #fff;
}
/* seta do Voltar: só a cor muda — NUNCA background (vira bloco branco / “stop”) */
#header-right-back-btn:hover .header-right-back-icon {
  color: #fff;
  background: transparent !important;
  transform: translateX(-2px);
}
.header-pill-cta:hover .header-pill-cta-dot {
  background: #fff;
}
.header-pill-cta .header-pill-cta-icon,
#header-right-back-btn .header-right-back-icon {
  display: block;
  flex-shrink: 0;
  background: transparent;
  transition:
    color 0.25s ease,
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.header-pill-cta-text,
#header-right-back-btn-text {
  line-height: 1;
}
/* ponto do CTA (opcional) */
.header-pill-cta-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: 0.85;
}

/* —— Som —— */
#header-right-sound-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
}
#header-right-sound-btn:hover {
  transform: scale(1.06);
}
#header-right-sound-btn.is-playing {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
#header-right-sound-btn canvas {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 1;
}

/* —— Fale conosco —— */
#header-right-talk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 22px 0 20px;
  border: none;
  border-radius: 999px;
  background: #2a2d36;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#header-right-talk-btn:hover {
  transform: scale(1.02);
  /* cor vem do fill laranja — não troca o background base */
}
#header-right-talk-btn-text,
#header-right-talk-btn:hover #header-right-talk-btn-text {
  line-height: 1;
  position: relative;
  z-index: 1;
  transform: none !important;
  transition: color 0.25s !important; /* sem animação de posição */
}
#header-right-talk-btn-dot,
#header-right-talk-btn:hover #header-right-talk-btn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transform: none !important;
  transition: background 0.25s !important;
}

/* —— Menu / Fechar —— */
#header-right-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  min-width: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: background 0.25s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#header-right-menu-btn:hover {
  transform: scale(1.03);
}
#header-right-menu-btn.--opened {
  padding: 0 16px 0 14px;
  gap: 8px;
}
#header-right-menu-btn-close {
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
  display: flex;
  align-items: center;
  margin-top: -2px;
}
#header-right-menu-btn-dots {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.1, 1);
}
#header-right-menu-btn.--opened #header-right-menu-btn-dots {
  transform: rotate(90deg);
}
#header-right-menu-btn-dots i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

#header-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: default;
  pointer-events: auto;
}

/* —— Painel abertura —— */
#header-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(300px, calc(100vw - 40px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 4;
  pointer-events: none;
}

#header-menu-links,
#header-menu-login {
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}

#header-menu-links {
  transform: translate3d(0, 3.5em, 0) rotate(2.8deg);
  transition:
    transform 0.45s cubic-bezier(0.4, 0, 0.1, 1),
    opacity 0.4s cubic-bezier(0.4, 0, 0.1, 1);
  background: #ffffff;
  border-radius: 22px;
  padding: 12px 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#header-menu-login {
  transform: translate3d(0, 4.5em, 0) rotate(-2.2deg);
  transition:
    transform 0.48s 0.04s cubic-bezier(0.4, 0, 0.1, 1),
    opacity 0.42s 0.04s cubic-bezier(0.4, 0, 0.1, 1),
    background 0.25s ease;
}

#header-menu.--opened #header-menu-links,
#header-menu.--opened #header-menu-login {
  pointer-events: auto;
  opacity: 1;
  transform: translate3d(0, 0, 0) rotate(0deg);
}

#header-menu.--opened #header-menu-links {
  transition:
    transform 0.55s 0.02s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.45s 0.02s cubic-bezier(0.16, 1, 0.3, 1);
}

#header-menu.--opened #header-menu-login {
  transition:
    transform 0.58s 0.08s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.48s 0.08s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.25s ease;
}

/* ═══════════════════════════════════════════
   LINK hover: texto sobe + clone entra + seta
   - clone NÃO vaza em repouso (clip total)
   - item .--active NÃO anima no hover
   ═══════════════════════════════════════════ */

.header-menu-link {
  position: relative;
  display: block;
  width: 100%;
  padding: 1em 1.5em;
  line-height: 1;
  cursor: pointer;
  color: #111;
  background: transparent;
  border: none;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  overflow: hidden;
  border-radius: 999px;
  /* só clica com menu aberto (painel pai controla) */
  pointer-events: none;
}

#header-menu.--opened .header-menu-link:not(.is-active):not(.--active) {
  pointer-events: auto;
}

/* Início activo: ainda clicável → topo da home */
#header-menu.--opened .header-menu-link.is-home-active {
  pointer-events: auto;
  cursor: pointer;
}

/* highlight pill 100% arredondada — laranja no hover */
.header-menu-link-background {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #ff6a00;
  opacity: 0;
  transform: scale(0.85);
  transition:
    opacity 0.3s cubic-bezier(0.4, 0, 0.1, 1),
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/*
  Máscara de texto: altura FIXA = 1 linha.
  overflow:hidden + line-height travado = zero “cabecinha” do clone embaixo.
*/
.header-menu-link-inner {
  position: relative;
  display: block;
  height: 1.2em;
  line-height: 1.2em;
  overflow: hidden;
  padding-right: 2.1em;
  /* clip extra (Safari / subpixel) */
  clip-path: inset(0 0 0 0);
}

.header-menu-link-text,
.header-menu-link-text-clone {
  display: block;
  width: 100%;
  height: 1.2em;
  line-height: 1.2em;
  font-size: 1.05em;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.1, 1);
  will-change: transform;
}

/* linha visível */
.header-menu-link-text {
  position: relative;
  z-index: 1;
  transform: translate3d(0, 0, 0);
}

/* clone 100% fora da máscara (embaixo), invisível até o hover */
.header-menu-link-text-clone {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  /* 100% da altura da máscara = some por completo, sem “topo” sobrando */
  transform: translate3d(0, 100%, 0);
  pointer-events: none;
}

/* seta na ponta — só no hover dos NÃO selecionados */
.header-menu-link-svg {
  position: absolute;
  right: 0.2em;
  top: 50%;
  width: 1.35em;
  height: 1.35em;
  margin-top: -0.675em;
  transform: scale(0);
  opacity: 0;
  transition:
    transform 0.22s cubic-bezier(0.4, 0, 0.1, 1),
    opacity 0.2s;
  z-index: 2;
  pointer-events: none;
}

/* bolinha só no ativo — fica fixa, sem animação de hover */
.header-menu-link-dot {
  position: absolute;
  top: 50%;
  right: 1.45em;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: #111;
  z-index: 2;
  pointer-events: none;
}

/* ── HOVER: só se NÃO for o item selecionado ── */
@media (hover: hover) {
  .header-menu-link:not(.is-active):not(.--active):hover .header-menu-link-background {
    opacity: 0.18;
    transform: scale(1);
  }

  .header-menu-link:not(.is-active):not(.--active):hover .header-menu-link-text {
    transform: translate3d(0, -100%, 0);
  }

  .header-menu-link:not(.is-active):not(.--active):hover .header-menu-link-text-clone {
    transform: translate3d(0, 0, 0);
  }

  .header-menu-link:not(.is-active):not(.--active):hover .header-menu-link-svg {
    transform: scale(1);
    opacity: 1;
    transition:
      opacity 0.2s,
      transform 0.28s 0.06s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

/* ativo: SEM animação, SEM highlight — só bolinha preta fixa */
.header-menu-link.is-active,
.header-menu-link.is-active:hover,
.header-menu-link.--active,
.header-menu-link.--active:hover {
  cursor: default;
  pointer-events: none;
  transition: none !important;
  animation: none !important;
  background: transparent !important;
}
.header-menu-link.is-active .header-menu-link-background,
.header-menu-link.is-active:hover .header-menu-link-background {
  display: none !important;
  opacity: 0 !important;
}
.header-menu-link.is-active .header-menu-link-svg,
.header-menu-link.is-active .header-menu-link-text-clone {
  display: none !important;
}
.header-menu-link.is-active .header-menu-link-text,
.header-menu-link.is-active:hover .header-menu-link-text {
  transform: none !important;
  transition: none !important;
  animation: none !important;
}
.header-menu-link.is-active .header-menu-link-dot {
  background: #111 !important;
  transition: none !important;
  animation: none !important;
}

/* LOGIN — mesma animação dos itens (texto sobe + clone + seta) */
#header-menu-login {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 56px;
  padding: 0 24px;
  border: none;
  border-radius: 999px;
  background: #0d0d0f;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

/* máscara de 1 linha — sem vazar clone */
.header-menu-login-inner {
  position: relative;
  display: block;
  height: 1.2em;
  line-height: 1.2em;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  text-align: left;
  clip-path: inset(0 0 0 0);
}

.header-menu-login-text,
.header-menu-login-text-clone {
  display: block;
  height: 1.2em;
  line-height: 1.2em;
  white-space: nowrap;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.1, 1);
  will-change: transform;
}

.header-menu-login-text {
  position: relative;
  transform: translate3d(0, 0, 0);
}

.header-menu-login-text-clone {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate3d(0, 100%, 0);
  pointer-events: none;
}

/* seta: some e surge no hover (como nos links) */
.header-menu-login-svg {
  flex-shrink: 0;
  width: 1.35em;
  height: 1.35em;
  margin-left: 12px;
  transform: scale(0);
  opacity: 0;
  transition:
    transform 0.22s cubic-bezier(0.4, 0, 0.1, 1),
    opacity 0.2s;
}

@media (hover: hover) {
  #header-menu-login:hover .header-menu-login-text {
    transform: translate3d(0, -100%, 0);
  }

  #header-menu-login:hover .header-menu-login-text-clone {
    transform: translate3d(0, 0, 0);
  }

  #header-menu-login:hover .header-menu-login-svg {
    transform: scale(1);
    opacity: 1;
    transition:
      opacity 0.2s,
      transform 0.28s 0.06s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 812px) {
  #header-right-talk-btn {
    display: none;
  }
  #header-right {
    gap: 8px;
  }
  #header-right-sound-btn,
  #header-right-menu-btn {
    width: 42px;
    height: 42px;
  }
  #header-right-menu-btn {
    padding: 0;
  }
  #header-right-menu-btn-text {
    display: none;
  }
}
