/* ==========================================================================
   06 · PARA QUEM É
   Mobile: título em 2 linhas, texto, características em lista, personagem
   à direita e o bloco escuro final sobre a base dele.
   Desktop (>= 64em): título à esquerda e texto após um fio; características
   em 2x2 e bloco escuro à esquerda; personagem em sticker sobre papel verde
   à direita, subindo até a altura do texto.

   Título no Archivo 900 a 70%: NÃO É PARA 4,57em · TODO MUNDO. 5,51em
   (+0,6em de fita). font-size (cqi) = fração da largura x 100 / largura em em.
   ========================================================================== */

.audience {
  position: relative;
  z-index: 1;
  padding-top: var(--section-space);
  padding-bottom: calc(var(--section-space) * 0.8 + var(--tear-h) * 1.6);
}

.audience__deco {
  position: absolute;
  inset: 0;
  overflow: clip;
  pointer-events: none;
}

.audience__corner--top {
  top: 0;
  right: 0;
  display: none;
  width: min(36vw, 26rem);
  height: clamp(4.5rem, 12vw, 10rem);
}

.audience__corner--bottom {
  bottom: calc(var(--tear-h) * 0.55);
  left: 0;
  width: min(46vw, 15rem);
  height: clamp(4.5rem, 18vw, 8.5rem);
  rotate: 180deg;
}

.audience__inner {
  position: relative;
  z-index: 1;
}

/* Abertura: título e texto ----------------------------------------------- */
.audience__intro {
  display: grid;
  gap: var(--sp-5);
  margin-top: var(--sp-6);
}

.audience__headline {
  width: min(100%, 34rem);
  container-type: inline-size;
}

.audience__title {
  font-weight: 900;
  line-height: 0.9;
  text-transform: uppercase;
}

.au-line {
  display: block;
  width: fit-content;
  font-size: 15.8cqi;
  font-stretch: 70%;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* TODO MUNDO. inclinado sobre a fita, quase na largura toda */
.au-line--2 {
  --tape-rotate: -1.4deg;
  margin-top: 0.12em;
  padding: 0.14em 0.3em 0.06em;
}

.au-line--2 .w {
  transform: skewX(-8deg);
}

.audience__lead {
  --reveal-delay: 150ms;
  max-width: 26em;
  font-size: clamp(1.0625rem, 0.92rem + 0.55vw, 1.5rem);
  line-height: 1.45;
}

/* Características -------------------------------------------------------- */
.audience__body {
  display: grid;
  margin-top: var(--sp-7);
}

.audience__fits {
  display: grid;
  gap: var(--sp-4);
  padding: 0;
  list-style: none;
}

.fit {
  --d: 0ms;
  --rot: -2deg;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-4);
  -webkit-tap-highlight-color: transparent;
  transition:
    opacity 500ms linear var(--d),
    translate 900ms var(--ease-out) var(--d);
}

.fit--2 { --rot: 1.5deg; }
.fit--3 { --rot: -1deg; }
.fit--4 { --rot: 2deg; }

/* Quadrado de papel com o ícone: o recorte fica no ::before, a sombra no
   próprio quadrado (fora do recorte). */
.fit__tile {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(4.25rem, 3.4rem + 3.4vw, 7rem);
  aspect-ratio: 1;
  rotate: var(--rot);
  filter:
    drop-shadow(0 1px 1px rgb(17 17 17 / 0.1))
    drop-shadow(0 8px 10px rgb(17 17 17 / 0.14));
  transition:
    rotate var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out),
    filter var(--dur-base) var(--ease-out);
}

.fit__tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: color-mix(in srgb, var(--c-gray) 45%, var(--c-white));
  background-image: var(--tex-paper);
  clip-path: var(--cut);
}

.fit__icon {
  position: relative;
  width: 56%;
  height: 56%;
  overflow: visible;
}

.fit__icon g {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fit__icon .ic-bar {
  stroke: none;
}

.fit__text {
  max-width: 22em;
  font-size: clamp(1rem, 0.94rem + 0.3vw, 1.25rem);
  line-height: 1.35;
}

/* Palavra-chave sublinhada com dois traços verdes de pincel */
.fit__mark {
  position: relative;
  z-index: 0;
  font-weight: 700;
  white-space: nowrap;
}

.fit__mark::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -0.15em;
  bottom: -0.32em;
  left: -0.1em;
  height: 0.55em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%23d7ff38' stroke-linecap='round'%3E%3Cpath d='M3 5c30-2.6 72-3.2 114-1.2' stroke-width='5' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M14 11c26-1.6 58-2.2 92-0.6' stroke-width='3' vector-effect='non-scaling-stroke'/%3E%3C/g%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
  clip-path: inset(-20% -2% -20% -2%);
}

/* Destaque do item em exploração (mouse ou toque, js/sections/audience.js) */
.fit.is-active .fit__tile {
  rotate: 0deg;
  transform: translateY(-0.35rem) scale(1.04);
  filter:
    drop-shadow(0 2px 2px rgb(17 17 17 / 0.12))
    drop-shadow(0 16px 16px rgb(17 17 17 / 0.2));
}

.fit:active .fit__tile {
  transform: translateY(-0.15rem) scale(0.98);
}

/* Ícones: detalhes que se movem ------------------------------------------ */
.fit__icon :is(.ic-screen, .ic-bar, .ic-trend, .ic-square, .ic-circle, .ic-triangle, .ic-code-l, .ic-code-r, .ic-slash) {
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

.fit__icon .ic-screen { transform-origin: 0% 50%; }
.fit__icon .ic-bar { transform-origin: 50% 100%; }
.fit__icon .ic-triangle { transform-origin: 50% 100%; }
.fit__icon .ic-trend path:last-child { stroke: var(--c-ink); }

.fit.is-active .ic-screen { animation: ic-type 700ms var(--ease-out); }
.fit.is-active .ic-bar { animation: ic-grow 700ms var(--ease-snap) backwards; }
.fit.is-active .ic-bar:nth-child(2) { animation-delay: 60ms; }
.fit.is-active .ic-bar:nth-child(3) { animation-delay: 120ms; }
.fit.is-active .ic-bar:nth-child(4) { animation-delay: 180ms; }
.fit.is-active .ic-trend { animation: ic-rise 700ms var(--ease-out); }
.fit.is-active .ic-square { animation: ic-turn 700ms var(--ease-out); }
.fit.is-active .ic-circle { animation: ic-hop 650ms var(--ease-out); }
.fit.is-active .ic-triangle { animation: ic-tilt 700ms var(--ease-out); }
.fit.is-active .ic-code-l { animation: ic-push-l 600ms var(--ease-out); }
.fit.is-active .ic-code-r { animation: ic-push-r 600ms var(--ease-out); }
.fit.is-active .ic-slash { animation: ic-flip 700ms var(--ease-out); }

@keyframes ic-type {
  from { transform: scaleX(0); }
}

@keyframes ic-grow {
  from { transform: scaleY(0.2); }
}

@keyframes ic-rise {
  40% { transform: translate(4px, -4px); }
}

@keyframes ic-turn {
  to { transform: rotate(90deg); }
}

@keyframes ic-hop {
  40% { transform: translateY(-7px); }
  70% { transform: translateY(1px); }
}

@keyframes ic-tilt {
  35% { transform: rotate(-14deg); }
  70% { transform: rotate(6deg); }
}

@keyframes ic-push-l {
  40% { transform: translateX(-4px); }
}

@keyframes ic-push-r {
  40% { transform: translateX(4px); }
}

@keyframes ic-flip {
  45% { transform: rotate(-18deg); }
}

/* Personagem ------------------------------------------------------------- */
.audience__figure {
  --reveal-delay: 100ms;
  position: relative;
  justify-self: end;
  width: min(60%, 17rem);
  margin-top: var(--sp-7);
}

/* Papel verde rasgado atrás do sticker, mais alto e deslocado à direita */
.audience__paper {
  position: absolute;
  top: -8%;
  right: 0;
  bottom: 14%;
  left: 18%;
  background-color: var(--c-acid);
  background-image: var(--tex-paper);
  clip-path: var(--cut);
  rotate: 3deg;
}

.audience__character {
  position: relative;
  display: block;
  rotate: -3deg;
}

.audience__character img {
  width: 100%;
  height: auto;
}

/* Mobile: listras no espaço livre à esquerda do personagem */
.audience__stripes {
  position: absolute;
  bottom: 42%;
  left: -58%;
  --stripes-w: 5.5rem;
  --stripes-h: 1.75rem;
  rotate: -6deg;
}

/* Bloco escuro final ----------------------------------------------------- */
/* Borda branca: recorte .cut-* no ::before; papel preto mais rasgado no ::after. */
.verdict {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--sp-3);
  margin-top: calc(var(--sp-8) * -1);
  padding: clamp(1.75rem, 1.4rem + 1.5vw, 2.75rem) clamp(1.25rem, 0.9rem + 1.6vw, 2.75rem);
  color: var(--c-paper);
  rotate: -1deg;
  filter:
    drop-shadow(0 1px 1px rgb(17 17 17 / 0.14))
    drop-shadow(0 14px 18px rgb(17 17 17 / 0.24));
}

.verdict::before,
.verdict::after {
  content: "";
  position: absolute;
  z-index: -1;
}

.verdict::before {
  inset: 0;
  background-color: var(--c-white);
  background-image: var(--tex-paper);
  clip-path: var(--cut);
}

.verdict::after {
  inset: 3px 2px;
  background-color: var(--c-ink);
  background-image: var(--tex-paper);
  clip-path: polygon(0% 5.7%, 5.5% 3.7%, 9.3% 0.5%, 14.2% 3.6%, 19.5% 2.9%, 24.8% 2.3%, 30.2% 5.2%, 34.5% 4%, 39.5% 1.8%, 44.2% 5.7%, 48% 5.7%, 53% 6%, 57% 1.1%, 62.4% 5.7%, 66.8% 1.1%, 70.4% 4.6%, 74.2% 6.7%, 79% 1.8%, 84% 2.8%, 89.8% 6.4%, 94.3% 4.7%, 99.4% 5.7%, 100% 1.1%, 99.1% 22%, 99.4% 45%, 99% 68%, 99.4% 86%, 100% 93.6%, 94.4% 96.4%, 91% 97.3%, 87.1% 94.3%, 82.6% 93.9%, 79% 98.6%, 73.9% 93.1%, 68.6% 93.1%, 64.6% 98.9%, 59.7% 95%, 55.6% 95.5%, 52.2% 99.5%, 49% 95.7%, 43.8% 95.6%, 37.8% 94.6%, 31.9% 98.8%, 26.9% 98.8%, 22.6% 98.4%, 17.2% 96.4%, 12.8% 97.6%, 8.5% 93.6%, 3.3% 94.7%, 0% 97.9%, 0.2% 80%, 0% 58%, 0.2% 34%, 0.8% 12%);
}

.verdict__arrow {
  width: clamp(1.75rem, 1.4rem + 1.2vw, 2.75rem);
  height: auto;
  margin-top: 0.05em;
  overflow: visible;
}

.verdict__arrow path {
  fill: none;
  stroke: var(--c-acid);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.verdict__text {
  font-family: var(--font-mono);
  font-size: clamp(0.875rem, 0.78rem + 0.45vw, 1.25rem);
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.verdict .hl {
  color: var(--c-ink);
}

/* Rasgo escuro na base --------------------------------------------------- */
.audience__tear {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: -1px;
  left: 0;
  height: var(--tear-h);
  pointer-events: none;
}

/* ==========================================================================
   Tablet e desktop
   ========================================================================== */
@media (min-width: 40em) {
  .audience__corner--top {
    display: block;
  }

  .audience__fits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-6) var(--sp-5);
  }

  .fit--2 { --d: 110ms; }
  .fit--3 { --d: 220ms; }
  .fit--4 { --d: 330ms; }

  /* Tablet: bloco escuro à esquerda, sobre a base do personagem */
  .audience__body {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    grid-template-areas:
      "fits fits"
      "verdict figure";
  }

  .audience__fits {
    grid-area: fits;
  }

  .audience__figure {
    grid-area: figure;
    justify-self: stretch;
    width: auto;
  }

  .audience__stripes {
    display: none;
  }

  .verdict {
    grid-area: verdict;
    align-self: end;
    margin: 0 -4rem var(--sp-6) 0;
  }
}

@media (min-width: 64em) {
  .audience__intro {
    grid-template-columns: minmax(0, 6.2fr) minmax(0, 3.8fr);
    align-items: center;
    column-gap: clamp(2rem, 3.5vw, 4rem);
    margin-top: clamp(1.5rem, 3vw, 2.5rem);
  }

  .audience__headline {
    width: 100%;
  }

  .au-line--1 {
    font-size: 17.4cqi;
  }

  .au-line--2 {
    font-size: 15.9cqi;
  }

  .audience__lead {
    padding-left: clamp(1.5rem, 2.5vw, 2.5rem);
    border-left: 1.5px solid var(--c-ink);
  }

  .audience__body {
    grid-template-columns: minmax(0, 6.6fr) minmax(0, 3.4fr);
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "fits figure"
      "verdict figure";
    align-items: start;
    column-gap: clamp(1.5rem, 3vw, 3rem);
    row-gap: clamp(2rem, 3.5vw, 3.25rem);
    margin-top: clamp(3rem, 5vw, 4.5rem);
  }

  .audience__fits {
    grid-area: fits;
    gap: clamp(1.5rem, 2.5vw, 2.5rem) clamp(1.25rem, 2.5vw, 2.5rem);
  }

  .audience__figure {
    grid-area: figure;
    align-self: end;
    justify-self: stretch;
    width: auto;
    margin: clamp(-10rem, -8vw, -5rem) 0 0;
  }

  .audience__paper {
    top: -6%;
    right: -4%;
    bottom: 3%;
    left: 12%;
  }

  .audience__stripes {
    position: absolute;
    z-index: 2;
    right: 8%;
    bottom: -2.25rem;
    left: auto;
    display: block;
    --stripes-w: 8rem;
    --stripes-h: 2.5rem;
    rotate: -4deg;
  }

  .verdict {
    grid-area: verdict;
    width: auto;
    align-self: end;
    margin: 0 clamp(-3rem, -2vw, -1rem) var(--sp-4) 0;
  }

  .verdict__text {
    font-size: clamp(1rem, 0.6rem + 0.7vw, 1.375rem);
  }
}

/* ==========================================================================
   Entrada (ver css/motion.css)
   ========================================================================== */
.has-reveal .fit {
  opacity: 0;
  translate: 0 2rem;
}

.has-reveal .fit.is-in {
  opacity: 1;
  translate: none;
}

/* O papel do ícone cola com rebote; o sublinhado passa o pincel em seguida. */
.has-reveal .fit .fit__tile {
  transition:
    scale 800ms var(--ease-snap) calc(var(--d) + 120ms),
    rotate var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out),
    filter var(--dur-base) var(--ease-out);
}

.has-reveal .fit:not(.is-in) .fit__tile {
  scale: 0.5;
}

.has-reveal .fit .fit__mark::after {
  transition: clip-path 650ms var(--ease-out) calc(var(--d) + 450ms);
}

.has-reveal .fit:not(.is-in) .fit__mark::after {
  clip-path: inset(-20% 102% -20% -2%);
}

/* Cada ícone faz seu gesto quando o item aparece. */
.has-reveal .fit :is(.ic-screen, .ic-bar, .ic-trend, .ic-square, .ic-circle, .ic-triangle, .ic-code-l, .ic-code-r, .ic-slash) {
  transition:
    transform 900ms var(--ease-snap) calc(var(--d) + 380ms),
    opacity 400ms linear calc(var(--d) + 380ms);
}

.has-reveal .fit:not(.is-in) .ic-screen { transform: scaleX(0); }
.has-reveal .fit:not(.is-in) .ic-bar { transform: scaleY(0); }
.has-reveal .fit:not(.is-in) .ic-trend { opacity: 0; transform: translate(-8px, 8px); }
.has-reveal .fit:not(.is-in) .ic-square { transform: rotate(-90deg); }
.has-reveal .fit:not(.is-in) .ic-circle { opacity: 0; transform: translateY(-12px); }
.has-reveal .fit:not(.is-in) .ic-triangle { opacity: 0; transform: rotate(-30deg); }
.has-reveal .fit:not(.is-in) .ic-code-l { opacity: 0; transform: translateX(8px); }
.has-reveal .fit:not(.is-in) .ic-code-r { opacity: 0; transform: translateX(-8px); }
.has-reveal .fit:not(.is-in) .ic-slash { transform: rotate(-60deg) scale(0.4); }

/* Bloco escuro: sobe e assenta; a seta se desenha e o verde passa sobre a frase final. */
.has-reveal .verdict {
  opacity: 0;
  translate: 0 2.5rem;
  scale: 0.96;
  transition:
    opacity 500ms linear,
    translate 900ms var(--ease-out),
    scale 900ms var(--ease-out);
}

.has-reveal .verdict.is-in {
  opacity: 1;
  translate: none;
  scale: none;
}

.has-reveal .verdict__arrow path {
  stroke-dasharray: 1;
  transition: stroke-dashoffset 600ms var(--ease-out) 450ms;
}

.has-reveal .verdict__arrow path + path {
  transition-delay: 800ms;
}

.has-reveal .verdict:not(.is-in) .verdict__arrow path {
  stroke-dashoffset: 1;
}

.has-reveal .verdict .hl {
  transition: background-size 750ms var(--ease-out) 950ms;
}

.has-reveal .verdict:not(.is-in) .hl {
  background-size: 0% 92%;
}
