/* ============================================
   NIHARA RESORT HOMES — Premium Design System
   Framer-quality animations & visual polish
   ============================================ */

/* === CSS Variables === */
:root {
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --transition-slow: 1.4s var(--ease-out-expo);
    --transition-base: 0.9s var(--ease-out-expo);
    --transition-fast: 0.5s var(--ease-out-expo);

    --brand-cream: #F4EFE6;
    --brand-terracotta: #C16A46;
    --brand-dark: #2A362E;
    --brand-sand: #D9C5A8;
    --brand-olive: #5C6B52;
    --brand-warm-white: #FAF8F4;
}

/* === Base === */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* ============================================
   NAVBAR — Full-width sticky, zero gap
   ============================================ */

/* Top info bar */
.site-topbar {
    background: var(--brand-dark);
    color: rgba(255,255,255,0.75);
    font-size: 12px;
    padding: 6px 0;
    letter-spacing: 0.03em;
}
.site-topbar .topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}
.site-topbar .topbar-left {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.site-topbar a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
    white-space: nowrap;
}
.site-topbar a:hover { color: var(--brand-sand); }

/* Hide project text on small screens */
@media (max-width: 640px) {
    .site-topbar .topbar-left { display: none; }
    .site-topbar .topbar-inner { justify-content: center; }
}

/* Main navbar */
.site-header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid #f0ebe0;
    box-shadow: 0 1px 12px rgba(42,54,46,0.06);
    transition: box-shadow 0.3s ease;
}
.site-header.scrolled {
    box-shadow: 0 2px 24px rgba(42,54,46,0.12);
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 68px;
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}
.nav-logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-dark);
    letter-spacing: 0.12em;
    line-height: 1;
}
.nav-logo-sub {
    font-family: 'Inter', sans-serif;
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: var(--brand-terracotta);
    text-transform: uppercase;
    line-height: 1.3;
}

/* Nav links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-links li a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}
.nav-links li a:hover,
.nav-links li a.active {
    color: var(--brand-terracotta);
}

/* CTA button */
.nav-cta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.btn-enquire {
    background: var(--brand-terracotta);
    color: #fff !important;
    padding: 0.6rem 1.4rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    white-space: nowrap;
}
.btn-enquire:hover {
    background: #a8582f;
    transform: translateY(-1px);
}

/* Mobile hamburger */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 6px;
    background: none;
    border: none;
}
.nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--brand-dark);
    border-radius: 2px;
    transition: all 0.3s;
}

/* Mobile menu */
.nav-mobile {
    display: none;
    flex-direction: column;
    background: #fff;
    border-top: 1px solid #f0ebe0;
    padding: 0 2rem 2rem;
    gap: 0.25rem;
}
.nav-mobile.open { display: flex; }

/* Close button row at top of mobile nav */
.nav-mobile-close-row {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 0 0.5rem;
}
.nav-mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid #e8e0d4;
    background: none;
    cursor: pointer;
    color: var(--brand-dark);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.nav-mobile-close:hover {
    background: var(--brand-terracotta);
    color: #fff;
    border-color: var(--brand-terracotta);
    transform: rotate(90deg);
}
.nav-mobile-close svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.nav-mobile a {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--brand-dark);
    text-decoration: none;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0ebe0;
}
.nav-mobile a:hover, .nav-mobile a.active { color: var(--brand-terracotta); }
.nav-mobile .btn-enquire {
    margin-top: 1rem;
    text-align: center;
    border-radius: 8px;
    padding: 0.8rem;
    font-size: 0.95rem;
}

/* Hamburger → X animation */
.nav-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.nav-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1023px) {
    .nav-links, .nav-cta { display: none; }
    .nav-hamburger { display: flex; }
}

/* Hero sections — always start at top-0, no gap */
.page-hero {
    position: relative;
    min-height: 55vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.page-hero-full {
    min-height: 100vh;
}
.page-hero img.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(42,54,46,0.25) 0%, rgba(42,54,46,0.7) 100%);
    z-index: 1;
}
.hero-overlay-strong {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(42,54,46,0.45) 0%, rgba(42,54,46,0.85) 100%);
    z-index: 1;
}
.page-hero .hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem 1rem;
}


::selection {
    background: var(--brand-terracotta);
    color: white;
}

/* === Smooth Custom Scrollbar === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--brand-cream); }
::-webkit-scrollbar-thumb { background: var(--brand-sand); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-terracotta); }

/* === Shared Section Styles === */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--brand-terracotta);
    margin-bottom: 1rem;
}

.section-label::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 1px;
    background: var(--brand-terracotta);
}

.section-title {
    font-family: 'Playfair Display', serif;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* === Hero Gradient Overlays === */
.hero-gradient {
    background: linear-gradient(
        180deg,
        rgba(42,54,46,0.15) 0%,
        rgba(42,54,46,0.3) 40%,
        rgba(42,54,46,0.75) 100%
    );
}

.hero-gradient-strong {
    background: linear-gradient(
        180deg,
        rgba(42,54,46,0.4) 0%,
        rgba(42,54,46,0.85) 100%
    );
}

/* === Premium Text Shadow === */
.premium-shadow {
    text-shadow: 0 4px 30px rgba(0,0,0,0.35), 0 1px 3px rgba(0,0,0,0.2);
}

/* === Scroll Reveal Animations === */
.reveal-up {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity var(--transition-base), transform var(--transition-base);
}
.reveal-up.active { opacity: 1; transform: translateY(0); }

.reveal-down {
    opacity: 0;
    transform: translateY(-40px);
    transition: opacity var(--transition-base), transform var(--transition-base);
}
.reveal-down.active { opacity: 1; transform: translateY(0); }

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity var(--transition-base), transform var(--transition-base);
}
.reveal-left.active { opacity: 1; transform: translateX(0); }

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity var(--transition-base), transform var(--transition-base);
}
.reveal-right.active { opacity: 1; transform: translateX(0); }

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all var(--transition-slow);
}
.reveal-scale.active { opacity: 1; transform: scale(1); }

.reveal-blur {
    opacity: 0;
    filter: blur(15px);
    transform: translateY(20px);
    transition: all var(--transition-slow);
}
.reveal-blur.active { opacity: 1; filter: blur(0); transform: translateY(0); }

/* Text mask reveal (hero titles) */
.clip-text {
    overflow: hidden;
    display: inline-block;
    vertical-align: top;
}

.reveal-mask {
    opacity: 0;
    transform: translateY(110%) rotate(3deg);
    transition: transform var(--transition-slow), opacity 0.6s var(--ease-out-expo);
    transform-origin: left bottom;
}
.reveal-mask.active { opacity: 1; transform: translateY(0) rotate(0); }

/* Fade only */
.reveal-fade {
    opacity: 0;
    transition: opacity var(--transition-base);
}
.reveal-fade.active { opacity: 1; }

/* === Stagger Delays === */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }
.delay-600 { transition-delay: 600ms; }
.delay-700 { transition-delay: 700ms; }
.delay-800 { transition-delay: 800ms; }

/* === Parallax === */
.parallax-wrapper {
    overflow: hidden;
    position: relative;
}
.parallax-img {
    height: 125%;
    width: 100%;
    object-fit: cover;
    will-change: transform;
    transition: none;
}

/* === Infinite Marquee / Ticker === */
.marquee-track {
    display: flex;
    width: max-content;
    animation: marqueeScroll 40s linear infinite;
    gap: 3rem;
}

.marquee-track:hover { animation-play-state: paused; }

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-item {
    white-space: nowrap;
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-style: italic;
    color: var(--brand-sand);
    display: flex;
    align-items: center;
    gap: 2rem;
}

.marquee-dot {
    width: 8px;
    height: 8px;
    background: var(--brand-terracotta);
    border-radius: 50%;
    flex-shrink: 0;
}

/* === Premium Image Cards === */
.img-reveal {
    overflow: hidden;
    border-radius: 1rem;
    position: relative;
}

.img-reveal img {
    transition: transform 1.2s var(--ease-out-expo);
}

.img-reveal:hover img {
    transform: scale(1.06);
}

.img-reveal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(42,54,46,0.4) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.img-reveal:hover::after { opacity: 1; }

/* === Glass Panel === */
.glass-panel {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.3);
}

.glass-dark {
    background: rgba(42,54,46,0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
}

/* === Premium Card Styles === */
.premium-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.6s var(--ease-out-expo), box-shadow 0.6s var(--ease-out-expo);
    border: 1px solid rgba(217, 197, 168, 0.25);
}

.premium-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 60px rgba(42,54,46,0.12);
}

.premium-card .card-accent {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-terracotta), var(--brand-sand));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s var(--ease-out-expo);
}

.premium-card:hover .card-accent { transform: scaleX(1); }

/* === Stat Counter === */
.stat-number {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1;
    color: var(--brand-terracotta);
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(42,54,46,0.5);
    margin-top: 0.5rem;
}

/* === Magnetic Button === */
.magnetic-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s var(--ease-out-quart);
    will-change: transform;
}

/* === Primary CTA Button === */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--brand-terracotta);
    color: white;
    padding: 1rem 2rem;
    border-radius: 100px;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.4s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: #a8583a;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(193,106,70,0.35);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: white;
    padding: 1rem 2rem;
    border-radius: 100px;
    font-weight: 500;
    border: 1.5px solid rgba(255,255,255,0.35);
    transition: all 0.4s var(--ease-out-expo);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.6);
}

.btn-dark {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--brand-dark);
    color: white;
    padding: 1rem 2rem;
    border-radius: 100px;
    font-weight: 500;
    transition: all 0.4s var(--ease-out-expo);
}

.btn-dark:hover {
    background: var(--brand-terracotta);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(42,54,46,0.25);
}

/* === Lightbox (Gallery) === */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    cursor: zoom-out;
}

.lightbox-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 0.5rem;
    transform: scale(0.9);
    transition: transform 0.5s var(--ease-out-expo);
}

.lightbox-overlay.open img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
}

.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* === Horizontal Scroll Gallery === */
.horiz-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 1rem 0;
}

.horiz-scroll::-webkit-scrollbar { display: none; }

.horiz-scroll-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

/* === Divider Line === */
.section-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand-sand), transparent);
}

/* === Floating Badge === */
.floating-badge {
    animation: floatBadge 6s ease-in-out infinite;
}

@keyframes floatBadge {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(2deg); }
}

/* === Number Count-Up === */
.count-up {
    font-variant-numeric: tabular-nums;
}

/* === WhatsApp Pulse === */
.whatsapp-pulse {
    animation: waPulse 2s ease-in-out infinite;
}

@keyframes waPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0.5); }
    50% { box-shadow: 0 0 0 14px rgba(37,211,102,0); }
}

/* === Responsive Adjustments === */
@media (max-width: 768px) {
    .marquee-item { font-size: 1.25rem; gap: 1.5rem; }
    .premium-card { padding: 1.75rem; border-radius: 1rem; }
    .stat-number { font-size: 2rem; }
}

/* === Page Transition Fade === */
body {
    animation: pageIn 0.5s ease both;
}

@keyframes pageIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* === Image Tilt on Hover (cards) === */
.tilt-card {
    transition: transform 0.5s var(--ease-out-expo);
    transform-style: preserve-3d;
}

.tilt-card:hover {
    transform: perspective(800px) rotateY(-2deg) rotateX(2deg) translateY(-4px);
}

/* === Nav pill active indicator === */
.nav-link {
    position: relative;
    padding-bottom: 2px;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--brand-terracotta);
}

/* === Navbar Scroll State === */
#navbar {
    transition: box-shadow 0.3s ease;
}

#navbar.scrolled {
    box-shadow: 0 2px 20px rgba(42, 54, 46, 0.1);
}
