/*
  cases.css — portfólio: case principal (Limpurb), comparativo de crescimento, insights e reels.
  Carregado depois de sections.css (reaproveita .carousel, .work-card-top, .tag-badge).
*/

.case-featured-cover img,
.series-item img,
.reel-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out-expo);
}

/* ---------- Case principal ---------- */
.case-featured {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-bottom: 2rem;
  padding: 2.5rem;
  border-radius: 24px;
}

.case-featured-head {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}

.case-featured-cover {
  aspect-ratio: 3 / 4;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
}
.case-featured-cover:hover img {
  transform: scale(1.05);
}

.case-featured .work-card-top {
  margin-bottom: 1.5rem;
}

.case-title {
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
}

.case-period {
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}
.case-period a {
  color: var(--accent-color);
  text-decoration: none;
  text-transform: none;
}
.case-period a:hover {
  text-decoration: underline;
}

.case-desc {
  max-width: 560px;
  margin-bottom: 2rem;
  font-size: 1.18rem;
  line-height: 1.6;
  color: #d4d4d8;
}

.case-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.case-stats dt {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}
.case-stats dd {
  margin-top: 0.35rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.3rem, 3vw, 2rem);
  line-height: 1.1;
  color: var(--accent-color);
}

.case-process {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.case-process li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 0.95rem;
  font-weight: 600;
}
.case-process span {
  font-family: monospace;
  font-size: 0.84rem;
  color: var(--accent-color);
}

.case-subtitle {
  margin-bottom: 1.25rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

/* Comparativo de crescimento (antes/depois) */
.growth-compare {
  margin-bottom: 2.5rem;
}
.growth-compare-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
}
.growth-compare-item {
  position: relative;
  margin: 0;
  aspect-ratio: 2 / 1; /* Cropped to focus only on top section */
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
}
.growth-compare-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.9s var(--ease-out-expo);
}
.growth-compare-item:hover img {
  transform: scale(1.05);
}
.growth-compare-item figcaption {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  background: rgba(20,21,23,0.88);
}
.growth-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}
.growth-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--accent-color);
}
.growth-compare-arrow {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-color);
}

/* Séries */
.series-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.series-item {
  position: relative;
  aspect-ratio: 3 / 4;
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
}
.case-note {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #7b7e85;
}

/* ---------- Responsivo ---------- */
@media (max-width: 1024px) {
  .case-featured-head { grid-template-columns: 1fr; }
  /* min(): em 390px o card só tem ~302px úteis; 320px fixos invadiam o padding */
  .case-featured-cover { width: min(320px, 100%); }
  .series-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .case-featured { padding: 1.5rem; gap: 2.5rem; }
  .case-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .growth-compare-grid { grid-template-columns: 1fr; }
  .growth-compare-arrow { justify-self: center; transform: rotate(90deg); }
}

.insights-data-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 768px) {
  .insights-data-grid {
    grid-template-columns: 1fr;
  }
}

.insight-data-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.35s ease, box-shadow 0.35s ease;
}

.insight-data-card:hover {
  transform: translateY(-4px);
  border-color: rgba(254, 99, 61, 0.35);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35), 0 0 20px rgba(254, 99, 61, 0.15);
}

.insight-number {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--accent-color);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: inline-block;
  transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.3s ease;
}

.insight-data-card.is-counting .insight-number {
  color: #ff7d57;
  text-shadow: 0 0 20px rgba(254, 99, 61, 0.6);
}

.insight-data-card.is-counted .insight-number {
  animation: numberSettle 0.45s ease-out;
}

@keyframes numberSettle {
  0% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.insight-text {
  font-size: 1.06rem;
  color: var(--text-secondary);
  line-height: 1.6;
}


.textual-growth {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2rem;
}

.growth-text-callout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.growth-number-huge {
  font-family: var(--font-display);
  /* Fixo em 3rem, "4x mais seguidores" não cabia numa linha no celular e a regra global de
     overflow-wrap (mobile.css, pensada para e-mail/URL) quebrava a palavra no meio:
     "seguidore" / "s". O clamp encolhe antes de chegar nesse ponto. */
  font-size: clamp(1.7rem, 7vw, 3rem);
  font-weight: 800;
  color: var(--accent-color);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.growth-description {
  font-size: 1.18rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.growth-description strong {
  color: #fff;
  font-weight: 600;
}


/* Reels Restored Styles */
.reels-track > * {
  flex: 0 0 clamp(190px, 22%, 245px);
}
.reel-card {
  position: relative;
  margin: 0;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0d1117;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.4s ease, box-shadow 0.4s ease;
  cursor: pointer;
}
.reel-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reel-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(254, 99, 61, 0.45);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.75), 0 0 25px rgba(254, 99, 61, 0.22);
  z-index: 2;
}
.reel-card:hover img {
  transform: scale(1.06);
}
.reel-card figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 3rem 0.85rem 0.85rem;
  background: linear-gradient(to top, rgba(9, 11, 16, 0.96) 0%, rgba(9, 11, 16, 0.8) 55%, transparent 100%);
  pointer-events: none;
}

.reel-views {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--accent-color);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  background: rgba(14, 18, 25, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(254, 99, 61, 0.28);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: border-color 0.35s ease, box-shadow 0.35s ease, background 0.35s ease, transform 0.35s ease;
}

.reel-views-icon {
  font-size: 0.75rem;
  color: var(--accent-color);
  display: inline-flex;
  align-items: center;
  animation: reelPulse 2.4s ease-in-out infinite;
}

@keyframes reelPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 1px rgba(254,99,61,0.5)); }
  50% { transform: scale(1.25); filter: drop-shadow(0 0 8px rgba(254,99,61,0.95)); }
}

.reel-views-count {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.reel-views.is-counting {
  border-color: rgba(254, 99, 61, 0.65);
  background: rgba(254, 99, 61, 0.15);
  box-shadow: 0 4px 18px rgba(254, 99, 61, 0.35), 0 0 15px rgba(254, 99, 61, 0.25);
}

.reel-card:hover .reel-views {
  border-color: rgba(254, 99, 61, 0.6);
  background: rgba(20, 24, 34, 0.92);
  box-shadow: 0 4px 20px rgba(254, 99, 61, 0.4);
}

.reel-title {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.3;
  color: #f1f1f5;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

/* ---------- Outros clientes: "perfis folhados" ----------
   Cada card é uma pilha: o print do perfil por cima (.leaf--profile) e 3 posts por baixo
   (.leaf--post), levemente girados para as bordas aparecerem. Aberto (hover com mouse, toque
   ou Enter/Espaço via js/clients-carousel.js), o perfil dobra pra cima e some, e os posts se
   desdobram lado a lado. O .leaf-deck tem proporção fixa, então nada empurra o layout. */
.clients-more {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}
.clients-more-lead {
  max-width: 520px;
  margin: 0 auto 2.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.leaf-grid {
  --leaf-ease: cubic-bezier(0.65, 0, 0.35, 1);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem;
  text-align: left;
}

.leaf-card {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.15rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  transition: border-color 0.4s ease, background 0.4s ease;
}
.leaf-card.is-featured {
  border-color: rgba(254,99,61,0.55);
  background: rgba(254,99,61,0.05);
}

/* Cabeçalho: logo + nome + @ */
.leaf-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.leaf-avatar {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.15);
}
.leaf-id {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.leaf-id h5 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leaf-id span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leaf-number {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* A pilha */
.leaf-deck {
  position: relative;
  aspect-ratio: 100 / 46;
  perspective: 900px;
  border-radius: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.leaf-deck:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 6px;
}

.leaf {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #0f1116;
  translate: -50% -50%;
  backface-visibility: hidden;
  box-shadow: 0 12px 26px -12px rgba(0,0,0,0.75);
}
.leaf img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Posts: fechados, empilhados atrás do perfil com as pontas aparecendo */
.leaf--post {
  width: 31%;
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(255,255,255,0.12);
  transition:
    translate 0.8s var(--leaf-ease),
    rotate 0.8s var(--leaf-ease),
    transform 0.8s var(--leaf-ease);
}
.leaf--1 { z-index: 1; translate: -78% -50%; rotate: -8deg; transform: rotateY(28deg); }
.leaf--2 { z-index: 2; translate: -50% -53%; rotate: 1.5deg; }
.leaf--3 { z-index: 1; translate: -22% -50%; rotate: 8deg; transform: rotateY(-28deg); }

/* Perfil: a "capa" da pilha. Fechando, espera os posts se juntarem antes de voltar. */
.leaf--profile {
  z-index: 5;
  width: 92%;
  aspect-ratio: 8 / 3;
  border: 1px solid rgba(255,255,255,0.14);
  transform-origin: 50% 0%;
  transition:
    transform 0.7s var(--leaf-ease) 0.35s,
    opacity 0.3s ease 0.35s;
}
.leaf--profile img {
  object-position: left top;
}
.leaf-count {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  background: var(--accent-color);
  color: var(--accent-ink);
  font-size: 0.68rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Aberto */
.leaf-card.is-open .leaf--profile {
  opacity: 0;
  transform: translateY(-30%) rotateX(80deg);
  transition:
    transform 0.8s var(--leaf-ease),
    opacity 0.4s ease 0.3s;
}
.leaf-card.is-open .leaf--post { rotate: 0deg; transform: rotateY(0deg); }
.leaf-card.is-open .leaf--1 { translate: -158% -50%; transition-delay: 0.14s; }
.leaf-card.is-open .leaf--2 { translate: -50% -50%; transition-delay: 0.06s; }
.leaf-card.is-open .leaf--3 { translate: 58% -50%; transition-delay: 0.22s; }

@media (hover: hover) {
  .leaf-card:hover .leaf--profile {
    opacity: 0;
    transform: translateY(-30%) rotateX(80deg);
    transition:
      transform 0.8s var(--leaf-ease) 0.08s,
      opacity 0.4s ease 0.38s;
  }
  .leaf-card:hover .leaf--post { rotate: 0deg; transform: rotateY(0deg); }
  .leaf-card:hover .leaf--1 { translate: -158% -50%; transition-delay: 0.22s; }
  .leaf-card:hover .leaf--2 { translate: -50% -50%; transition-delay: 0.14s; }
  .leaf-card:hover .leaf--3 { translate: 58% -50%; transition-delay: 0.3s; }
  .leaf-card:hover { border-color: rgba(255,255,255,0.22); }
  .leaf-card.is-featured:hover { border-color: var(--accent-color); }
}

/* Rodapé: tags, frase e link */
.leaf-foot {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.leaf-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
.leaf-cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.leaf-card.is-featured .leaf-cta,
.leaf-cta:hover,
.leaf-cta:focus-visible {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--accent-ink);
}
.leaf-cta-arrow {
  display: inline-block;
  transition: rotate 0.3s ease;
}
.leaf-cta:hover .leaf-cta-arrow {
  rotate: 45deg;
}

@media (prefers-reduced-motion: reduce) {
  .leaf {
    transition-duration: 0.01s !important;
    transition-delay: 0s !important;
  }
}
