/* ==========================================================================
   Capa dos cases: painel com a marca do cliente
   O vermelho Bradesco aparece só aqui, como cor do cliente; o resto da página
   continua no design system do portfólio.
   ========================================================================== */

.case-hero .case-hero-card { grid-template-columns: 5fr 7fr; align-items: stretch; min-height: 0; }
.case-hero-copy { align-self: end; }
/* Capa mais baixa: menos respiro no card e no botão de voltar */
.case-hero .case-hero-card { padding: clamp(var(--space-3), 3.5vw, var(--space-6)); gap: var(--space-4); }
.case-hero .back-link { margin-bottom: var(--space-4); }
.case-hero .case-lead { margin-bottom: var(--space-3); }

.brand-panel {
  position: relative;
  align-self: stretch;
  min-height: 448px;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius-feature);
  box-shadow: var(--shadow-raised);
}
.brand-bradesco {
  background:
    radial-gradient(ellipse at 20% 0%, rgb(255 255 255 / 16%), transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgb(80 0 20 / 45%), transparent 60%),
    linear-gradient(160deg, #CC092F, #8F0620);
}
/* Tap: o degradê da tela de boas-vindas, do azul Cielo ao vermelho Bradesco */
.brand-tap {
  background:
    radial-gradient(ellipse at 20% 0%, rgb(255 255 255 / 14%), transparent 55%),
    linear-gradient(150deg, #0D4E8E 0%, #4A2C78 48%, #CC092F 100%);
}

/* Logos no canto, em branco */
.brand-logos {
  position: absolute;
  z-index: 5;
  top: var(--space-4);
  left: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: rgb(255 255 255 / 72%);
  font-size: var(--fs-card);
  font-weight: 600;
}
.brand-logos img { display: block; width: auto; height: 40px; filter: brightness(0) invert(1); }

/* Anéis de fundo, girando devagar atrás dos celulares */
.brand-rings { position: absolute; z-index: 0; inset: 0; pointer-events: none; }
.brand-rings::before,
.brand-rings::after {
  position: absolute;
  left: 50%;
  top: 56%;
  aspect-ratio: 1;
  border-radius: 50%;
  translate: -50% -50%;
  content: "";
}
.brand-rings::before { width: 78%; border: 1px solid rgb(255 255 255 / 22%); }
.brand-rings::after { width: 52%; border: 1px dashed rgb(255 255 255 / 30%); animation: orbit-spin 60s linear infinite; }

/* Celulares maiores, saindo pela base do painel */
.brand-panel .fan,
.brand-panel .fan-center,
.brand-panel .fan-left,
.brand-panel .fan-right { width: min(30%, 216px); bottom: -14%; z-index: 1; }
.brand-panel .slot-phone.fan { width: min(26%, 184px); bottom: -10%; }

@media (max-width: 950px) {
  .case-hero .case-hero-card { grid-template-columns: 1fr; }
  .brand-panel { min-height: 400px; }
}
@media (max-width: 680px) {
  .brand-panel { min-height: 360px; }
  .brand-logos { top: var(--space-3); left: var(--space-3); }
  .brand-logos img { height: 28px; }
  .brand-panel .fan,
  .brand-panel .fan-center,
  .brand-panel .fan-left,
  .brand-panel .fan-right { width: min(46%, 200px); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-rings::after { animation: none; }
}

/* ==========================================================================
   Capa do card Open Finance na home: celulares menores e mais inteiros
   ========================================================================== */
.project-card .preview-phones img { width: 21%; bottom: 10%; }
.project-card .preview-phones img:nth-child(1) { left: 17%; }
.project-card .preview-phones img:nth-child(2) { left: 39.5%; bottom: 14%; }
.project-card .preview-phones img:nth-child(3) { right: 17%; }
@media (max-width: 680px) {
  .project-card .preview-phones img { width: 26%; bottom: 8%; }
  .project-card .preview-phones img:nth-child(1) { left: 6%; }
  .project-card .preview-phones img:nth-child(2) { left: 35%; }
  .project-card .preview-phones img:nth-child(3) { right: 6%; }
}

/* ==========================================================================
   Tags da hero: azul e areia, alternados (paleta do design system)
   ========================================================================== */
.hero-tags span:nth-child(odd) { background: var(--mist); border-color: rgb(49 95 140 / 20%); color: var(--blue); }
.hero-tags span:nth-child(even) { background: rgb(197 168 120 / 22%); border-color: rgb(197 168 120 / 48%); color: #76580D; }

/* Logos das ferramentas em órbita na hero */
.orbit-badge img { display: block; width: 56%; height: 56%; object-fit: contain; }

/* ==========================================================================
   Órbita das ferramentas com profundidade: anel inclinado em elipse.
   Na base o logo cresce de leve e passa por cima da foto; no topo diminui e
   passa por trás. Só CSS, então funciona também no canvas.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .hero-portrait .portrait-satellites { animation: none; z-index: auto; }
  .hero-portrait .portrait-satellites .orbit-badge { animation: orbit-ring 44s linear infinite; }
  .hero-portrait .portrait-satellites .orbit-badge:nth-child(1) { animation-delay: 0.00s; }
  .hero-portrait .portrait-satellites .orbit-badge:nth-child(2) { animation-delay: -3.38s; }
  .hero-portrait .portrait-satellites .orbit-badge:nth-child(3) { animation-delay: -6.77s; }
  .hero-portrait .portrait-satellites .orbit-badge:nth-child(4) { animation-delay: -10.15s; }
  .hero-portrait .portrait-satellites .orbit-badge:nth-child(5) { animation-delay: -13.54s; }
  .hero-portrait .portrait-satellites .orbit-badge:nth-child(6) { animation-delay: -16.92s; }
  .hero-portrait .portrait-satellites .orbit-badge:nth-child(7) { animation-delay: -20.31s; }
  .hero-portrait .portrait-satellites .orbit-badge:nth-child(8) { animation-delay: -23.69s; }
  .hero-portrait .portrait-satellites .orbit-badge:nth-child(9) { animation-delay: -27.08s; }
  .hero-portrait .portrait-satellites .orbit-badge:nth-child(10) { animation-delay: -30.46s; }
  .hero-portrait .portrait-satellites .orbit-badge:nth-child(11) { animation-delay: -33.85s; }
  .hero-portrait .portrait-satellites .orbit-badge:nth-child(12) { animation-delay: -37.23s; }
  .hero-portrait .portrait-satellites .orbit-badge:nth-child(13) { animation-delay: -40.62s; }
  /* Trilha pontilhada acompanha a elipse */
  .hero-portrait .orbit-one { inset: 16% 1%; animation: none; }
}
@keyframes orbit-ring {
  0.000% { left: 50.00%; top: 16.00%; scale: 0.860; opacity: 0.90; z-index: 1; }
  2.778% { left: 58.51%; top: 16.52%; scale: 0.862; opacity: 0.90; z-index: 1; }
  5.556% { left: 66.76%; top: 18.05%; scale: 0.868; opacity: 0.90; z-index: 1; }
  8.333% { left: 74.50%; top: 20.55%; scale: 0.879; opacity: 0.91; z-index: 1; }
  11.111% { left: 81.50%; top: 23.95%; scale: 0.893; opacity: 0.91; z-index: 1; }
  13.889% { left: 87.54%; top: 28.15%; scale: 0.910; opacity: 0.92; z-index: 1; }
  16.667% { left: 92.44%; top: 33.00%; scale: 0.930; opacity: 0.93; z-index: 1; }
  19.444% { left: 96.04%; top: 38.37%; scale: 0.952; opacity: 0.93; z-index: 1; }
  22.222% { left: 98.26%; top: 44.10%; scale: 0.976; opacity: 0.94; z-index: 1; }
  25.000% { left: 99.00%; top: 50.00%; scale: 1.000; opacity: 0.95; z-index: 1; }
  27.778% { left: 98.26%; top: 55.90%; scale: 1.024; opacity: 0.96; z-index: 4; }
  30.556% { left: 96.04%; top: 61.63%; scale: 1.048; opacity: 0.97; z-index: 4; }
  33.333% { left: 92.44%; top: 67.00%; scale: 1.070; opacity: 0.97; z-index: 4; }
  36.111% { left: 87.54%; top: 71.85%; scale: 1.090; opacity: 0.98; z-index: 4; }
  38.889% { left: 81.50%; top: 76.05%; scale: 1.107; opacity: 0.99; z-index: 4; }
  41.667% { left: 74.50%; top: 79.45%; scale: 1.121; opacity: 0.99; z-index: 4; }
  44.444% { left: 66.76%; top: 81.95%; scale: 1.132; opacity: 1.00; z-index: 4; }
  47.222% { left: 58.51%; top: 83.48%; scale: 1.138; opacity: 1.00; z-index: 4; }
  50.000% { left: 50.00%; top: 84.00%; scale: 1.140; opacity: 1.00; z-index: 4; }
  52.778% { left: 41.49%; top: 83.48%; scale: 1.138; opacity: 1.00; z-index: 4; }
  55.556% { left: 33.24%; top: 81.95%; scale: 1.132; opacity: 1.00; z-index: 4; }
  58.333% { left: 25.50%; top: 79.45%; scale: 1.121; opacity: 0.99; z-index: 4; }
  61.111% { left: 18.50%; top: 76.05%; scale: 1.107; opacity: 0.99; z-index: 4; }
  63.889% { left: 12.46%; top: 71.85%; scale: 1.090; opacity: 0.98; z-index: 4; }
  66.667% { left: 7.56%; top: 67.00%; scale: 1.070; opacity: 0.98; z-index: 4; }
  69.444% { left: 3.96%; top: 61.63%; scale: 1.048; opacity: 0.97; z-index: 4; }
  72.222% { left: 1.74%; top: 55.90%; scale: 1.024; opacity: 0.96; z-index: 4; }
  75.000% { left: 1.00%; top: 50.00%; scale: 1.000; opacity: 0.95; z-index: 4; }
  77.778% { left: 1.74%; top: 44.10%; scale: 0.976; opacity: 0.94; z-index: 1; }
  80.556% { left: 3.96%; top: 38.37%; scale: 0.952; opacity: 0.93; z-index: 1; }
  83.333% { left: 7.56%; top: 33.00%; scale: 0.930; opacity: 0.93; z-index: 1; }
  86.111% { left: 12.46%; top: 28.15%; scale: 0.910; opacity: 0.92; z-index: 1; }
  88.889% { left: 18.50%; top: 23.95%; scale: 0.893; opacity: 0.91; z-index: 1; }
  91.667% { left: 25.50%; top: 20.55%; scale: 0.879; opacity: 0.91; z-index: 1; }
  94.444% { left: 33.24%; top: 18.05%; scale: 0.868; opacity: 0.90; z-index: 1; }
  97.222% { left: 41.49%; top: 16.52%; scale: 0.862; opacity: 0.90; z-index: 1; }
  100.000% { left: 50.00%; top: 16.00%; scale: 0.860; opacity: 0.90; z-index: 1; }
}

/* Círculo do personagem um pouco menor (era 62% do retrato) */
.hero-portrait .portrait-placeholder { width: 50%; }
.hero-portrait .orbit-two { inset: 22%; }
@media (max-width: 680px) {
  .hero-portrait .portrait-placeholder { width: 50%; }
}

/* A órbita larga não pode criar rolagem lateral */
body { overflow-x: clip; }

/* ==========================================================================
   INTRO (roteiro de ~6,5 s, quase todo em CSS para tocar também no canvas)
   0,2 s  a porta se desenha        0,7 s  o avatar sai pela porta
   1,0 s  "Oi! seja bem-vindo!"     1,9 s  DO PROBLEMA
   2,2 s  logos entram, 1 a cada 0,3 s
   3,4 s  fundo vira azul + AO PRODUTO     4,8 s  fundo volta ao carvão
   fim    (JS) fundo clareia e o avatar com o anel desliza até a hero
   ========================================================================== */
.has-intro .intro { background: none; }
.intro::before, .intro::after { position: absolute; inset: 0; z-index: -2; content: ""; transition: opacity .6s ease; }
.intro::before { background: radial-gradient(ellipse at 50% 55%, rgb(49 95 140 / 45%), transparent 55%), var(--ink); }
.intro::after { z-index: -1; background: radial-gradient(ellipse at 50% 55%, rgb(232 240 246 / 18%), transparent 60%), var(--blue); opacity: 0; animation: intro-flip 6.5s linear both; }
@keyframes intro-flip { 0%, 51% { opacity: 0; } 53%, 72% { opacity: 1; } 75%, 100% { opacity: 0; } }

/* Palavras: uma por batida */
.intro-phrase > span:nth-child(1) > span { animation-delay: 1.9s; }
.intro-phrase > span:nth-child(2) > span { animation-delay: 3.4s; }

/* Porta: desenha de baixo para cima, maçaneta acende, some depois que o avatar sai */
.intro-door { position: absolute; z-index: 1; top: 50%; left: 50%; width: 64px; height: 112px; translate: -50% -50%; border: 2px solid rgb(232 240 246 / 70%); border-radius: 4px; animation: door-draw .5s .2s cubic-bezier(.2, .7, .2, 1) both, door-out .5s 1.8s ease forwards; }
.intro-door i { position: absolute; top: 50%; right: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--mist); opacity: 0; animation: intro-fade .3s .6s forwards; }
@keyframes door-draw { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
@keyframes door-out { to { opacity: 0; translate: 40% -50%; } }

/* Avatar sai de dentro da porta para o centro */
.intro-photo { z-index: 2; opacity: 0; transform: none; animation: intro-walk .8s .7s cubic-bezier(.2, .8, .25, 1.1) both; }
@keyframes intro-walk { from { opacity: 0; translate: 0 0; scale: .45; } 30% { opacity: 1; } to { opacity: 1; translate: 0 0; scale: 1; } }

/* Saudação escrita à mão (Caveat, exceção decorativa da tipografia) */
.intro-hello { position: absolute; z-index: 3; bottom: calc(100% + 16px); left: 50%; translate: -50% 0; margin: 0; color: var(--mist); font-family: "Caveat", cursive; font-size: 32px; font-weight: 600; line-height: 1; white-space: nowrap; clip-path: inset(0 100% 0 0); animation: hello-write 1s 1s steps(19) forwards, intro-fade-out .4s 2.6s forwards; }
@keyframes hello-write { to { clip-path: inset(0 0 0 0); } }
@keyframes intro-fade-out { to { opacity: 0; } }

/* Órbita da intro: mesma proporção da hero (foto = 50% do anel) */
.intro-orbit { position: absolute; inset: -84px; pointer-events: none; }
.intro-orbit::before { position: absolute; inset: 16% 1%; border: 1px dashed rgb(232 240 246 / 22%); border-radius: 50%; opacity: 0; animation: intro-fade .6s 2s forwards; content: ""; }
.intro-orbit .orbit-badge { width: 37px; z-index: 3; border-color: rgb(255 255 255 / 70%); box-shadow: 0 6px 18px rgb(0 0 0 / 28%); }
@media (prefers-reduced-motion: no-preference) {
  .intro-orbit .orbit-badge { animation: orbit-ring 18s linear infinite, orbit-pop .8s cubic-bezier(.2, .8, .25, 1.15) both, logo-gather 1.4s cubic-bezier(.6, 0, .3, 1) 6.8s forwards; }
  .intro-orbit .orbit-badge:nth-child(1) { animation-delay: 0.00s, 2.20s, 6.80s; --dx: 63px; --dy: -50px; --cx: 14px; --cy: 0px; }
  .intro-orbit .orbit-badge:nth-child(2) { animation-delay: -1.38s, 2.50s, 6.83s; --dx: 88px; --dy: -15px; --cx: 19px; --cy: 10px; }
  .intro-orbit .orbit-badge:nth-child(3) { animation-delay: -2.77s, 2.80s, 6.86s; --dx: 84px; --dy: 26px; --cx: 16px; --cy: 23px; }
  .intro-orbit .orbit-badge:nth-child(4) { animation-delay: -4.15s, 3.10s, 6.89s; --dx: 52px; --dy: 57px; --cx: 2px; --cy: 14px; }
  .intro-orbit .orbit-badge:nth-child(5) { animation-delay: -5.54s, 3.40s, 6.92s; --dx: 2px; --dy: 70px; --cx: -7px; --cy: 20px; }
  .intro-orbit .orbit-badge:nth-child(6) { animation-delay: -6.92s, 3.70s, 6.95s; --dx: -48px; --dy: 59px; --cx: -21px; --cy: 19px; }
  .intro-orbit .orbit-badge:nth-child(7) { animation-delay: -8.31s, 4.00s, 6.98s; --dx: -82px; --dy: 28px; --cx: -14px; --cy: 3px; }
  .intro-orbit .orbit-badge:nth-child(8) { animation-delay: -9.69s, 4.30s, 7.01s; --dx: -89px; --dy: -12px; --cx: -20px; --cy: -5px; }
  .intro-orbit .orbit-badge:nth-child(9) { animation-delay: -11.08s, 4.60s, 7.04s; --dx: -65px; --dy: -48px; --cx: -21px; --cy: -19px; }
  .intro-orbit .orbit-badge:nth-child(10) { animation-delay: -12.46s, 4.90s, 7.07s; --dx: -20px; --dy: -68px; --cx: -5px; --cy: -13px; }
  .intro-orbit .orbit-badge:nth-child(11) { animation-delay: -13.85s, 5.20s, 7.10s; --dx: 32px; --dy: -65px; --cx: 3px; --cy: -21px; }
  .intro-orbit .orbit-badge:nth-child(12) { animation-delay: -15.23s, 5.50s, 7.13s; --dx: 73px; --dy: -41px; --cx: 16px; --cy: -23px; }
  .intro-orbit .orbit-badge:nth-child(13) { animation-delay: -16.62s, 5.80s, 7.16s; --dx: 90px; --dy: -2px; --cx: 12px; --cy: -7px; }
}
@keyframes orbit-pop {
  from { transform: translate(var(--dx, 0px), var(--dy, -80px)) scale(.4); filter: blur(6px); visibility: hidden; }
  1% { visibility: visible; }
  70% { filter: blur(0); }
  to { transform: none; filter: none; visibility: visible; }
}

/* Pouso na hero (classe colocada pelo JS no fim) */
.intro.is-landing::before, .intro.is-landing::after { opacity: 0; animation: none; }
.intro.is-landing .intro-phrase, .intro.is-landing .intro-signature, .intro.is-landing .intro-counter,
.intro.is-landing .intro-skip, .intro.is-landing .intro-hello, .intro.is-landing .intro-door, .intro.is-landing .intro-spark { opacity: 0; transition: opacity .35s ease; }

.intro.is-landing .intro-orbit::before { border-color: rgb(49 95 140 / 32%); }
.intro-landing .hero-portrait { visibility: hidden; }

@media (max-width: 680px) {
  .intro-avatar { width: 128px; }
  .intro-orbit { inset: -64px; }
  .intro-orbit .orbit-badge { width: 28px; }
  .intro-hello { font-size: 26px; }
  .intro-door { width: 48px; height: 84px; }
}
/* Durante o pouso, o retrato da hero já está no lugar final (sem o deslize de entrada) */
.intro-landing .hero-portrait.reveal-on-scroll { transform: none !important; opacity: 1 !important; transition: none !important; }

/* Intro: o texto troca em 3 batidas (uma frase substitui a outra)
   1,9 s  ANTES DA · TELA,          (carvão)
   3,4 s  A PERGUNTA · CERTA.       (azul)
   4,8 s  DO PROBLEMA · → AO PRODUTO (carvão, fica até o fim) */
.intro-phrase { position: relative; display: block; height: 1.1em; }
.intro-phrase .beat { position: absolute; inset: 0; display: flex; justify-content: space-between; gap: var(--space-4); overflow: visible; padding: 0; }
.intro-phrase .beat > .w { display: block; overflow: hidden; padding: .18em 0 .08em; margin-top: -.18em; transform: none; animation: none; }
.intro-phrase .beat > .w > span { display: block; transform: translateY(150%); }
.beat-1 > .w > span { animation: word-in .8s 1.9s cubic-bezier(.2, .7, .2, 1) forwards, word-out .45s 3.2s cubic-bezier(.6, 0, .8, .4) forwards; }
.beat-1 > .w:nth-child(2) > span { animation-delay: 2.05s, 3.25s; }
.beat-2 > .w > span { animation: word-in .8s 3.4s cubic-bezier(.2, .7, .2, 1) forwards, word-out .45s 4.6s cubic-bezier(.6, 0, .8, .4) forwards; }
.beat-2 > .w:nth-child(2) > span { animation-delay: 3.55s, 4.65s; }
.beat-3 > .w > span { animation: word-in .8s 4.8s cubic-bezier(.2, .7, .2, 1) forwards; }
.beat-3 > .w:nth-child(2) > span { animation-delay: 4.95s; }
@keyframes word-in { from { transform: translateY(150%); } to { transform: translateY(0); } }
@keyframes word-out { from { transform: translateY(0); } to { transform: translateY(-150%); } }
@media (max-width: 680px) {
  .intro-phrase { height: 2.2em; }
  .intro-phrase .beat { flex-direction: column; gap: 0; }
}
/* Seta provisória antes de NEGÓCIO (pode virar um ícone definitivo) */
.beat-arrow { display: inline-block; width: .8em; height: .8em; margin-right: .2em; vertical-align: -.02em; }

/* Contador em porcentagem */
.intro-counter small { margin-left: .04em; font-size: .5em; font-weight: 600; vertical-align: .62em; }

/* Com JS, quem manda nas batidas é a porcentagem (6% → 1, 20% → 2, 50% → 3).
   Sem JS (canvas), vale a linha do tempo em CSS definida acima. */
.intro.js-beats::after { animation: none; opacity: 0; transition: opacity .35s ease; }
.intro.js-beats.bg-blue::after { opacity: 1; }
.intro.js-beats .beat > .w > span { animation: none; transform: translateY(150%); transition: transform .75s cubic-bezier(.2, .7, .2, 1); }
.intro.js-beats .beat > .w:nth-child(2) > span { transition-delay: .14s; }
.intro.js-beats .beat.is-in > .w > span { transform: translateY(0); }
.intro.js-beats .beat.is-out > .w > span { transform: translateY(-150%); transition-duration: .45s; transition-timing-function: cubic-bezier(.6, 0, .8, .4); }

/* Batidas com cor própria (fundo + texto do topo)
   1 · carvão, texto névoa   2 (30%) · azul, texto névoa   3 (60%) · igual à 1: carvão, texto névoa */
.intro::after { opacity: 1; background-color: transparent; animation: intro-flip 6.5s linear both; transition: background-color .45s ease, opacity .6s ease; }
.intro-phrase { transition: color .45s ease; animation: phrase-color 6.5s linear both; }
@keyframes intro-flip { 0%, 51% { background-color: transparent; } 53%, 72% { background-color: var(--blue); } 75%, 100% { background-color: transparent; } }
@keyframes phrase-color { 0%, 100% { color: var(--mist); } }
.intro.js-beats::after { animation: none; opacity: 1; background-color: transparent; }
.intro.js-beats.bg-blue::after { background-color: var(--blue); }
.intro.js-beats.bg-deep::after { background-color: transparent; }
.intro.js-beats .intro-phrase { animation: none; color: var(--mist); }
.intro.js-beats.bg-deep .intro-phrase { color: var(--mist); }
.intro.js-beats.is-landing::after { opacity: 0; }

/* ==========================================================================
   Intro: o personagem começa solto (sem círculo). Quando todos os logos já
   estão na elipse, a esfera se forma em volta dele e ele fica dentro.
   CSS: a esfera aparece aos 6,6 s (canvas). JS: aparece aos 100% (classe .is-sphere).
   ========================================================================== */
.intro-photo { overflow: visible; background: transparent; box-shadow: none; clip-path: circle(75% at 50% 50%); animation: intro-walk .8s .7s cubic-bezier(.2, .8, .25, 1.1) both, photo-into-sphere .7s 6.6s cubic-bezier(.2, .8, .25, 1) forwards; }
.intro-photo b { display: none; }
.intro-photo img { object-fit: contain; }
.intro-avatar::before {
  position: absolute; inset: 0; z-index: 1; box-sizing: border-box;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--blue), var(--blue-deep));
  box-shadow: 0 0 0 8px rgb(232 240 246 / 8%), var(--shadow-float);
  transform: scale(0); opacity: 0;
  animation: sphere-in .75s 6.6s cubic-bezier(.2, .9, .3, 1.25) forwards;
  content: "";
}
@keyframes sphere-in { from { transform: scale(0); opacity: 0; } 40% { opacity: 1; } to { transform: scale(1); opacity: 1; } }
@keyframes photo-into-sphere { to { clip-path: circle(50% at 50% 50%); } }

/* Com JS: a esfera espera o contador chegar a 100% */
.intro.js-beats .intro-avatar::before { animation: none; transition: transform .75s cubic-bezier(.2, .9, .3, 1.25), opacity .3s ease; }
.intro.js-beats .intro-photo { animation: intro-walk .8s .7s cubic-bezier(.2, .8, .25, 1.1) both; transition: clip-path .7s cubic-bezier(.2, .8, .25, 1); }
.intro.js-beats.is-sphere .intro-avatar::before { transform: scale(1); opacity: 1; }
.intro.js-beats.is-sphere .intro-photo { clip-path: circle(50% at 50% 50%); }

/* No pouso, a esfera azul da intro vira a esfera clara da hero (troca suave) */
.intro-avatar::after {
  position: absolute; inset: 0; z-index: 1; box-sizing: border-box;
  border: 8px solid rgb(255 255 255 / 88%); border-radius: 50%;
  background: linear-gradient(145deg, var(--mist), var(--paper) 65%, var(--mist));
  box-shadow: var(--shadow-float);
  opacity: 0; transition: opacity .6s ease .15s;
  content: "";
}
.intro.is-landing .intro-avatar::after { opacity: 1; }
.intro.js-beats.is-sphere.is-landing .intro-photo { clip-path: circle(calc(50% - 8px) at 50% 50%); }

/* Na hero, depois do pouso, os logos saem do centro da esfera para a órbita */
.hero-portrait.logos-burst .portrait-satellites .orbit-badge { animation-name: orbit-ring, logo-burst; animation-duration: 44s, 1.1s; animation-timing-function: linear, cubic-bezier(.2, .8, .25, 1.15); animation-iteration-count: infinite, 1; animation-fill-mode: none, both; }
/* Cada logo nasce no centro da esfera, na frente do personagem, e sai para o seu lugar na órbita */
@keyframes logo-burst {
  from { transform: translate(var(--bx, 0px), var(--by, 0px)) scale(.2); filter: blur(4px); opacity: 0; z-index: 6; }
  20% { opacity: 1; z-index: 6; }
  85% { z-index: 6; }
  to { transform: none; filter: none; }
}

/* Fim da linha do tempo em CSS (canvas): os logos voam ao centro, ficam
   aglomerados na frente do personagem, se fundem, e só então nasce a esfera */
@keyframes logo-gather {
  55%, 78% { left: calc(50% + var(--cx, 0px)); top: calc(50% + var(--cy, 0px)); scale: .72; opacity: 1; z-index: 5; }
  100% { left: 50%; top: 50%; scale: 1.4; opacity: 0; z-index: 5; }
}
.intro-avatar::before { animation-delay: 8.2s; }
.intro-photo { animation-delay: .7s, 8.2s; }
/* No site (JS), quem faz a junção é o script: tira a animação de CSS */
.intro.js-beats .intro-orbit .orbit-badge { animation-name: orbit-ring, orbit-pop, none; }

/* ==========================================================================
   Hero dentro de um card grande, de borda arredondada
   O card vai quase até a borda da tela (16px de folga); o conteúdo continua
   alinhado com o resto do site. O brilho de fundo fica dentro do card.
   ========================================================================== */
.hero { --hero-card-x: calc((100% - 100vw) / 2 + var(--space-2)); margin-top: var(--space-1); }
.hero::before,
.hero::after { position: absolute; top: 0; bottom: var(--space-2); left: var(--hero-card-x); right: var(--hero-card-x); border-radius: 32px; pointer-events: none; content: ""; }
.hero::before { inset: auto; top: 0; bottom: var(--space-2); left: var(--hero-card-x); right: var(--hero-card-x); z-index: -2; }
.hero::after { z-index: -3; border: 1px solid rgb(255 255 255 / 88%); background: linear-gradient(160deg, rgb(255 255 255 / 72%), rgb(255 255 255 / 48%) 60%, rgb(232 240 246 / 56%)); box-shadow: 0 1px 0 rgb(255 255 255 / 90%) inset, var(--shadow-soft); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
@media (max-width: 680px) {
  .hero { --hero-card-x: calc((100% - 100vw) / 2 + var(--space-1)); }
  .hero::before, .hero::after { border-radius: var(--radius-feature); bottom: var(--space-1); }
}
/* respiro interno: o conteúdo fica a pelo menos 48px da borda do card */
.hero { padding-inline: max(0px, calc(var(--space-6) - ((100vw - 100%) / 2 - var(--space-2)))); margin-bottom: var(--space-5); }
@media (max-width: 680px) {
  .hero { padding-inline: max(0px, calc(var(--space-3) - ((100vw - 100%) / 2 - var(--space-1)))); margin-bottom: var(--space-3); }
}
@media (max-width: 680px) {
  /* no celular a elipse de logos cabe inteira dentro do card */
  .hero-portrait { width: min(82vw, 400px); }
}

/* Hero como no exemplo: apresentação no topo do card, tags coladas no canto inferior */
@media (min-width: 951px) {
  .hero { --hero-pad: max(0px, calc(var(--space-6) - ((100vw - 100%) / 2 - var(--space-2)))); padding-block: var(--space-8) calc(var(--space-2) + var(--space-6)); align-items: stretch; }
  .hero-copy { display: flex; flex-direction: column; align-self: stretch; }
  .hero-copy .hero-tags { margin-top: auto; padding-top: var(--space-5); }
  .hero-portrait { align-self: center; }
  /* "Ver projetos" na mesma linha das tags, no canto inferior direito */
  .hero .scroll-cue { right: var(--hero-pad); bottom: calc(var(--space-2) + var(--space-6) - 12px); }
}
/* o anel decorativo ficava em cima da apresentação: sai da hero */
.hero .deco-ring { display: none; }

/* ==========================================================================
   Constraints da hero (como no Figma)
   A própria hero é o card: 16px da borda da tela e 48px de respiro interno.
   Apresentação presa no topo + esquerda; tags presas embaixo + esquerda;
   "Ver projetos" preso embaixo + direita. Vale para qualquer largura.
   ========================================================================== */
.hero.section-wrap { width: auto; max-width: none; margin-inline: var(--space-2); padding-inline: var(--space-6); --hero-card-x: 0px; --hero-pad: var(--space-6); }
.hero::before, .hero::after { left: 0; right: 0; }
@media (min-width: 951px) {
  .hero.section-wrap { padding-block: var(--space-6); }
  .hero::before, .hero::after { bottom: 0; }
  .hero-copy { justify-content: flex-start; }
  .hero-copy .hero-tags { margin-top: auto; }
  .hero .scroll-cue { right: var(--space-6); bottom: calc(var(--space-6) - 12px); }
}
@media (max-width: 950px) {
  .hero.section-wrap { padding: var(--space-5) var(--space-4); }
  .hero::before, .hero::after { bottom: 0; }
}
@media (max-width: 680px) {
  .hero.section-wrap { margin-inline: var(--space-1); padding: var(--space-4) var(--space-3); }
}
.hero .deco-spark { top: var(--space-5); right: var(--space-5); }
@media (max-width: 680px) { .hero-portrait { width: min(72vw, 360px); } }

/* Trabalho: linha divisória no início (abaixo do título) e no fim (largura total) */
.projects { position: relative; }
.projects .section-heading { margin-bottom: var(--space-3); padding-bottom: var(--space-5); border-bottom: 1px solid var(--line); }
.projects::after { position: absolute; bottom: 0; left: 50%; width: 100vw; height: 1px; transform: translateX(-50%); background: var(--line); content: ""; }
.projects + .clients-band { border-top: 0; }
@media (max-width: 680px) { .projects .section-heading { padding-bottom: var(--space-4); } }

/* Faixa de marcas: sem fundo próprio, passagem contínua entre as dobras,
   logos separados por um ponto azul */
.clients-band { background: transparent; border-bottom-color: var(--line); }
.client-group { grid-template-columns: repeat(5, 8px minmax(0, 1fr)); }
.client-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); opacity: .48; }

/* Sobre + Trajetória: um fundo levemente mais claro, de ponta a ponta,
   contínuo entre as duas dobras */
.about, .tl { position: relative; isolation: isolate; }
.about::before, .tl::before { position: absolute; inset: 0 calc(50% - 50vw); z-index: -1; background: rgb(255 255 255 / 48%); pointer-events: none; content: ""; }

/* Contato: conteúdo 24px mais alto */
.collaboration-invite { padding-top: calc(clamp(var(--space-12), 12vw, 208px) - var(--space-3)); }

/* Trabalho: "Ver case" em caixa alta */
.projects .case-button:not(.is-soon) { text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); font-size: var(--fs-small); line-height: var(--lh-small); }

/* Hero: tags em caixa alta */
.hero-tags span { text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); }
/* Duas primeiras em azul, duas últimas em areia */
.hero-tags span:nth-child(-n+2) { background: var(--mist); border-color: rgb(49 95 140 / 20%); color: var(--blue); }
.hero-tags span:nth-child(n+3) { background: rgb(197 168 120 / 22%); border-color: rgb(197 168 120 / 48%); color: #76580D; }

/* Contato: botão Copiar vira "Copiado" com check */
#copy-email { display: inline-flex; align-items: center; gap: 4px; transition: background-color .2s ease, border-color .2s ease, color .2s ease; }
#copy-email.is-copied, #copy-email.is-copied:hover { border-color: var(--tag-ok-line); background: var(--tag-ok-bg); color: var(--tag-ok-text); }
#copy-email svg { flex: none; animation: copy-check .3s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes copy-check { from { transform: scale(.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #copy-email svg { animation: none; } }

/* Contato: título em destaque, o dobro do tamanho (96px no desktop) */
.collaboration-invite h2 { font-size: clamp(40px, 10vw, 96px); line-height: 1.08; letter-spacing: -.03em; }

/* Sobre: parágrafos seguidos com 16px entre eles */
.about-body:has(+ .about-body) { margin-bottom: var(--space-2); }

/* Open Finance: moldura de desktop atrás dos celulares (mobile + desktop).
   Enquanto a tela não chega, mostra um esqueleto neutro de internet banking. */
.desk { position: absolute; z-index: 0; margin: 0; display: flex; flex-direction: column; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 12px; background: var(--white); box-shadow: 0 24px 48px rgb(23 33 43 / 22%); }
.desk-bar { flex: none; height: 20px; padding-inline: 8px; display: flex; align-items: center; gap: 4px; background: var(--neutral-100); border-bottom: 1px solid var(--neutral-200); }
.desk-bar i { width: 6px; height: 6px; border-radius: 50%; background: var(--neutral-300); }
.desk-bar b { flex: 1; height: 8px; margin-left: 8px; max-width: 40%; border-radius: 4px; background: var(--white); }
.desk-screen { position: relative; flex: 1; overflow: hidden; }
.desk-screen img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.desk-skel { position: absolute; inset: 0; display: grid; grid-template-columns: 22% 1fr 1fr; grid-template-rows: 14% 1fr 1fr; gap: 6%; padding: 6%; }
.desk-skel i { border-radius: 6px; background: var(--neutral-100); }
.desk-skel i:nth-child(1) { grid-column: 1; grid-row: 1 / 4; background: rgb(204 9 47 / 10%); }
.desk-skel i:nth-child(2) { grid-column: 2 / 4; background: var(--neutral-200); }
.desk-skel i:nth-child(n+5) { display: none; }

/* Capa do case */
.brand-panel.has-desk .desk { top: 18%; left: 50%; translate: -50% 0; width: 78%; }
.brand-panel.has-desk .fan, .brand-panel.has-desk .fan-left, .brand-panel.has-desk .fan-right { width: min(24%, 176px); bottom: -18%; }
.brand-panel.has-desk .fan-center { width: min(28%, 200px); bottom: -14%; }
.brand-panel.has-desk .fan-left { left: 10%; }
.brand-panel.has-desk .fan-right { right: 10%; }

/* Card da home */
.project-card .preview-phones.has-desk .desk { top: 6%; left: 50%; translate: -50% 0; width: 86%; border-radius: 8px; }
.project-card .preview-phones.has-desk img { bottom: -2%; width: 19%; }
.project-card .preview-phones.has-desk img:nth-child(2) { bottom: 2%; }
.project-card .preview-phones.has-desk img { z-index: 1; }
.project-card .preview-phones.has-desk img:nth-child(2) { z-index: 2; }
.preview-phones .desk img, .project-card .preview-phones .desk img { position: static; width: 100%; height: 100%; rotate: none; translate: none; transform: none; filter: none; }
