/* ==========================================================================
   02 · HERO
   Mobile: título no topo, personagem no meio, CTA e texto embaixo.
   Desktop (>= 64em): personagem à esquerda, título e ações à direita.

   O título usa unidades de container (cqi). Cada linha ocupa uma fração
   fixa da largura do bloco, então nunca corta e mantém a composição em
   qualquer tela. Larguras medidas no Archivo 900:
     SEU NEGÓCIO a 80%: 6,01em · NÃO CABE a 66%: 3,74em
     EM UM SITE a 100%: 6,19em · COMUM. a 100%: 4,60em
   Fórmula: font-size (cqi) = fração da largura x 100 / largura em em.
   ========================================================================== */

.hero {
  --sheet: color-mix(in srgb, var(--c-white) 62%, var(--c-paper));
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding-top: var(--header-h);
}

/* Folha de papel mais clara atrás do título (só desktop) ----------------- */
.hero__sheet {
  display: none;
}

/* Palco ------------------------------------------------------------------ */
.hero__stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-height: calc(100svh - var(--header-h));
  padding-top: var(--sp-4);
  padding-bottom: calc(var(--tear-h) + var(--sp-3));
}

/* Título ----------------------------------------------------------------- */
/* Em telas médias o título para de crescer para não engolir o personagem. */
.hero__headline {
  --headline-max: 34rem;
  position: relative;
  z-index: 2;
  align-self: center;
  width: min(100%, var(--headline-max));
  container-type: inline-size;
}

.hero__title {
  position: relative;
  z-index: 1;
  font-weight: 900;
  line-height: 0.86;
  text-transform: uppercase;
}

/* O espaçamento fica na linha para ser calculado sobre o tamanho dela. */
.hero__line {
  --i: 0;
  display: block;
  width: fit-content;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.hero__line--1 {
  font-size: 13.6cqi;
  font-stretch: 80%;
  margin: 0 0 0.06em 1.5cqi;
  rotate: -2.5deg;
}

/* O respiro no topo afasta o til de "NÃO" da linha de cima. */
.hero__line--2 {
  --i: 1;
  font-size: 26.2cqi;
  font-stretch: 66%;
  line-height: 0.8;
  padding-top: 0.17em;
}

.hero__line--3 {
  --i: 2;
  position: relative;
  isolation: isolate;
  font-size: 13.2cqi;
  font-stretch: 100%;
  margin: 0.1em 0 0.14em 2cqi;
  padding: 0.12em 0.26em 0.04em;
  rotate: -2deg;
}

.hero__line--4 {
  --i: 3;
  font-size: 17.4cqi;
  font-stretch: 100%;
  margin-left: 1cqi;
}

/* Fita verde rasgada atrás de "EM UM SITE" */
.hero__tape {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--c-acid);
  background-image: var(--tex-paper);
  clip-path: polygon(
    1% 9%, 3.5% 0, 30% 3%, 62% 0, 96.5% 5%, 99% 15%, 98% 33%, 100% 50%,
    98.5% 68%, 100% 86%, 97% 100%, 66% 97%, 34% 100%, 2.5% 96%, 0 84%,
    1.5% 63%, 0 45%, 2% 26%
  );
  transform-origin: left center;
}

/* Linhas de impacto e globo ---------------------------------------------- */
.hero__burst {
  position: absolute;
  z-index: 2;
  right: 1cqi;
  bottom: 2cqi;
  width: 13cqi;
  height: 13cqi;
  rotate: 35deg;
  color: var(--c-ink);
}

.hero__globe {
  position: absolute;
  color: var(--c-ink);
  overflow: visible;
}

.hero__globe--title {
  display: none;
}

/* Personagem ------------------------------------------------------------- */
/* No mobile a altura sobra do que título e ações ocupam (título ~0,68 da largura). */
.hero__figure {
  position: relative;
  z-index: 1;
  align-self: center;
  height: clamp(
    13rem,
    100svh - var(--header-h) - 0.68 * min(100vw - 2 * var(--gutter), 34rem) - 15.5rem,
    27rem
  );
  aspect-ratio: 1133 / 1427;
  margin-block: var(--sp-1);
}

.hero__character {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

.hero__character img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.hero__paint {
  position: absolute;
  z-index: 0;
  left: -24%;
  top: 14%;
  width: 140%;
  height: 76%;
  color: var(--c-acid);
  overflow: visible;
}

.hero__globe--figure {
  z-index: 0;
  right: -20%;
  top: -3%;
  width: 36%;
  aspect-ratio: 1;
  rotate: -14deg;
}

/* Fita listrada sobre a camiseta */
.hero__stripes {
  position: absolute;
  z-index: 2;
  left: -9%;
  bottom: 9%;
  width: 40%;
  height: 10%;
  rotate: -14deg;
  background: repeating-linear-gradient(
    -55deg,
    var(--c-ink) 0 0.55rem,
    var(--c-white) 0.55rem 1.1rem
  );
  box-shadow: var(--shadow-paper);
}

/* Ações ------------------------------------------------------------------ */
.hero__actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  text-align: center;
}

.hero__cta {
  min-width: min(100%, 19rem);
}

.hero__lead {
  max-width: 26ch;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.5;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero__scroll {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem 0.25rem;
}

.hero__scroll::after {
  content: "";
  width: 1.9rem;
  height: 0.28rem;
  background: var(--c-acid);
}

.hero__scroll-icon {
  width: 1.6rem;
  height: 1.6rem;
  animation: hero-bob 1.8s var(--ease-in-out) 2.6s infinite;
}

.hero__scroll-icon--d {
  display: none;
}

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

/* ==========================================================================
   Desktop
   ========================================================================== */
@media (min-width: 64em) {
  .hero__sheet {
    position: absolute;
    z-index: 0;
    top: calc(var(--header-h) + 3rem);
    right: 0;
    bottom: 0;
    left: 33%;
    display: block;
    background-color: var(--sheet);
    background-image: var(--tex-paper);
    filter: drop-shadow(0 -2px 2px rgb(17 17 17 / 0.07));
  }

  .hero__sheet svg {
    position: absolute;
    bottom: calc(100% - 1px);
    left: 0;
    width: 100%;
    height: 2.5rem;
    fill: var(--sheet);
  }

  .hero__stage {
    display: grid;
    grid-template-columns: minmax(0, 43fr) minmax(0, 57fr);
    grid-template-rows: 1fr auto auto 1.25fr;
    gap: clamp(1.75rem, 4.5svh, 3.25rem) 0;
    padding-top: 0;
    padding-bottom: calc(var(--tear-h) + var(--sp-4));
  }

  /* O título também respeita a altura da tela, para caber junto com as ações. */
  .hero__headline {
    grid-column: 2;
    grid-row: 2;
    align-self: auto;
    width: min(100%, calc((100svh - var(--header-h) - 13rem) * 1.45));
  }

  .hero__line--1 {
    font-size: 12.3cqi;
    margin-left: 3cqi;
    rotate: -2deg;
  }

  .hero__line--3 {
    font-size: 12.9cqi;
    margin-left: 5cqi;
  }

  .hero__line--4 {
    font-size: 20.9cqi;
    margin-left: 0;
  }

  .hero__burst {
    top: -8cqi;
    right: auto;
    bottom: auto;
    left: -6cqi;
    width: 9cqi;
    height: 9cqi;
    rotate: 0deg;
    scale: -1 1;
  }

  .hero__globe--title {
    z-index: 0;
    top: -9cqi;
    right: -2cqi;
    display: block;
    width: 21cqi;
    height: 21cqi;
    rotate: -16deg;
  }

  .hero__globe--figure {
    display: none;
  }

  .hero__figure {
    position: absolute;
    bottom: -5%;
    left: calc(var(--gutter) * -0.6);
    height: 94%;
    max-width: 46%;
    margin: 0;
  }

  .hero__character img {
    object-position: left bottom;
  }

  .hero__paint {
    left: -14%;
    top: 20%;
    width: 120%;
    height: 72%;
  }

  .hero__stripes {
    left: -6%;
    bottom: 13%;
    width: 46%;
    height: 9%;
  }

  .hero__actions {
    grid-column: 2;
    grid-row: 3;
    flex-direction: row;
    gap: clamp(1.25rem, 2.6vw, 2.5rem);
    text-align: left;
  }

  .hero__cta {
    flex: none;
    min-width: 0;
    min-height: 3.75rem;
    padding-inline: 2em;
    font-size: clamp(0.875rem, 0.55rem + 0.45vw, 1.0625rem);
  }

  /* Três linhas, como na referência: a largura conta o recuo da barra. */
  .hero__lead {
    position: relative;
    flex: none;
    width: calc(24ch + clamp(1.25rem, 2.6vw, 2.5rem));
    max-width: none;
    padding-left: clamp(1.25rem, 2.6vw, 2.5rem);
    font-size: 0.8125rem;
  }

  .hero__lead::before {
    content: "";
    position: absolute;
    top: 8%;
    bottom: 8%;
    left: 0;
    width: 1.5px;
    background: currentColor;
    rotate: 14deg;
  }

  .hero__scroll {
    margin-left: auto;
  }

  .hero__scroll-icon--m {
    display: none;
  }

  .hero__scroll-icon--d {
    display: block;
    width: 1.5rem;
    height: 2.5rem;
  }
}

/* ==========================================================================
   Entrada
   O JS adiciona .is-ready quando as fontes carregam (ou após 1,2s).
   Sem JS, nada fica escondido. Se o JS falhar, tudo aparece em 2,5s.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .hero [data-depth] {
    will-change: translate;
  }
}

.js .hero:not(.is-ready) :is(
  .hero__line, .hero__character, .hero__paint, .hero__globe,
  .hero__burst, .hero__stripes, .hero__actions > *
) {
  opacity: 0;
  animation: hero-failsafe 0s linear 2.5s forwards;
}

.hero.is-ready .hero__line {
  animation: hero-line 900ms var(--ease-out) backwards;
  animation-delay: calc(120ms + var(--i) * 110ms);
}

.hero.is-ready .hero__tape {
  animation: hero-tape 650ms var(--ease-out) 560ms backwards;
}

.hero.is-ready .hero__paint {
  animation: hero-splash 900ms var(--ease-out) 200ms backwards;
}

.hero.is-ready .hero__character {
  animation: hero-rise 1000ms var(--ease-out) 280ms backwards;
}

.hero.is-ready :is(.hero__globe, .hero__burst, .hero__stripes) {
  animation: hero-pop 700ms var(--ease-snap) 760ms backwards;
}

.hero.is-ready .hero__actions > * {
  animation: hero-rise 800ms var(--ease-out) backwards;
}

.hero.is-ready .hero__actions > :nth-child(1) { animation-delay: 700ms; }
.hero.is-ready .hero__actions > :nth-child(2) { animation-delay: 800ms; }
.hero.is-ready .hero__actions > :nth-child(3) { animation-delay: 900ms; }

@keyframes hero-line {
  from {
    clip-path: inset(-30% -5% 130% -5%);
    transform: translateY(55%);
  }
  to {
    clip-path: inset(-30% -5% -30% -5%);
    transform: none;
  }
}

@keyframes hero-tape {
  from { transform: scaleX(0); }
  to { transform: none; }
}

@keyframes hero-splash {
  from { opacity: 0; transform: scale(0.75) rotate(-6deg); }
  to { opacity: 1; transform: none; }
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(1.5rem); }
  to { opacity: 1; transform: none; }
}

@keyframes hero-pop {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 1; transform: none; }
}

@keyframes hero-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(0.35rem); }
}

@keyframes hero-failsafe {
  to { opacity: 1; }
}
