/* =========================================================
   Stratus IA — bloco de públicos (carrossel de cards; o aberto fica no centro)
   ========================================================= */

.aud { padding: clamp(40px, 5vw, 80px) var(--side) clamp(80px, 10vw, 140px); }

.aud__head {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.6fr);
  align-items: end;
  gap: 32px;
  margin-bottom: clamp(36px, 5vw, 56px);
}
.aud__title {
  font-size: clamp(2.6rem, 1rem + 4.6vw, 5.8rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.aud__kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.aud__kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}
/* "Feita para" fixo + o perfil ativo trocando embaixo (altura reservada para não pular) */
.aud__title { min-height: 2.04em; }
.aud__title > span { display: block; }
.aud__pre { color: rgba(242, 244, 247, 0.32); }
.aud__swap { display: inline-block; color: var(--text); will-change: transform, filter; }
/* troca junto com o perfil; altura de 3 linhas reservada para nada pular */
.aud__lead { justify-self: end; max-width: 34ch; min-height: 4.8em; font-size: 1.12rem; color: var(--muted); will-change: transform, filter; }

/* botões com todos os perfis, sincronizados com os painéis */
.aud__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 clamp(22px, 3vw, 30px);
}
.aud__chip {
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font: 500 15px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.aud__chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.32); }
.aud__chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.aud__chip.is-on {
  background: #fff;
  border-color: #fff;
  color: #0B0D12;
  box-shadow: 0 10px 30px -10px rgba(77, 163, 255, 0.6);
}

/* ---------- Painéis: cards retangulares em uma fileira que rola de lado ---------- */

.aud__panels {
  display: flex;
  gap: 12px;
  height: clamp(580px, 82vh, 840px);
  /* a fileira vaza até as bordas da tela; o padding mantém o primeiro card alinhado ao conteúdo */
  margin: 0 calc(var(--side) * -1);
  padding: 0 var(--side);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.aud__panels::-webkit-scrollbar { display: none; }
/* com JS: carrossel infinito, o card aberto sempre no centro (posições calculadas no audiences.js) */
.aud__panels.is-carousel {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  overflow: clip; /* sem rolagem interna: o foco do teclado não desloca os cards */
  touch-action: pan-y;
}
.aud__panels.is-carousel .aud__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
}
@media (hover: hover) and (pointer: fine) {
  .aud__panels { cursor: grab; }
}
.aud__panels.is-dragging,
.aud__panels.is-dragging .aud__toggle { cursor: grabbing; user-select: none; }

/* larguras calculadas no JS (--aud-wc fechado, --aud-wa aberto); os valores daqui são o fallback */
.aud__panel {
  position: relative;
  flex: none;
  width: var(--aud-wc, clamp(280px, 26vw, 400px));
  border-radius: 30px;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg-2);
  border: 1px solid var(--line);
  --mx: 50%;
  --my: 40%;
}
.aud__panel.is-active { width: var(--aud-wa, min(860px, 64vw)); }

.aud__video {
  position: absolute;
  top: -6%;
  left: 0;
  z-index: -3;
  width: 100%;
  height: 112%;
  max-width: none;
  object-fit: cover;
  filter: grayscale(0.55) brightness(0.45);
  transition: filter 0.9s ease;
}
.aud__panel.is-active .aud__video { filter: saturate(1.05) brightness(0.78); }
/* vídeos repetidos entre perfis: espelhados e com outro enquadramento */
.aud__video--alt { transform: scaleX(-1); object-position: 30% 50%; }

.aud__shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, rgba(3, 6, 13, 0.35) 0%, rgba(3, 6, 13, 0.05) 32%, rgba(3, 6, 13, 0.55) 62%, rgba(3, 6, 13, 0.94) 100%);
}
/* brilho que segue o cursor */
.aud__panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(77, 163, 255, 0.2), transparent 60%);
  transition: opacity 0.4s ease;
}
.aud__panel:hover::after { opacity: 1; }
.aud__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border-radius: inherit;
  border: 1px solid transparent;
  transition: border-color 0.5s ease;
}
.aud__panel.is-active::before { border-color: rgba(77, 163, 255, 0.35); }

/* barra de tempo da troca automática */
.aud__timer {
  position: absolute;
  top: 18px;
  left: 22px;
  right: 22px;
  z-index: 3;
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.aud__timer i {
  display: block;
  height: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.aud__panel.is-active .aud__timer { opacity: 1; }

/* título do card fechado (embaixo, à esquerda) */
.aud__toggle {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0 clamp(22px, 2.4vw, 34px) clamp(26px, 2.6vw, 38px);
  text-align: left;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  border-radius: inherit;
}
.aud__panel.is-before .aud__toggle { justify-content: flex-end; text-align: right; }
.aud__toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.aud__panel.is-active .aud__toggle { pointer-events: none; }
.aud__vtitle {
  max-width: 11ch;
  font-size: clamp(1.3rem, 0.8rem + 1vw, 2rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
  transition: opacity 0.45s ease, transform 0.6s var(--ease);
}
.aud__panel.is-active .aud__vtitle { opacity: 0; }
.aud__panel:not(.is-active):hover .aud__vtitle { transform: translateY(-6px); }

/* selo de status */
.aud__hud {
  position: absolute;
  top: 36px;
  right: 22px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 14, 22, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #E2E8F0;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.aud__hud i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ADE80;
  animation: pulseDot 1.6s ease-in-out infinite;
}
.aud__panel.is-active .aud__hud { opacity: 1; }

/* conteúdo do painel aberto */
.aud__body {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 300px);
  align-items: end;
  gap: 28px;
  /* largura fixa do painel aberto (calculada no JS) para o texto não refluir durante a expansão */
  width: var(--aud-w, 780px);
  max-width: none;
  padding: 0 clamp(24px, 3vw, 44px) clamp(26px, 3vw, 40px);
  visibility: hidden;
}
.aud__panel.is-active .aud__body { visibility: visible; }
.aud__codes {
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--amber);
}
.aud__body h3 {
  max-width: 13ch;
  font-size: clamp(2.2rem, 1rem + 2.6vw, 3.8rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.aud__who { margin-top: 14px; max-width: 34ch; color: rgba(242, 244, 247, 0.78); }
.aud__list {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 20px 0 24px;
  padding: 0;
}
.aud__list li {
  position: relative;
  padding-left: 26px;
  font-size: 15px;
}
.aud__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(77, 163, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(77, 163, 255, 0.5);
}
.aud__list li::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 7px;
  width: 6px;
  height: 3.5px;
  border-left: 1.6px solid #BFDBFE;
  border-bottom: 1.6px solid #BFDBFE;
  transform: rotate(-45deg);
}
.aud__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.aud__link {
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  transition: border-color 0.3s ease;
}
.aud__link:hover { border-color: #fff; }

/* mini conversa do WhatsApp */
.aud__chat { display: grid; gap: 8px; }
.aud__bubble {
  position: relative;
  padding: 9px 11px 6px;
  border-radius: 12px;
  color: #E9EDEF;
  font-size: 13.5px;
  line-height: 1.42;
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.8);
}
.aud__bubble b { display: block; margin-bottom: 2px; font-weight: 700; }
.aud__bubble em { display: block; margin-top: 4px; font-style: italic; font-size: 11.5px; color: #8696A0; }
.aud__bubble span {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
  font-size: 10.5px;
  color: rgba(233, 237, 239, 0.6);
}
.aud__bubble span svg { width: 16px; height: 11px; color: #53BDEB; }
.aud__bubble--out { justify-self: end; max-width: 92%; background: #005C4B; border-top-right-radius: 3px; }
.aud__bubble--in {
  background: rgba(32, 44, 51, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top-left-radius: 3px;
}
.aud__typing {
  justify-self: start;
  display: none;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  border-top-left-radius: 3px;
  background: rgba(32, 44, 51, 0.94);
}
.aud__typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8696A0;
  animation: typing 1.1s infinite ease-in-out;
}
.aud__typing i:nth-child(2) { animation-delay: 0.15s; }
.aud__typing i:nth-child(3) { animation-delay: 0.3s; }

/* ---------- Telas menores ---------- */

@media (max-width: 1100px) {
  .aud__body { grid-template-columns: 1fr; gap: 18px; }
  .aud__list { display: none; }
}

@media (max-width: 900px) {
  .aud__head { grid-template-columns: 1fr; }
  .aud__lead { justify-self: start; }
  .aud__panels { gap: 10px; }
  .aud__title { min-height: 3.06em; }
  /* perfis em uma linha que rola de lado */
  .aud__chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-left: calc(var(--side) * -1);
    margin-right: calc(var(--side) * -1);
    padding: 4px var(--side) 6px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--side), #000 calc(100% - var(--side)), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 var(--side), #000 calc(100% - var(--side)), transparent 100%);
  }
  .aud__chips::-webkit-scrollbar { display: none; }
  .aud__chip { flex: none; height: 40px; padding: 0 16px; font-size: 14px; }
  .aud__panel { border-radius: 24px; }
  /* os vizinhos só aparecem como uma fresta: o nome deles fica nos chips acima */
  .aud__vtitle { opacity: 0; }
  .aud__hud { top: 30px; right: 18px; }
  .aud__body h3 { max-width: none; font-size: 2.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .aud__hud i, .aud__typing i { animation: none; }
  .aud__video { transition: none; }
}
