/* ============================================================
   HERO — Estilo "além do comum": sans-serif gigante,
   trust badges, dois CTAs, buscador full-width no fim.
============================================================ */

.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  --hero-header-offset: var(--nav-height);
  --hero-cloud-reserve: 5.5rem;
  margin-top: calc(-1 * var(--hero-header-offset));
  overflow: hidden;
  isolation: isolate;
  background-color: var(--orla-900);
  display: flex;
  flex-direction: column;
}

.site-content:has(.announcement) {
  --site-announcement-offset: var(--announcement-height);
}

.site-content:has(.announcement) .hero {
  --hero-header-offset: calc(var(--nav-height) + var(--announcement-height));
  margin-top: calc(-1 * var(--hero-header-offset));
}

.site-content--house .hero {
  --hero-header-offset: calc(var(--roof-height) + var(--nav-height) + var(--announcement-height));
  margin-top: calc(-1 * var(--hero-header-offset));
}

.site-content--house:not(:has(.announcement)) .hero {
  --hero-header-offset: calc(var(--roof-height) + var(--nav-height));
  margin-top: calc(-1 * var(--hero-header-offset));
}

/* Dentro da moldura casa o recuo lateral já vem do .hero-house */
@media (min-width: 901px) {
  .hero-house .hero {
    margin-top: calc(-1 * var(--hero-header-offset));
  }
}

@media (max-width: 600px) {
  .hero {
    --hero-cloud-reserve: 4rem;
  }

  .site-content:has(.announcement) {
    --site-announcement-offset: var(--announcement-height-mobile);
  }

  .site-content:has(.announcement) .hero {
    --hero-header-offset: calc(var(--nav-height-mobile) + var(--announcement-height-mobile));
    margin-top: calc(-1 * var(--hero-header-offset));
  }

  .site-content--house .hero {
    --hero-header-offset: calc(var(--nav-height-mobile) + var(--announcement-height-mobile));
    margin-top: calc(-1 * var(--hero-header-offset));
  }

  .site-content--house:not(:has(.announcement)) .hero {
    --hero-header-offset: var(--nav-height-mobile);
    margin-top: calc(-1 * var(--hero-header-offset));
  }
}
.hero__video,
.hero__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.hero__video { filter: saturate(1.05) contrast(1.02); }

rf-hero[data-period="night"] .hero__video {
  filter: saturate(0.9) contrast(1.05) brightness(0.82);
}

rf-hero[data-period="night"] .hero__overlay {
  background: linear-gradient(180deg, rgba(14, 43, 67, 0.5) 0%, rgba(10, 31, 50, 0.72) 100%);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(14, 43, 67, 0.22) 0%,
    rgba(14, 43, 67, 0.3) 50%,
    rgba(10, 31, 50, 0.42) 100%
  );
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.35;
}

.hero__grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* Ticker dentro do hero — sempre visível abaixo da nav */
.hero__ticker {
  position: absolute;
  top: var(--hero-header-offset);
  left: 0;
  right: 0;
  z-index: 8;
  overflow: hidden;
  padding-block: 10px;
  background: rgba(26, 46, 34, 0.38);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hero__ticker-track {
  display: flex;
  width: max-content;
  gap: var(--space-8);
  animation: hero-ticker-scroll 38s linear infinite;
  padding-inline: var(--space-4);
}

.hero__ticker-item {
  flex-shrink: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

@keyframes hero-ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__ticker-track { animation: none; }
}

/* --- Container do hero --- */
.hero__container {
  position: relative;
  z-index: 6;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: calc(var(--hero-header-offset) + var(--space-4));
  padding-bottom: calc(var(--hero-cloud-reserve, 5.5rem) + var(--space-6));
  gap: var(--space-4);
  min-height: min(100dvh, 100%);
}

.hero__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: center;
  text-align: center;
  max-width: 900px;
  width: 100%;
  padding-bottom: 0;
  margin-top: clamp(0.25rem, 2vh, 1.5rem);
  transform: none;
}
.hero__beach {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.hero__beach-palm {
  position: absolute;
  bottom: calc(var(--hero-cloud-reserve) + 8%);
  width: clamp(48px, 8vw, 80px);
  opacity: 0.85;
  animation: palm-sway 8s ease-in-out infinite alternate;
}

.hero__beach-palm--left { left: 4%; }
.hero__beach-palm--right {
  right: 6%;
  transform: scaleX(-1);
  animation-delay: -3s;
}

.hero__beach-wave {
  position: absolute;
  bottom: calc(var(--hero-cloud-reserve) - 0.5rem);
  left: 0;
  right: 0;
  width: 100%;
  opacity: 0.9;
}

@keyframes palm-sway {
  from { transform: rotate(-2deg); }
  to   { transform: rotate(3deg); }
}

.hero__beach-palm--right {
  animation-name: palm-sway-right;
}

@keyframes palm-sway-right {
  from { transform: scaleX(-1) rotate(-2deg); }
  to   { transform: scaleX(-1) rotate(3deg); }
}

/* --- Eyebrow design system --- */
.hero__eyebrow {
  opacity: 0;
  transform: translateY(20px);
  margin-bottom: var(--space-5);
  justify-content: center;
}

.hero__description {
  font-size: clamp(0.95rem, 1.8vw, 1.125rem);
  line-height: var(--lh-relaxed);
  color: rgba(251, 246, 236, 0.92);
  max-width: 38ch;
  margin-inline: auto;
  margin-bottom: var(--space-5);
  opacity: 0;
  transform: translateY(20px);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  opacity: 0;
  transform: translateY(20px);
}

.hero__cta .btn--shiny,
.hero__cta .btn--outline-hero {
  min-width: 11rem;
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: 1.08;
  color: var(--branco);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
  max-width: 18ch;
  margin-inline: auto;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 4px 24px rgba(0, 0, 0, 0.45);
  display: block;
}

.hero__title em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--sol);
  display: inline;
  white-space: nowrap;
}

.hero__title-break {
  display: block;
}

/* --- Sol girando no fim do título --- */
.hero__sun {
  display: inline-flex;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.15em;
  color: var(--sun);
  flex-shrink: 0;
  animation: sun-spin 18s linear infinite;
  filter: drop-shadow(0 2px 12px rgba(245, 194, 78, 0.4));
  opacity: 0;
  transform: scale(0.5) rotate(0);
}

@keyframes sun-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Quando entra na cena, o GSAP/CSS troca opacity+scale, mas precisa
   permitir que o spin continue. Por isso usamos uma classe extra: */
.hero__sun.is-visible {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-spring);
}
/* Palavras animadas */
.hero__title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  will-change: opacity, transform;
}

/* --- Buscador logo após os botões do hero --- */
.hero__search {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(100%, 38rem);
  margin-top: var(--space-4);
  padding: var(--space-3);
  opacity: 0;
  transform: translateY(20px);
}

/* Em mobile, dá folga lateral pra não encostar nas bordas */
@media (max-width: 700px) {
  .hero__sun {
    width: 0.75em;
    height: 0.75em;
  }
}
/* ============================================================
   RESPONSIVO — compactação progressiva
============================================================ */

@media (max-width: 900px) {
  .hero__title { letter-spacing: -0.025em; }
}

@media (max-width: 700px) {
  .hero {
    --hero-cloud-reserve: 4.5rem;
    min-height: 100svh;
    min-height: 100dvh;
  }

  .hero__container {
    padding-top: calc(var(--hero-header-offset) + var(--space-2));
    padding-bottom: calc(var(--hero-cloud-reserve) + var(--space-5));
    gap: var(--space-3);
    justify-content: center;
  }

  .hero__text {
    padding-top: 0;
    transform: none;
    margin-top: 0;
  }

  .hero__description {
    font-size: 0.9rem;
    margin-bottom: var(--space-4);
    max-width: 32ch;
  }

  .hero__cta {
    width: 100%;
    max-width: 20rem;
    flex-direction: column;
  }

  .hero__cta .btn {
    width: 100%;
  }

  .hero__eyebrow { margin-bottom: var(--space-3); }
  .hero__title {
    font-size: clamp(1.875rem, 8.5vw, 2.75rem);
    max-width: 100%;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: var(--space-3);
  }
  .hero__title em { font-size: 0.95em; }

  .hero__search {
    max-width: min(100%, 21rem);
    margin-top: var(--space-3);
    padding: var(--space-2) var(--space-1);
  }

  .hero__beach-palm { display: none; }
}

@media (max-width: 480px) {
  .hero__title { font-size: clamp(1.5rem, 9vw, 2.25rem); }
  .hero__description { font-size: 0.875rem; }
}

/* ============================================================
   NUVENS DE TRANSIÇÃO — fundo do hero para a próxima section
   Três camadas de SVGs com formas orgânicas redondas, criando
   profundidade. Os prédios "emergem das nuvens".
============================================================ */

.hero__clouds {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--hero-cloud-reserve, 5.5rem);
  z-index: 4;
  pointer-events: none;
  line-height: 0;
  overflow: hidden;
}

/* As três camadas se sobrepõem no mesmo bottom */
.hero__clouds-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  display: block;
}

/* Camada de trás — mais translúcida, mais lenta */
.hero__clouds-layer--back {
  opacity: 0.55;
  filter: blur(2px);
  animation: cloud-drift-slow 28s ease-in-out infinite;
}

/* Camada do meio — meio translúcida */
.hero__clouds-layer--mid {
  opacity: 0.85;
  animation: cloud-drift-mid 22s ease-in-out infinite reverse;
}

/* Camada da frente — sólida, conecta visualmente com a próxima section */
.hero__clouds-layer--front {
  opacity: 1;
  animation: cloud-drift-fast 18s ease-in-out infinite;
}

@keyframes cloud-drift-slow {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-30px); }
}
@keyframes cloud-drift-mid {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(20px); }
}
@keyframes cloud-drift-fast {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-12px); }
}

/* A próxima section continua o fundo branco das nuvens */
.hero + rf-apartments-teaser,
.hero + section,
.hero + .next-section {
  background: var(--paper);
  position: relative;
}

/* Em mobile: nuvens mais baixas — não cobrem o buscador */
@media (max-width: 700px) {
  .hero__clouds-layer--back,
  .hero__clouds-layer--mid {
    display: none;
  }

  .hero__clouds-layer--front {
    opacity: 1;
    animation: none;
  }
}

/* Site wrapper — sem will-change:transform aqui (quebra position:fixed da navbar) */
.site-content {
  position: relative;
  z-index: 2;
  background-color: var(--sand-200);
  min-height: 100vh;
  transform-origin: right center;
}