/* ============================================
   L'ÉCRIN — Restaurant Gastronomique v2
   Skill: web-dev-luxe applied
   ============================================ */

/* CSS Variables — Design Tokens */
:root {
  --color-gold: #C9A962;
  --color-gold-light: #DCC8A0;
  --color-gold-dark: #A68B4B;
  --color-charcoal: #1A1A1A;
  --color-charcoal-light: #2D2D2D;
  --color-charcoal-lighter: #3D3D3D;
  --color-cream: #F5F0E8;
  --color-cream-dark: #E8E0D4;
  --font-display: 'Playfair Display', serif;
  --font-body: 'Lato', sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --cursor-size: 16px;
  --cursor-follower-size: 40px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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 {
  font-family: var(--font-body);
  background-color: var(--color-charcoal);
  color: var(--color-charcoal);
  overflow-x: hidden;
  cursor: none; /* Hide default cursor on desktop */
}

/* Show default cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
  body {
    cursor: auto;
  }
  #cursor,
  #cursor-follower {
    display: none !important;
  }
}

/* Selection */
::selection {
  background-color: var(--color-gold);
  color: var(--color-charcoal);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-charcoal);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gold-dark);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold);
}

/* ============================================
   CUSTOM CURSOR
   ============================================ */
#cursor {
  width: var(--cursor-size);
  height: var(--cursor-size);
  border-radius: 50%;
  border: 1px solid var(--color-gold);
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transition: transform 0.1s ease, width 0.3s ease, height 0.3s ease;
  transform: translate(-50%, -50%);
}

#cursor.hover {
  width: 50px;
  height: 50px;
  background: rgba(201, 169, 98, 0.1);
}

#cursor-follower {
  width: var(--cursor-follower-size);
  height: var(--cursor-follower-size);
  border-radius: 50%;
  border: 1px solid rgba(201, 169, 98, 0.3);
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  transition: transform 0.3s ease, width 0.5s ease, height 0.5s ease;
  transform: translate(-50%, -50%);
}

#cursor-follower.hover {
  width: 60px;
  height: 60px;
}

/* ============================================
   PAGE LOADER
   ============================================ */
#page-loader {
  background: var(--color-charcoal);
}

.loader-circle {
  animation: loader-draw 1.5s ease-out forwards;
}

@keyframes loader-draw {
  to {
    stroke-dashoffset: 0;
  }
}

.loader-progress {
  transition: width 1.5s ease-out;
}

/* ============================================
   FILM GRAIN CANVAS
   ============================================ */
#grain-canvas {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.08;
}

/* ============================================
   NAVIGATION
   ============================================ */
#navbar {
  background: transparent;
}

#navbar.scrolled {
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201, 169, 98, 0.1);
}

/* Mobile menu */
#mobile-menu.open {
  transform: translateX(0);
}

/* ============================================
   CURTAIN REVEAL
   ============================================ */
.curtain {
  transform-origin: top;
  transform: scaleY(1);
}

.curtain.revealed {
  transform: scaleY(0);
  transition: transform 1.2s cubic-bezier(0.76, 0, 0.24, 1);
}

/* ============================================
   BLUR REVEAL
   ============================================ */
.blur-reveal {
  filter: blur(20px);
  opacity: 0;
  transform: translateY(30px);
  transition: filter 1s ease, opacity 1s ease, transform 1s ease;
}

.blur-reveal.revealed {
  filter: blur(0);
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   IMAGE REVEAL (clip-path)
   ============================================ */
.image-reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.2s cubic-bezier(0.76, 0, 0.24, 1);
}

.image-reveal.revealed {
  clip-path: inset(0 0% 0 0);
}

/* ============================================
   HERO
   ============================================ */
.hero-bg {
  will-change: transform;
}

/* ============================================
   MENU ITEMS
   ============================================ */
.menu-item {
  transition: var(--transition-smooth);
  position: relative;
}

.menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--color-gold);
  transition: width 0.6s ease;
}

.menu-item:hover::before {
  width: 100%;
}

.menu-item:hover {
  padding-left: 8px;
}

.menu-item:hover p:first-child {
  color: var(--color-gold);
}

/* ============================================
   GALLERY
   ============================================ */
.gallery-item {
  position: relative;
  overflow: hidden;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 26, 26, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* ============================================
   MAGNETIC EFFECT
   ============================================ */
.magnetic {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================
   FORM
   ============================================ */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.6;
  cursor: pointer;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23F5F0E8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  background-size: 20px;
  padding-right: 28px;
}

/* ============================================
   COOKIE BANNER
   ============================================ */
#cookie-banner.visible {
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .hero-title {
    font-size: 3rem;
  }
  
  .hero-subtitle {
    font-size: 0.65rem;
    letter-spacing: 0.3em;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .curtain,
  .blur-reveal,
  .image-reveal {
    transition: none !important;
    transform: none !important;
    clip-path: none !important;
    filter: none !important;
    opacity: 1 !important;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  #navbar,
  #page-loader,
  #cursor,
  #cursor-follower,
  #grain-canvas,
  #cookie-banner,
  #mobile-menu,
  .hero-cta,
  #reservation-form button {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
    cursor: auto;
  }
}
