/* ==========================================================================
   components.css — blocos BEM (marca, nav, botões, hero, notebook/celular, rodapé…)
   Etapa 3 completa: .service-card, .project-card, .filter, .client-tile,
   .testimonial, .step, .cta-banner.
   ========================================================================== */

/* ---------- Marca (logo) ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand__logo {
  width: auto;
  height: var(--logo-height);
  transform-origin: left center;
}

.site-header--compact .brand__logo {
  transform: scale(var(--header-logo-scale));
}

/* ---------- Botões ---------- */

/* Borda transparente em todos: primário e contorno ficam com a mesma altura. */
.btn {
  display: inline-flex;
  position: relative;
  align-items: center;
  max-width: 100%; /* com fonte grande o texto quebra dentro do botão, sem estourar a tela */
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap-target);

  /* lateral limitada a 7% da tela: com a fonte grande em tela estreita, o texto ainda cabe */
  padding: calc(var(--space-4) - var(--btn-border)) min(calc(var(--space-7) - var(--btn-border)), 7vw);
  border: var(--btn-border) solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-body);
  text-align: center;
}

/* Sombra do hover num pseudo-elemento: anima só a opacity dele (box-shadow não é animado). */
.btn::before {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--btn-border));
  border-radius: inherit;
  box-shadow: var(--shadow-btn-hover);
  opacity: 0;
  pointer-events: none;
}

.btn--primary {
  background: var(--gradient-brand);
  color: var(--color-white);
}

.btn--outline {
  border-color: var(--color-ink);
  color: var(--color-ink);
}

.btn--sm {
  padding: calc(var(--space-3) - var(--btn-border)) calc(1.375rem - var(--btn-border)); /* 12 × 22 */
  font-size: var(--text-base);
}

/* Sobre fundo azul (CTA) */
.btn--light {
  background: var(--color-white);
  color: var(--color-royal);
}

.btn--outline-light {
  border-color: var(--color-white);
  background: var(--veil-on-blue);
  color: var(--color-white);
}

/* ---------- Badge ---------- */
.badge {
  align-self: flex-start;
  margin: 0;
  padding: var(--space-2) 0.875rem; /* 8 × 14 */
  border-radius: var(--radius-pill);
  background: var(--color-chip-bg);
  color: var(--color-eyebrow);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

/* ---------- Navegação principal (desktop) ---------- */
.site-nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
}

.site-nav__link {
  display: inline-block;
  position: relative;
  padding-block: var(--space-2);
  color: var(--color-ink);
}

.site-nav__link:hover {
  color: var(--color-nav-active);
}

/* Seção atual (js/scrollspy.js): cor + sublinhado que cresce (scaleX). */
.site-nav__link[aria-current="true"] {
  color: var(--color-nav-active);
}

.site-nav__link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--color-nav-active);
  transform: scaleX(0);
  transform-origin: left center;
}

.site-nav__link[aria-current="true"]::after {
  transform: scaleX(1);
}

/* ---------- Botão hambúrguer ---------- */
.menu-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: var(--tap-target);
  height: var(--tap-target);
  border-radius: var(--radius-md);
  color: var(--color-ink);
}

.menu-toggle__bar {
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentcolor;
  transition: transform var(--duration-fast) var(--ease-out), opacity var(--duration-fast) var(--ease-out);
}

/* Barras viram "X" quando aberto (deslocamento = gap 5px + altura 2px) */
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Menu mobile (≤ 64em = 1024px com fonte padrão) ----------
   Em "em", não em px: quem aumenta a fonte do navegador (ex.: 200%) ganha o hambúrguer
   antes de o menu deixar de caber. Só este ponto usa em, pois depende da largura do texto.
   Abaixo disso, logo + 4 links + botão não cabem numa linha.
   O painel só abre com JS; sem JS, css/no-js.css mostra o menu aberto. */
@media (width <= 64em) {
  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    padding: var(--space-2) var(--container-pad) var(--space-6);
    border-bottom: 1px solid var(--color-line);
    background: var(--color-white);
    box-shadow: var(--shadow-panel);
  }

  /* O painel acompanha o fundo do header compacto. */
  .site-header--compact .site-nav {
    transform: translateY(calc(var(--shrink) / -2));
  }

  /* Estado vem do aria-expanded: CSS e acessibilidade nunca divergem. */
  .menu-toggle[aria-expanded="true"] + .site-nav {
    display: block;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    font-size: var(--text-lg);
  }

  .site-nav__link {
    display: flex;
    align-items: center;
    min-height: 3rem;
    border-bottom: 1px solid var(--color-line);
  }

  .site-nav__link::after {
    display: none; /* no painel, a cor já marca a seção atual */
  }


  .site-nav__item--cta {
    margin-top: var(--space-5);
  }

  .site-nav__item--cta .btn {
    width: 100%;
  }
}

/* ---------- Hero: conteúdo ---------- */
.hero__title {
  font-size: var(--text-h1);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-ink);
}

.hero__title-accent {
  color: var(--color-blue);
}

.hero__lead {
  max-width: 520px;
  font-size: var(--text-xl);
  line-height: var(--leading-body);
  color: var(--color-text-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.hero__highlights {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-7);
  margin-top: var(--space-4);
  font-size: var(--text-base);
  color: var(--color-text-muted);
}

.hero__highlight {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hero__check {
  flex-shrink: 0;
  color: var(--color-blue);
}

@media (width <= 768px) {
  .hero__lead {
    font-size: var(--text-lg);
  }
}

@media (width <= 480px) {
  .hero__actions .btn {
    flex: 1 1 100%;
  }
}

/* ---------- Hero: camadas da cena (medidas em --u = 1px do design) ---------- */
.hero__layer {
  position: absolute;
}

/* Posição do símbolo recortado equivalente à do PNG com margens usado no design
   (no design: 560px de largura, top -30, right -60, incluindo a área transparente). */
.hero__layer--symbol {
  top: calc(106 * var(--u));
  right: calc(-25 * var(--u));
  width: calc(492 * var(--u));
}

.hero__symbol {
  width: 100%;
  opacity: 0.95;
}

/* left = sobra lateral da base do notebook: a base começa no limite da cena, sem sair dela. */
.hero__layer--laptop {
  top: calc(84 * var(--u));
  left: calc(22 * var(--u));
  width: calc(430 * var(--u));
}

.hero__layer--phone {
  top: calc(176 * var(--u));
  right: calc(12 * var(--u));
  width: calc(136 * var(--u));
}

.hero__layer--chip {
  bottom: calc(20 * var(--u));
  left: calc(30 * var(--u));
}

/* ---------- Notebook e celular do hero (capturas reais de um projeto) ----------
   Molduras desenhadas em CSS; a captura preenche a tela (object-fit: cover, a partir do topo). */
.laptop__screen {
  overflow: hidden;
  padding: calc(9 * var(--u));
  border-radius: calc(14 * var(--u)) calc(14 * var(--u)) 0 0;
  background: var(--color-ink);
  box-shadow: var(--shadow-mockup);
}

.laptop__image {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: calc(4 * var(--u));
  object-fit: cover;
  object-position: top;
}

/* Base do notebook: um pouco mais larga que a tela, com os cantos de baixo arredondados. */
.laptop__base {
  height: calc(12 * var(--u));
  margin-inline: calc(-22 * var(--u));
  border-radius: 0 0 calc(12 * var(--u)) calc(12 * var(--u));
  background: var(--color-window-dot);
  box-shadow: var(--shadow-mockup);
}

.phone {
  padding: calc(6 * var(--u));
  border-radius: calc(22 * var(--u));
  background: var(--color-ink);
  box-shadow: var(--shadow-mockup-strong);
}

.phone__screen {
  overflow: hidden;
  border-radius: calc(16 * var(--u));
}

.phone__image {
  width: 100%;
  height: auto;
  aspect-ratio: 398 / 883;
  object-fit: cover;
  object-position: top;
}

/* ---------- Chip "fluxo n8n" ---------- */
.flow-chip {
  display: flex;
  align-items: center;
  gap: calc(10 * var(--u));
  margin: 0;
  padding: calc(12 * var(--u)) calc(16 * var(--u));
  border-radius: calc(12 * var(--u));
  background: var(--color-ink);
  box-shadow: var(--shadow-chip);
  color: var(--color-white);
  font-size: max(0.75rem, calc(14 * var(--u)));
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.flow-chip__dot {
  flex-shrink: 0;
  width: calc(10 * var(--u));
  height: calc(10 * var(--u));
  border-radius: 50%;
  background: var(--color-cyan);
}

/* ---------- Cabeçalho de seção (rótulo + título + apoio) ---------- */
.section-heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0; /* como item flex (topo do portfólio), encolhe abaixo da maior palavra com fonte grande */
  max-width: 640px;
}

.section-heading__eyebrow {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-eyebrow);
}

.section-heading__title {
  font-size: var(--text-h2);
  font-weight: var(--weight-bold);
}

.section-heading__lead {
  font-size: var(--text-lg);
  line-height: var(--leading-body);
}

.section-heading--on-dark .section-heading__eyebrow {
  color: var(--color-cyan);
}

.section-heading--on-dark .section-heading__lead {
  color: var(--color-text-on-dark);
}

/* ---------- Faixa de marcas ---------- */
.brands__title {
  flex: 0 1 auto; /* pode encolher: com fonte grande, não empurra a página para os lados */
  min-width: 0;
  font-family: var(--font-body);
  font-size: var(--text-base-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ---------- Card de serviço ---------- */
.services__item {
  display: flex;
  min-width: 0; /* item de grid não encolhe abaixo da maior palavra sem isto (fonte grande) */
}

.service-card {
  display: flex;
  position: relative;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 0.875rem; /* 14 */
  padding: var(--space-7);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--color-white);
}

.service-card::before,
.project-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
}

.service-card::before {
  box-shadow: var(--shadow-card-hover);
}

.service-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-window);
  background: var(--color-chip-bg);
  color: var(--color-royal);
}

.service-card__title {
  font-size: var(--text-h4);
  font-weight: var(--weight-semibold);
  letter-spacing: normal;
}

.service-card__text {
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-text-muted);
}

/* ---------- Etapa do processo ---------- */
.step {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-5);
  border-top: 3px solid var(--color-blue);
}

.step__number {
  font-family: var(--font-display);
  font-size: var(--text-base-sm);
  font-weight: var(--weight-bold);
  color: var(--color-eyebrow);
}

.step__title {
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  letter-spacing: normal;
}

.step__text {
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-text-muted);
}

/* ---------- Faixa de chamada final (CTA) ---------- */
.cta__banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  padding: var(--space-16);
  border-radius: var(--radius-xl);
  background: var(--gradient-cta);
  color: var(--color-white);
}

.cta__text {
  display: flex;
  flex: 1 1 420px;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 560px; /* mantém o texto na parte escura do gradiente (contraste AA) */
}

.cta__title {
  font-size: var(--text-cta);
  font-weight: var(--weight-bold);
  line-height: 1.12;
}

.cta__lead {
  font-size: var(--text-lg);
  line-height: var(--leading-body);
  color: var(--color-text-on-blue);
}

.cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem; /* 14 */
}

@media (width <= 768px) {
  .cta__banner {
    padding: var(--space-10) min(var(--space-6), 6vw); /* lateral limitada: fonte grande em tela estreita */
    border-radius: var(--radius-lg);
  }

  /* Aqui o texto avança sobre a parte clara do gradiente: branco puro mantém o AA. */
  .cta__lead {
    color: var(--color-white);
  }
}

@media (width <= 480px) {
  .cta__actions .btn {
    flex: 1 1 100%;
  }
}

/* ---------- Faixa de marcas: peças ---------- */
.brands__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand-tile {
  display: flex;
  flex: 1 1 120px;
  align-items: center;
  justify-content: center;
  min-height: 48px; /* mínima, não fixa: com fonte grande o texto não é cortado */
  padding: var(--space-1) var(--space-3);
  border: 1px dashed var(--color-placeholder-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  color: var(--color-placeholder-text);
  text-align: center;
}

.brand-tile-logo,
.client-tile-logo {
  width: auto;
  max-height: 32px;
}

/* Logo quadrado ou redondo (ex.: selo do VIP Hotel): na mesma altura dos largos, sumiria.
   Na faixa ele usa toda a altura útil do tile (48px − 2 × 6px), sem mudar a altura da faixa. */
.brand-tile-logo--square {
  max-height: 36px;
}

.client-tile-logo--square {
  max-height: 56px;
}

/* ---------- Faixa de marcas em movimento (js/marquee.js) ---------- */
.brands--marquee .brands__track {
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, var(--color-ink) 8%, var(--color-ink) 92%, transparent); /* bordas esmaecidas (só a opacidade conta) */
}

.marquee__inner {
  display: flex;
  width: max-content;
}

.brands--marquee .brands__list {
  flex-wrap: nowrap;
  justify-content: flex-start;
  padding-right: var(--space-4); /* mesmo espaço entre as cópias: o loop não "pula" */
}

.brands--marquee .brand-tile {
  flex: 0 0 160px; /* largura fixa: MARQUEE_ITEM_WIDTH em js/marquee.js = 160 + 16 */

  /* width também: a lista mede a si mesma por max-content, e alguns motores (ex.: WebKit) somam a
     largura do conteúdo de cada quadro (logo + padding), não o flex-basis. A lista ficava mais
     estreita que os quadros e a cópia seguinte começava por cima do fim desta (logos sobrepostos). */
  width: 160px;
}

/* ---------- Portfólio: topo e filtros ---------- */
.portfolio__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
}

.portfolio__head .section-heading {
  max-width: 620px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem; /* 10 */
}

.filter {
  min-height: var(--tap-target);
  padding: 0 var(--space-5);
  border: 1px solid var(--color-border-dark-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-on-dark-soft);
  font-size: var(--text-base-sm);
  font-weight: var(--weight-semibold);
}

.filter:hover {
  border-color: var(--color-cyan);
}

.filter[aria-pressed="true"] {
  border-color: var(--color-cyan);
  background: var(--color-cyan);
  color: var(--color-deep);
}

/* ---------- Portfólio: projeto em destaque ---------- */
.featured {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-10);
  padding: var(--space-8);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-lg);
  background: var(--color-surface-dark);
}

.featured__info {
  display: flex;
  flex: 1 1 320px;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.featured__badge {
  align-self: flex-start;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-tag-dark);
  color: var(--color-accent-on-dark);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.featured__title {
  font-size: var(--text-h3-lg);
  font-weight: var(--weight-bold);
  line-height: 1.15;
  letter-spacing: normal;
}

.featured__summary {
  font-size: var(--text-md);
  line-height: 1.65;
  color: var(--color-text-on-dark);
}

.featured__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tag {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-xs);
  background: var(--color-tag-dark);
  color: var(--color-text-on-dark-soft);
  font-size: var(--text-sm);
}

.featured__link {
  align-self: flex-start;
}

.featured__link::after {
  content: "→";
  font-weight: var(--weight-bold);
}

@media (width <= 768px) {
  .featured {
    gap: var(--space-6);
    padding: var(--space-5);
  }

  .shot--featured .shot__media {
    height: 120px;
  }
}

/* ---------- Janela de navegador (captura ou placeholder) ---------- */
.shot {
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--color-white);
}

.shot--featured {
  flex: 1 1 520px; /* coluna do visual dentro de .featured */
  min-width: 0;
  border-radius: var(--radius-window);
  box-shadow: var(--shadow-dark);
}

.shot__bar {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-line);
  background: var(--color-mist);
}

.shot--featured .shot__bar {
  padding: 0.625rem 0.875rem;
}

.shot__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-window-dot);
}

.shot--featured .shot__dot {
  width: 9px;
  height: 9px;
}

.shot__address {
  flex: 1;
  height: 18px;
  margin-left: var(--space-3);
  border-radius: 9px;
  background: var(--color-window-bar);
}

.shot__body {
  display: flex;
  flex-direction: column;
  transform-origin: center top; /* zoom do hover só dentro da janela; a barra fica parada */
  gap: 0.625rem;
  height: 170px;
  padding: 0.875rem;
}

.shot--featured .shot__body {
  gap: 0.875rem;
  height: auto;
  padding: var(--space-5);
}

.shot__media {
  flex-shrink: 0;
  height: 84px;
  border-radius: var(--radius-xs);
}

.shot--featured .shot__media {
  height: 190px;
  border-radius: var(--radius-sm);
}

.shot__media--featured { background: var(--gradient-featured); }
.shot__media--tone-1 { background: linear-gradient(135deg, var(--tone-1-from), var(--tone-1-to)); }
.shot__media--tone-2 { background: linear-gradient(135deg, var(--tone-2-from), var(--tone-2-to)); }
.shot__media--tone-3 { background: linear-gradient(135deg, var(--tone-3-from), var(--tone-3-to)); }
.shot__media--tone-4 { background: linear-gradient(135deg, var(--tone-4-from), var(--tone-4-to)); }
.shot__media--tone-5 { background: linear-gradient(135deg, var(--tone-5-from), var(--tone-5-to)); }
.shot__media--tone-6 { background: linear-gradient(135deg, var(--tone-6-from), var(--tone-6-to)); }

.shot__line {
  height: 9px;
  border-radius: 5px;
  background: var(--color-line);
}

.shot--featured .shot__line {
  height: 12px;
  border-radius: 6px;
}

.shot__line--w80 { width: 80%; }
.shot__line--w70 { width: 70%; }
.shot__line--w55 { width: 55%; }
.shot__line--w40 { width: 40%; }

.shot__row {
  display: flex;
  gap: var(--space-3);
}

.shot__stack {
  display: flex;
  flex: 2;
  flex-direction: column;
  gap: var(--space-2);
}

.shot__pill {
  flex: 1;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--color-royal);
}

.shot__box {
  flex: 1;
  height: 70px;
  border-radius: var(--radius-sm);
  background: var(--color-mist);
}

/* Captura real: uma "janela" de proporção fixa que mostra o topo da imagem. */
.shot__viewport {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.shot__image {
  width: 100%;
  height: 100%;
  transform-origin: center top;
  object-fit: cover;
  object-position: top;
}

/* Captura da página inteira (bem mais alta que larga): a imagem fica na altura natural e
   rola dentro da janela até a base dela encostar na base da janela (css/animations.css).

   O fim da rolagem sai das proporções, e não de uma porcentagem fixa:
     altura da janela / altura da imagem = proporção da imagem / proporção da janela
     (as duas têm a mesma largura), então fim = (img / janela − 1) × 100% da altura da imagem.
   --shot-img-ratio (largura ÷ altura da imagem) vem do JSON, posto pelo js/portfolio.js;
   --shot-view-ratio é a janela de cada tipo de card. Ex.: Jardel 529 × 2000 numa janela 16:10
   → (0,2645 / 1,6 − 1) = −83,5%; AcadMeta 1551 × 6877 na janela do destaque → −85,2%. */
.shot--scroll {
  --shot-view-ratio: 1.6; /* 16:10, igual à janela dos cards */
  --shot-scroll-end: calc((var(--shot-img-ratio, 1) / var(--shot-view-ratio) - 1) * 100%);

  position: relative;
}

/* No destaque, a janela é um pouco mais alta (escolhida no projeto da AcadMeta: fim em −85,2%). */
.shot--featured.shot--scroll {
  --shot-view-ratio: calc(1551 / 1018);
}

.shot--scroll .shot__viewport {
  aspect-ratio: var(--shot-view-ratio);
}

/* Enquanto a captura inteira não chegou, a capa (leve) preenche a janela pelo topo;
   com a captura inteira no lugar (.shot--ready), a imagem fica na altura natural para rolar. */
.shot--ready .shot__image {
  height: auto;
  object-fit: fill;
}

/* Botão "Ver rolagem": no toque não existe hover, então é ele que liga/desliga a rolagem.
   Fica sobre o canto da janela. O estado vive no aria-pressed (o CSS lê o atributo).
   Sem box-shadow próprio: ele apagaria a linha escura do anel de foco (base.css). */
.shot__toggle {
  display: inline-flex;
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-3);
  z-index: 1;
  align-items: center;
  min-height: var(--tap-target);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--color-ink);
  color: var(--color-white);
  font-size: var(--text-base-sm);
  font-weight: var(--weight-semibold);
}

.shot__toggle[aria-pressed="true"] {
  background: var(--color-cyan);
  color: var(--color-deep);
}

/* Com mouse a rolagem acontece no hover: o botão some da tela, mas continua acessível
   pelo teclado (aparece ao receber foco), como o link "pular para o conteúdo". */
@media (hover: hover) and (pointer: fine) {
  .shot__toggle:not(:focus-visible) {
    width: 1px;
    min-height: 0;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Quem pede menos movimento não tem rolagem: a captura fica parada no topo. */
@media (prefers-reduced-motion: reduce) {
  .shot__toggle {
    display: none;
  }
}

/* ---------- Janela de WhatsApp (projetos de automação) ----------
   Mesma proporção das capturas (16:10): o card fica da altura dos outros. A conversa rola
   dentro da janela; o botão "Ver conversa" reaproveita o visual do "Ver rolagem" (.shot__toggle). */
.chat {
  margin: 0;
}

.chat__window {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--color-chat-bg);
}

.chat__bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: calc(var(--tap-target) + 2 * var(--space-1)); /* cabe o "Ver conversa" */
  padding: var(--space-1) var(--space-3);
  background: var(--color-chat-bar);
}

/* No chat o botão fica na barra do topo, à direita: sobre as mensagens ele cobriria a última. */
.chat__window .shot__toggle {
  top: var(--space-1);
  right: var(--space-2);
  bottom: auto;
}

.chat__avatar {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: var(--color-white);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
}

.chat__avatar--photo {
  object-fit: cover;
  background: none;
}

.chat__who {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.chat__name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-chat-text);
}

.chat__status {
  font-size: var(--text-xs);
  color: var(--color-chat-meta);
}

.chat__viewport {
  aspect-ratio: 16 / 10;
  overflow-y: auto;
  padding: var(--space-3);
  scrollbar-color: var(--color-chat-in) transparent;
  scrollbar-width: thin;
}

.chat__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.chat__msg {
  max-width: 85%;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-xs);
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--color-chat-text);
  overflow-wrap: anywhere;
}

.chat__msg--in {
  align-self: flex-start;
  border-top-left-radius: 2px;
  background: var(--color-chat-in);
}

.chat__msg--out {
  align-self: flex-end;
  border-top-right-radius: 2px;
  background: var(--color-chat-out);
}

/* Ainda não "enviada": fora da vista, mas no DOM (leitor de tela e buscador leem a conversa toda). */
.chat__msg--pending {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Desenho do botão do WhatsApp dentro do balão (não clicável). */
.chat__action {
  display: block;
  margin: var(--space-1) calc(-1 * var(--space-2)) calc(-1 * var(--space-1));
  padding: var(--space-1) var(--space-2);
  border-top: 1px solid var(--color-chat-divider);
  font-weight: var(--weight-semibold);
  text-align: center;
  color: var(--color-chat-link);
}

.chat__typing {
  display: inline-flex;
  gap: 4px;
  margin-top: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-xs);
  border-top-left-radius: 2px;
  background: var(--color-chat-in);
}

.chat__typing[hidden] {
  display: none; /* o display acima venceria o atributo hidden */
}

.chat__typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-chat-meta);
}

.chat__note {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--color-text-on-dark);
}

/* ---------- Portfólio: grade → carrossel ---------- */
.portfolio__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: var(--space-6);
}

.portfolio__item {
  display: flex;
}

/* Exatamente 4 cards visíveis (contando o filtro): 2 × 2 em vez de 3 + 1 sozinho.
   No carrossel (≤ 768px) a grade vira flex e esta regra não tem efeito. */
.portfolio__grid:has(> :nth-child(4 of :not([hidden])):nth-last-child(1 of :not([hidden]))) {
  grid-template-columns: repeat(2, 1fr);
}

.project-card {
  display: flex;
  position: relative; /* sem overflow:hidden: cortaria a sombra do hover */
  flex: 1;
  flex-direction: column;
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-card);
  background: var(--color-surface-dark);
}

.project-card::before {
  z-index: 1; /* o anel ciano do hover fica por cima da borda */
  box-shadow: var(--shadow-card-dark-hover);
}

.project-card__visual {
  padding: var(--space-5) var(--space-5) 0;
}

.project-card__body {
  display: flex;
  flex: 1; /* ocupa a sobra do card: o botão "Ver site" fica na base */
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
}

.project-card__type {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-accent-on-dark);
}

.project-card__title {
  font-size: var(--text-h4);
  font-weight: var(--weight-semibold);
  letter-spacing: normal;
}

.project-card__text {
  font-size: var(--text-base-sm);
  line-height: 1.55;
  color: var(--color-text-on-dark);
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block: var(--space-1) var(--space-2);
}

/* "Ver site": mesmo botão do destaque, menor. margin-top: auto alinha os botões na base dos cards. */
.project-card__cta {
  align-self: flex-start;
  margin-top: auto;
}

.project-card__cta::after {
  content: "→";
  font-weight: var(--weight-bold);
}

.portfolio__empty,
.load-error {
  font-size: var(--text-md);
  color: var(--color-text-on-dark);
}

.clients .load-error {
  color: var(--color-text-muted);
}

/* Celular: a grade vira carrossel horizontal com "encaixe" em cada card. */
@media (width <= 768px) {
  .portfolio__scroller {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    padding-bottom: var(--space-3); /* espaço para o anel de foco e a barra de rolagem */
  }

  .portfolio__grid {
    display: flex;
    gap: var(--space-4);
  }

  .portfolio__item {
    flex: 0 0 85%;
    scroll-snap-align: start;
  }
}

/* ---------- Clientes ---------- */
.clients__body {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--space-6);
}

.clients__grid {
  display: grid;
  flex: 1 1 520px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  align-content: center; /* poucos clientes: a linha de logos fica no meio da altura do depoimento ao lado */
  gap: var(--space-4);
  min-width: 0;
}

/* Sem depoimento ao lado (escondido no index.html): os logos dividem a largura toda,
   em vez de ficarem encostados à esquerda com colunas vazias. */
.clients__body:has(> .testimonial[hidden]) > .clients__grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* Exatamente 4 clientes, lado a lado com o depoimento: 2 × 2 em vez de 3 + 1 sozinho. */
@media (width > 968px) {
  .clients__grid:has(> :nth-child(4):last-child) {
    grid-template-columns: repeat(2, 1fr);
  }
}

.client-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 96px;
  padding-inline: var(--space-4);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-tile);
  background: var(--color-white);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  color: var(--color-placeholder-text);
  text-align: center;
}

/* Logo/nome com link: ocupa o quadro inteiro (área de toque grande). */
.client-tile-link,
.brand-tile-link {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 100%;
  border-radius: inherit;
  color: inherit;
}

.client-tile:has(.client-tile-link) {
  padding-inline: 0;
}

.testimonial {
  display: flex;
  flex: 1 1 360px;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-7);
  min-width: 0;
  padding: 2.25rem; /* 36 */
  border-radius: var(--radius-lg);
  background: var(--color-royal);
  color: var(--color-white);
}

.testimonial__text {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
}

.testimonial__author {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.testimonial__avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-cyan);
  object-fit: cover;
}

.testimonial__who {
  display: flex;
  flex-direction: column;
  font-size: var(--text-base);
  line-height: 1.3;
}

.testimonial__name {
  font-weight: var(--weight-semibold);
}

.testimonial__role {
  color: var(--color-text-on-dark);
}

@media (width <= 480px) {
  .testimonial {
    padding: var(--space-6);
  }

  .testimonial__text {
    font-size: var(--text-h4);
  }
}

/* ---------- Rodapé ---------- */
.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: var(--weight-bold);
  color: var(--color-white);
}

.footer-brand__symbol {
  width: 46px;
  height: auto;
}

.footer-brand__accent {
  color: var(--color-cyan);
}

.footer-brand__text {
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  min-width: 0; /* item de flex: sem isso não encolhe abaixo do texto mais longo (o e-mail) */
  font-size: var(--text-base);
}

.footer-nav__title {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  letter-spacing: normal;
  color: var(--color-white);
}

.footer-nav__list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer-nav__link:hover {
  color: var(--color-white);
}

.footer-legal {
  font-size: var(--text-sm);
  color: var(--color-text-on-dark-faint);
}

.footer-nav__address {
  font-style: normal;

  /* E-mail e @ não têm espaço para quebrar: com a fonte grande, quebram em qualquer ponto
     em vez de empurrar a página para os lados. */
  overflow-wrap: anywhere;
}
