/* ==============================================================
   HERO — Vila de Fiori
   Camadas: z0 foto da casa → z1 véu de leitura → z3 título
            → z9 texto de apoio + botões
   ============================================================== */

.site-shell {
  min-height: 100vh;
}

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  isolation: isolate;
  background: #3f6f8f;
}

.hero-world,
.scene-img,
.hero-title,
.intro-copy {
  position: absolute;
}

.hero-world {
  inset: 0;
  overflow: hidden;
}

/* ---------- Foto de fundo ---------- */

.scene-img {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  will-change: transform;
}

.hero-bg {
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Mantém a casa e o início da piscina no enquadramento */
  object-position: 50% 55%;
  transform-origin: 50% 60%;
  animation: bg-in 2400ms var(--ease-out) both;
}

/* Véu de leitura: sombra no topo (header + título) e na base (texto) */
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      180deg,
      rgba(11, 17, 16, 0.55) 0%,
      rgba(11, 17, 16, 0.18) 30%,
      rgba(11, 17, 16, 0) 48%,
      rgba(11, 17, 16, 0.12) 64%,
      rgba(11, 17, 16, 0.62) 100%
    );
  pointer-events: none;
}

/* ---------- Título ---------- */

.hero-title {
  z-index: 3;
  left: 50%;
  top: clamp(180px, 33vh, 360px);
  width: min(94vw, 1780px);
  margin: 0;
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  text-align: center;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.28);
  transform: translate3d(-50%, 0, 0) scale(1);
  will-change: transform, opacity;
}

.hero-title-kicker {
  display: block;
  margin-bottom: 0.28em;
  font-size: var(--fs-hero-sub);
  font-weight: var(--fw-medium);
  line-height: var(--lh-hero-sub);
  letter-spacing: var(--ls-h3);
  animation: rise-in 1100ms var(--ease-out) 150ms both;
}

.hero-title-name {
  display: block;
  font-size: calc(var(--fs-wordmark) * 0.76);
  line-height: 0.8;
  letter-spacing: var(--ls-wordmark);
  text-transform: uppercase;
  animation: rise-in 1300ms var(--ease-out) 300ms both;
}

/* ---------- Texto de apoio ---------- */

.intro-copy {
  z-index: 9;
  left: 50%;
  bottom: clamp(48px, 10vh, 120px);
  width: min(560px, calc(100vw - 40px));
  text-align: center;
  transform: translate3d(-50%, 0, 0);
  will-change: transform, opacity;
}

.intro-copy p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--paper);
  font-size: var(--fs-subtitle);
  font-weight: var(--fw-medium);
  line-height: var(--lh-subtitle);
  letter-spacing: var(--ls-subtitle);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
  animation: rise-in 1000ms var(--ease-out) 700ms both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
  animation: rise-in 1000ms var(--ease-out) 850ms both;
}

.hero-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 25px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--paper);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  line-height: 1;
  letter-spacing: var(--ls-small);
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  transition: transform 260ms var(--ease-out), background-color 240ms ease, color 240ms ease;
}

.hero-action:hover {
  transform: translateY(-2px);
}

.hero-action--accent {
  color: var(--paper);
  background: var(--terracotta);
}

.hero-action--accent:hover {
  background: var(--olive);
}

/* ==============================================================
   ANIMAÇÕES DE ENTRADA
   Usam as propriedades individuais (translate / scale) para não
   conflitar com o transform de posicionamento de cada camada.
   ============================================================== */

@keyframes rise-in {
  from {
    opacity: 0;
    translate: 0 28px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes bg-in {
  from {
    scale: 1.1;
  }
  to {
    scale: 1;
  }
}

/* ==============================================================
   EFEITO DE SCROLL EM CSS PURO (scroll-driven animations)
   Ao rolar, a foto aproxima levemente e o título/texto somem.
   Navegadores sem suporte simplesmente mantêm o hero estático.
   ============================================================== */

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .hero-title {
      animation: title-scroll linear both;
      animation-timeline: scroll(root);
      animation-range: 90px 650px;
    }

    .intro-copy {
      animation: intro-scroll linear both;
      animation-timeline: scroll(root);
      animation-range: 90px 650px;
    }

    .hero-bg {
      animation: bg-in 2400ms var(--ease-out) both, bg-scroll linear both;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0 100vh;
    }
  }
}

@keyframes title-scroll {
  from {
    opacity: 1;
    transform: translate3d(-50%, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(-50%, -210px, 0) scale(0.92);
  }
}

@keyframes intro-scroll {
  from {
    opacity: 1;
    transform: translate3d(-50%, 0, 0);
  }
  to {
    opacity: 0;
    transform: translate3d(-50%, 90px, 0);
  }
}

@keyframes bg-scroll {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(0, 8vh, 0) scale(1.12);
  }
}

/* ==============================================================
   RESPONSIVO
   ============================================================== */

@media (max-width: 1100px) {
  .hero-title {
    top: 33vh;
  }
}

/* Header em duas linhas a partir daqui: título desce para não colidir */
@media (max-width: 980px) {
  .hero-title {
    top: clamp(210px, 33vh, 360px);
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 640px;
  }

  .hero-title {
    top: max(260px, 41vh);
  }

  .hero-title-name {
    font-size: calc(var(--fs-wordmark) * 1.18);
  }

  /* No celular a foto fica em pé: centraliza na casa */
  .hero-bg {
    object-position: 58% 50%;
  }

  .intro-copy {
    bottom: 42px;
  }

  .hero-actions {
    gap: 8px;
  }

  .hero-action {
    min-height: 38px;
    padding: 0 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg,
  .hero-title,
  .hero-title-kicker,
  .hero-title-name,
  .intro-copy,
  .intro-copy p,
  .hero-actions {
    animation: none;
  }

  .hero-action {
    transition: none;
  }
}
