/*
  Grand Luxe — Global Premium Design System
  Psychology: dark serenity, champagne-gold reward cues, depth & motion
*/

/* ============ ROOT TOKENS ============ */
:root {
    --lux-bg: #030712;
    --lux-bg-soft: #0a0d18;
    --lux-gold: #d4af37;
    --lux-gold-light: #f3e5ab;
    --lux-gold-dark: #aa8c2c;
    --lux-ink: #f8f6f0;
    --lux-muted: #9ca3af;
    --lux-line: rgba(212, 175, 55, 0.18);
    --lux-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============ PAGE LOADER (3D diamond) ============ */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 45%, #0d1226 0%, #030712 65%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out;
}
.loader-spinner {
    width: 56px;
    height: 56px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-top: 1px solid #d4af37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: relative;
}
.loader-spinner::after {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-bottom: 1px solid rgba(243, 229, 171, 0.7);
    border-radius: 50%;
    animation: spin 1.6s linear infinite reverse;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============ BASE ============ */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}
/* Lenis smooth-scroll overrides (prevents jank/double easing) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
body {
    background-color: #030712;
    color: #111827;
    overflow-x: hidden;
}
::selection {
    background: #d4af37;
    color: #030712;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #05070d; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #d4af37, #aa8c2c);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: #f3e5ab; }

/* ============ SCROLL PROGRESS BAR ============ */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, #aa8c2c, #d4af37, #f3e5ab, #d4af37);
    z-index: 9999;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.7);
    pointer-events: none;
}

/* ============ CURSOR GLOW (desktop) ============ */
#cursor-glow {
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.07) 0%, transparent 65%);
    pointer-events: none;
    z-index: 5;
    transform: translate(-50%, -50%);
    transition: opacity 0.4s ease;
    opacity: 0;
}
@media (hover: hover) and (pointer: fine) {
    #cursor-glow { opacity: 1; }
}
@media (max-width: 768px) {
    #cursor-glow { display: none; }
}

/* ============ GLASSMORPHISM ============ */
.glass-effect {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.glass-effect-dark {
    background: linear-gradient(145deg, rgba(13, 17, 31, 0.72), rgba(5, 7, 13, 0.55));
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: none;
}
.glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}
.glass-nav {
    background: rgba(5, 7, 13, 0.55);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}

/* ============ TYPOGRAPHY HELPERS ============ */
.text-gold-gradient {
    background: linear-gradient(120deg, #aa8c2c 0%, #d4af37 30%, #f7ecc9 50%, #d4af37 70%, #aa8c2c 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: goldFlow 6s linear infinite;
}
@keyframes goldFlow {
    to { background-position: 200% center; }
}
.eyebrow {
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    font-size: 0.72rem;
    color: #d4af37;
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
}
.eyebrow::before {
    content: '';
    width: 2.2rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d4af37);
}

/* ============ NAVIGATION ============ */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
    padding-bottom: 5px;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
    transition: width 0.4s var(--lux-ease);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}
.nav-link:hover::after, .active-link::after { width: 100%; }
.nav-link:hover, .active-link { color: #f3e5ab !important; }

/* User profile dropdown */
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    width: 230px;
    background: rgba(8, 10, 18, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(212, 175, 55, 0.15);
    z-index: 50;
    display: none;
    overflow: hidden;
    transform-origin: top right;
}
.dropdown-menu.show {
    display: block;
    animation: dropIn 0.35s var(--lux-ease);
}
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============ PREMIUM BUTTONS ============ */
.btn-lux {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(120deg, #b8912a, #d4af37 45%, #e9d27a 55%, #d4af37);
    background-size: 220% auto;
    color: #0a0d18;
    border: 1px solid rgba(212, 175, 55, 0.6);
    overflow: hidden;
    transition: all 0.5s var(--lux-ease);
    box-shadow: 0 8px 28px rgba(212, 175, 55, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    cursor: pointer;
}
.btn-lux::before {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s var(--lux-ease);
}
.btn-lux:hover {
    background-position: right center;
    box-shadow: 0 12px 40px rgba(212, 175, 55, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}
.btn-lux:hover::before { left: 130%; }

.btn-lux-outline {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.45);
    backdrop-filter: blur(8px);
    overflow: hidden;
    transition: all 0.5s var(--lux-ease);
    cursor: pointer;
}
.btn-lux-outline::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, #b8912a, #d4af37, #e9d27a);
    opacity: 0;
    transition: opacity 0.45s ease;
    z-index: 0;
}
.btn-lux-outline > * { position: relative; z-index: 1; }
.btn-lux-outline:hover {
    color: #0a0d18;
    box-shadow: 0 10px 32px rgba(212, 175, 55, 0.35);
    transform: translateY(-2px);
}
.btn-lux-outline:hover::after { opacity: 1; }

.btn-gold {
    background: linear-gradient(120deg, #b8912a, #d4af37 45%, #e9d27a 55%, #d4af37);
    background-size: 220% auto;
    color: #0a0d18;
    transition: all 0.5s var(--lux-ease);
    border: 1px solid rgba(212, 175, 55, 0.6);
    cursor: pointer;
}
.btn-gold:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
}
.btn-outline-gold {
    background: transparent;
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.5);
    transition: all 0.5s var(--lux-ease);
    cursor: pointer;
}
.btn-outline-gold:hover {
    background: linear-gradient(120deg, #b8912a, #d4af37);
    color: #0a0d18;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.35);
}

/* ============ 3D TILT CARDS ============ */
.tilt-card {
    transform-style: preserve-3d;
    perspective: 900px;
    will-change: transform;
    transition: transform 0.5s var(--lux-ease), box-shadow 0.5s var(--lux-ease), border-color 0.5s ease;
}
.tilt-card .tilt-inner {
    transform: translateZ(30px);
    transition: transform 0.4s var(--lux-ease);
}
.tilt-card:hover {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(212, 175, 55, 0.12);
}
.tilt-sheen {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--sheen-x, 50%) var(--sheen-y, 50%), rgba(243, 229, 171, 0.14) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 2;
}
.tilt-card:hover .tilt-sheen { opacity: 1; }

/* ============ AMBIENT ORBS / AURORA ============ */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    will-change: transform;
    animation: orbFloat 16s ease-in-out infinite alternate;
}
@media (max-width: 768px) {
    .orb { filter: blur(50px); animation: none; }
}
.orb-gold { background: radial-gradient(circle, rgba(212, 175, 55, 0.16), transparent 70%); }
.orb-indigo { background: radial-gradient(circle, rgba(67, 56, 202, 0.16), transparent 70%); }
.orb-teal { background: radial-gradient(circle, rgba(45, 212, 191, 0.08), transparent 70%); }
@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -30px) scale(1.12); }
    100% { transform: translate(-30px, 25px) scale(0.95); }
}

/* ============ SCROLL REVEAL ============ */
.reveal {
    opacity: 0;
    transform: translateY(44px);
    transition: opacity 1s var(--lux-ease), transform 1s var(--lux-ease);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}
.reveal-left { transform: translateX(-56px); }
.reveal-right { transform: translateX(56px); }
.reveal-zoom { transform: scale(0.92); }
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* ============ FLOATING 3D ============ */
.float-3d {
    animation: float3d 7s ease-in-out infinite;
    will-change: transform;
}
.float-3d-slow { animation: float3d 10s ease-in-out infinite; }
@keyframes float3d {
    0%, 100% { transform: translateY(0) rotateX(0deg); }
    50% { transform: translateY(-14px) rotateX(2deg); }
}

/* ============ MARQUEE ============ */
.marquee {
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}
.marquee-track {
    display: inline-flex;
    align-items: center;
    gap: 4rem;
    white-space: nowrap;
    animation: marqueeMove 34s linear infinite;
    will-change: transform;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marqueeMove {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ============ IMAGES / FRAMES ============ */
.img-frame {
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}
.img-frame img {
    transition: transform 1.4s var(--lux-ease), filter 0.8s ease;
    will-change: transform;
}
.img-frame:hover img { transform: scale(1.08); }
.frame-gold-border {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(212, 175, 55, 0.35);
    transform: translate(14px, 14px);
    pointer-events: none;
    transition: transform 0.5s var(--lux-ease);
    z-index: 0;
}
.img-frame:hover + .frame-gold-border,
.frame-gold-border:hover { transform: translate(8px, 8px); }

/* ============ FORM INPUTS ============ */
.input-lux {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    padding: 0.85rem 0;
    transition: border-color 0.4s ease;
}
.input-lux:focus {
    outline: none;
    border-color: #d4af37;
}
.input-lux::placeholder { color: #6b7280; }
.input-wrap { position: relative; }
.input-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #f3e5ab, transparent);
    transform: translateX(-50%);
    transition: width 0.5s var(--lux-ease);
    pointer-events: none;
}
.input-wrap:focus-within::after { width: 100%; }

/* ============ BADGES / PILLS ============ */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
    border: 1px solid rgba(212, 175, 55, 0.3);
    background: rgba(212, 175, 55, 0.06);
    color: #e9d27a;
    backdrop-filter: blur(6px);
}

/* ============ DIVIDERS ============ */
.divider-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.divider-ornament .line {
    height: 1px;
    width: 4.5rem;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.7), transparent);
}
.divider-ornament .dot {
    width: 5px;
    height: 5px;
    transform: rotate(45deg);
    background: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

/* ============ SHIMMER TEXT (stats) ============ */
.stat-value {
    font-family: 'Cormorant Garamond', serif;
    background: linear-gradient(120deg, #f3e5ab, #d4af37);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============ CARD HOVER GLOW BORDER ============ */
.glow-border {
    position: relative;
    overflow: hidden;
}
.glow-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.55), rgba(212, 175, 55, 0.06) 40%, rgba(212, 175, 55, 0.06) 60%, rgba(212, 175, 55, 0.55));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 3;
}
.glow-border:hover::before { opacity: 1; }

/* ============ ANIMATED TICK PULSE (status) ============ */
.pulse-dot {
    position: relative;
}
.pulse-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid currentColor;
    opacity: 0.6;
    animation: pulseRing 2s ease-out infinite;
}
@keyframes pulseRing {
    0% { transform: scale(0.6); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* ============ UTILITY ANIMATIONS ============ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-shimmer {
    background: linear-gradient(90deg, rgba(212,175,55,0) 0%, rgba(212,175,55,0.5) 50%, rgba(212,175,55,0) 100%);
    background-size: 200% 100%;
    animation: shimmerMove 2.4s linear infinite;
}
@keyframes shimmerMove {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* ============ PARALLAX LAYERS ============ */
.parallax-layer {
    will-change: transform;
}

/* ============ PAGE LEAVE WIPE ============ */
.page-leave-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: linear-gradient(180deg, #030712, #0a0d18);
    transform: scaleY(0);
    transform-origin: bottom;
    pointer-events: none;
}
body.page-leaving .page-leave-overlay {
    transform: scaleY(1);
    transition: transform 0.45s cubic-bezier(0.7, 0, 0.3, 1);
}
body.page-leaving main,
body.page-leaving footer,
body.page-leaving nav {
    opacity: 0;
    transition: opacity 0.35s ease;
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}
