/* ============================================================
   QUARTIER 12 TATTOO — Design Tokens & Custom Styles
   Architecture: Primitive → Semantic → Component
   ============================================================ */

/* --- LAYER 1: PRIMITIVES --- */
:root {
  /* Colors */
  --color-ink-950: #0E0C0A;
  --color-ink-900: #1C1916;
  --color-ink-850: #252220;
  --color-stone-500: #A39080;
  --color-stone-200: #E8DDD0;
  --color-violet-600: #7B6A9B;
  --color-violet-400: #9889B8;
  --color-brass-500: #B8965A;
  --color-cream-100: #F5EDE3;

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;

  /* Spacing (base 8px) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;
  --space-15: 120px;

  /* Radius */
  --radius-none: 0;
  --radius-sm: 4px;
  --radius-full: 9999px;

  /* --- LAYER 2: SEMANTIC --- */
  --color-background: var(--color-ink-950);
  --color-surface: var(--color-ink-900);
  --color-foreground: var(--color-stone-200);
  --color-foreground-muted: var(--color-stone-500);
  --color-primary: var(--color-violet-600);
  --color-primary-hover: var(--color-violet-400);
  --color-accent: var(--color-brass-500);
  --color-highlight: var(--color-cream-100);

  --spacing-section: var(--space-15);
  --spacing-section-mobile: var(--space-10);
  --spacing-component: var(--space-3);

  --font-heading: var(--font-display);
  --font-text: var(--font-body);
  --font-label: var(--font-mono);

  /* --- LAYER 3: COMPONENT --- */
  --gallery-overlay-bg: var(--color-primary);
  --gallery-overlay-opacity: 0.85;

  --nav-bg: var(--color-surface);
  --nav-logo-color: var(--color-highlight);
  --nav-cta-bg: var(--color-primary);

  --hero-title-color: var(--color-highlight);
  --hero-watermark-opacity: 0.08;

  --cta-bg: var(--color-primary);
  --cta-bg-hover: var(--color-primary-hover);
  --cta-fg: var(--color-highlight);
  --cta-radius: var(--radius-sm);

  --rating-star-color: var(--color-accent);
}

/* --- BASE RESETS --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background-color: var(--color-background);
  color: var(--color-foreground);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background: var(--color-primary);
  color: var(--color-highlight);
}

:focus-visible {
  outline: 2px solid var(--color-primary-hover);
  outline-offset: 2px;
}

/* --- TYPOGRAPHY --- */
.font-display { font-family: var(--font-heading); }
.font-mono { font-family: var(--font-label); }
.font-body { font-family: var(--font-text); }

.tracking-display { letter-spacing: -0.03em; }
.tracking-label { letter-spacing: 0.1em; }

/* --- NAVIGATION --- */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(28, 25, 22, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(163, 144, 128, 0.08);
  transition: transform 0.4s ease, background 0.3s ease;
}

.nav-bar.nav-hidden {
  transform: translateY(-100%);
}

.nav-bar.nav-scrolled {
  background: rgba(28, 25, 22, 0.95);
}

/* --- HERO --- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to top, var(--color-background) 0%, rgba(14,12,10,0.85) 25%, rgba(14,12,10,0.4) 55%, rgba(14,12,10,0.2) 100%);
}

.hero-watermark {
  position: absolute;
  bottom: -5%;
  right: -2%;
  z-index: 2;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 30vw;
  line-height: 0.8;
  color: var(--color-highlight);
  opacity: var(--hero-watermark-opacity);
  user-select: none;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: var(--space-6) var(--space-3) var(--space-12);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: var(--color-foreground-muted);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-highlight);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0% { top: -100%; }
  50% { top: 100%; }
  100% { top: 100%; }
}

/* --- DOT NAVIGATION --- */
.dot-nav {
  position: fixed;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dot-nav a {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-foreground-muted);
  opacity: 0.4;
  transition: all 0.3s ease;
  position: relative;
}

.dot-nav a:hover,
.dot-nav a.active {
  opacity: 1;
  background: var(--color-primary);
  transform: scale(1.3);
}

.dot-nav a::before {
  content: attr(aria-label);
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-label);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-foreground-muted);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.dot-nav a:hover::before {
  opacity: 1;
}

/* --- GALLERY / MASONRY --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.gallery-item:hover img,
.gallery-item:focus-within img {
  transform: scale(1.03);
}

/* Stencil Reveal Overlay */
.stencil-overlay {
  position: absolute;
  inset: 0;
  background: var(--gallery-overlay-bg);
  opacity: 0;
  transform: translateY(100%);
  transition: transform 0.4s ease-out, opacity 0.4s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  z-index: 2;
}

/* Halftone dot pattern */
.stencil-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 8px 8px;
  z-index: 0;
}

.stencil-overlay span {
  position: relative;
  z-index: 1;
}

.gallery-item:hover .stencil-overlay,
.gallery-item.stencil-active .stencil-overlay {
  opacity: var(--gallery-overlay-opacity);
  transform: translateY(0);
}

/* Asymmetric grid spans */
.gallery-item:nth-child(1) { grid-column: span 7; grid-row: span 2; }
.gallery-item:nth-child(2) { grid-column: span 5; }
.gallery-item:nth-child(3) { grid-column: span 5; }
.gallery-item:nth-child(4) { grid-column: span 5; grid-row: span 2; }
.gallery-item:nth-child(5) { grid-column: span 7; }
.gallery-item:nth-child(6) { grid-column: span 7; }
.gallery-item:nth-child(7) { grid-column: span 4; }
.gallery-item:nth-child(8) { grid-column: span 8; }

/* Gallery item heights */
.gallery-item { min-height: 280px; }
.gallery-item:nth-child(1) { min-height: 560px; }
.gallery-item:nth-child(4) { min-height: 560px; }

/* --- ARTISTE SECTION --- */
.artiste-grid {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: var(--space-8);
  align-items: center;
}

.star-rating {
  color: var(--rating-star-color);
}

/* --- CTA BUTTONS --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--cta-bg);
  color: var(--cta-fg);
  font-family: var(--font-label);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 14px 28px;
  border-radius: var(--cta-radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.3s ease, transform 0.2s ease;
  min-height: 44px;
  min-width: 44px;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--cta-bg-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--color-foreground-muted);
  font-family: var(--font-label);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 14px 28px;
  border-radius: var(--cta-radius);
  border: 1px solid var(--color-foreground-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  min-height: 44px;
  min-width: 44px;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  color: var(--color-foreground);
  border-color: var(--color-foreground);
  transform: translateY(-1px);
}

/* --- SEPARATOR --- */
.separator-brass {
  width: 60px;
  height: 1px;
  background: var(--color-accent);
  opacity: 0.5;
}

/* --- MAP EMBED --- */
.map-container {
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.map-container iframe {
  display: block;
  width: 100%;
  height: 350px;
  border: none;
  filter: grayscale(0.8) contrast(1.1) brightness(0.7) sepia(0.3);
  transition: filter 0.4s ease;
}

.map-container:hover iframe {
  filter: grayscale(0.4) contrast(1.05) brightness(0.8) sepia(0.1);
}

/* --- LIGHTBOX --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(14, 12, 10, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(8px);
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 2px;
}

.lightbox-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: none;
  border: none;
  color: var(--color-foreground);
  font-size: 32px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.lightbox-close:hover {
  color: var(--color-primary-hover);
}

/* --- ANIMATIONS --- */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays */
.fade-up[data-delay="1"] { transition-delay: 0.1s; }
.fade-up[data-delay="2"] { transition-delay: 0.2s; }
.fade-up[data-delay="3"] { transition-delay: 0.3s; }
.fade-up[data-delay="4"] { transition-delay: 0.4s; }

/* --- CUSTOM CURSOR (gallery only, desktop) --- */
.custom-cursor {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  pointer-events: none;
  z-index: 150;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.15s ease;
  mix-blend-mode: screen;
}

.custom-cursor.visible {
  opacity: 1;
}

.cursor-trail {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  pointer-events: none;
  z-index: 149;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* --- RESPONSIVE --- */
@media (max-width: 767px) {
  .hero-watermark { display: none; }

  .hero-content {
    padding: var(--space-4) var(--space-2) var(--space-8);
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .gallery-item,
  .gallery-item:nth-child(1),
  .gallery-item:nth-child(2),
  .gallery-item:nth-child(3),
  .gallery-item:nth-child(4),
  .gallery-item:nth-child(5),
  .gallery-item:nth-child(6),
  .gallery-item:nth-child(7),
  .gallery-item:nth-child(8) {
    grid-column: span 1;
    grid-row: span 1;
    min-height: 300px;
  }

  .artiste-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .dot-nav { display: none; }

  .custom-cursor,
  .cursor-trail { display: none !important; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .gallery-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .gallery-item:nth-child(1) { grid-column: span 4; grid-row: span 1; min-height: 350px; }
  .gallery-item:nth-child(2) { grid-column: span 2; min-height: 350px; }
  .gallery-item:nth-child(3) { grid-column: span 3; }
  .gallery-item:nth-child(4) { grid-column: span 3; grid-row: span 1; min-height: 280px; }
  .gallery-item:nth-child(5) { grid-column: span 3; }
  .gallery-item:nth-child(6) { grid-column: span 3; }
  .gallery-item:nth-child(7) { grid-column: span 2; }
  .gallery-item:nth-child(8) { grid-column: span 4; }
}

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

  .fade-up {
    opacity: 1;
    transform: none;
  }

  .stencil-overlay {
    transition: opacity 0.01ms ease;
    transform: none;
  }

  .gallery-item:hover .stencil-overlay,
  .gallery-item.stencil-active .stencil-overlay {
    transform: none;
  }

  .scroll-line::after {
    animation: none;
  }
}

/* --- PRINT --- */
@media print {
  .nav-bar, .dot-nav, .scroll-indicator, .lightbox, .custom-cursor, .cursor-trail { display: none; }
  body { background: white; color: black; }
}
