/* "Com o meu kit" em camadas 3D: placa com textura, palavra gigante atrás da cabeça, recorte da pessoa e interface na frente.
   Em loop, as camadas se separam no espaço, a cena gira e tudo volta a encaixar. Cores e fontes vêm do estilo sorteado (diferenca.css). */
@property --sep { syntax: "<number>"; inherits: true; initial-value: 0; }

.dif-kit.k3 { perspective: 260cqw; perspective-origin: 50% 42%; background: #05070C; }
.k3 .k3-cena { position: absolute; inset: 0; transform-style: preserve-3d; --sep: 0; }
.k3.toca .k3-cena { animation: k3-loop 9s cubic-bezier(.7, 0, .3, 1) 1.5s infinite; }
@keyframes k3-loop {
  0%, 10%   { --sep: 0; transform: rotateX(0) rotateY(0) scale(1); }
  30%       { --sep: 1; transform: rotateX(13deg) rotateY(-32deg) scale(.64); }
  52%       { --sep: 1; transform: rotateX(9deg) rotateY(26deg) scale(.64); }
  72%, 100% { --sep: 0; transform: rotateX(0) rotateY(0) scale(1); }
}

.k3 .k3-cam {
  position: absolute; inset: 0; border-radius: 17px; transform-style: preserve-3d;
  transform: translateZ(calc(var(--sep) * var(--d) * 56cqw));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, calc(var(--sep) * .55));
  background: rgba(255, 255, 255, calc(var(--sep) * .035));
}

/* camada 1: placa com textura (brilho da cor do estilo, retícula e grão) */
.k3 .k3-fundo { --d: -1; overflow: hidden;
  background:
    radial-gradient(75% 42% at 50% 40%, color-mix(in srgb, var(--k-ac) 62%, transparent), transparent 72%),
    radial-gradient(60% 40% at 85% 95%, color-mix(in srgb, var(--k-sec) 70%, transparent), transparent 70%),
    var(--k-bg);
}
.k3 .k3-fundo::before { content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--k-tx) 30%, transparent) 0 .42cqw, transparent .55cqw) 0 0 / 3.4cqw 3.4cqw;
  -webkit-mask: radial-gradient(70% 55% at 50% 42%, #000, transparent 75%); mask: radial-gradient(70% 55% at 50% 42%, #000, transparent 75%);
  opacity: .55;
}
.k3 .k3-fundo::after { content: ""; position: absolute; inset: -20%; opacity: .5; mix-blend-mode: overlay;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .7 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>") 0 0 / 160px;
  animation: k3-grao .9s steps(3) infinite;
}
@keyframes k3-grao { 0% { transform: translate(0, 0); } 33% { transform: translate(-4%, 3%); } 66% { transform: translate(3%, -2%); } }
.k3 .k3-aneis { position: absolute; left: 50%; top: 40%; width: 120cqw; height: 120cqw; translate: -50% -50%; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--k-tx) 22%, transparent);
  box-shadow: 0 0 0 12cqw transparent, inset 0 0 0 14cqw transparent;
  outline: 1px solid color-mix(in srgb, var(--k-tx) 12%, transparent); outline-offset: 12cqw;
  animation: k3-gira 18s linear infinite;
}
.k3 .k3-aneis::after { content: ""; position: absolute; left: 50%; top: -1.2cqw; width: 2.4cqw; height: 2.4cqw; border-radius: 50%; background: var(--k-ac); box-shadow: 0 0 4cqw var(--k-ac); }
@keyframes k3-gira { to { rotate: 360deg; } }

/* camada 2: a palavra gigante, atrás da cabeça */
.k3 .k3-grande { --d: -.3; }
.k3 .k3-isso { position: absolute; left: 0; right: 0; top: 12.4%; text-align: center; white-space: nowrap;
  font-family: var(--k-f-disp); font-weight: var(--k-w-disp); font-stretch: var(--k-larg, 100%); font-style: var(--k-st, normal);
  font-size: calc(var(--k-tam, 21cqw) * 1.32); line-height: .86; letter-spacing: var(--k-esp, -.03em); color: var(--k-ac);
}
.k3 .k3-isso.k3-eco { color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--k-tx) 55%, transparent); transform: translate(2.4cqw, 2.4cqw); opacity: .7; }

/* camada 3: o recorte (busto apoiado na base) */
.k3 .k3-pessoa { --d: .45; }
.k3 .k3-pessoa img { position: absolute; left: 0; bottom: 0; width: 100%; height: auto; filter: drop-shadow(0 -2cqw 6cqw rgba(0, 0, 0, .45)); }
.k3 .k3-pessoa::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22%; border-radius: 0 0 17px 17px;
  background: linear-gradient(transparent, color-mix(in srgb, var(--k-bg) 85%, transparent)); }

/* camada 4: interface na frente */
.k3 .k3-frente { --d: 1.15; }
.dif-kit.k3[data-estilo] .kk-texto { top: 7.6%; left: 7cqw; right: 7cqw; bottom: auto; flex-direction: column; align-items: flex-start; text-align: left; }
.k3 .kk-l1 { text-shadow: 0 .4cqw 2cqw rgba(0, 0, 0, .35); font-size: 7.4cqw; }
.k3 .kk-hud, .k3 .kk-estilo, .k3 .kk-regra { text-shadow: 0 .3cqw 1.4cqw rgba(0, 0, 0, .5); }
.k3 .kk-estilo, .k3 .kk-regra { color: #fff; }
.k3 .kk-regra { background: rgba(0, 0, 0, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.k3 .kk-canto { border-color: var(--k-tx); }
.k3 .kk-c2 { border-color: #fff; }

/* etiquetas das camadas: aparecem quando a cena se abre */
.k3 .k3-tag { position: absolute; left: 4cqw; top: 4cqw; z-index: 4; font-family: "Geist Mono", var(--fm); font-size: 2.9cqw; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: rgba(8, 11, 20, .72); border: 1px solid rgba(255, 255, 255, .25); border-radius: 99px; padding: .8cqw 2.2cqw;
  opacity: calc(var(--sep) * 1.4 - .4); white-space: nowrap; }
.k3 .k3-grande .k3-tag { top: auto; bottom: 34%; left: auto; right: 4cqw; }
.k3 .k3-pessoa .k3-tag { top: auto; bottom: 12%; }
.k3 .k3-frente .k3-tag { top: auto; bottom: 4cqw; left: auto; right: 4cqw; opacity: 0; }

/* entrada da palavra gigante com a regra do kit (sobe e desfoca) */
.k3 .k3-isso .kk-pal { opacity: 0; }
.k3.toca .k3-isso .kk-pal { animation: kk-sobe var(--t7, 233ms) var(--sobe) forwards; animation-delay: var(--a, 0ms); }
.k3 .k3-isso.k3-eco { opacity: 0; }
.k3.toca .k3-isso.k3-eco { animation: k3-eco .5s var(--sobe) .55s forwards; }
@keyframes k3-eco { from { opacity: 0; transform: translate(0, 0); } to { opacity: .7; transform: translate(2.4cqw, 2.4cqw); } }
.k3 .k3-pessoa img { opacity: 0; transform: translateY(8cqw); }
.k3.toca .k3-pessoa img { animation: k3-sobe-pessoa .5s var(--sobe) .15s forwards; }
@keyframes k3-sobe-pessoa { to { opacity: 1; transform: none; } }

/* os estilos claros pedem tinta escura na frente */
.k3[data-estilo="laranja-cobalto"] .kk-l1, .k3[data-estilo="editorial"] .kk-l1, .k3[data-estilo="clean"] .kk-l1 { text-shadow: none; }
.k3[data-estilo="editorial"] .k3-isso, .k3[data-estilo="clean"] .k3-isso { font-size: calc(var(--k-tam, 21cqw) * 1.15); }

@media (prefers-reduced-motion: reduce) {
  .k3.toca .k3-cena, .k3 .k3-aneis, .k3 .k3-fundo::after { animation: none; }
  .k3 .k3-isso .kk-pal, .k3 .k3-pessoa img, .k3 .k3-isso.k3-eco { opacity: 1; animation: none; transform: none; }
}
.sem-motion .k3 .k3-cena, .sem-motion .k3 .k3-aneis { animation: none !important; }
.sem-motion .k3 .k3-isso .kk-pal, .sem-motion .k3 .k3-pessoa img { opacity: 1 !important; transform: none !important; }
.k3 .kk-estilo { max-width: 44%; line-height: 1.35; bottom: 5.4cqw; }
.k3 .kk-c1 { display: none; }
