/* ==========================================================================
   04 — SECTION PROJECTS (#projetos · "Bonds We're Proud Of") · v155
   - Fundo contínuo em Warm Stone (transparente sobre o WebGL global)
   - Cabeçalho alinhado à largura da secção de Serviços (60% desktop)
     com título à esquerda e barra de progresso preenchida no scroll à direita
   - Galeria full-bleed (100vw) em 2 linhas alinhadas estilo galeria de arte,
     rolando horizontalmente da extrema direita para a esquerda
   - Cards retangulares com nome do cliente e tags de serviço estilo iOS
     sobrepostos na base da imagem
   ========================================================================== */

#projetos.raju-projects {
  position: relative;
  width: 100%;
  background-color: transparent;
  color: var(--text-on-paper, #0a0518);
  z-index: 3;
}

#projetos .raju-projects-runway {
  position: relative;
  width: 100%;
  height: 460dvh;
  background-color: transparent;
}

#projetos .raju-projects-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100dvh;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: clamp(1rem, 2vh, 1.75rem);
  padding-block: clamp(1.5rem, 3.5vh, 4.25rem);
  box-sizing: border-box;
  overflow: hidden;
  background-color: transparent;
}

/* --------------------------------------------------------------------------
   CABEÇALHO — ALINHADO À LARGURA DE SERVIÇOS (60% DESKTOP)
   -------------------------------------------------------------------------- */
#projetos .raju-projects-header {
  width: 60%;
  max-width: 100%;
  margin-inline: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(1.5rem, 3vw, 3rem);
  flex-shrink: 0;
}

#projetos .raju-projects-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

#projetos .raju-projects-eyebrow {
  margin: 0;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(10, 5, 24, 0.52);
}

#projetos .raju-projects-title {
  margin: 0;
  font-family: var(--font-sans, "Mona Sans", sans-serif);
  font-size: clamp(1.65rem, min(2.65vw, 4.2dvh), 3.4rem);
  white-space: nowrap;
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: #0a0518;
}

#projetos .raju-projects-title em {
  font-family: var(--font-display, "Wittgenstein", serif);
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: -0.015em;
  color: #5e35ff;
}

/* Barra de navegação / progresso à direita preenchida no scroll */
#projetos .raju-projects-progress-wrap {
  width: min(280px, 34%);
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 0.35rem;
}

#projetos .raju-projects-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(10, 5, 24, 0.52);
}

#projetos .raju-projects-progress-pct {
  color: #0a0518;
  font-weight: 600;
}

#projetos .raju-projects-progress-track {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background-color: rgba(10, 5, 24, 0.12);
  overflow: hidden;
}

#projetos .raju-projects-progress-fill {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0a0518 0%, #5e35ff 100%);
  transform-origin: left center;
  transform: scaleX(0.02);
  will-change: transform;
}

/* --------------------------------------------------------------------------
   GALERIA FULL-BLEED (100VW) — 2 LINHAS ALINHADAS ESTILO GALERIA DE ARTE
   -------------------------------------------------------------------------- */
#projetos .raju-projects-viewport {
  width: 100%;
  flex: 0 1 auto;
  overflow: hidden;
  padding-block: 0.35rem 0.75rem;
}

#projetos .raju-projects-track {
  --card-h: clamp(300px, min(75dvh, calc(100dvh - 155px)), 1350px);
  --card-w: calc(var(--card-h) * 0.64);
  display: grid;
  grid-template-rows: var(--card-h);
  grid-auto-flow: column;
  grid-auto-columns: var(--card-w);
  gap: calc(var(--card-h) * 0.055);
  width: max-content;
  will-change: transform;
  transform: translate3d(100vw, 0, 0);
}

/* Card retangular estilo galeria de arte */
#projetos .raju-proj-card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #100921;
  text-decoration: none;
  color: inherit;
  box-shadow: none;
  container-type: inline-size;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

#projetos .raju-proj-card:hover {
  box-shadow: none;
}

#projetos .raju-proj-media {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #100921;
}

/* Camada de fundo: cópia da própria mídia do card que vira Gaussian Blur no hover */
#projetos .raju-proj-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  transform: scale(1.04);
  filter: blur(0px) brightness(1) saturate(1);
  transition:
    filter 1.15s cubic-bezier(0.33, 0, 0.15, 1),
    transform 1.15s cubic-bezier(0.33, 0, 0.15, 1);
  will-change: filter, transform;
  pointer-events: none;
}

#projetos .raju-proj-card:hover .raju-proj-backdrop,
#projetos .raju-proj-card:focus-visible .raju-proj-backdrop {
  transform: scale(1.12);
  filter: blur(20px) brightness(0.8) saturate(1.1);
}

/* Camada principal (capa): faz zoom out para 70% centralizada no retângulo no hover */
#projetos .raju-proj-fg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  transform-origin: center center;
  transform: scale(1);
  transition: transform 1.15s cubic-bezier(0.33, 0, 0.15, 1);
  will-change: transform;
}

#projetos .raju-proj-card:hover .raju-proj-fg,
#projetos .raju-proj-card:focus-visible .raju-proj-fg {
  transform: scale(0.78);
}

#projetos .raju-proj-img,
#projetos .raju-proj-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Sem controles nativos nos vídeos de projeto */
#projetos .raju-proj-video::-webkit-media-controls,
#projetos .raju-proj-video::-webkit-media-controls-enclosure,
#projetos .raju-proj-video::-webkit-media-controls-panel,
#projetos .raju-proj-video::-webkit-media-controls-play-button,
#projetos .raju-proj-video::-webkit-media-controls-start-playback-button {
  display: none !important;
  opacity: 0 !important;
  -webkit-appearance: none !important;
}

/* Arte editorial de placeholder enquanto a mídia real não é subida no CMS */
#projetos .raju-proj-art {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--proj-bg, linear-gradient(140deg, #160d30 0%, #0a0518 100%));
  overflow: hidden;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

#projetos .raju-proj-art::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: var(--proj-glow, radial-gradient(circle at 75% 25%, rgba(168, 198, 57, 0.24), transparent 55%));
  pointer-events: none;
}

#projetos .raju-proj-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(229, 228, 222, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(229, 228, 222, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 68% 34%, black 15%, transparent 78%);
  pointer-events: none;
}

#projetos .raju-proj-art-index {
  position: absolute;
  top: clamp(0.85rem, 1.4vw, 1.25rem);
  right: clamp(0.95rem, 1.5vw, 1.35rem);
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: rgba(229, 228, 222, 0.45);
}

/* --------------------------------------------------------------------------
   BASE SOBREPOSTA NO CARD — NOME DO CLIENTE + TAGS ESTILO iOS
   -------------------------------------------------------------------------- */
#projetos .raju-proj-overlay {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 2;
  padding: clamp(1.75rem, 11cqi, 4.75rem) clamp(1rem, 5.2cqi, 2.75rem) clamp(0.95rem, 4.8cqi, 2.5rem);
  background: linear-gradient(
    to top,
    rgba(10, 5, 24, 0.84) 0%,
    rgba(10, 5, 24, 0.46) 52%,
    rgba(10, 5, 24, 0) 100%
  );
  display: flex;
  flex-direction: column;
  gap: clamp(0.45rem, 2.2cqi, 1.15rem);
  pointer-events: none;
}

#projetos .raju-proj-client {
  margin: 0;
  font-family: var(--font-sans, "Mona Sans", sans-serif);
  font-size: clamp(1.05rem, 5.2cqi, 2.55rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #f6f5f0;
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.28em;
  row-gap: 0.05em;
}

/* Efeito caça-níquel (slot-machine roll) no nome do cliente no mesmo lugar */
#projetos .raju-slot-word {
  display: inline-flex;
  white-space: nowrap;
}

#projetos .raju-slot-char {
  display: inline-block;
  position: relative;
  height: 1.15em;
  line-height: 1.15em;
  overflow: hidden;
  vertical-align: top;
}

#projetos .raju-slot-reel {
  display: flex;
  flex-direction: column;
  transform: translate3d(0, 0, 0);
  transition: transform 0.56s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--char-i, 0) * 22ms);
  will-change: transform;
}

#projetos .raju-slot-reel > span {
  display: block;
  height: 1.15em;
  line-height: 1.15em;
}

#projetos .raju-proj-card:hover .raju-slot-reel,
#projetos .raju-proj-card:focus-visible .raju-slot-reel {
  transform: translate3d(0, -1.15em, 0);
}

#projetos .raju-proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.32rem, 1.4cqi, 0.72rem);
}

/* Tags de serviço estilo iOS (frosted translucent pills) */
#projetos .raju-proj-tag {
  display: inline-flex;
  align-items: center;
  padding: clamp(0.24rem, 1.05cqi, 0.56rem) clamp(0.58rem, 2.5cqi, 1.3rem);
  border-radius: 999px;
  font-family: var(--font-sans, "Mona Sans", sans-serif);
  font-size: clamp(0.64rem, 2.4cqi, 1.12rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px) saturate(165%);
  -webkit-backdrop-filter: blur(14px) saturate(165%);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

/* --------------------------------------------------------------------------
   RESPONSIVIDADE MOBILE (<= 900px)
   -------------------------------------------------------------------------- */
@media (min-width: 901px) and (max-width: 1240px) {
  #projetos .raju-projects-header {
    width: min(84%, 1060px);
  }
}

@media (max-width: 900px) {
  #projetos .raju-projects-runway {
    height: 380svh;
  }

  #projetos .raju-projects-sticky {
    height: 100dvh;
    min-height: 100dvh;
    gap: 1.15rem;
    padding-block: 1.5rem 2rem;
  }

  #projetos .raju-projects-header {
    width: 100%;
    padding-inline: clamp(1.5rem, 6.5vw, 2.25rem);
    box-sizing: border-box;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  #projetos .raju-projects-title {
    font-size: clamp(1.7rem, 7.6vw, 2.35rem);
  }

  #projetos .raju-projects-progress-wrap {
    width: 100%;
    min-width: 0;
    padding-bottom: 0;
  }

  #projetos .raju-projects-track {
    --card-h: clamp(260px, min(59dvh, calc(82vw / 0.64)), 560px);
    --card-w: calc(var(--card-h) * 0.64);
    display: grid;
    grid-template-rows: var(--card-h);
    grid-auto-flow: column;
    grid-auto-columns: var(--card-w);
    gap: calc(var(--card-h) * 0.048);
  }
}

/* --------------------------------------------------------------------------
   TELAS BAIXAS / COMPACTAS DESKTOP (1366×768 · 1280×720) — v183
   Impede quebra de linha em "BONDS WE'RE Proud Of" e afasta cabeçalho do header fixo
   -------------------------------------------------------------------------- */
@media (min-width: 901px) and (max-width: 1480px) {
  #projetos .raju-projects-header {
    width: min(74%, 1140px);
    gap: clamp(1rem, 2vw, 2.2rem);
  }

  #projetos .raju-projects-title {
    font-size: clamp(1.55rem, 2.45vw, 2.65rem);
    white-space: nowrap;
  }

  #projetos .raju-projects-progress-wrap {
    width: min(220px, 28%);
    min-width: 150px;
  }
}

@media (min-width: 901px) and (max-height: 860px) {
  #projetos .raju-projects-sticky {
    min-height: 0;
    justify-content: flex-start;
    padding-top: max(5.6rem, 11.5dvh);
    padding-bottom: clamp(1rem, 2.2dvh, 1.75rem);
    gap: clamp(0.75rem, 1.8dvh, 1.35rem);
  }

  #projetos .raju-projects-track {
    --card-h: clamp(250px, calc(100dvh - max(5.6rem, 11.5dvh) - 6.8rem), 540px);
    --card-w: calc(var(--card-h) * 0.64);
  }
}

@media (max-width: 900px) {
  #projetos .raju-projects-title {
    white-space: normal;
  }
}
