/* ==============================================
   COIFFURE ARTINI — Le Barbier de Quartier
   Design Tokens (Primitive → Semantic → Component)
   ============================================== */

/* --- PRIMITIVE TOKENS --- */
:root {
  /* Colors */
  --charcoal-900: #1B1F26;
  --charcoal-800: #242930;
  --charcoal-700: #353B44;
  --warm-white: #F4F1EC;
  --warm-gray: #A09890;
  --copper-500: #D99A42;
  --copper-400: #E5AD55;

  /* Fonts */
  --font-display: 'Big Shoulders Display', Impact, sans-serif;
  --font-body: 'DM Sans', Inter, sans-serif;

  /* Spacing */
  --radius-sm: 4px;
  --radius-md: 8px;

  /* --- SEMANTIC TOKENS --- */
  --base: var(--charcoal-900);
  --surface: var(--charcoal-800);
  --text-primary: var(--warm-white);
  --text-secondary: var(--warm-gray);
  --accent: var(--copper-500);
  --accent-hover: var(--copper-400);
  --border: var(--charcoal-700);

  /* --- COMPONENT TOKENS --- */
  --btn-bg: var(--copper-500);
  --btn-text: var(--charcoal-900);
  --btn-hover: var(--copper-400);
  --card-bg: var(--charcoal-800);
  --card-border: var(--charcoal-700);
  --nav-bg: rgba(36, 41, 48, 0.95);
  --hero-overlay: var(--charcoal-900);
  --section-py: clamp(5rem, 8vw, 7.5rem);
}

/* --- BASE RESET --- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background-color: var(--base);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--base);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent);
  color: var(--base);
}

img { display: block; max-width: 100%; }

/* --- FOCUS --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* --- SECTION PADDING --- */
.section-padding {
  padding-top: var(--section-py);
  padding-bottom: var(--section-py);
}

/* --- NAV LINKS --- */
.nav-link {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.nav-link:hover { color: var(--accent); }

/* --- HEADER --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.5rem 2rem;
  transition: background-color 0.5s ease, padding 0.5s ease, backdrop-filter 0.5s ease;
  background-color: transparent;
}

.site-header.scrolled {
  background-color: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}

/* --- HERO --- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--base) 0%,
    rgba(27, 31, 38, 0.9) 25%,
    rgba(27, 31, 38, 0.65) 55%,
    rgba(27, 31, 38, 0.5) 100%
  );
}

/* Halftone dots behind hero title */
.hero-dots {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: radial-gradient(circle, var(--copper-500) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.06;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 45%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 45%, black 0%, transparent 70%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
}

/* Letter-by-letter animation */
.hero-title-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(24px);
  animation: letterReveal 0.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.hero-title-space {
  display: inline-block;
  width: 0.25em;
}

@keyframes letterReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==============================================
   THE FADE — Halftone Divider (Signature Element)
   Mimics the barber fade technique with dissolving dots
   ============================================== */
.fade-divider {
  height: 60px;
  position: relative;
  overflow: hidden;
  background-color: var(--surface);
}

.fade-divider::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, var(--copper-500) 1.5px, transparent 1.5px),
    radial-gradient(circle, var(--copper-500) 1px, transparent 1px),
    radial-gradient(circle, var(--copper-500) 0.5px, transparent 0.5px);
  background-size:
    16px 16px,
    16px 16px,
    16px 16px;
  background-position:
    0 0,
    8px 8px,
    4px 12px;
  opacity: 0.18;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0) 100%);
}

.fade-divider--reverse {
  background-color: var(--base);
}

.fade-divider--reverse::before {
  mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0) 100%);
}

/* --- SERVICE CARDS --- */
.service-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.service-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* --- GALLERY --- */
.gallery-cell {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 4 / 3;
}

.gallery-cell--tall {
  grid-row: span 2;
  aspect-ratio: auto;
}

.gallery-cell--wide {
  grid-column: span 2;
}

.gallery-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-img {
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-img:hover {
  transform: scale(1.04);
}

/* --- REVIEW CARD --- */
.review-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: left;
  max-width: 480px;
  margin: 0 auto;
}

/* --- CTA BUTTON --- */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--btn-bg);
  color: var(--btn-text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-cta:hover {
  background-color: var(--btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(217, 154, 66, 0.25);
}

.btn-cta--large {
  font-size: 1rem;
  padding: 1.125rem 2.25rem;
}

/* --- COPPER LINE --- */
.copper-line {
  height: 1px;
  width: 100%;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
}

/* --- SCROLL REVEAL --- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transition-delay: var(--delay, 0s);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* --- MOBILE MENU --- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background-color: rgba(27, 31, 38, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.mobile-menu[aria-hidden="false"] {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu a {
  font-family: var(--font-display);
  font-size: 1.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.mobile-menu a:hover,
.mobile-menu a:focus-visible {
  color: var(--accent);
}

/* --- HAMBURGER --- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  z-index: 201;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--text-primary);
  transition: transform 0.35s ease, opacity 0.35s ease;
  transform-origin: center;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- RESPONSIVE --- */
@media (max-width: 767px) {
  .site-header { padding: 1rem 1.25rem; }
  .site-header.scrolled { padding-top: 0.75rem; padding-bottom: 0.75rem; }
  .hamburger { display: flex; }

  .gallery-cell--tall { grid-row: span 1; }
  .gallery-cell--wide { grid-column: span 2; }
}

@media (max-width: 640px) {
  .gallery-cell--wide { grid-column: span 2; }
}

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

  html { scroll-behavior: auto; }

  .reveal, .reveal-left, .reveal-right {
    opacity: 1;
    transform: none;
  }

  .hero-title-letter {
    opacity: 1;
    transform: none;
  }
}