/* ==========================================================================
   00 — HEADER NAVIGATION (3-Zone Editorial Bar · Raju Studio v2 · v180)
   - Esquerda: Botão editorial circular só ícone (Scrapbook · frames/folhas)
   - Centro: Logo rajuˢᵗ centralizado com mix-blend-mode: exclusion real
   - Direita: Menu (ícone 2×2) + Let's Talk (Violeta + círculo Acid + ímã)
   - Mobile (<= 640px): Menu vira circular só ícone para manter o logo 100% central
   ========================================================================== */

#site-header.raju-header {
  position: static;
  pointer-events: none;
}

#site-header .raju-header-inner {
  position: static;
  pointer-events: none;
}

/* Botão Editorial Scrapbook à esquerda (só ícone frames/folhas, mesmo comportamento do Menu) */
#site-header .raju-nav-tag.raju-header-lab-btn {
  position: fixed;
  top: clamp(1.25rem, 2.4vh, 2.1rem);
  left: 20%;
  z-index: 40;
  pointer-events: auto;
  width: clamp(52px, 3.85vw, 62px);
  height: clamp(52px, 3.85vw, 62px);
  padding: 0;
  border-radius: 50%;
}

#site-header .raju-header-lab-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(20px, 1.55vw, 24px);
  height: clamp(20px, 1.55vw, 24px);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

#site-header .raju-header-lab-icon svg {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  display: block;
}

#site-header .raju-header-lab-icon .raju-lab-frame-back {
  transform-origin: center;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

#site-header .raju-header-lab-icon .raju-lab-frame-front {
  transform-origin: center;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

#site-header .raju-nav-tag.raju-header-lab-btn:hover .raju-lab-frame-back,
#site-header .raju-nav-tag.raju-header-lab-btn:focus-visible .raju-lab-frame-back {
  transform: translate(-1.4px, -1.2px) rotate(-6deg);
}

#site-header .raju-nav-tag.raju-header-lab-btn:hover .raju-lab-frame-front,
#site-header .raju-nav-tag.raju-header-lab-btn:focus-visible .raju-lab-frame-front {
  transform: translate(1.2px, 1px) rotate(4deg);
}

/* Estado ativo quando o visitante já está na página Scrapbook */
#site-header .raju-nav-tag.raju-header-lab-btn.is-active,
#site-header.is-on-light .raju-nav-tag.raju-header-lab-btn.is-active,
#site-header.is-on-dark .raju-nav-tag.raju-header-lab-btn.is-active {
  background-color: #a8c639;
  color: #0a0518;
}

/* Logo rajuˢᵗ centralizado — fixo no root stacking context para exclusion real */
#site-header .raju-header-logo {
  --logo-h: clamp(50px, 3.85vw, 66px);
  position: fixed;
  top: clamp(1.15rem, 2.2vh, 2rem);
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  z-index: 41;
  min-height: clamp(52px, 3.85vw, 62px);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  color: #ffffff;
  mix-blend-mode: exclusion;
  text-decoration: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

#site-header .raju-header-logo:hover {
  opacity: 0.85;
}

#site-header .raju-header-logo svg {
  height: var(--logo-h);
  width: calc(var(--logo-h) * 2.1357);
  max-width: none;
  max-height: none;
  flex-shrink: 0;
  display: block;
}

/* Grupo de botões à direita — sem blend mode */
#site-header .raju-header-nav {
  position: fixed;
  top: clamp(1.25rem, 2.4vh, 2.1rem);
  right: 20%;
  z-index: 40;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: clamp(0.65rem, 1vw, 1.1rem);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

body.is-preloading #site-header .raju-header-logo {
  opacity: 0;
  transform: translate3d(-50%, -10px, 0);
}

body.is-preloading #site-header .raju-header-lab-btn,
body.is-preloading #site-header .raju-header-nav {
  opacity: 0;
  transform: translate3d(0, -10px, 0);
}

/* Botões tag sólidos (Scrapbook + Menu) — onda líquida Acid no hover */
#site-header .raju-nav-tag {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: clamp(52px, 3.85vw, 62px);
  padding-inline: clamp(1.4rem, 1.95vw, 2rem);
  border-radius: 999px;
  border: none;
  box-shadow: none;
  background-color: #e5e4de;
  color: #0a0518;
  font-family: var(--font-sans, "Mona Sans", sans-serif);
  font-size: clamp(1.05rem, 1.2vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.35s ease,
    color 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Onda suave que sobe preenchendo o botão */
#site-header .raju-nav-tag::before,
#site-header .raju-nav-cta::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 108%;
  width: 230%;
  aspect-ratio: 1 / 1;
  border-radius: 43% 47% 44% 46% / 45% 42% 48% 45%;
  transform: translate(-50%, 0) rotate(0deg);
  z-index: -1;
  pointer-events: none;
  will-change: top, transform;
  transition:
    top 0.68s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.88s cubic-bezier(0.22, 1, 0.36, 1);
}

#site-header .raju-nav-tag::before {
  background-color: #a8c639;
}

#site-header .raju-nav-tag:hover::before,
#site-header .raju-nav-tag:focus-visible::before {
  top: -55%;
  transform: translate(-50%, 0) rotate(34deg);
}

#site-header .raju-nav-tag:hover,
#site-header .raju-nav-tag:focus-visible {
  color: #0a0518;
  transform: translateY(-1px);
  outline: none;
}

/* Botão Menu (ícone grid 2×2 de pontos) */
#site-header .raju-nav-menu-btn {
  gap: clamp(0.5rem, 0.72vw, 0.72rem);
  cursor: pointer;
}

#site-header .raju-nav-menu-icon,
#site-header .raju-nav-menu-label {
  position: relative;
  z-index: 1;
}

#site-header .raju-nav-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(15px, 1.15vw, 18px);
  height: clamp(15px, 1.15vw, 18px);
  flex-shrink: 0;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

#site-header .raju-nav-menu-icon svg {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  display: block;
}

#site-header .raju-nav-menu-btn:hover .raju-nav-menu-icon,
#site-header .raju-nav-menu-btn:focus-visible .raju-nav-menu-icon {
  transform: rotate(90deg);
}

/* Botão Let's Talk — Violeta (#5E35FF) + círculo Acid (#A8C639) no padrão;
   onda líquida Acid (#A8C639) + círculo Deep Indigo (#0A0518) no hover */
#site-header .raju-nav-cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: clamp(0.95rem, 1.35vw, 1.3rem);
  height: clamp(52px, 3.85vw, 62px);
  padding: 6px 6px 6px clamp(1.45rem, 2vw, 2rem);
  border-radius: 999px;
  border: none;
  box-shadow: none;
  background-color: #5e35ff;
  color: #ffffff;
  font-family: var(--font-sans, "Mona Sans", sans-serif);
  font-size: clamp(1.05rem, 1.2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  will-change: transform;
  transition:
    background-color 0.35s ease,
    color 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

#site-header .raju-nav-cta::before {
  background-color: #a8c639;
}

#site-header .raju-nav-cta:hover::before,
#site-header .raju-nav-cta:focus-visible::before {
  top: -55%;
  transform: translate(-50%, 0) rotate(34deg);
}

#site-header .raju-nav-cta-label,
#site-header .raju-nav-cta-circle {
  position: relative;
  z-index: 1;
}

#site-header .raju-nav-cta-circle {
  width: clamp(40px, 3vw, 50px);
  height: clamp(40px, 3vw, 50px);
  border-radius: 50%;
  background-color: #a8c639;
  color: #0a0518;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background-color 0.38s ease,
    color 0.38s ease,
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#site-header .raju-nav-cta-circle svg {
  width: clamp(18px, 1.35vw, 21px);
  height: clamp(18px, 1.35vw, 21px);
  display: block;
}

#site-header .raju-nav-cta:hover,
#site-header .raju-nav-cta:focus-visible {
  color: #ffffff;
  outline: none;
}

#site-header .raju-nav-cta:hover .raju-nav-cta-circle,
#site-header .raju-nav-cta:focus-visible .raju-nav-cta-circle {
  background-color: #0a0518;
  color: #a8c639;
  transform: translate(1.5px, -1.5px);
}

/* --------------------------------------------------------------------------
   MODO ESCURO EXPLÍCITO (ex.: Secção Projetos #projetos)
   -------------------------------------------------------------------------- */
#site-header.is-on-dark .raju-nav-tag {
  background-color: #0a0518;
  color: #e5e4de;
}

#site-header.is-on-dark .raju-nav-tag:hover,
#site-header.is-on-dark .raju-nav-tag:focus-visible {
  color: #0a0518;
}

#site-header.is-on-dark .raju-nav-cta {
  background-color: #5e35ff;
  color: #ffffff;
}

#site-header.is-on-dark .raju-nav-cta-circle {
  background-color: #a8c639;
  color: #0a0518;
}

#site-header.is-on-dark .raju-nav-cta:hover,
#site-header.is-on-dark .raju-nav-cta:focus-visible {
  color: #ffffff;
}

#site-header.is-on-dark .raju-nav-cta:hover .raju-nav-cta-circle,
#site-header.is-on-dark .raju-nav-cta:focus-visible .raju-nav-cta-circle {
  background-color: #0a0518;
  color: #a8c639;
}

/* --------------------------------------------------------------------------
   MODO SOBRE SUPERFÍCIES CLARAS / ACID (Serviços, About Us, Social, Scrapbook)
   -------------------------------------------------------------------------- */
#site-header.is-on-light .raju-nav-tag {
  background-color: #0a0518;
  color: #e5e4de;
}

#site-header.is-on-light .raju-nav-tag:hover,
#site-header.is-on-light .raju-nav-tag:focus-visible {
  color: #0a0518;
}

#site-header.is-on-light .raju-nav-cta {
  background-color: #5e35ff;
  color: #ffffff;
  border: none;
  box-shadow: none;
}

#site-header.is-on-light .raju-nav-cta-circle {
  background-color: #a8c639;
  color: #0a0518;
}

#site-header.is-on-light .raju-nav-cta:hover,
#site-header.is-on-light .raju-nav-cta:focus-visible {
  color: #ffffff;
}

#site-header.is-on-light .raju-nav-cta:hover .raju-nav-cta-circle,
#site-header.is-on-light .raju-nav-cta:focus-visible .raju-nav-cta-circle {
  background-color: #0a0518;
  color: #a8c639;
}

/* --------------------------------------------------------------------------
   RESPONSIVIDADE TABLET (901px – 1240px) & MOBILE (<= 900px / <= 640px / <= 410px)
   -------------------------------------------------------------------------- */
@media (min-width: 901px) and (max-width: 1240px) {
  #site-header .raju-nav-tag.raju-header-lab-btn {
    left: max(8%, calc((100% - 1060px) / 2));
  }

  #site-header .raju-header-logo {
    --logo-h: clamp(42px, 3.6vw, 54px);
  }

  #site-header .raju-header-nav {
    right: max(8%, calc((100% - 1060px) / 2));
  }
}

@media (max-width: 900px) {
  #site-header .raju-nav-tag.raju-header-lab-btn {
    top: max(0.95rem, env(safe-area-inset-top));
    left: clamp(1rem, 4.8vw, 2rem);
    width: 38px;
    height: 38px;
  }

  #site-header .raju-header-lab-icon {
    width: 17px;
    height: 17px;
  }

  #site-header .raju-header-logo {
    --logo-h: 32px;
    top: max(0.95rem, env(safe-area-inset-top));
    min-height: 38px;
  }

  #site-header .raju-header-nav {
    top: max(0.95rem, env(safe-area-inset-top));
    right: clamp(1rem, 4.8vw, 2rem);
    gap: 0.42rem;
  }

  #site-header .raju-nav-tag {
    height: 38px;
    padding-inline: 0.85rem;
    font-size: 0.82rem;
  }

  #site-header .raju-nav-tag.raju-nav-menu-btn {
    gap: 0.42rem;
  }

  #site-header .raju-nav-menu-icon {
    width: 14px;
    height: 14px;
  }

  #site-header .raju-nav-cta {
    height: 38px;
    gap: 0.48rem;
    padding: 3px 3px 3px 0.88rem;
    font-size: 0.82rem;
  }

  #site-header .raju-nav-cta-circle {
    width: 32px;
    height: 32px;
  }

  #site-header .raju-nav-cta-circle svg {
    width: 14px;
    height: 14px;
  }
}

/* Mobile (<= 640px): Menu vira circular só ícone 2×2 para o logo rajuˢᵗ ficar 100% centralizado */
@media (max-width: 640px) {
  #site-header .raju-nav-menu-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    gap: 0;
  }

  #site-header .raju-nav-menu-label {
    display: none;
  }

  #site-header .raju-nav-menu-icon {
    width: 15px;
    height: 15px;
  }

  #site-header .raju-header-logo {
    --logo-h: 28px;
  }
}

@media (max-width: 410px) {
  #site-header .raju-nav-tag.raju-header-lab-btn {
    left: 0.875rem;
    width: 34px;
    height: 34px;
  }

  #site-header .raju-header-lab-icon {
    width: 15px;
    height: 15px;
  }

  #site-header .raju-header-logo {
    --logo-h: 24px;
    min-height: 34px;
  }

  #site-header .raju-header-nav {
    right: 0.875rem;
    gap: 0.34rem;
  }

  #site-header .raju-nav-menu-btn {
    width: 34px;
    height: 34px;
  }

  #site-header .raju-nav-menu-icon {
    width: 14px;
    height: 14px;
  }

  #site-header .raju-nav-cta {
    height: 34px;
    gap: 0.34rem;
    padding: 3px 3px 3px 0.65rem;
    font-size: 0.72rem;
  }

  #site-header .raju-nav-cta-circle {
    width: 28px;
    height: 28px;
  }

  #site-header .raju-nav-cta-circle svg {
    width: 13px;
    height: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #site-header .raju-nav-tag::before,
  #site-header .raju-nav-cta::before {
    transition: top 0.2s ease;
  }
}

/* --------------------------------------------------------------------------
   BOTÃO FLUTUANTE DISCRETO "VOLTAR AO TOPO" (SÓ ÍCONE + ANEL DE PROGRESSO)
   - Aparece somente após sair da Hero (desativado no Scrapbook e com modais abertos)
   -------------------------------------------------------------------------- */
.raju-back-to-top {
  position: fixed;
  right: clamp(1.15rem, 2.6vw, 2.2rem);
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 39;
  width: 46px;
  height: 46px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background-color: rgba(10, 5, 24, 0.78);
  color: #e5e4de;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(10, 5, 24, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 14px, 0) scale(0.88);
  transition:
    opacity 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.28s ease,
    color 0.28s ease,
    visibility 0s linear 0.36s;
}

.raju-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
  transition:
    opacity 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.28s ease,
    color 0.28s ease,
    visibility 0s linear 0s;
}

.raju-back-to-top:hover,
.raju-back-to-top:focus-visible {
  background-color: #a8c639;
  color: #0a0518;
  transform: translate3d(0, -2px, 0) scale(1.04);
  outline: none;
}

.raju-btt-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}

.raju-btt-track {
  fill: none;
  stroke: rgba(229, 228, 222, 0.18);
  stroke-width: 1.6;
}

.raju-btt-progress {
  fill: none;
  stroke: #a8c639;
  stroke-width: 1.8;
  stroke-linecap: round;
  transition: stroke 0.25s ease;
}

.raju-back-to-top:hover .raju-btt-progress,
.raju-back-to-top:focus-visible .raju-btt-progress {
  stroke: #0a0518;
}

.raju-btt-arrow {
  position: relative;
  z-index: 1;
  width: 17px;
  height: 17px;
  display: block;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.raju-back-to-top:hover .raju-btt-arrow,
.raju-back-to-top:focus-visible .raju-btt-arrow {
  transform: translateY(-2px);
}

html.is-menu-modal-open .raju-back-to-top,
html.is-contact-modal-open .raju-back-to-top,
body.is-preloading .raju-back-to-top {
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 640px) {
  .raju-back-to-top {
    width: 42px;
    height: 42px;
    right: 1rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .raju-btt-arrow {
    width: 15px;
    height: 15px;
  }
}
