/* Creator: fundo do bloco "Sua marca em outro enquadramento", espaçamento entre
   blocos e animações do site inteiro. Carregado depois do CSS original. */

@property --cr-sweep {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

/* ================================================================ espaçamento */
.secao { padding-block: clamp(56px, 8vw, 104px) !important; }

/* Bloco "Sua marca": menos respiro no topo, mantém o espaço do planeta embaixo */
.hero-portal [data-gp-content] > div {
  padding-top: clamp(72px, 10vw, 120px) !important;
  padding-bottom: 24svh !important;
}

/* Fundo próprio do bloco (fica atrás do conteúdo) */
.hero-portal,
.hero-portal [data-gp-content] { background: transparent !important; }

/* ===================================================== fundo "Sua marca" (bg2) */
#cr-bg2 {
  position: absolute;
  left: 0;
  width: 100%;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
  background: #000;
  contain: strict;
}
#cr-bg2 > * { position: absolute; pointer-events: none; }

/* Faixa de cor: preto em cima, azul-grafite no meio, preto embaixo */
#cr-bg2 .b2-band {
  inset: 0;
  background: linear-gradient(to bottom, #000 0%, #000 34%, #0a1322 64%, #0c1830 76%, #050a14 90%, #000 100%);
}

/* Grade fina que desce devagar, com uma linha de luz azul passando */
#cr-bg2 .b2-grid {
  inset: 0 0 auto 0;
  height: 72%;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, .13) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, .13) 1px, transparent 1px);
  background-size: 3.5rem 3rem;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 55%, transparent 100%);
  animation: b2-grid 9s linear infinite;
}
@keyframes b2-grid { to { background-position: 0 3rem, 0 3rem; } }
#cr-bg2 .b2-scan {
  inset: 0 0 auto 0;
  height: 72%;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 55%, transparent 100%);
  overflow: hidden;
}
#cr-bg2 .b2-scan::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -30%;
  height: 30%;
  background: linear-gradient(to bottom, transparent, rgba(59, 130, 246, .10) 70%, rgba(147, 197, 253, .35) 99%, transparent);
  animation: b2-scan 7s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes b2-scan { 0% { top: -30%; } 70%, 100% { top: 110%; } }

/* Partículas (canvas) */
#cr-bg2 canvas { inset: 0; width: 100%; height: 100%; opacity: .9; }

/* Planeta: horizonte com borda azul, atmosfera e luz percorrendo a borda */
#cr-bg2 .b2-planet-wrap {
  inset: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 84%, transparent 99%);
  mask-image: linear-gradient(to bottom, #000 84%, transparent 99%);
}
#cr-bg2 .b2-planet,
#cr-bg2 .b2-atmo,
#cr-bg2 .b2-sweep {
  position: absolute;
  left: 50%;
  top: calc(100% - 17svh);
  width: 760px;
  height: 500px;
  transform: translateX(-50%);
  border-radius: 100%;
}
#cr-bg2 .b2-planet {
  background: radial-gradient(closest-side, #000 82%, #0b2a6b 89%, #2f6fe0 94%, #9cc7ff 98.5%, #eaf4ff 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
}
#cr-bg2 .b2-atmo {
  background: radial-gradient(closest-side, transparent 86%, rgba(59, 130, 246, .38) 96%, rgba(59, 130, 246, 0) 100%);
  transform: translateX(-50%) scale(1.09);
  filter: blur(18px);
  animation: b2-atmo 6s ease-in-out infinite;
}
@keyframes b2-atmo {
  0%, 100% { opacity: .65; transform: translateX(-50%) scale(1.08); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.11); }
}
#cr-bg2 .b2-sweep {
  background: conic-gradient(from var(--cr-sweep), transparent 0deg, rgba(255, 255, 255, .95) 10deg, rgba(147, 197, 253, .6) 22deg, transparent 48deg, transparent 360deg);
  -webkit-mask-image: radial-gradient(closest-side, transparent 95.2%, #000 98.4%, #000 99.6%, transparent 100%);
  mask-image: radial-gradient(closest-side, transparent 95.2%, #000 98.4%, #000 99.6%, transparent 100%);
  filter: blur(1.5px) drop-shadow(0 0 8px rgba(147, 197, 253, .9));
  animation: b2-sweep 7s linear infinite;
}
@keyframes b2-sweep { from { --cr-sweep: 230deg; } to { --cr-sweep: 590deg; } }

/* Laterais escurecidas para focar no centro */
#cr-bg2 .b2-vignette {
  inset: 0;
  background: radial-gradient(ellipse 90% 70% at 50% 45%, transparent 55%, rgba(0, 0, 0, .65) 100%);
}

@media (min-width: 768px) {
  #cr-bg2 .b2-grid { background-size: 6rem 5rem; }
  @keyframes b2-grid { to { background-position: 0 5rem, 0 5rem; } }
  #cr-bg2 .b2-planet, #cr-bg2 .b2-atmo, #cr-bg2 .b2-sweep {
    top: calc(100% - 19svh);
    width: 1150px;
    height: 560px;
  }
}
@media (min-width: 1024px) {
  #cr-bg2 .b2-planet, #cr-bg2 .b2-atmo, #cr-bg2 .b2-sweep {
    top: calc(100% - 21svh);
    width: 140%;
    height: 780px;
  }
}

/* ===================================================== barra de progresso */
#cr-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 70;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #1d4ed8, #3b82f6 40%, #93c5fd);
  box-shadow: 0 0 12px rgba(59, 130, 246, .8);
  pointer-events: none;
}

/* ===================================================== brilho que segue o mouse */
#cr-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 560px;
  height: 560px;
  margin: -280px 0 0 -280px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(59, 130, 246, .13), rgba(59, 130, 246, .04) 55%, transparent);
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s ease;
  will-change: transform;
}
#cr-cursor.on { opacity: 1; }

/* ============================================================ animações */
@media (prefers-reduced-motion: no-preference) {

  /* Surgir ao rolar (sistema original do site, mais intenso) */
  .rv-wait {
    opacity: 0;
    transform: translate3d(0, 64px, 0) scale(.96);
    filter: blur(10px);
  }
  .rv-go {
    transition:
      opacity 1s cubic-bezier(.16, 1, .3, 1) calc(var(--rv-delay, 0s) * 1.6),
      transform 1.2s cubic-bezier(.16, 1, .3, 1) calc(var(--rv-delay, 0s) * 1.6),
      filter 1s cubic-bezier(.16, 1, .3, 1) calc(var(--rv-delay, 0s) * 1.6) !important;
  }

  /* Títulos: revelados de baixo para cima, como uma cortina */
  .rv-wait .h2, .rv-wait.h2 { clip-path: inset(0 0 100% 0); transform: translateY(.35em); }
  .rv-go .h2, .rv-go.h2 {
    clip-path: inset(-10% -5% -25% -5%);
    transition:
      clip-path 1.3s cubic-bezier(.77, 0, .175, 1) calc(var(--rv-delay, 0s) * 1.6 + .1s),
      transform 1.3s cubic-bezier(.16, 1, .3, 1) calc(var(--rv-delay, 0s) * 1.6 + .1s);
  }

  /* Rótulos azuis: letras se aproximam */
  .rv-wait .rotulo, .rv-wait.rotulo { letter-spacing: .5em; opacity: 0; }
  .rv-go .rotulo, .rv-go.rotulo {
    transition: letter-spacing 1.4s cubic-bezier(.16, 1, .3, 1), opacity 1s ease;
  }

  /* Destaques (palavras em azul) acendem depois do título */
  .rv-go .destaque { animation: cr-destaque 1.6s cubic-bezier(.16, 1, .3, 1) .6s both; }
  @keyframes cr-destaque {
    from { text-shadow: 0 0 0 rgba(96, 165, 250, 0); }
    40% { text-shadow: 0 0 28px rgba(96, 165, 250, .85); }
    to { text-shadow: 0 0 0 rgba(96, 165, 250, 0); }
  }

  /* Bloco "Sua marca": cada linha entra em sequência quando chega na tela */
  .cr-sm .hero-fade {
    opacity: 0;
    transform: translate3d(0, 56px, 0);
    filter: blur(12px);
    animation: none !important;
  }
  .cr-sm.cr-on .hero-fade {
    opacity: 1;
    transform: none;
    filter: none;
    transition:
      opacity 1.1s cubic-bezier(.16, 1, .3, 1) calc(var(--d, 0) * 130ms),
      transform 1.3s cubic-bezier(.16, 1, .3, 1) calc(var(--d, 0) * 130ms),
      filter 1.1s cubic-bezier(.16, 1, .3, 1) calc(var(--d, 0) * 130ms);
  }

  /* Elementos marcados pelo script (cards, itens, fotos) */
  .cr-in {
    opacity: 0;
    transform: translate3d(0, 48px, 0) scale(.94);
    filter: blur(8px);
  }
  .cr-in.cr-on {
    opacity: 1;
    transform: none;
    filter: none;
    transition:
      opacity .9s cubic-bezier(.16, 1, .3, 1) var(--cr-d, 0s),
      transform 1.1s cubic-bezier(.16, 1, .3, 1) var(--cr-d, 0s),
      filter .9s cubic-bezier(.16, 1, .3, 1) var(--cr-d, 0s);
  }

  /* Fotos: abrem como uma janela e desfazem o zoom */
  .cr-photo { clip-path: inset(18% 8% 18% 8% round 24px); }
  .cr-photo img { scale: 1.28; }
  .cr-photo.cr-on {
    clip-path: inset(0 0 0 0 round 0);
    transition: clip-path 1.5s cubic-bezier(.77, 0, .175, 1) var(--cr-d, 0s);
  }
  .cr-photo.cr-on img { scale: 1; transition: scale 2s cubic-bezier(.16, 1, .3, 1) var(--cr-d, 0s); }

  /* Linha de luz que atravessa o topo de cada bloco quando ele chega */
  .cr-seam { position: relative; }
  .cr-seam::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    width: min(88%, 1100px);
    height: 1px;
    transform: translateX(-50%) scaleX(0);
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, .9) 30%, #dbeafe 50%, rgba(59, 130, 246, .9) 70%, transparent);
    box-shadow: 0 0 18px rgba(59, 130, 246, .7);
    opacity: 0;
    pointer-events: none;
    z-index: 2;
  }
  .cr-seam.cr-seam-on::after { animation: cr-seam 2.2s cubic-bezier(.16, 1, .3, 1) forwards; }
  @keyframes cr-seam {
    0% { transform: translateX(-50%) scaleX(0); opacity: 0; }
    25% { opacity: 1; }
    60% { transform: translateX(-50%) scaleX(1); opacity: .9; }
    100% { transform: translateX(-50%) scaleX(1); opacity: .16; }
  }

  /* Botão principal: brilho atravessando de tempos em tempos */
  .btn-primario {
    background-image: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, .38) 50%, transparent 62%);
    background-size: 260% 100%;
    background-repeat: no-repeat;
    background-position: 160% 0;
    animation: cr-shine 4.5s cubic-bezier(.45, 0, .55, 1) 1.5s infinite;
  }
  @keyframes cr-shine {
    0% { background-position: 160% 0; }
    35%, 100% { background-position: -60% 0; }
  }

  /* Cards: inclinação 3D acompanhando o mouse (só em computador) */
  @media (hover: hover) and (pointer: fine) {
    .cr-tilt {
      transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
      transition: transform .5s cubic-bezier(.16, 1, .3, 1), border-color .5s;
      transform-style: preserve-3d;
    }
    .cr-tilt.cr-tilting { transition: transform .12s linear, border-color .5s; }
    .btn { transition: translate .4s cubic-bezier(.16, 1, .3, 1), background-color .3s, color .3s, border-color .3s; }
  }
}

@media (prefers-reduced-motion: reduce) {
  #cr-bg2 *, #cr-bg2 *::after { animation: none !important; }
  #cr-cursor { display: none; }
}

/* ===================================================== Trabalhos → portfólio */
/* Os 4 cards "Em produção" saem; entra o painel com o botão do portfólio */
#trabalhos .container-site > .grid.grid-cols-1 { display: none !important; }

.cr-portfolio { align-items: center; }
.cr-portfolio .cr-pf-label { margin: 0; }
.cr-portfolio .cr-pf-title {
  margin: 0;
  font-size: clamp(1.5rem, 3.4vw, 2.25rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #fff;
}
.cr-portfolio .cr-pf-sub {
  margin: 0;
  max-width: 46ch;
  color: rgba(255, 255, 255, .62);
  font-size: clamp(.95rem, 1.6vw, 1.05rem);
  line-height: 1.6;
}
.cr-portfolio .cr-pf-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.cr-portfolio .cr-pf-tags li {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  color: rgba(255, 255, 255, .7);
  font-size: 12px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.cr-portfolio .cr-pf-btn {
  justify-self: start;
  gap: 10px;
  min-height: 52px;
  padding-inline: 28px;
  font-size: 15px;
  box-shadow: 0 0 0 1px rgba(147, 197, 253, .25) inset, 0 0 30px rgba(37, 99, 235, .45);
}
.cr-portfolio .cr-pf-btn .seta { display: inline-block; transition: transform .4s cubic-bezier(.16, 1, .3, 1); }
.cr-portfolio .cr-pf-btn:hover .seta,
.cr-portfolio .cr-pf-btn:focus-visible .seta { transform: translate(3px, -3px); }

@media (prefers-reduced-motion: no-preference) {
  .cr-portfolio .cr-pf-btn { animation: cr-shine 4.5s cubic-bezier(.45, 0, .55, 1) 1.5s infinite, cr-pf-glow 3.2s ease-in-out infinite; }
  @keyframes cr-pf-glow {
    0%, 100% { box-shadow: 0 0 0 1px rgba(147, 197, 253, .25) inset, 0 0 26px rgba(37, 99, 235, .38); }
    50% { box-shadow: 0 0 0 1px rgba(147, 197, 253, .4) inset, 0 0 44px rgba(59, 130, 246, .6); }
  }
}

@media (max-width: 767px) {
  .cr-portfolio .cr-pf-btn { justify-self: stretch; }
}
@media (min-width: 900px) {
  .cr-portfolio { grid-template-columns: 1fr auto; column-gap: 48px; }
  .cr-portfolio .cr-pf-btn { justify-self: end; }
}
