/* ============================================================
   landing-v2.css — Luxury Resort Cinematic
   Aesthetic overlay for index.html
   Uses existing --sea-*, --ink, --gold tokens from design-tokens.css
   (imported via index-styles.css L1)
   ============================================================ */

/* ─── Fonts ─────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT@9..144,200..900,0..100&family=Spline+Sans:wght@300;400;500;600;700&display=swap');

/* ─── Local tokens ──────────────────────────────────────── */

:root {
  --clr-deep:       #0a0a0d;
  --clr-bone:       #f5f0e8;
  --clr-ink:        #1a1a20;
  --clr-foam:       #d4d9d0;
  --clr-current:    #bfc9c0;
  --clr-accent:     #c9a96e;

  /* Typography scale */
  --ff-display:     'Fraunces', Georgia, serif;
  --ff-body:        'Spline Sans', system-ui, sans-serif;
  --fw-display:     300;
  --fw-display-bold: 700;

  /* Spacing */
  --space-section:  clamp(4rem, 10vh, 8rem);
  --space-block:    clamp(2rem, 4vh, 4rem);

  /* Motion */
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --duration-slow:  1.2s;
  --duration-med:   0.7s;
  --duration-fast:  0.35s;
}

/* ─── Reset overrides ──────────────────────────────────── */

html { scroll-behavior: smooth; }

/* ─── Grain overlay ────────────────────────────────────── */

.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
}

.grain::after {
  content: '';
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  animation: grainShift 0.8s steps(2) infinite;
}

@keyframes grainShift {
  0%  { transform: translate(0, 0); }
  50% { transform: translate(-2px, 1px); }
  100%{ transform: translate(0, 0); }
}

/* ─── Cinematic image slideshow (replaces video) ────────── */

.me-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  will-change: transform;
  transform-origin: center center;
}

.hero-slideshow { /* legacy — hidden but kept for backward compat */
  display: none;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.03);
  will-change: transform, opacity;
  transition: opacity 1.4s cubic-bezier(0.22, 1, 0.36, 1),
              transform 6s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-slide.loaded {
  opacity: 1;
}

.hero-slide.zoom {
  transform: scale(1.12);
}

.hero-slide.entering {
  opacity: 0;
  z-index: 2;
}

.hero-slide.entering.loaded {
  opacity: 1;
}

.hero-slide.exiting {
  opacity: 0;
  z-index: 1;
  transform: scale(1.15);
  transition: opacity 1.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 2s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-slide.error {
  display: none;
}

/* ─── Dark gradient overlay over slideshow ──────────────── */

.hero-media-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(2, 17, 20, 0.30) 0%,
    rgba(2, 17, 20, 0.55) 60%,
    rgba(2, 17, 20, 0.85) 100%
  );
}

/* ─── Reduced motion ─────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .hero-slide {
    transition: none;
    transform: none !important;
    opacity: 1;
  }
  .hero-slide.exiting {
    display: none;
  }
}

/* ─── Lazy background image for curation cards ──────────── */

.curation-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.curation-img.loaded {
  opacity: 1;
}

.curation-media,
.concierge-media-frame,
.final-cta-media {
  position: relative;
  overflow: hidden;
}

.curation-media {
  min-height: 360px;
}

.concierge-media-frame {
  min-height: 640px;
  border-radius: 32px;
}

.final-cta-media {
  position: absolute;
  inset: 0;
}

/* Ken Burns subtle zoom on static curation images */
.curation-img.loaded {
  animation: curationKenBurns 20s ease-in-out infinite alternate;
}

@keyframes curationKenBurns {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}

/* ─── Gradient-mesh hero fallback (when no slideshow) ─────── */

.hero-media-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: var(--clr-deep);
}

.hero-media-wrap::before {
  content: '';
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(201,169,110,0.15) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(11,72,107,0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(201,169,110,0.08) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(10,10,13,1) 0%, rgba(10,10,13,1) 100%);
  animation: meshDrift 18s ease-in-out infinite alternate;
}

@keyframes meshDrift {
  0%   { transform: scale(1) rotate(0deg); }
  33%  { transform: scale(1.08) rotate(1deg); filter: brightness(1.05); }
  66%  { transform: scale(0.95) rotate(-0.5deg); filter: brightness(0.95); }
  100% { transform: scale(1.04) rotate(0.5deg); filter: brightness(1.02); }
}

/* ─── Animated mesh fallback for concierge & final-cta ──── */

.concierge-media-wrap::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(201,169,110,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(11,72,107,0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, var(--clr-deep) 0%, var(--clr-deep) 100%);
  animation: meshDrift 22s ease-in-out infinite alternate;
  z-index: 0;
}

.final-text-wrap::before {
  content: '';
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(ellipse at 25% 50%, rgba(201,169,110,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 30%, rgba(11,72,107,0.15) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, var(--clr-deep) 0%, var(--clr-deep) 100%);
  animation: meshDrift 20s ease-in-out infinite alternate;
  z-index: 0;
}

/* ─── Nav — scroll-shrink logo ──────────────────────────── */

nav.scrolled .nav-brand img {
  width: 64px !important;
  height: 64px !important;
  transition: width var(--duration-med) var(--ease-out-expo),
              height var(--duration-med) var(--ease-out-expo);
}

.nav-brand img {
  transition: width var(--duration-med) var(--ease-out-expo),
              height var(--duration-med) var(--ease-out-expo);
  will-change: width, height;
}

/* ─── Nav links — refined hover ─────────────────────────── */

.nav-links ul li a {
  position: relative;
  transition: color var(--duration-fast) ease;
}

.nav-links ul li a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--clr-accent);
  transition: width var(--duration-med) var(--ease-out-expo);
}

.nav-links ul li a:hover::after,
.nav-links ul li a:focus-visible::after {
  width: 100%;
}

/* ─── Hero ───────────────────────────────────────────────── */

.hero-wordmark {
  font-family: var(--ff-display);
  font-weight: var(--fw-display);
  font-size: clamp(2.5rem, 9vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--clr-bone);
  text-transform: uppercase;
  margin: 0.2em 0 0.4em;
  position: relative;
  z-index: 3;
}

/* ─── Hero entrance animation sequence ──────────────────── */

.hero-outer {
  opacity: 0;
}

/* Animate elements on load via a class added by JS or the existing flow.
   If no JS triggers it, the animation still runs thanks to the
   animation-fill-mode: forwards below. */

.hero-brand,
.hero-wordmark,
.hero-kicker,
.hero-outer h1,
.hero-sub,
.hero-actions {
  opacity: 0;
  transform: translateY(24px);
}

/* Stagger: each sibling animates in sequence */
.hero-brand              { animation: fadeUp 0.8s var(--ease-out-expo) 0.2s forwards; }
.hero-wordmark           { animation: fadeUp 0.9s var(--ease-out-expo) 0.35s forwards; }
.hero-kicker             { animation: fadeUp 0.7s var(--ease-out-expo) 0.5s forwards; }
.hero-outer h1           { animation: fadeUp 0.8s var(--ease-out-expo) 0.65s forwards; }
.hero-sub                { animation: fadeUp 0.7s var(--ease-out-expo) 0.8s forwards; }
.hero-actions            { animation: fadeUp 0.7s var(--ease-out-expo) 0.95s forwards; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Reduce motion ─────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  /* The animations above are the default for users who accept motion */
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .grain::after {
    animation: none;
  }

  .hero-media-wrap::before,
  .concierge-media-wrap::before,
  .final-text-wrap::before {
    animation: none;
  }

  .hero-brand,
  .hero-wordmark,
  .hero-kicker,
  .hero-outer h1,
  .hero-sub,
  .hero-actions {
    opacity: 1;
    transform: none;
  }
}

/* ─── Smooth scroll progressive enhancement ─────────────── */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ─── Responsive: smaller screens ───────────────────────── */

@media (max-width: 768px) {
  :root {
    --space-section: clamp(2.5rem, 6vh, 4rem);
  }

  .hero-wordmark {
    font-size: clamp(2rem, 12vw, 3.5rem);
  }
}
