/* ================================================================
   LUMIÈRE — layout.css
   Loader · Cursor · Scroll progress · Navigation · Mega menu
   Mobile menu · Footer · Back-to-top · Page transition
   ================================================================ */

/* ----------------------------------------------------------------
   1. PAGE LOADER
   ---------------------------------------------------------------- */
.loader {
  position: fixed; inset: 0; z-index: var(--z-loader);
  background: var(--bg-primary);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2rem;
  transition: opacity 0.8s var(--ease-out), visibility 0.8s;
}
.loader.hidden { opacity: 0; visibility: hidden; }

.loader-mark {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: 0.08em;
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
}
.loader-mark span { color: var(--gold); }
.loader-mark::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(212,175,55,0.5) 50%, transparent 80%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  animation: shimmer 2.2s linear infinite;
  mix-blend-mode: overlay;
}
.loader-bar {
  width: min(240px, 60vw); height: 1px; background: var(--border-gold);
  position: relative; overflow: hidden;
}
.loader-bar::after {
  content: ''; position: absolute; inset: 0; left: -100%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: loaderSweep 1.4s var(--ease-inout) infinite;
}
@keyframes loaderSweep { to { left: 100%; } }
.loader-tagline {
  font-size: 0.65rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--text-muted);
}

/* ----------------------------------------------------------------
   2. CUSTOM CURSOR
   ---------------------------------------------------------------- */
.cursor-dot, .cursor-ring { position: fixed; pointer-events: none; border-radius: 50%; opacity: 0; will-change: transform; }
.cursor-dot {
  width: 6px; height: 6px; background: var(--gold);
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, opacity 0.3s, background 0.2s;
  mix-blend-mode: difference;
}
.cursor-ring {
  width: 40px; height: 40px; border: 1px solid var(--gold);
  z-index: calc(var(--z-cursor) - 1);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, border-color 0.3s, opacity 0.3s, background 0.3s;
}
.cursor-ring.hover { width: 64px; height: 64px; border-color: var(--gold-lt); background: var(--gold-glass); }
.cursor-ring.hover-label::after {
  content: attr(data-cursor); position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.5rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold);
}
@media (hover: none) and (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }

/* ----------------------------------------------------------------
   3. AMBIENT GLOW
   ---------------------------------------------------------------- */
.ambient-glow { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.ambient-glow-orb {
  position: absolute; width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: left 0.8s var(--ease-out), top 0.8s var(--ease-out);
  will-change: left, top;
}

/* ----------------------------------------------------------------
   4. SCROLL PROGRESS INDICATOR
   ---------------------------------------------------------------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-lt));
  z-index: var(--z-nav);
  box-shadow: 0 0 12px var(--gold-glow);
  transition: width 0.1s linear;
}

/* ----------------------------------------------------------------
   5. NAVIGATION
   ---------------------------------------------------------------- */
.nav {
  position: fixed; top: 1.5rem; left: 50%; transform: translateX(-50%);
  z-index: var(--z-nav);
  display: flex; align-items: center; justify-content: space-between; gap: 2.5rem;
  padding: 0.7rem 0.7rem 0.7rem 1.75rem;
  background: var(--nav-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-pill);
  width: min(94vw, 1080px);
  transition: background 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out),
              border-color 0.5s, top 0.5s var(--ease-out);
}
.nav.scrolled {
  background: var(--nav-bg-solid);
  box-shadow: 0 8px 40px var(--shadow-card), 0 0 30px var(--gold-glow);
  border-color: rgba(212, 175, 55, 0.3);
}
.nav.hidden-up { top: -100px; }

.nav-logo {
  font-family: var(--font-serif); font-size: 1.375rem; font-weight: 500;
  letter-spacing: 0.06em; color: var(--text-primary); white-space: nowrap;
}
.nav-logo span { color: var(--gold); }

.nav-links { display: flex; align-items: center; gap: 1.9rem; }
.nav-links > li { position: relative; }
.nav-links a.nav-link {
  font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-secondary); font-weight: 400; position: relative;
  transition: color 0.3s var(--ease-out); display: inline-flex; align-items: center; gap: 0.4rem;
}
.nav-links a.nav-link::after {
  content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 1px;
  background: var(--gold); transition: width 0.35s var(--ease-out);
}
.nav-link.has-mega .caret {
  width: 6px; height: 6px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-1px); transition: transform 0.3s;
}
.nav-item.mega-open .caret { transform: rotate(-135deg) translateY(1px); }
.nav-link.active { color: var(--gold); }
.nav-link.active::after { width: 100%; }

@media (hover: hover) and (pointer: fine) {
  .nav-links a.nav-link:hover { color: var(--gold); }
  .nav-links a.nav-link:hover::after { width: 100%; }
}

.nav-right { display: flex; align-items: center; gap: 1rem; }

.nav-cta {
  background: var(--espresso); color: var(--ivory);
  padding: 0.6rem 1.4rem; border-radius: var(--radius-pill);
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500;
  white-space: nowrap;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.3s, background 0.3s, color 0.3s;
}
[data-theme="dark"] .nav-cta { background: var(--gold); color: var(--espresso); }
@media (hover: hover) and (pointer: fine) {
  .nav-cta:hover { transform: scale(1.04); background: var(--gold); color: var(--espresso);
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.35); }
}
.nav-cta:active { transform: scale(0.97); }

/* Theme toggle */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border-gold); background: var(--gold-glass);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--text-secondary); flex-shrink: 0;
  transition: transform 0.4s var(--ease-spring), color 0.3s, border-color 0.3s, background 0.3s;
}
.theme-toggle:hover { color: var(--gold); border-color: var(--gold); transform: rotate(20deg); }
.theme-toggle .icon-sun, .theme-toggle .icon-moon {
  position: absolute; transition: opacity 0.4s var(--ease-out), transform 0.5s var(--ease-spring);
}
.theme-toggle .icon-moon { opacity: 0; transform: scale(0.4) rotate(-90deg); }
[data-theme="dark"] .theme-toggle .icon-sun  { opacity: 0; transform: scale(0.4) rotate(90deg); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 1; transform: scale(1) rotate(0); }

.nav-hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; cursor: pointer; background: none; border: none; padding: 0;
  border-radius: 50%;
}
.nav-hamburger span {
  display: block; width: 22px; height: 1.5px; margin: 0 auto; background: var(--text-primary);
  transform-origin: center; transition: transform 0.35s var(--ease-out), opacity 0.2s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ----------------------------------------------------------------
   6. MEGA MENU
   ---------------------------------------------------------------- */
.mega {
  position: absolute; top: calc(100% + 1.25rem); left: 50%; transform: translateX(-50%) translateY(10px);
  width: min(88vw, 720px);
  background: var(--nav-bg-solid);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--border-gold); border-radius: var(--radius-card);
  box-shadow: 0 30px 80px var(--shadow-lg), 0 0 40px var(--gold-glow);
  padding: 2rem; opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.35s var(--ease-out), transform 0.4s var(--ease-out), visibility 0.35s;
  z-index: 5;
}
.nav-item.mega-open .mega { opacity: 1; visibility: visible; pointer-events: all; transform: translateX(-50%) translateY(0); }
.mega-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; }
.mega-col h5 {
  font-family: var(--font-sans); font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1rem;
}
.mega-links { display: grid; gap: 0.15rem; }
.mega-link {
  display: flex; flex-direction: column; gap: 0.1rem; padding: 0.6rem 0.85rem; border-radius: var(--radius-sm);
  transition: background 0.25s, transform 0.25s;
}
.mega-link strong { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 500; color: var(--text-primary); }
.mega-link span { font-size: 0.72rem; color: var(--text-muted); }
.mega-link:hover { background: var(--gold-glass); transform: translateX(4px); }
.mega-feature {
  position: relative; border-radius: var(--radius-sm); overflow: hidden; min-height: 200px;
  display: flex; align-items: flex-end; padding: 1.25rem; color: #fff;
}
.mega-feature img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; transition: transform 0.8s var(--ease-out); }
.mega-feature::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.7), transparent 70%); z-index: 1; }
.mega-feature:hover img { transform: scale(1.06); }
.mega-feature-text { position: relative; z-index: 2; }
.mega-feature-text .eyebrow { color: var(--gold-lt); }
.mega-feature-text strong { display: block; font-family: var(--font-serif); font-size: 1.4rem; margin-top: 0.35rem; }

/* ----------------------------------------------------------------
   7. MOBILE MENU OVERLAY  (premium fullscreen navigation)
   Structure: .mobile-menu > __top(logo+close) · __nav(links) · __foot(social+CTA)
   z-index sits above the nav (900) and below the loader (9500) & cursor.
   Content is a flex column so links are always inside the viewport.
   ---------------------------------------------------------------- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 8000;
  background: var(--overlay-bg);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  display: flex; flex-direction: column;
  padding: 1.4rem clamp(1.5rem, 6vw, 3rem) 2rem;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.45s var(--ease-out), visibility 0.45s var(--ease-out);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.mobile-menu.open { opacity: 1; visibility: visible; pointer-events: auto; }

/* Top bar: logo + close */
.mobile-menu__top { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.mobile-menu__logo {
  font-family: var(--font-serif); font-size: 1.6rem; font-weight: 500;
  letter-spacing: 0.05em; color: var(--text-primary);
}
.mobile-menu__logo span { color: var(--gold); }
.mobile-menu__close {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--border-gold); background: var(--gold-glass);
  color: var(--text-primary); cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.35s var(--ease-spring), background 0.3s, color 0.3s;
}
.mobile-menu__close:hover { background: var(--gold); color: var(--espresso); transform: rotate(90deg); }
.mobile-menu__close svg { width: 20px; height: 20px; }

/* Navigation links */
.mobile-menu__nav {
  flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center;
  gap: 0.15rem; padding: 2rem 0; min-height: 0;
}
.mobile-menu__nav a {
  font-family: var(--font-serif); font-size: clamp(1.6rem, 7.5vw, 2.4rem); font-weight: 400;
  color: var(--text-primary); line-height: 1.3; width: fit-content;
  display: inline-flex; align-items: baseline; gap: 0.85rem;
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-spring), color 0.25s;
}
.mobile-menu__nav a::before {
  content: counter(mm, decimal-leading-zero); counter-increment: mm;
  font-family: var(--font-sans); font-size: 0.7rem; letter-spacing: 0.1em;
  color: var(--gold); opacity: 0.7; transform: translateY(-0.4em);
}
.mobile-menu__nav { counter-reset: mm; }
.mobile-menu.open .mobile-menu__nav a { opacity: 1; transform: translateY(0); }
.mobile-menu.open .mobile-menu__nav a:nth-child(1)  { transition-delay: 0.08s; }
.mobile-menu.open .mobile-menu__nav a:nth-child(2)  { transition-delay: 0.12s; }
.mobile-menu.open .mobile-menu__nav a:nth-child(3)  { transition-delay: 0.16s; }
.mobile-menu.open .mobile-menu__nav a:nth-child(4)  { transition-delay: 0.20s; }
.mobile-menu.open .mobile-menu__nav a:nth-child(5)  { transition-delay: 0.24s; }
.mobile-menu.open .mobile-menu__nav a:nth-child(6)  { transition-delay: 0.28s; }
.mobile-menu.open .mobile-menu__nav a:nth-child(7)  { transition-delay: 0.32s; }
.mobile-menu.open .mobile-menu__nav a:nth-child(8)  { transition-delay: 0.36s; }
.mobile-menu.open .mobile-menu__nav a:nth-child(9)  { transition-delay: 0.40s; }
.mobile-menu.open .mobile-menu__nav a:nth-child(10) { transition-delay: 0.44s; }
.mobile-menu__nav a.active { color: var(--gold); }
.mobile-menu__nav a:hover, .mobile-menu__nav a:focus-visible { color: var(--gold); }

/* Footer: social + CTA */
.mobile-menu__foot {
  flex-shrink: 0; display: flex; flex-direction: column; gap: 1.25rem;
  padding-top: 1.5rem; border-top: 1px solid var(--border-subtle);
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.5s var(--ease-out) 0.42s, transform 0.5s var(--ease-out) 0.42s;
}
.mobile-menu.open .mobile-menu__foot { opacity: 1; transform: translateY(0); }
.mobile-menu__social { display: flex; gap: 0.75rem; }
.mobile-menu__social a {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--border-gold); background: var(--gold-glass);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 0.95rem;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s;
}
.mobile-menu__social a:hover { background: var(--gold); color: var(--espresso); border-color: var(--gold); transform: translateY(-3px); }
.mobile-menu__cta { width: 100%; justify-content: center; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .mobile-menu__nav a, .mobile-menu__foot { transition: none; opacity: 1; transform: none; }
}

/* ----------------------------------------------------------------
   8. BACK TO TOP
   ---------------------------------------------------------------- */
.back-to-top {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 80;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--espresso); color: var(--ivory);
  border: 1px solid var(--border-gold);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: 0; transform: translateY(20px) scale(0.8); pointer-events: none;
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-spring), background 0.3s, color 0.3s;
}
[data-theme="dark"] .back-to-top { background: var(--gold); color: var(--espresso); }
.back-to-top.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }
.back-to-top:hover { background: var(--gold); color: var(--espresso); transform: translateY(-4px) scale(1.05); }
.back-to-top svg { width: 18px; height: 18px; }

/* ----------------------------------------------------------------
   9. PAGE TRANSITION VEIL
   ---------------------------------------------------------------- */
.page-veil {
  position: fixed; inset: 0; z-index: var(--z-loader);
  background: var(--bg-invert);
  transform: scaleY(0); transform-origin: bottom;
  pointer-events: none;
}
.page-veil.enter { animation: veilEnter 0.6s var(--ease-inout) forwards; }
.page-veil.leave { animation: veilLeave 0.7s var(--ease-inout) forwards; }
@keyframes veilEnter { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }
@keyframes veilLeave { from { transform: scaleY(1); transform-origin: top; } to { transform: scaleY(0); transform-origin: top; } }

/* NOTE: this animation must NOT use `transform` — a transform on <body>
   (even an identity matrix left behind by animation-fill-mode) turns <body>
   into the containing block for every position:fixed descendant, which
   breaks the sticky nav, back-to-top and (visibly) the fullscreen mobile
   menu. Keep it opacity-only. */
body.page-enter { animation: pageEnter 0.7s var(--ease-out) both; }
@keyframes pageEnter { from { opacity: 0; } to { opacity: 1; } }

/* ----------------------------------------------------------------
   10. FOOTER
   ---------------------------------------------------------------- */
.footer { background: var(--bg-invert); padding: 5rem 0 2.5rem; position: relative; overflow: hidden; color: var(--text-on-dark); }
[data-theme="dark"] .footer { border-top: 1px solid var(--border-subtle); }
.footer::before {
  content: ''; position: absolute; bottom: -20%; left: -10%; width: 50%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(212,175,55,0.05) 0%, transparent 70%); pointer-events: none;
}

.footer-cta {
  text-align: center; padding-bottom: 4rem; margin-bottom: 4rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-cta h2 { font-size: clamp(2rem, 4vw, 3.4rem); color: var(--ivory); line-height: 1.1; }
.footer-cta p { color: rgba(247,243,238,0.55); margin: 1rem auto 2rem; max-width: 44ch; }

.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 4rem;
  padding-bottom: 4rem; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.footer-brand h3 {
  font-family: var(--font-serif); font-size: 1.875rem; font-weight: 400; color: var(--ivory);
  letter-spacing: 0.04em; margin-bottom: 1rem;
}
.footer-brand h3 span { color: var(--gold); }
.footer-brand p { font-size: 0.875rem; color: rgba(247,243,238,0.5); line-height: 1.7; max-width: 30ch; }
.footer-social { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.social-link {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center; color: rgba(247,243,238,0.45);
  font-size: 0.8rem; transition: border-color 0.25s, color 0.25s, background 0.25s, transform 0.25s;
}
.social-link:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-glass); transform: translateY(-3px); }

.footer-col h4 {
  font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 1.25rem; font-family: var(--font-sans);
}
.footer-col ul { display: flex; flex-direction: column; gap: 0.65rem; }
.footer-col ul li, .footer-col address { font-size: 0.875rem; color: rgba(247,243,238,0.5); line-height: 1.6; }
.footer-col a { color: rgba(247,243,238,0.5); transition: color 0.25s; }
.footer-col a:hover { color: var(--gold); }
.footer-closed { margin-top: 0.75rem; opacity: 0.5; }

.footer-newsletter p { font-size: 0.85rem; color: rgba(247,243,238,0.5); margin-bottom: 1rem; }
.footer-newsletter-form { display: flex; gap: 0.5rem; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-pill); padding: 0.35rem 0.35rem 0.35rem 1.1rem; }
.footer-newsletter-form input {
  flex: 1; background: none; border: none; outline: none; color: var(--ivory);
  font-family: var(--font-sans); font-size: 0.82rem; min-width: 0;
}
.footer-newsletter-form input::placeholder { color: rgba(247,243,238,0.35); }
.footer-newsletter-form button {
  width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--gold); color: var(--espresso);
  cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: transform 0.25s var(--ease-spring), background 0.25s;
}
.footer-newsletter-form button:hover { transform: scale(1.08); background: var(--gold-lt); }
.footer-newsletter-note { font-size: 0.7rem; color: rgba(247,243,238,0.35); margin-top: 0.75rem; }
.footer-newsletter-note.success { color: var(--gold-lt); }

.footer-bottom {
  padding-top: 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.footer-bottom p { font-size: 0.775rem; color: rgba(247,243,238,0.3); }
.footer-bottom-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-bottom-links a { font-size: 0.775rem; color: rgba(247,243,238,0.3); transition: color 0.25s; }
.footer-bottom-links a:hover { color: rgba(247,243,238,0.6); }

/* ----------------------------------------------------------------
   11. NAV RESPONSIVE
   ---------------------------------------------------------------- */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-cta.desktop-only { display: none; }
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .footer-brand { grid-column: 1 / -1; }
  .back-to-top { bottom: 1.25rem; right: 1.25rem; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .nav { padding-left: 1.25rem; }
}
