/* =========================================================
   section-abertura — mao.css integrado com escopo na section.
   Lógica visual idêntica à de mao.html; mudanças:
   - sem html/body {height:100%; overflow:hidden}
   - medidas em vh trocadas pela altura da section (810px do Figma)
   - título em Proxima Nova Bold, cor #000
   ========================================================= */

.section-abertura {
  --stage-h: 810px;
  --hand-w: min(60vw, calc(var(--stage-h) * 0.52), 560px);
  --row-h: clamp(56px, calc(var(--stage-h) * 0.11), 110px);
  position: relative;
  width: 100%;
  height: var(--stage-h);
  background: var(--surface-abertura);
  overflow: hidden;
}

.section-abertura .stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden; /* a borda de baixo "esconde" a mão */
}

/* ---------- Fundo: ilustração de mãozinhas coloridas (fundo2) ---------- */
.section-abertura .bg-hands {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url('../img/abertura/fundo2.png') center bottom / cover no-repeat;
}

.section-abertura .bg-hand {
  position: absolute;
  height: auto;
  opacity: 0.06;
  user-select: none;
}

/* ---------- Modo "só o fundo" (atributo data-so-fundo na section) ---------- */
.section-abertura[data-so-fundo] .hand-move,
.section-abertura[data-so-fundo] .row-hands { display: none; }
/* o h1 continua para leitores de tela, só some da tela */
.section-abertura[data-so-fundo] .title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Título ---------- */
.section-abertura .title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--hand-w) * 1.08);
  z-index: 1;
  margin: 0;
  text-align: center;
  font-family: var(--font);
  font-weight: var(--fw-bold);
  font-size: clamp(32px, calc(var(--hand-w) * 0.15), 84px);
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--text);
  opacity: 0;
  transform: translateY(20%) scale(0.9);
  pointer-events: none;
}

/* ---------- Fileira de mãozinhas da base ---------- */
.section-abertura .row-hands {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--row-h);
  z-index: 2;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
}

.section-abertura .row-side {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
}

.section-abertura .row-gap {
  flex: 1;
}

.section-abertura .row-hand {
  height: calc(var(--row-h) * var(--s, 1));
  width: auto;
  margin-bottom: var(--dy, 0px);
  transform-origin: 50% 100%;
  transform: scale(0);
  user-select: none;
}

.section-abertura .row-hand.waving {
  animation: row-wave var(--dur, 3s) ease-in-out var(--delay, 0s) infinite alternate;
}

@keyframes row-wave {
  from { transform: rotate(-3deg) translateY(0); }
  to   { transform: rotate(3deg) translateY(-2px); }
}

/* ---------- Mão grande ---------- */
.section-abertura .hand-move {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 3;
  width: var(--hand-w);
  margin-left: calc(var(--hand-w) / -2);
  transform: translateY(105%);
  will-change: transform;
}

.section-abertura .hand-squash {
  transform-origin: 50% 100%;
  will-change: transform;
}

.section-abertura .hand-img {
  position: relative;
  transform-origin: 50% 95%;
  will-change: transform;
}

.section-abertura .hand-img > img:first-child {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  margin-bottom: -6%;
}

/* ---------- Corações nos dedos ---------- */
.section-abertura .heart {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: calc(var(--hand-w) * 0.055);
  min-width: 18px;
  height: auto;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(var(--r)) translateY(6px) scale(0.4);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(.25, 1, .5, 1);
  pointer-events: none;
}

.section-abertura .heart.on {
  opacity: 0.9;
  transform: translate(-50%, -50%) rotate(var(--r)) translateY(0) scale(1);
}

.section-abertura .heart.off {
  transition-duration: 0.25s, 0.25s;
  transition-timing-function: ease-in, ease-in;
}

@media (prefers-reduced-motion: reduce) {
  .section-abertura .row-hand { transform: none; }
  .section-abertura .row-hand.waving { animation: none; }
}
