/**
 * Residence hero — full-screen minimal luxury.
 * Mobile-first. Tokens only. Replaces residence_hero.css.
 */

.res-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--color-primary);
  color: #fff;
}

.res-hero__media {
  position: absolute;
  inset: 0;
}

.res-hero__media.swiper { height: 100%; }

.res-hero__slide { position: relative; }

.res-hero__img,
.res-hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.res-hero__poster { z-index: 0; }
/* The video paints late on first load; keep the poster visible beneath and
   fade the video in only once it is actually rendering frames — kills the
   black/white flash glitch on first paint. */
.res-hero__video {
  z-index: 1;
  opacity: 0;
  transition: opacity 0.9s var(--ease-standard);
}
.res-hero__video.is-playing { opacity: 1; }

/* Bottom-LEFT on purpose: the chat launcher is pinned bottom-right at the
   maximum z-index, and sat exactly on top of this control. */
.res-hero__video-toggle {
  position: absolute;
  left: var(--space-4);
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  z-index: 4;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(12, 35, 64, 0.35);
  color: #fff;
  font-size: var(--font-size-sm);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.res-hero__video-toggle:hover { background: rgba(12, 35, 64, 0.6); }

/* Legibility scrim — quiet gradient, no heavy tint */
.res-hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(12, 35, 64, 0.28) 0%,
    rgba(12, 35, 64, 0.05) 40%,
    rgba(12, 35, 64, 0.55) 100%
  );
  pointer-events: none;
}

.res-hero__content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: var(--container-max);
  padding: var(--space-8) var(--space-5);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
}

.res-hero__logo {
  max-height: 120px;
  max-width: 70vw;
  object-fit: contain;
  filter: drop-shadow(0 2px 12px rgba(12, 35, 64, 0.35));
}

.res-hero__title {
  font-family: var(--font-family-display, 'Playfair Display', serif);
  font-size: clamp(2.2rem, 8vw, 4.25rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0.01em;
  color: #fff;
  margin: 0;
  text-wrap: balance;
}

.res-hero__subtitle {
  font-size: clamp(0.95rem, 2.6vw, 1.15rem);
  font-weight: 300;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
  max-width: 56ch;
  margin: 0;
}

.res-hero__cta { margin-top: var(--space-2); }

/* Thin animated scroll cue */
.res-hero__scroll {
  position: absolute;
  left: 50%;
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 3;
  display: block;
  width: 1px;
  height: 48px;
  overflow: hidden;
}

.res-hero__scroll-line {
  display: block;
  width: 1px;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  animation: res-hero-scroll 2.2s var(--ease-standard) infinite;
  transform-origin: top;
}

@keyframes res-hero-scroll {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* Swiper fade pagination — quiet dots */
.res-hero .swiper-pagination-bullet {
  background: rgba(255, 255, 255, 0.55);
  opacity: 1;
}
.res-hero .swiper-pagination-bullet-active { background: var(--color-accent); }

/* Stronger center scrim so the centred logo/title always read */
.res-hero__scrim {
  background: linear-gradient(
    180deg,
    rgba(12, 35, 64, 0.35) 0%,
    rgba(12, 35, 64, 0.18) 45%,
    rgba(12, 35, 64, 0.5) 100%
  );
}

@media (min-width: 768px) {
  .res-hero__content { gap: var(--space-6); }
  .res-hero__logo { max-height: 160px; max-width: 420px; }
}

@media (prefers-reduced-motion: reduce) {
  .res-hero__scroll-line { animation: none; }
}
