/* ════════════════════════════════════════════════════════════════
   CA STONE · Hero Storytelling
   Apenas a seção .stone-story-hero é estilizada aqui — pronto para
   colar no styles.css do projeto sem colidir com o resto.
   Animação anima SOMENTE opacity + transform (performance).
═══════════════════════════════════════════════════════════════════ */

.stone-story-hero {
  /* ── tokens de ajuste rápido ── */
  --text: #f7f2ea;
  --text-soft: rgba(247, 242, 234, 0.82);
  --line-shadow: 0 2px 28px rgba(20, 12, 4, 0.45);
  --pad: clamp(24px, 6vw, 110px);

  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh; /* evita "pulo" com a barra de endereço no mobile */
  overflow: hidden;
  background: #0d0b08;
  isolation: isolate; /* contém o stacking-context da hero */
}

/* ── CAMADA 1 · imagens em sequência ────────────────────────────── */
.stone-story-hero__visual {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.stone-story-hero__frame {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  will-change: opacity;
}

/* primeira cena já visível antes do JS rodar (sem flash preto) */
.stone-story-hero__frame:first-child {
  opacity: 1;
}

.stone-story-hero__frame picture,
.stone-story-hero__frame img {
  display: block;
  width: 100%;
  height: 100%;
}

.stone-story-hero__frame img {
  object-fit: cover;
  object-position: center;
  will-change: transform, filter;
  transform: scale(1);   /* o Ken Burns parte daqui */
  filter: blur(0px);     /* o blur-dissolve parte daqui */
}

/* ajuste fino de enquadramento por cena, se precisar:
   .stone-story-hero__frame:nth-child(5) img { object-position: center 40%; } */

/* ── CAMADA 2 · overlay cinematográfico p/ legibilidade ─────────── */
.stone-story-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    /* escurece a base onde mora o texto (desktop) */
    linear-gradient(
      to top,
      rgba(12, 8, 4, 0.72) 0%,
      rgba(12, 8, 4, 0.34) 32%,
      rgba(12, 8, 4, 0.05) 58%,
      rgba(12, 8, 4, 0) 78%
    ),
    /* leve reforço lateral esquerdo */
    linear-gradient(
      to right,
      rgba(12, 8, 4, 0.42) 0%,
      rgba(12, 8, 4, 0) 46%
    ),
    /* vinheta suave */
    radial-gradient(
      130% 100% at 50% 50%,
      rgba(12, 8, 4, 0) 55%,
      rgba(12, 8, 4, 0.28) 100%
    );
}

/* ── CAMADA 3 · frases ──────────────────────────────────────────── */
.stone-story-hero__content {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;        /* desktop: terço inferior, à esquerda */
  justify-content: flex-start;
  padding: var(--pad);
  padding-bottom: clamp(64px, 12vh, 132px);
  pointer-events: none;
}

/* todas as frases ocupam a MESMA célula (empilhadas) → o container
   se ajusta à frase mais alta, sem layout shift, sem position:absolute */
.stone-story-hero__lines {
  display: grid;
  max-width: min(92vw, 60rem);   /* mais largo → frases em menos linhas */
}

.stone-story-hero__line {
  grid-area: 1 / 1;
  margin: 0;
  opacity: 0;                    /* o JS controla a entrada/saída */
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: clamp(2.1rem, 4.9vw, 4.5rem);
  line-height: 1.06;
  letter-spacing: -0.012em;
  color: var(--text);
  text-shadow: var(--line-shadow);
  text-wrap: balance;
  will-change: transform, opacity;
}

/* ênfase opcional: deixe a 1ª palavra em itálico claro
   .stone-story-hero__line { font-style: italic; } */

/* ── micro-indício de scroll ────────────────────────────────────── */
.stone-story-hero__cue {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: clamp(20px, 4vh, 38px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  pointer-events: none;
}

.stone-story-hero__cue i {
  width: 1px;
  height: 42px;
  background: linear-gradient(to bottom, rgba(247, 242, 234, 0.9), rgba(247, 242, 234, 0));
  animation: storyCuePulse 2.4s ease-in-out infinite;
}

@keyframes storyCuePulse {
  0%, 100% { transform: scaleY(0.4); transform-origin: top; opacity: 0.5; }
  50%      { transform: scaleY(1);   transform-origin: top; opacity: 1; }
}

/* ════════════════════════════════════════════════════════════════
   MOBILE · mesma narrativa, texto no terço inferior centralizado
═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* hero pinada ocupa a tela inteira: imagem preenche tudo (imersivo)
     e não sobra bege quando o GSAP prende o scroll. */
  .stone-story-hero {
    height: 100svh;
  }

  .stone-story-hero__content {
    align-items: flex-end;
    justify-content: center;
    text-align: center;
    padding-bottom: clamp(64px, 13vh, 120px);
  }

  .stone-story-hero__lines {
    max-width: min(90vw, 32rem);   /* mais largo no mobile também */
    justify-items: center;
  }

  .stone-story-hero__line {
    font-size: clamp(1.85rem, 7.6vw, 3rem);
  }

  /* base do overlay um pouco mais densa (texto mais centralizado) */
  .stone-story-hero__overlay {
    background:
      linear-gradient(
        to top,
        rgba(12, 8, 4, 0.78) 0%,
        rgba(12, 8, 4, 0.40) 38%,
        rgba(12, 8, 4, 0.08) 64%,
        rgba(12, 8, 4, 0) 84%
      ),
      radial-gradient(130% 100% at 50% 60%, rgba(12, 8, 4, 0) 52%, rgba(12, 8, 4, 0.3) 100%);
  }
}

/* ════════════════════════════════════════════════════════════════
   ACESSIBILIDADE · respeita quem prefere menos movimento
   (o JS detecta e mostra um estado final estático; aqui garantimos
    que nada "pisque" caso o JS não rode)
═══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .stone-story-hero__cue { display: none; }
}

/* ── seção fantasma do preview (remover ao integrar) ────────────── */
.preview-after {
  display: grid;
  place-items: center;
  min-height: 40vh;
  padding: 32px 40px;
  background: #f4eee3;
  color: #6b5a44;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.9rem;
  text-align: center;
}
