/* ==========================================================================
   Cabeçalho translúcido
   A barra tem exatamente a largura da régua do conteúdo (--content-w): a logo
   alinha com a margem esquerda das seções e o botão com a margem direita.
   O vidro avança --header-pad para fora, dando respiro aos itens.
   ========================================================================== */

.site-header {
  position: fixed;
  top: var(--header-top);
  right: 0;
  left: 0;
  z-index: 50;
}

.site-header__bar {
  position: relative;
  z-index: 2; /* acima do menu em tela cheia */
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: var(--content-w);
  height: var(--header-h);
  margin-inline: auto;
}

/* Vidro */
.site-header__bar::before {
  content: "";
  position: absolute;
  inset: 0 calc(-1 * var(--header-pad));
  z-index: -1;
  border: 1px solid rgb(234 241 255 / 0.07);
  border-radius: 20px;
  background:
    radial-gradient(60% 140% at 50% -60%, rgb(29 143 240 / 0.14), transparent 70%),
    linear-gradient(180deg, rgb(14 22 40 / 0.42), rgb(3 6 14 / 0.3));
  box-shadow:
    inset 0 1px 0 rgb(234 241 255 / 0.06),
    0 20px 50px -34px rgb(29 143 240 / 0.6);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  transition: background-color 0.4s var(--ease-out), border-color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

/* Reflexo azul na borda inferior */
.site-header__bar::after {
  content: "";
  position: absolute;
  right: 22%;
  bottom: 0;
  left: 22%;
  z-index: -1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(29 143 240 / 0.75), rgb(190 224 255 / 0.85), rgb(29 143 240 / 0.75), transparent);
  opacity: 0.55;
  transition: opacity 0.4s var(--ease-out);
}

.site-header.is-scrolled .site-header__bar::before,
.site-header.is-open .site-header__bar::before {
  border-color: rgb(234 241 255 / 0.11);
  background:
    radial-gradient(60% 140% at 50% -60%, rgb(29 143 240 / 0.16), transparent 70%),
    linear-gradient(180deg, rgb(10 17 32 / 0.78), rgb(3 6 13 / 0.7));
  box-shadow:
    inset 0 1px 0 rgb(234 241 255 / 0.07),
    0 24px 60px -30px rgb(0 0 0 / 0.9),
    0 20px 50px -34px rgb(29 143 240 / 0.7);
}

.site-header.is-scrolled .site-header__bar::after {
  opacity: 0.85;
}

/* Logo original em duas camadas (mesmas formas): o texto e o F, que gira no hover.
   O F ocupa 42,54% da largura da logo (gerado por tools/brand/build-brand.ps1). */
.site-header__brand {
  --logo-h: 34px;
  position: relative;
  display: block;
  flex: none;
  height: var(--logo-h);
  aspect-ratio: 4262 / 2566;
  border-radius: 6px;
  /* profundidade para o giro do F sobre o eixo horizontal (rotateX) */
  perspective: 90px;
  perspective-origin: 21% 50%;
}

/* Identificação: nome e função, ao lado da logo */
.site-header__id {
  display: grid;
  gap: 0.2rem;
  margin: 0 auto 0 0.35rem;
  padding-left: 0.95rem;
  border-left: 1px solid var(--line-strong);
  font-size: 0.6875rem;
  line-height: 1.1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-header__name {
  color: var(--frost);
  font-weight: 700;
}

.site-header__role {
  color: var(--mist);
  font-weight: 500;
}

.brand-logo__type {
  width: 100%;
  height: 100%;
}

/* O F é uma placa com espessura: face da frente, camadas azuis em profundidade e a face de
   trás. O conjunto gira em 3D (preserve-3d); nenhum filtro é aplicado ao conjunto, porque
   um filtro achataria a profundidade. */
.brand-logo__mark {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 42.54%;
  height: 100%;
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
}

.brand-logo__face,
.brand-logo__back,
.brand-logo__slab {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  backface-visibility: visible;
}

.brand-logo__face {
  transition: filter 0.35s var(--ease-out);
}

/* camadas da espessura: cópias do F tingidas de azul, cada vez mais escuras ao fundo */
.brand-logo__slab {
  filter: brightness(var(--b, 0.5)) sepia(1) hue-rotate(178deg) saturate(6);
}

.brand-logo__back {
  opacity: 0.78;
}

/* parado, só a face da frente aparece (a espessura surge durante o giro) */
.brand-logo__slab,
.brand-logo__back {
  visibility: hidden;
}

.site-header__brand.is-charged .brand-logo__slab,
.site-header__brand.is-charged .brand-logo__back {
  visibility: visible;
}

/* brilho discreto durante o giro */
.site-header__brand.is-charged .brand-logo__face {
  filter: drop-shadow(0 0 3px rgb(120 190 255 / 0.9)) drop-shadow(0 0 10px rgb(29 143 240 / 0.6));
}

/* canvas do traçado de energia e das faíscas em volta do F */
.brand-logo__fx {
  position: absolute;
  top: -18px;
  left: -18px;
  width: calc(42.54% + 36px);
  max-width: none;
  height: calc(100% + 36px);
  pointer-events: none;
}

.site-nav ul {
  display: flex;
  gap: 0.15rem;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0.5rem 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: rgb(234 241 255 / 0.72);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color 0.25s var(--ease-out), background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}

.site-nav a:hover {
  background: rgb(234 241 255 / 0.05);
  color: var(--frost);
}

/* Seção atual: pílula com borda e um leve brilho azul */
.site-nav a.is-active {
  border-color: rgb(234 241 255 / 0.1);
  background: linear-gradient(180deg, rgb(29 143 240 / 0.16), rgb(29 143 240 / 0.04));
  box-shadow: inset 0 1px 0 rgb(234 241 255 / 0.06);
  color: var(--frost);
}

.site-nav a:focus-visible {
  outline-offset: 2px;
}

.site-header__cta {
  margin-left: 0.5rem;
}

.site-header__cta-short {
  display: none;
}

/* Botão do menu (telas pequenas) */
.menu-toggle {
  display: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgb(234 241 255 / 0.03);
  transition: border-color 0.25s var(--ease-out);
}

.menu-toggle:hover {
  border-color: rgb(29 143 240 / 0.8);
}

.menu-toggle__lines {
  position: relative;
  display: block;
  width: 16px;
  height: 8px;
}

.menu-toggle__lines::before,
.menu-toggle__lines::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.3s var(--ease-out), top 0.3s var(--ease-out);
}

.menu-toggle__lines::before {
  top: 0;
}

.menu-toggle__lines::after {
  top: 6.5px;
}

.site-header.is-open .menu-toggle__lines::before {
  top: 3.25px;
  transform: rotate(45deg);
}

.site-header.is-open .menu-toggle__lines::after {
  top: 3.25px;
  transform: rotate(-45deg);
}

/* Menu em tela cheia */
.menu-panel {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding: calc(var(--header-top) + var(--header-h) + 2.75rem) var(--gutter) 2rem;
  overflow-y: auto;
  background:
    radial-gradient(80% 50% at 90% 0%, rgb(11 75 156 / 0.4), transparent 70%),
    radial-gradient(60% 40% at 0% 100%, rgb(21 109 220 / 0.14), transparent 70%),
    rgb(1 2 3 / 0.97);
}

.menu-panel[hidden] {
  display: none;
}

.menu-panel__links {
  display: grid;
  gap: 0.15rem;
  padding: 0;
  list-style: none;
}

.menu-panel__links a {
  display: inline-block;
  padding: 0.15rem 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 1.5rem + 6vw, 4rem);
  font-weight: 300;
  line-height: 1.08;
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}

.menu-panel__links a:hover {
  color: var(--volt-hi);
}

.menu-panel__foot {
  display: grid;
  gap: 1.25rem;
  justify-items: start;
  margin-top: auto;
}

@media (max-width: 960px) {
  .site-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
  }
}

/* Entre 961px e 1180px a navegação fica mais compacta para a identificação caber */
@media (min-width: 961px) and (max-width: 1180px) {
  .site-header__bar {
    gap: 0.5rem;
  }

  .site-header__id {
    padding-left: 0.75rem;
    letter-spacing: 0.12em;
  }

  .site-nav a {
    padding-inline: 0.7rem;
  }

  .site-header__cta {
    margin-left: 0.25rem;
  }
}

/* No celular a identificação não cabe ao lado do menu: ela aparece na Hero (.hero__intro) */
@media (max-width: 560px) {
  .site-header__id {
    display: none;
  }

  .site-header__brand {
    margin-right: auto;
  }
}

@media (max-width: 520px) {
  .site-header__brand {
    --logo-h: 30px;
  }

  .site-header__cta-long {
    display: none;
  }

  .site-header__cta-short {
    display: inline;
  }
}

@media (max-width: 360px) {
  .site-header__bar {
    gap: 0.5rem;
  }

  .site-header__cta {
    padding-inline: 0.8rem;
  }
}
