/* ==========================================================================
   Páginas de projeto em blocos (projetos com "sections" em js/data.js)
   As animações ficam em js/case-blocks.js. Só animamos transform, opacity e clip-path.
   ========================================================================== */

.cb {
  --cb-accent: var(--black);
  --cb-on-accent: var(--white);
  --cb-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --cb-header: 72px;
  overflow-x: clip; /* nada de rolagem horizontal da página; "clip" não quebra o position: sticky */
}

.cb-section {
  position: relative;
  padding: var(--section) 0;
}

.cb h1,
.cb h2,
.cb h3 {
  text-wrap: balance;
}

.cb-tone-dark {
  background: var(--black);
  color: var(--off-white);
}

.cb-tone-soft {
  background: var(--off-white);
}

.cb-tone-accent {
  background: var(--cb-accent);
  color: var(--cb-on-accent);
}

.cb-tone-dark .rich,
.cb-tone-accent .rich {
  color: inherit;
  opacity: 0.82;
}

.cb-tone-dark .rich strong,
.cb-tone-accent .rich strong {
  color: inherit;
}

.cb-eyebrow {
  font-size: 15px;
  letter-spacing: 0.01em;
  opacity: 0.7;
  margin-bottom: 20px;
}

.cb-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.65;
  margin-bottom: 20px;
}

.cb-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cb-accent);
}

.cb-tone-accent .cb-kicker::before {
  background: currentColor;
}

/* ---------- Entradas ao rolar ---------- */
[data-cb] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s var(--cb-ease), transform 1.1s var(--cb-ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}

[data-cb="left"] {
  transform: translateX(-56px);
}

[data-cb="right"] {
  transform: translateX(56px);
}

[data-cb="scale"] {
  transform: scale(0.94);
}

[data-cb].is-in {
  opacity: 1;
  transform: none;
}

/* Título com as palavras subindo uma por uma */
.cb-words .cb-w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.cb-words .cb-w > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.1s var(--cb-ease);
  transition-delay: calc(var(--w, 0) * 70ms + 100ms);
}

.cb-words.is-in .cb-w > span {
  transform: none;
}

/* ---------- Hero ---------- */
.cb-hero {
  padding: clamp(56px, 8vw, 112px) 0 0;
}

.cb-title {
  font-size: clamp(44px, 8.4vw, 128px);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 0.98;
  max-width: 14ch;
}

.cb-hero-cover {
  margin-top: clamp(48px, 6vw, 80px);
}

.cb-hero-frame {
  overflow: hidden;
  border-radius: clamp(12px, 2vw, 24px);
  clip-path: inset(8% 6% 0 6% round 24px);
  transition: clip-path 1.4s var(--cb-ease) 0.2s;
}

.cb-hero-cover.is-in .cb-hero-frame {
  clip-path: inset(0 0 0 0 round 24px);
}

.cb-hero-frame img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transform: translate3d(0, var(--py, 0px), 0) scale(1.07);
  will-change: transform;
}

/* Hero com peças reais em leque */
.cb-stack {
  position: relative;
  height: clamp(340px, 38vw, 560px);
  margin-top: clamp(32px, 4vw, 56px);
}

.cb-stack-item {
  position: absolute;
  left: 50%;
  bottom: 0;
  --_x: var(--x);
  width: clamp(170px, 24vw, 340px);
  transform: translate3d(calc(-50% + var(--_x)), calc(var(--y, 0px) + var(--sy, 0px)), 0) rotate(var(--r));
  transform-origin: 50% 100%;
}

.cb-stack-item > .cb-pop {
  opacity: 0;
  transform: translateY(30%) rotate(calc(var(--r) * -0.6));
  transition: opacity 0.9s var(--cb-ease), transform 1.3s var(--cb-ease);
  transition-delay: calc(var(--i, 0) * 120ms + 250ms);
}

.cb-stack.is-in .cb-stack-item > .cb-pop {
  opacity: 1;
  transform: none;
}

.cb-stack-item:nth-child(2) {
  z-index: 2;
}

/* ---------- Molduras (feitas em CSS; o conteúdo é sempre a peça real) ---------- */
.cb-frame {
  position: relative;
}

.cb-screen {
  position: relative;
  overflow: hidden;
  background: var(--screen-bg, var(--white));
  transition: background-color 0.4s ease;
}

.cb-screen img,
.cb-screen video {
  display: block;
  width: 100%;
  height: auto;
}

.cb-screen.is-cover img,
.cb-screen.is-cover video {
  height: 100%;
  object-fit: cover;
  object-position: 50% 0;
}

/* Só as telas que rolam por dentro precisam medir a própria altura (unidades cqh) */
.cb-scroll,
.cb-auto {
  container-type: size;
}

/* E-mail: cartão com sombra. Ao passar o mouse, a peça rola até o fim. */
.cb-email .cb-screen {
  border-radius: clamp(10px, 1.2vw, 16px);
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.35), 0 0 0 1px rgb(0 0 0 / 0.06);
}

.cb-scroll img {
  transition: transform var(--dur, 6s) cubic-bezier(0.45, 0, 0.25, 1);
}

@media (hover: hover) and (pointer: fine) {
  .cb-scroll:hover img {
    transform: translateY(min(0px, calc(-100% + 100cqh)));
  }
}

/* Rolagem automática dentro do celular, enquanto ele está na tela */
.cb-auto img,
.cb-auto > svg {
  display: block;
  width: 100%;
  height: auto;
  animation: cb-autoscroll var(--dur, 16s) cubic-bezier(0.45, 0, 0.55, 1) 1s infinite alternate;
  animation-play-state: paused;
}

.cb-auto.is-in img,
.is-in .cb-auto img,
.cb-auto.is-in > svg {
  animation-play-state: running;
}

@keyframes cb-autoscroll {
  0%,
  8% {
    transform: translateY(0);
  }
  92%,
  100% {
    transform: translateY(min(0px, calc(-100% + 100cqh)));
  }
}

/* Celular */
.cb-phone {
  padding: clamp(6px, 0.8vw, 10px);
  border-radius: clamp(30px, 4vw, 48px);
  background: #111;
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.5), inset 0 0 0 1.5px #2a2a2a;
}

.cb-phone .cb-screen {
  aspect-ratio: 9 / 19;
  border-radius: clamp(24px, 3.2vw, 38px);
}

.cb-phone::after {
  content: "";
  position: absolute;
  top: clamp(12px, 1.5vw, 18px);
  left: 50%;
  width: 30%;
  height: clamp(14px, 1.6vw, 22px);
  border-radius: 999px;
  background: #000;
  transform: translateX(-50%);
  z-index: 2;
}

/* Navegador */
.cb-browser {
  border-radius: clamp(8px, 1vw, 14px);
  overflow: hidden;
  background: #1c1c1c;
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.5);
}

.cb-browser-bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
}

.cb-browser-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a3a3a;
}

.cb-plain .cb-screen {
  border-radius: clamp(10px, 1.4vw, 20px);
  background: transparent;
}

/* Flutuação leve */
.cb-float {
  animation: cb-float 7s ease-in-out infinite alternate;
  animation-delay: calc(var(--i, 0) * -2.3s);
}

@keyframes cb-float {
  from {
    transform: translateY(-10px);
  }
  to {
    transform: translateY(10px);
  }
}

/* ---------- Texto (desafio, solução, resultado) ---------- */
.cb-text-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
}

.cb-text-grid .h2 {
  max-width: 12ch;
}

.cb-text-grid .rich {
  max-width: 60ch;
}

/* ---------- Intro: resumo + ficha técnica ---------- */
.cb-intro-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.cb-lead {
  font-size: clamp(22px, 2.3vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.25;
  max-width: 30ch;
}

.cb-intro .case-meta div {
  border-color: currentColor;
  border-color: color-mix(in srgb, currentColor 18%, transparent);
}

.cb-intro .case-meta dt {
  color: inherit;
  opacity: 0.6;
}

.cb-intro .case-highlight {
  margin-top: 24px;
}

/* ---------- Carrossel horizontal preso à rolagem ---------- */
.cb-hz {
  padding: 0;
}

.cb-hz-sticky {
  position: sticky;
  top: var(--cb-header);
  height: calc(100vh - var(--cb-header));
  height: calc(100svh - var(--cb-header));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(24px, 4vh, 48px);
  overflow: hidden;
}

.cb-hz-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
}

.cb-hz-count {
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
  white-space: nowrap;
}

.cb-hz-track {
  display: flex;
  gap: clamp(20px, 3vw, 48px);
  padding: 0 var(--gutter);
  width: max-content;
  transform: translate3d(var(--tx, 0px), 0, 0);
  will-change: transform;
}

.cb-hz-item {
  flex: none;
  margin: 0;
  height: min(62vh, 640px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cb-hz-item .cb-frame {
  height: 100%;
  min-height: 0;
  aspect-ratio: var(--ar, 3 / 4);
}

.cb-hz-item .cb-screen {
  height: 100%;
}

.cb-hz-item figcaption,
.cb-cap {
  font-size: 14px;
  opacity: 0.7;
}

.cb-hz-progress {
  margin: 0 var(--gutter);
  height: 2px;
  background: color-mix(in srgb, currentColor 15%, transparent);
  overflow: hidden;
}

.cb-hz-progress span {
  display: block;
  height: 100%;
  background: currentColor;
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
}

/* Versão nativa (celular ou movimento reduzido): rolagem lateral com encaixe */
.cb-hz.is-native {
  padding: var(--section) 0;
}

.cb-hz.is-native .cb-hz-sticky {
  position: static;
  height: auto;
  overflow: visible;
}

.cb-hz.is-native .cb-hz-track {
  width: auto;
  transform: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  padding-bottom: 12px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.cb-hz.is-native .cb-hz-track::-webkit-scrollbar {
  display: none;
}

.cb-hz.is-native .cb-hz-item {
  scroll-snap-align: start;
  height: auto;
  width: min(78vw, 360px);
}

.cb-hz.is-native .cb-hz-item .cb-frame {
  height: auto;
  width: 100%;
}

.cb-hz.is-native .cb-hz-item.is-wide {
  width: min(88vw, 640px);
}

.cb-hz.is-native .cb-hz-progress,
.cb-hz.is-native .cb-hz-count {
  display: none;
}

/* ---------- Split: texto e imagem entrando de lados opostos ---------- */
.cb-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 7vw, 120px);
  align-items: center;
}

.cb-split.is-reverse .cb-split-media {
  order: -1;
}

.cb-split-media {
  display: flex;
  justify-content: center;
}

.cb-split-media .cb-frame {
  width: min(100%, var(--mw, 420px));
}

.cb-split .h3 {
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 20px;
}

.cb-split .rich {
  max-width: 46ch;
}

/* ---------- Mockup: peças reais em dispositivos ---------- */
.cb-mockup-head {
  max-width: 760px;
  margin-bottom: clamp(48px, 6vw, 96px);
}

.cb-mockup-head .rich {
  margin-top: 20px;
}

.cb-devices {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(20px, 5vw, 80px);
  perspective: 1400px;
}

.cb-devices-tilt {
  display: contents;
}

.cb-device {
  width: var(--dw, clamp(200px, 22vw, 300px));
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.8s var(--cb-ease);
}

.cb-device figcaption {
  margin-top: 16px;
  text-align: center;
}

/* ---------- Galeria com entrada escalonada ---------- */
.cb-gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  gap: clamp(12px, 2vw, 24px);
  align-items: start;
}

.cb-gallery-grid figure {
  margin: 0;
}

/* ---------- Imagem cheia com máscara se abrindo ---------- */
.cb-fullbleed {
  padding: 0;
}

.cb-fullbleed-frame {
  overflow: hidden;
  clip-path: inset(var(--ci, 12%) calc(var(--ci, 12%) * 1.4) round clamp(12px, 2vw, 28px));
  will-change: clip-path;
}

.cb-fullbleed-frame img,
.cb-fullbleed-frame video {
  display: block;
  width: 100%;
  height: auto;
  transform: scale(var(--cs, 1.15));
  will-change: transform;
}

.cb-fullbleed figcaption {
  padding-top: 16px;
}

/* ---------- Números ---------- */
.cb-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(32px, 4vw, 64px);
  border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  padding-top: clamp(32px, 4vw, 56px);
}

.cb-stat-value {
  display: block;
  font-size: clamp(36px, 13vw, 112px);
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--cb-accent);
}

.cb-stat-unit {
  font-size: 0.42em;
  letter-spacing: 0;
  margin-inline: 0.12em;
  vertical-align: 0.9em;
  font-weight: inherit;
}

.cb-stat-value {
  white-space: nowrap;
}

/* ---------- Barra única de progresso (progress) ---------- */
.cb-pg {
  --pg-h: clamp(56px, 7vw, 96px);
  --pg-dark: color-mix(in srgb, #000 45%, var(--cb-accent));
  position: relative;
}

.cb-pg-marks {
  position: relative;
  height: clamp(84px, 9vw, 120px);
}

.cb-pg-mark {
  position: absolute;
  bottom: 14px;
  display: grid;
  gap: 4px;
  font-size: 15px;
  line-height: 1.3;
  white-space: nowrap;
}

.cb-pg-mark strong {
  font-size: clamp(32px, 4.4vw, 60px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cb-pg-mark.is-from {
  left: 0;
  opacity: 0.85;
}

.cb-pg-mark.is-to {
  left: calc(var(--b) * 100%);
  transform: translateX(-100%);
  text-align: right;
}

.cb-pg-track {
  position: relative;
  height: var(--pg-h);
  background: color-mix(in srgb, currentColor 12%, transparent);
  overflow: hidden;
}

.cb-pg-base,
.cb-pg-gain {
  position: absolute;
  top: 0;
  bottom: 0;
  transform-origin: left center;
  transform: scaleX(0);
}

.cb-pg-base {
  left: 0;
  width: calc(var(--a) * 100%);
  background: var(--pg-dark);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}

.cb-pg-gain {
  left: calc(var(--a) * 100%);
  width: calc((var(--b) - var(--a)) * 100%);
  background: #fff;
  color: var(--pg-dark);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: clamp(12px, 1.6vw, 24px);
  transition: transform 1.8s cubic-bezier(0.22, 1, 0.36, 1) 1s;
}

.cb-pg-gain em {
  font-style: normal;
  font-size: clamp(16px, 1.8vw, 26px);
  letter-spacing: -0.02em;
  opacity: 0;
  transition: opacity 0.5s 2.4s;
}

.cb-pg.is-in .cb-pg-base,
.cb-pg.is-in .cb-pg-gain {
  transform: scaleX(1);
}

.cb-pg.is-in .cb-pg-gain em {
  opacity: 1;
}

.cb-pg-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 13px;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.cb-pg-note {
  margin-top: clamp(32px, 4vw, 56px);
  font-size: clamp(22px, 2.4vw, 34px);
  letter-spacing: -0.02em;
}

@media (max-width: 640px) {
  /* No celular os rótulos não cabem lado a lado sobre a barra: ficam nas pontas */
  .cb-pg-marks {
    height: auto;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
  }

  .cb-pg-mark {
    position: static;
    font-size: 13px;
  }

  .cb-pg-mark.is-to {
    transform: none;
  }

  .cb-pg-gain em {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cb-pg-base,
  .cb-pg-gain {
    transform: none;
    transition: none;
  }

  .cb-pg-gain em {
    opacity: 1;
    transition: none;
  }
}

.cb-tone-accent .cb-stat-value {
  color: inherit;
}

.cb-stat-label {
  display: block;
  margin-top: 16px;
  max-width: 28ch;
  opacity: 0.7;
}

.cb-source {
  margin-top: 32px;
  font-size: 14px;
  opacity: 0.55;
}

.cb-hero.has-pad {
  padding-bottom: clamp(48px, 6vw, 96px);
}

/* ---------- Frase grande (texto que antes era slide) ---------- */
.cb-statement-line {
  font-size: clamp(30px, 4.6vw, 72px);
  letter-spacing: -0.04em;
  line-height: 1.08;
  max-width: 20ch;
  text-wrap: balance;
}

.cb-statement-line + .cb-statement-line {
  margin-top: 0.5em;
}

.cb-statement-line strong {
  font-weight: 600;
}

.cb-statement-line em {
  font-style: normal;
  opacity: 0.55;
}

.cb-statement.is-center .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cb-statement-body {
  margin-top: 32px;
  max-width: 56ch;
}

/* ---------- Paleta ---------- */
.cb-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: clamp(8px, 1.2vw, 16px);
}

.cb-swatch {
  aspect-ratio: 5 / 4;
  border-radius: clamp(12px, 1.6vw, 20px);
  padding: clamp(14px, 1.6vw, 22px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  box-shadow: inset 0 0 0 1px rgb(127 127 127 / 0.2);
}

.cb-swatch-name {
  font-size: 15px;
}

.cb-swatch-hex {
  font-size: 13px;
  letter-spacing: 0.06em;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

/* ---------- Vídeo incorporado ---------- */
.cb-embed-frame {
  width: 100%;
  overflow: hidden;
  border-radius: clamp(10px, 1.4vw, 20px);
  background: #000;
}

.cb-embed-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Depoimento ---------- */
.cb-quote figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.cb-quote-text {
  max-width: 28ch;
  font-size: clamp(26px, 3.2vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.cb-quote figcaption {
  opacity: 0.7;
}

/* ---------- Wireframe (esqueleto da página) ---------- */
.wf-svg {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border-radius: clamp(8px, 1vw, 14px);
  box-shadow: 0 0 0 1px #e4e2ea;
}

.wf-band {
  fill: none;
  stroke: #e6e4ec;
  stroke-dasharray: 6 6;
  vector-effect: non-scaling-stroke;
}

.wf-card {
  fill: #f5f4f8;
  stroke: #d9d6e2;
  vector-effect: non-scaling-stroke;
}

.wf-img {
  fill: #ebe9f0;
  stroke: #c3c0cf;
  vector-effect: non-scaling-stroke;
}

.wf-x {
  stroke: #c9c6d4;
  vector-effect: non-scaling-stroke;
}

.wf-play {
  fill: #a9a5b8;
}

.wf-icon {
  fill: none;
  stroke: #c3c0cf;
  vector-effect: non-scaling-stroke;
}

.wf-title {
  fill: #a29eb2;
}

.wf-text {
  fill: #d3d0dc;
}

.wf-btn {
  fill: none;
  stroke: #8f8aa4;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.wf-btn.is-fill {
  fill: #d9d5e6;
}

.wf-label {
  fill: var(--cb-accent);
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* desenha bloco a bloco quando a seção entra na tela */
.wf-sec .wf-el,
.wf-sec .wf-label {
  opacity: 0;
  transform: translateY(10px);
  transform-box: fill-box;
  transition: opacity 0.6s var(--cb-ease), transform 0.8s var(--cb-ease);
  transition-delay: calc(min(var(--i, 0), 40) * 28ms);
}

.wf-sec.is-in .wf-el,
.wf-sec.is-in .wf-label {
  opacity: 1;
  transform: none;
}

.cb-wire-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 2.4fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}

.cb-wire-list {
  position: sticky;
  top: calc(var(--cb-header) + 32px);
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.cb-wire-list li {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 15px;
  opacity: 0.45;
  transition: opacity 0.4s, background-color 0.4s;
}

.cb-wire-list li span {
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
}

.cb-wire-list li.is-active {
  opacity: 1;
  background: color-mix(in srgb, var(--cb-accent) 10%, transparent);
}

.cb-wire-figure {
  max-width: 760px;
}

.cb-wire-figure figcaption {
  margin-top: 14px;
}

/* ---------- Antes/depois (wireframe × layout) ---------- */
@property --pos {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}

.cb-compare-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: clamp(16px, 3vw, 40px);
  align-items: start;
}

.cb-compare-grid:has(> :only-child) {
  grid-template-columns: 1fr;
}

/* Comparadores empilhados, todos em largura total */
.cb-compare-grid.is-stack {
  grid-template-columns: 1fr;
  gap: clamp(40px, 6vw, 80px);
}

.cb-compare {
  position: relative;
  overflow: hidden;
  border-radius: clamp(10px, 1.2vw, 16px);
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.35), 0 0 0 1px rgb(0 0 0 / 0.06);
  touch-action: pan-y; /* arrastar na horizontal move a divisória; na vertical, rola a página */
  user-select: none;
  -webkit-user-select: none;
  cursor: ew-resize;
  background: #fff;
}

.cb-compare-after,
.cb-compare-before,
.cb-compare-before .wf-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 0;
  box-shadow: none;
}

.cb-compare-before {
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

/* as camadas não capturam o ponteiro (evita o arrasto nativo da imagem, que cancelaria o gesto) */
.cb-compare-after,
.cb-compare-before {
  pointer-events: none;
  -webkit-user-drag: none;
}

.cb-compare-before .wf-sec .wf-el,
.cb-compare-before .wf-sec .wf-label {
  opacity: 1;
  transform: none;
}

.cb-compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 44px;
  margin-left: -22px;
  display: grid;
  place-items: center;
  outline: none;
}

.cb-compare-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: var(--cb-accent);
}

.cb-compare-handle span {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--cb-accent);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.25);
  transition: transform 0.3s var(--cb-ease);
}

.cb-compare-handle span::before,
.cb-compare-handle span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  margin-top: -6px;
}

.cb-compare-handle span::before {
  left: 5px;
  border-right-color: var(--cb-on-accent);
}

.cb-compare-handle span::after {
  right: 5px;
  border-left-color: var(--cb-on-accent);
}

.cb-compare.is-dragging .cb-compare-handle span,
.cb-compare-handle:focus-visible span {
  transform: scale(1.15);
}

.cb-compare-handle:focus-visible span {
  outline: 3px solid var(--cb-accent);
  outline-offset: 4px;
}

.cb-compare-tag {
  position: absolute;
  top: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgb(255 255 255 / 0.9);
  color: #222;
  pointer-events: none;
}

.cb-compare-tag.is-before {
  left: 12px;
}

.cb-compare-tag.is-after {
  right: 12px;
  background: var(--cb-accent);
  color: var(--cb-on-accent);
}

.cb-compare-item figcaption {
  margin-top: 12px;
}

/* entrada: a divisória passeia uma vez antes de parar no meio */
.cb-compare-item.is-in .cb-compare:not(.was-touched) {
  animation: cb-compare-intro 2.4s var(--cb-ease) 0.4s both;
}

@keyframes cb-compare-intro {
  0% {
    --pos: 88%;
  }
  45% {
    --pos: 12%;
  }
  100% {
    --pos: 50%;
  }
}

/* ---------- Próximo projeto ---------- */
.cb-next {
  border-top: 1px solid var(--gray-200);
}

.cb-next a {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
}

.cb-next-title {
  font-size: clamp(44px, 8vw, 120px);
  letter-spacing: -0.05em;
  line-height: 1;
  display: inline-block;
  transition: transform 0.7s var(--cb-ease);
}

.cb-next a:hover .cb-next-title {
  transform: translateX(12px);
}

.cb-next-thumb {
  width: clamp(120px, 22vw, 320px);
  border-radius: 16px;
  overflow: hidden;
  clip-path: inset(0 round 16px);
}

.cb-next-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 1s var(--cb-ease);
}

.cb-next a:hover .cb-next-thumb img {
  transform: scale(1.08);
}

/* Ao trocar o idioma, o conteúdo aparece sem animar de novo */
.cb.cb-no-anim *,
.cb.cb-no-anim *::before {
  transition: none !important;
}

/* ---------- Telas menores ---------- */
@media (max-width: 809px) {
  .cb-text-grid,
  .cb-intro-grid,
  .cb-split-grid {
    grid-template-columns: 1fr;
  }

  .cb-split.is-reverse .cb-split-media {
    order: 0;
  }

  [data-cb="left"],
  [data-cb="right"] {
    transform: translateY(40px);
  }

  .cb-devices {
    flex-wrap: wrap;
  }

  .cb-device {
    --dw: min(42vw, 220px);
  }

  .cb-devices.is-single .cb-device {
    --dw: min(70vw, 300px);
  }

  .cb-gallery-grid {
    grid-template-columns: repeat(var(--mcols, 2), 1fr);
  }

  .cb-wire-grid,
  .cb-compare-grid {
    grid-template-columns: 1fr;
  }

  .cb-wire-list {
    display: none;
  }

  .cb-compare-item.is-mobile {
    max-width: 320px;
    margin-inline: auto;
  }

  .cb-gallery-grid > figure[style*="grid-column"] {
    grid-column: 1 / -1 !important;
  }

  .cb-stack {
    height: clamp(240px, 72vw, 360px);
  }

  .cb-stack-item {
    width: clamp(130px, 40vw, 200px);
    --_x: var(--xm, var(--x));
  }

  .cb-next a {
    grid-template-columns: 1fr;
  }

  .cb-hz-head {
    flex-direction: column;
    align-items: start;
  }
}

/* ---------- Movimento reduzido: tudo visível, sem deslocamentos ---------- */
@media (prefers-reduced-motion: reduce) {
  [data-cb],
  .cb-words .cb-w > span,
  .cb-stack-item > .cb-pop {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .cb-hero-frame,
  .cb-fullbleed-frame {
    clip-path: none;
    transition: none;
  }

  .cb-hero-frame img,
  .cb-fullbleed-frame img,
  .cb-fullbleed-frame video {
    transform: none;
  }

  .cb-float,
  .cb-auto img,
  .cb-auto > svg {
    animation: none;
  }

  .wf-sec .wf-el,
  .wf-sec .wf-label {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .cb-compare-item.is-in .cb-compare:not(.was-touched) {
    animation: none;
  }

  .cb-auto,
  .cb-scroll {
    overflow-y: auto;
  }

  .cb-scroll img {
    transition: none;
  }

  .cb-device {
    transform: none;
  }
}

/* ---------- Case com várias entregas: índice e abertura de cada capítulo ---------- */
.cb-chapters {
  padding-block: clamp(56px, 7vw, 96px);
}

.cb-chapters .h2 {
  margin-bottom: 40px;
  max-width: 16ch;
}

.cb-chapters-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid currentColor;
  border-color: rgb(127 127 127 / 0.3);
}

.cb-chapters-list li {
  border-bottom: 1px solid rgb(127 127 127 / 0.3);
}

.cb-chapters-list a {
  display: grid;
  grid-template-columns: 56px 1fr auto 24px;
  align-items: baseline;
  gap: 16px;
  padding: 22px 0;
  transition: padding 0.5s var(--cb-ease), color 0.3s;
}

.cb-ch-n {
  font-size: 14px;
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
}

.cb-ch-t {
  font-size: clamp(22px, 2.6vw, 36px);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.cb-ch-m {
  font-size: 14px;
  opacity: 0.6;
  text-align: right;
}

.cb-ch-arrow {
  width: 16px;
  height: 16px;
  align-self: center;
  transition: transform 0.5s var(--cb-ease);
}

@media (hover: hover) {
  .cb-chapters-list a:hover {
    padding-left: 12px;
  }

  .cb-chapters-list a:hover .cb-ch-arrow {
    transform: translateY(4px);
  }
}

.cb-chapter {
  padding-bottom: clamp(48px, 6vw, 80px);
}

.cb-chapter-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.6fr) 1.4fr;
  gap: 40px;
  align-items: start;
}

.cb-chapter-n {
  font-size: clamp(72px, 12vw, 180px);
  line-height: 0.85;
  letter-spacing: -0.06em;
  color: var(--cb-accent);
  font-variant-numeric: tabular-nums;
}

.cb-chapter-title {
  font-size: clamp(36px, 5.2vw, 76px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
  max-width: 16ch;
}

.cb-chapter-body {
  margin-top: 28px;
  max-width: 62ch;
}

.cb-chapter .case-links {
  margin-top: 28px;
}

.cb-chapter-meta {
  margin-top: 40px;
}

@media (max-width: 809px) {
  .cb-chapters-list a {
    grid-template-columns: 36px 1fr 18px;
    gap: 12px;
  }

  .cb-ch-m {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
  }

  .cb-ch-arrow {
    grid-column: 3;
    grid-row: 1;
  }

  .cb-chapter-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
