/* =========================================================================
   Agua Frio Garden Resort — Landing page ENHANCEMENT LAYER (preview)
   Loaded after landing.css. Same layout, colors and content as the
   original landing page; this file only adds motion, smoother transitions
   and small visual polish. Remove the <link> to go back to the original.
   ========================================================================= */

:root {
    --enh-accent: #f5a623;
    --enh-accent-soft: rgba(245, 166, 35, 0.35);
    --enh-ease: cubic-bezier(0.22, 1, 0.36, 1);      /* smooth "expo-out" */
    --enh-ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}
html[data-theme="light"] {
    --enh-accent: #C1440E;
    --enh-accent-soft: rgba(193, 68, 14, 0.3);
}

/* Smooth in-page scrolling that stops below the sticky nav. */
html:has(body.lp-home) { scroll-behavior: smooth; scroll-padding-top: 84px; }

/* ---------- Scroll progress bar ---------- */
.enh-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200;
    background: linear-gradient(90deg, #ffc72c, var(--enh-accent));
    transform-origin: 0 50%; transform: scaleX(var(--enh-progress, 0));
    pointer-events: none;
}

/* ---------- NAV: slides in, turns to frosted glass on scroll ---------- */
body.lp-home .lp-nav {
    animation: enhNavIn 0.9s var(--enh-ease) both;
    transition: background-color 0.5s var(--enh-ease), box-shadow 0.5s var(--enh-ease),
                border-color 0.5s var(--enh-ease), backdrop-filter 0.5s var(--enh-ease);
}
body.lp-home .lp-nav-inner { transition: padding 0.5s var(--enh-ease); }
body.lp-home .lp-brand-logo { transition: width 0.5s var(--enh-ease), height 0.5s var(--enh-ease), transform 0.8s var(--enh-ease); }
body.lp-home .lp-brand:hover .lp-brand-logo { transform: rotate(-8deg) scale(1.06); }

body.lp-home .lp-nav.is-scrolled {
    background: rgba(13, 26, 40, 0.72);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    backdrop-filter: blur(14px) saturate(160%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
html[data-theme="light"] body.lp-home .lp-nav.is-scrolled {
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 30px rgba(58, 46, 30, 0.1);
}
body.lp-home .lp-nav.is-scrolled .lp-nav-inner { padding-top: 0.55rem; padding-bottom: 0.55rem; }
body.lp-home .lp-nav.is-scrolled .lp-brand-logo { width: 42px; height: 42px; }

/* Animated underline + active section highlight on nav links. */
body.lp-home .lp-nav-link { position: relative; transition: color 0.3s var(--enh-ease); }
body.lp-home .lp-nav-link::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px;
    background: var(--enh-accent); transform: scaleX(0); transform-origin: right;
    transition: transform 0.45s var(--enh-ease);
}
body.lp-home .lp-nav-link:hover::after,
body.lp-home .lp-nav-link.is-active::after { transform: scaleX(1); transform-origin: left; }
body.lp-home .lp-nav-link.is-active { color: #fff; }
html[data-theme="light"] body.lp-home .lp-nav-link.is-active { color: #C1440E; }

/* Chat dot gently pulses. */
body.lp-home .lp-chat-dot { animation: enhPulseDot 2.2s ease-out infinite; }

/* Nav buttons: softer, longer transitions + lift. */
body.lp-home .lp-btn-theme,
body.lp-home .lp-btn-download,
body.lp-home .lp-btn-login {
    position: relative; overflow: hidden;
    transition: background-color 0.35s var(--enh-ease), color 0.35s var(--enh-ease),
                border-color 0.35s var(--enh-ease), transform 0.35s var(--enh-ease), box-shadow 0.35s var(--enh-ease);
}
body.lp-home .lp-btn-download:hover,
body.lp-home .lp-btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18); }
body.lp-home .lp-btn-theme:hover svg { transform: rotate(40deg); }
body.lp-home .lp-btn-theme svg { transition: transform 0.6s var(--enh-ease); }
body.lp-home .lp-btn-download svg { transition: transform 0.4s var(--enh-ease); }
body.lp-home .lp-btn-download:hover svg { transform: translateY(2px); }

/* ---------- HERO ---------- */
/* Photo: slow Ken Burns zoom + scroll/mouse parallax (individual transform
   properties so the two don't fight). */
body.lp-home .lp-hero::before {
    animation: enhKenBurns 24s ease-in-out infinite alternate;
    translate: calc(var(--enh-mx, 0) * -14px) calc(var(--enh-shift, 0px) + var(--enh-my, 0) * -10px);
    will-change: scale, translate;
}
/* Soft drifting sunlight over the photo. */
body.lp-home .lp-hero::after {
    content: ''; position: absolute; inset: -20%; z-index: -1; pointer-events: none;
    background: radial-gradient(circle at 30% 30%, rgba(255, 214, 140, 0.18), transparent 45%);
    animation: enhGlare 14s ease-in-out infinite alternate;
    mix-blend-mode: screen;
}
body.lp-home .lp-hero-content {
    opacity: var(--enh-fade, 1);
    translate: calc(var(--enh-mx, 0) * 6px) calc(var(--enh-shift, 0px) * 0.4 + var(--enh-my, 0) * 4px);
    will-change: opacity, translate;
}
body.lp-home .lp-hero .lp-eyebrow { animation: enhEyebrowIn 1.2s var(--enh-ease) 0.15s both; }
body.lp-home .lp-hero-sub { animation: enhFadeUp 1s var(--enh-ease) 1.15s both; }

/* Title words rise in one by one (split by landing-enhanced.js). */
html.enh-js .lp-hero-title:not(.enh-split) { opacity: 0; animation: enhShow 0s 2.5s forwards; }
.lp-hero-title .enh-word {
    display: inline-block;
    opacity: 0; transform: translateY(0.55em) rotate(2deg); filter: blur(10px);
    animation: enhWordIn 1s var(--enh-ease) forwards;
    animation-delay: calc(0.35s + var(--i, 0) * 0.09s);
}
.lp-hero-title .lp-accent .enh-word {
    background: linear-gradient(100deg, #f5a623 0%, #ffd766 45%, #f5a623 60%);
    background-size: 220% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: enhWordIn 1s var(--enh-ease) forwards, enhShimmer 5s ease-in-out 2s infinite;
    animation-delay: calc(0.35s + var(--i, 0) * 0.09s), 2s;
}

/* Scroll cue at the bottom of the hero. */
.enh-scroll-cue {
    position: absolute; left: 50%; bottom: 28px; translate: -50% 0;
    width: 26px; height: 42px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, 0.55);
    display: flex; justify-content: center; padding-top: 7px;
    animation: enhFadeUp 1s var(--enh-ease) 1.6s both;
    transition: border-color 0.3s;
}
.enh-scroll-cue:hover { border-color: #fff; }
.enh-scroll-cue span {
    width: 4px; height: 8px; border-radius: 2px; background: #fff;
    animation: enhScrollDot 1.8s var(--enh-ease-io) infinite;
}

/* ---------- Scroll reveal (applied by JS) ----------
   Uses `translate`/`opacity`/`filter`, leaving `transform` free for hover. */
html.enh-js [data-enh-reveal] {
    opacity: 0; translate: 0 34px; filter: blur(6px);
    transition: opacity 0.9s var(--enh-ease), translate 0.9s var(--enh-ease), filter 0.9s var(--enh-ease);
    transition-delay: var(--enh-d, 0ms);
}
html.enh-js [data-enh-reveal].is-in { opacity: 1; translate: 0 0; filter: none; }

/* Section titles get an accent bar that draws in. */
body.lp-home .lp-rooms-title { position: relative; padding-bottom: 0.45rem; }
body.lp-home .lp-rooms-title::after {
    content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 44px; border-radius: 3px;
    background: var(--enh-accent); transform: scaleX(0); transform-origin: left;
    transition: transform 0.9s var(--enh-ease) 0.25s;
}
body.lp-home .lp-rooms-header.is-in .lp-rooms-title::after,
html:not(.enh-js) body.lp-home .lp-rooms-title::after { transform: scaleX(1); }

/* ---------- Cards ---------- */
body.lp-home .lp-room-card,
body.lp-home .lp-feature-card,
body.lp-home .lp-info-card {
    transition:
        opacity 0.9s var(--enh-ease) var(--enh-d, 0ms),
        translate 0.9s var(--enh-ease) var(--enh-d, 0ms),
        filter 0.9s var(--enh-ease) var(--enh-d, 0ms),
        transform 0.55s var(--enh-ease),
        box-shadow 0.55s var(--enh-ease),
        border-color 0.45s var(--enh-ease),
        background-color 0.45s var(--enh-ease);
}
body.lp-home .lp-room-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
    border-color: var(--enh-accent-soft);
}
html[data-theme="light"] body.lp-home .lp-room-card:hover { box-shadow: 0 24px 50px rgba(58, 46, 30, 0.18); }

/* Photo slowly zooms and a light sheen sweeps across on hover. */
body.lp-home .lp-room-img { position: relative; }
body.lp-home .lp-room-img img { transition: transform 1.2s var(--enh-ease); }
body.lp-home .lp-room-card:hover .lp-room-img img { transform: scale(1.07); }
body.lp-home .lp-room-img::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.22) 48%, transparent 66%);
    transform: translateX(-120%);
}
body.lp-home .lp-room-card:hover .lp-room-img::after { transform: translateX(120%); transition: transform 1.1s var(--enh-ease); }

/* Book / Reserve / View buttons. */
body.lp-home .lp-btn-book {
    position: relative; overflow: hidden;
    transition: background-color 0.35s var(--enh-ease), transform 0.35s var(--enh-ease), box-shadow 0.35s var(--enh-ease);
}
body.lp-home .lp-btn-book:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(255, 199, 44, 0.3); }
body.lp-home .lp-btn-book svg { transition: transform 0.4s var(--enh-ease); }
body.lp-home .lp-btn-book:hover svg { transform: translateX(4px); }

/* Click ripple. */
.enh-ripple {
    position: absolute; border-radius: 50%; pointer-events: none;
    background: currentColor; opacity: 0.25; transform: scale(0);
    animation: enhRipple 0.65s var(--enh-ease) forwards;
}

/* Feature cards. */
body.lp-home .lp-feature-card:hover { transform: translateY(-5px); border-color: var(--enh-accent-soft); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3); }
html[data-theme="light"] body.lp-home .lp-feature-card:hover { box-shadow: 0 18px 40px rgba(58, 46, 30, 0.14); }
body.lp-home .lp-feature-icon { transition: transform 0.7s var(--enh-ease), background-color 0.4s; }
body.lp-home .lp-feature-card:hover .lp-feature-icon { transform: rotate(-12deg) scale(1.12); }

/* Info cards. */
body.lp-home .lp-info-card:hover { border-color: var(--enh-accent-soft); transform: translateY(-3px); }
body.lp-home .lp-info-row { transition: transform 0.4s var(--enh-ease); }
body.lp-home .lp-info-row:hover { transform: translateX(4px); }

/* ---------- Download app ---------- */
body.lp-home .lp-download-qr-box { animation: enhFloat 5s ease-in-out infinite; position: relative; }
body.lp-home .lp-download-qr-box::before {
    content: ''; position: absolute; inset: -10px; border-radius: 22px; z-index: -1;
    border: 2px solid var(--enh-accent-soft);
    animation: enhRing 2.8s ease-out infinite;
}

/* ---------- FAQ chat opens smoothly ---------- */
.lp-chat:not([hidden]) { animation: enhChatIn 0.45s var(--enh-ease) both; }

/* ---------- Theme switch ---------- */
/* Circle reveal from the toggle button (View Transitions, where supported). */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
/* Fallback: colors fade instead of snapping. */
html.enh-theme-fade *,
html.enh-theme-fade *::before,
html.enh-theme-fade *::after {
    transition: background-color 0.5s var(--enh-ease), color 0.5s var(--enh-ease),
                border-color 0.5s var(--enh-ease), fill 0.5s, stroke 0.5s !important;
}

/* ---------- Keyframes ---------- */
@keyframes enhNavIn     { from { opacity: 0; transform: translateY(-100%); } to { opacity: 1; transform: none; } }
@keyframes enhKenBurns  { from { scale: 1.06; } to { scale: 1.16; } }
@keyframes enhGlare     { from { transform: translate(-6%, -4%); opacity: 0.6; } to { transform: translate(8%, 6%); opacity: 1; } }
@keyframes enhEyebrowIn { from { opacity: 0; letter-spacing: 0.6em; } to { opacity: 1; letter-spacing: 0.2em; } }
@keyframes enhFadeUp    { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes enhWordIn    { to { opacity: 1; transform: none; filter: none; } }
@keyframes enhShimmer   { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
@keyframes enhShow      { to { opacity: 1; } }
@keyframes enhScrollDot { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
@keyframes enhPulseDot  { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55); } 100% { box-shadow: 0 0 0 9px rgba(22, 163, 74, 0); } }
@keyframes enhRipple    { to { transform: scale(2.6); opacity: 0; } }
@keyframes enhFloat     { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes enhRing      { 0% { opacity: 0.9; transform: scale(0.96); } 100% { opacity: 0; transform: scale(1.08); } }
@keyframes enhChatIn    { from { opacity: 0; translate: 0 18px; scale: 0.96; } to { opacity: 1; translate: 0 0; scale: 1; } }

/* ---------- Respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
    html:has(body.lp-home) { scroll-behavior: auto; }
    body.lp-home *, body.lp-home *::before, body.lp-home *::after {
        animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html.enh-js [data-enh-reveal] { opacity: 1; translate: none; filter: none; }
    .lp-hero-title .enh-word { opacity: 1; transform: none; filter: none; }
}


/* =========================================================================
   DARK MODE — night-time layer
   Everything here fades in/out smoothly when the theme changes.
   ========================================================================= */

/* Shared night layer inside the hero (fireflies, stars, water shimmer). */
.enh-night {
    position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
    opacity: 0; transition: opacity 1.4s var(--enh-ease);
}
html[data-theme="dark"] .enh-night { opacity: 1; }

/* Stars twinkle in the upper sky. */
.enh-star {
    position: absolute; left: var(--x); top: var(--y);
    width: var(--s); height: var(--s); border-radius: 50%; background: #fff;
    opacity: 0.15; animation: enhTwinkle var(--d) ease-in-out var(--delay) infinite;
}

/* Fireflies drift and blink over the garden. */
.enh-firefly {
    position: absolute; left: var(--x); top: var(--y);
    width: var(--s); height: var(--s); border-radius: 50%;
    background: #ffe29a;
    box-shadow: 0 0 6px 2px rgba(255, 206, 102, 0.85), 0 0 18px 6px rgba(255, 180, 60, 0.35);
    animation: enhDrift var(--d) ease-in-out var(--delay) infinite alternate,
               enhBlink calc(var(--d) * 0.45) ease-in-out var(--delay) infinite;
}

/* Moonlight ripples on the pool. */
.enh-water {
    position: absolute; left: 0; right: 0; bottom: 0; height: 38%;
    background:
        repeating-linear-gradient(172deg, transparent 0 14px, rgba(190, 215, 255, 0.10) 14px 16px, transparent 16px 34px),
        repeating-linear-gradient(8deg, transparent 0 22px, rgba(190, 215, 255, 0.07) 22px 23px, transparent 23px 48px);
    background-size: 220% 100%, 260% 100%;
    -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 100%);
    mask-image: linear-gradient(to top, #000 10%, transparent 100%);
    mix-blend-mode: screen;
    animation: enhRipple2 16s linear infinite;
}

/* Moonlight instead of sunlight. */
body.lp-home .lp-hero::after { transition: opacity 1.2s var(--enh-ease); }
html[data-theme="dark"] body.lp-home .lp-hero::after {
    background: radial-gradient(circle at 78% 18%, rgba(180, 205, 255, 0.20), transparent 42%);
}

/* Warm glow on "Agua Frio" at night. */
html[data-theme="dark"] .lp-hero-title .lp-accent { animation: enhAccentGlow 4s ease-in-out 2.2s infinite; }

/* Slow aurora behind the page content (dark only). */
.enh-aurora {
    position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
    opacity: 0; transition: opacity 1.6s var(--enh-ease);
}
html[data-theme="dark"] .enh-aurora { opacity: 1; }
.enh-aurora::before,
.enh-aurora::after {
    content: ''; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
    filter: blur(90px); opacity: 0.22;
}
.enh-aurora::before {
    background: radial-gradient(circle, #1f6f8b 0%, transparent 65%);
    left: -15vmax; top: 10vh; animation: enhAuroraA 28s ease-in-out infinite alternate;
}
.enh-aurora::after {
    background: radial-gradient(circle, #8a5a12 0%, transparent 65%);
    right: -20vmax; bottom: -10vh; animation: enhAuroraB 34s ease-in-out infinite alternate;
}

/* Nav: glowing underline + logo halo. */
html[data-theme="dark"] body.lp-home .lp-nav-link::after { box-shadow: 0 0 10px rgba(245, 166, 35, 0.7); }
html[data-theme="dark"] body.lp-home .lp-nav.is-scrolled { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 -1px 0 rgba(245, 166, 35, 0.12); }
html[data-theme="dark"] body.lp-home .lp-brand-logo { filter: drop-shadow(0 0 0 rgba(245, 166, 35, 0)); transition: width 0.5s var(--enh-ease), height 0.5s var(--enh-ease), transform 0.8s var(--enh-ease), filter 0.6s var(--enh-ease); }
html[data-theme="dark"] body.lp-home .lp-brand:hover .lp-brand-logo { filter: drop-shadow(0 0 12px rgba(245, 166, 35, 0.55)); }
html[data-theme="dark"] .enh-progress { box-shadow: 0 0 12px rgba(245, 166, 35, 0.8); }

/* Cards: spotlight that follows the cursor + soft gold glow. */
body.lp-home .lp-room-card,
body.lp-home .lp-feature-card,
body.lp-home .lp-info-card { position: relative; }
body.lp-home .lp-room-card::before,
body.lp-home .lp-feature-card::before,
body.lp-home .lp-info-card::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
    background: radial-gradient(420px circle at var(--sx, 50%) var(--sy, 50%), rgba(245, 166, 35, 0.13), transparent 45%);
    opacity: 0; transition: opacity 0.5s var(--enh-ease);
}
html[data-theme="dark"] body.lp-home .lp-room-card:hover::before,
html[data-theme="dark"] body.lp-home .lp-feature-card:hover::before,
html[data-theme="dark"] body.lp-home .lp-info-card:hover::before { opacity: 1; }

html[data-theme="dark"] body.lp-home .lp-room-card:hover,
html[data-theme="dark"] body.lp-home .lp-feature-card:hover {
    border-color: rgba(245, 166, 35, 0.4);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(245, 166, 35, 0.18), 0 0 40px rgba(245, 166, 35, 0.10);
}
html[data-theme="dark"] body.lp-home .lp-room-img::after {
    background: linear-gradient(115deg, transparent 30%, rgba(255, 220, 150, 0.18) 48%, transparent 66%);
}

/* Buttons glow at night. */
html[data-theme="dark"] body.lp-home .lp-btn-book:not(:disabled):hover {
    box-shadow: 0 0 0 4px rgba(255, 199, 44, 0.14), 0 10px 30px rgba(255, 199, 44, 0.35);
}
html[data-theme="dark"] body.lp-home .lp-btn-download:hover,
html[data-theme="dark"] body.lp-home .lp-btn-login:hover { box-shadow: 0 0 22px rgba(245, 166, 35, 0.25); }
html[data-theme="dark"] body.lp-home .lp-btn-theme:hover { box-shadow: 0 0 18px rgba(245, 166, 35, 0.35); }

/* Section title bar glows. */
html[data-theme="dark"] body.lp-home .lp-rooms-title::after { box-shadow: 0 0 12px rgba(245, 166, 35, 0.6); }

/* Feature icons breathe with a soft glow. */
html[data-theme="dark"] body.lp-home .lp-feature-icon { animation: enhIconGlow 3.6s ease-in-out infinite; }
html[data-theme="dark"] body.lp-home .lp-feature-card:nth-child(2) .lp-feature-icon { animation-delay: 1.2s; }
html[data-theme="dark"] body.lp-home .lp-feature-card:nth-child(3) .lp-feature-icon { animation-delay: 2.4s; }

/* QR code glows. */
html[data-theme="dark"] body.lp-home .lp-download-qr-box { filter: drop-shadow(0 0 24px rgba(245, 166, 35, 0.18)); }
html[data-theme="dark"] body.lp-home .lp-download-qr-box::before { border-color: rgba(245, 166, 35, 0.55); box-shadow: 0 0 20px rgba(245, 166, 35, 0.25); }

@keyframes enhTwinkle    { 0%, 100% { opacity: 0.12; transform: scale(0.8); } 50% { opacity: 0.95; transform: scale(1.2); } }
@keyframes enhDrift      { 0% { transform: translate(0, 0); } 50% { transform: translate(calc(var(--dx) * 0.6), calc(var(--dy) * -0.4)); } 100% { transform: translate(var(--dx), var(--dy)); } }
@keyframes enhBlink      { 0%, 100% { opacity: 0.15; } 45%, 60% { opacity: 1; } }
@keyframes enhRipple2    { from { background-position: 0 0, 100% 0; } to { background-position: 100% 0, 0 0; } }
@keyframes enhAccentGlow { 0%, 100% { filter: drop-shadow(0 0 0 rgba(245, 166, 35, 0)); } 50% { filter: drop-shadow(0 0 18px rgba(245, 166, 35, 0.55)); } }
@keyframes enhAuroraA    { from { transform: translate(0, 0) scale(1); } to { transform: translate(18vw, 20vh) scale(1.2); } }
@keyframes enhAuroraB    { from { transform: translate(0, 0) scale(1.1); } to { transform: translate(-22vw, -25vh) scale(0.9); } }
@keyframes enhIconGlow   { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 166, 35, 0); } 50% { box-shadow: 0 0 18px 2px rgba(245, 166, 35, 0.35); } }

@media (prefers-reduced-motion: reduce) {
    .enh-night, .enh-aurora { display: none; }
}
