@import "tailwindcss";
@import "tw-animate-css";

@custom-variant dark (&:is(.dark *));

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Brand Colors */
  --color-brand-bg: #FDFCF9;
  --color-brand-dark: #1A1A1A;
  --color-brand-accent: #C5A17A;
  /* Or « encre » : même famille, assombri pour que les petits textes dorés
     restent lisibles sur fond clair (≈ 5,4:1). L'or clair reste pour les
     traits, fonds et le mode sombre. */
  --color-brand-goldink: #8B6F47;
  --color-brand-muted: #F3F1ED;

  /* shadcn compat */
  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);

  --shadow-editorial: 0 10px 40px -10px rgba(0, 0, 0, 0.05);
}

/* Light Theme */
:root {
  --radius: 0.75rem;
  --background: #FDFCF9;
  --foreground: #1A1A1A;
  --card: #ffffff;
  --card-foreground: #1A1A1A;
  --popover: #ffffff;
  --popover-foreground: #1A1A1A;
  --primary: #1A1A1A;
  --primary-foreground: #ffffff;
  --secondary: #F3F1ED;
  --secondary-foreground: #1A1A1A;
  --muted: #F3F1ED;
  --muted-foreground: #6b6b6b;
  --accent: #C5A17A;
  --accent-foreground: #1A1A1A;
  --destructive: #ef4444;
  --border: rgba(0, 0, 0, 0.08);
  --input: rgba(0, 0, 0, 0.08);
  --ring: #C5A17A;
  --chart-1: #C5A17A;
  --chart-2: #1A1A1A;
  --chart-3: #10b981;
  --chart-4: #f59e0b;
  --chart-5: #ef4444;
  --sidebar: #ffffff;
  --sidebar-foreground: #1A1A1A;
  --sidebar-primary: #1A1A1A;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #F3F1ED;
  --sidebar-accent-foreground: #1A1A1A;
  --sidebar-border: rgba(0, 0, 0, 0.05);
  --sidebar-ring: #C5A17A;
}

/* Dark Theme */
.dark {
  --radius: 0.75rem;
  --background: #0a0a0a;
  --foreground: #fafafa;
  --card: #141414;
  --card-foreground: #fafafa;
  --popover: #141414;
  --popover-foreground: #fafafa;
  --primary: #C5A17A;
  --primary-foreground: #1A1A1A;
  --secondary: #1f1f1f;
  --secondary-foreground: #fafafa;
  --muted: #1f1f1f;
  --muted-foreground: #a1a1aa;
  --accent: #C5A17A;
  --accent-foreground: #1A1A1A;
  --destructive: #ef4444;
  --border: #272727;
  --input: #272727;
  --ring: #C5A17A;
  --chart-1: #C5A17A;
  --chart-2: #fafafa;
  --chart-3: #10b981;
  --chart-4: #f59e0b;
  --chart-5: #ef4444;
  --sidebar: #0f0f0f;
  --sidebar-foreground: #fafafa;
  --sidebar-primary: #C5A17A;
  --sidebar-primary-foreground: #1A1A1A;
  --sidebar-accent: #272727;
  --sidebar-accent-foreground: #fafafa;
  --sidebar-border: #1f1f1f;
  --sidebar-ring: #C5A17A;
}

@layer base {
  * {
    @apply border-border outline-ring/50;
    box-sizing: border-box;
  }

  html {
    scroll-behavior: smooth;
  }

  body {
    @apply bg-background text-foreground;
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
  }

  ::selection {
    background: rgba(197, 161, 122, 0.2);
  }

  :focus-visible {
    @apply outline-none ring-2 ring-ring ring-offset-2;
  }

  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 999px; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

  .dark ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }
  .dark ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
}

/* Editorial Design Utilities */
.editorial-card {
  @apply bg-white border border-black/5 rounded-3xl transition-all duration-500;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.05);
}
.editorial-card:hover {
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.1);
}

.dark .editorial-card {
  @apply bg-[#141414] border-white/5;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.3);
}

.premium-button {
  @apply bg-brand-dark text-white px-8 py-3.5 rounded-xl font-bold text-sm transition-all hover:scale-[1.02] active:scale-95;
  box-shadow: 0 4px 14px rgba(26, 26, 26, 0.2);
}
.premium-button:hover {
  box-shadow: 0 8px 25px rgba(26, 26, 26, 0.3);
}
.dark .premium-button {
  @apply bg-brand-accent text-brand-dark;
  box-shadow: 0 4px 14px rgba(197, 161, 122, 0.2);
}

.accent-pill {
  @apply px-4 py-1.5 rounded-full border border-brand-accent/40 text-brand-goldink text-[11px] font-bold uppercase tracking-widest bg-brand-accent/10;
}
.dark .accent-pill {
  @apply text-brand-accent bg-brand-accent/5 border-brand-accent/20;
}
.dark .accent-pill {
  @apply border-brand-accent/20;
}

.dark-section {
  @apply bg-brand-dark text-white;
}
.dark .dark-section {
  @apply bg-[#0a0a0a];
}

/* Loading */
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--ring);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Luxury & Ambient Utilities */
.hero-glow {
  background: radial-gradient(circle at 50% 18%, rgba(197, 161, 122, 0.22) 0%, rgba(197, 161, 122, 0.08) 35%, transparent 70%);
}
.dark .hero-glow {
  background: radial-gradient(circle at 50% 18%, rgba(197, 161, 122, 0.18) 0%, rgba(197, 161, 122, 0.04) 40%, transparent 75%);
}

.gradient-text-gold {
  background: linear-gradient(135deg, #1A1A1A 0%, #8B6F47 50%, #C5A17A 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.dark .gradient-text-gold {
  background: linear-gradient(135deg, #FFFFFF 0%, #E8D5C0 50%, #C5A17A 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.luxury-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.07);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.luxury-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 60px -15px rgba(139, 111, 71, 0.15);
  border-color: rgba(197, 161, 122, 0.4);
}

.dark .luxury-card {
  background: rgba(24, 24, 24, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.5);
}
.dark .luxury-card:hover {
  border-color: rgba(197, 161, 122, 0.5);
  box-shadow: 0 30px 60px -15px rgba(197, 161, 122, 0.2);
}

.popular-glow {
  position: relative;
}
.popular-glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 34px;
  background: linear-gradient(135deg, #C5A17A, #8B6F47, #C5A17A);
  z-index: -1;
  opacity: 0.85;
  filter: blur(8px);
}

.floating-badge {
  animation: floatSlow 6s ease-in-out infinite alternate;
}
.floating-badge-delayed {
  animation: floatSlow 6s ease-in-out infinite alternate 3s;
}
@keyframes floatSlow {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-10px) rotate(1deg); }
}

@keyframes laserScan {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
.laser-beam {
  animation: laserScan 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--muted) 0%, rgba(255,255,255,0.05) 50%, var(--muted) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* 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;
  }
}

/* High contrast */
@media (prefers-contrast: high) {
  :root {
    --border: rgba(0, 0, 0, 0.2);
  }
  .dark {
    --border: #404040;
  }
}
