/* ==============================================
   AVC DESIGN — Forger l'Espace
   Design Tokens (Primitive → Semantic → Component)
   + Custom Styles
   ============================================== */

/* --- PRIMITIVE TOKENS --- */
:root {
  --color-charcoal-950: #0F1114;
  --color-charcoal-900: #181B22;
  --color-charcoal-800: #22262F;
  --color-steel-400: #9BA3B0;
  --color-steel-700: #2A2F38;
  --color-copper-500: #D4924D;
  --color-copper-700: #B07A3B;
  --color-ice-100: #E4E7EC;

  --font-heading: 'Syne', 'Arial Black', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-accent: 'DM Serif Text', Georgia, serif;

  --radius-none: 0;

  /* --- SEMANTIC TOKENS --- */
  --surface-primary: var(--color-charcoal-950);
  --surface-elevated: var(--color-charcoal-900);
  --surface-subtle: var(--color-charcoal-800);
  --text-primary: var(--color-ice-100);
  --text-muted: var(--color-steel-400);
  --accent-primary: var(--color-copper-500);
  --accent-deep: var(--color-copper-700);
  --border-default: var(--color-steel-700);
  --border-accent: var(--color-copper-700);

  /* --- COMPONENT TOKENS --- */
  --btn-primary-bg: var(--accent-primary);
  --btn-primary-text: var(--surface-primary);
  --btn-primary-hover: #C0833F;
  --nav-bg: transparent;
  --nav-bg-scrolled: rgba(34, 38, 47, 0.92);
  --nav-text: var(--text-primary);
  --nav-active: var(--accent-primary);
  --card-bg: var(--surface-elevated);
  --card-border: var(--border-default);
  --card-hover-accent: var(--border-accent);
  --signature-color: var(--accent-deep);
  --signature-opacity: 0.6;
}

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

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

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(--surface-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

/* --- TYPOGRAPHY HELPERS --- */
.heading-upper {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  line-height: 1.1;
}

/* --- HEADER --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.5rem 2.5rem;
  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-scrolled);
  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;
}

/* Subtle brushed-metal radial gradient */
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(42, 47, 56, 0.25) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 70% 60%, rgba(176, 122, 59, 0.06) 0%, transparent 60%),
    var(--surface-primary);
}

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

/* Hero title letter animation */
[data-animate="letters"] .letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(24px);
  animation: letterReveal 0.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

[data-animate="letters"] .letter-space {
  display: inline-block;
  width: 0.35em;
}

/* Mobile: prevent hero title overflow on narrow viewports */
@media (max-width: 639px) {
  [data-animate="letters"] {
    width: 100%;
    font-size: clamp(1.75rem, 9vw, 2.25rem);
  }
}

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

/* --- EQUERRE SIGNATURE --- */

/* Hero equerres — flanking the title */
.hero-equerres {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.equerre-svg {
  opacity: 0;
  transition: opacity 0.8s ease;
}

.equerre-svg.visible {
  opacity: 1;
}

.equerre-svg path {
  stroke: var(--signature-color);
  stroke-width: 1.5;
  fill: none;
  stroke-dasharray: 96;
  stroke-dashoffset: 96;
  transition: stroke-dashoffset 0.8s ease-out;
}

.equerre-svg.visible path {
  stroke-dashoffset: 0;
}

/* Hero breathing equerres */
.equerre-breathe {
  animation: equerreBreath 4s ease-in-out infinite;
}

@keyframes equerreBreath {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

/* Section title equerres — draw on scroll */
.section-title-wrap {
  position: relative;
  display: inline-block;
  padding: 12px 24px;
}

.section-title-wrap .equerre-corner {
  position: absolute;
  width: 20px;
  height: 20px;
}

.section-title-wrap .equerre-corner path {
  stroke: var(--signature-color);
  stroke-width: 1.5;
  fill: none;
  opacity: var(--signature-opacity);
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  transition: stroke-dashoffset 0.8s ease-out;
}

.section-title-wrap.visible .equerre-corner path {
  stroke-dashoffset: 0;
}

.equerre-tl { top: 0; left: 0; }
.equerre-br { bottom: 0; right: 0; }

/* Section separators with equerres */
.section-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.section-separator .sep-line {
  flex: 1;
  height: 1px;
  background: var(--border-default);
}

.section-separator .sep-equerre {
  flex-shrink: 0;
}

.section-separator .sep-equerre path {
  stroke: var(--signature-color);
  stroke-width: 1.5;
  fill: none;
  opacity: var(--signature-opacity);
}

/* Card hover equerre */
.card-equerre {
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card-equerre path {
  stroke: var(--accent-primary);
  stroke-width: 1.5;
  fill: none;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  transition: stroke-dashoffset 0.4s ease-out;
}

.service-card:hover .card-equerre,
.service-card:focus-within .card-equerre {
  opacity: 1;
}

.service-card:hover .card-equerre path,
.service-card:focus-within .card-equerre path {
  stroke-dashoffset: 0;
}

/* --- SERVICE CARDS --- */
.service-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 2.5rem 2rem;
  transition: border-color 0.4s ease, transform 0.3s ease;
}

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

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

.btn-primary:hover {
  background-color: var(--btn-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(212, 146, 77, 0.25);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  background-color: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1rem 2rem;
  border: 1px solid var(--border-default);
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

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

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

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

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

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

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

.stagger > * { transition-delay: calc(var(--i, 0) * 0.15s); }

/* --- MOBILE MENU --- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background-color: rgba(15, 17, 20, 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-heading);
  font-size: 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

/* --- 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: 1.5px;
  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(6.5px) rotate(45deg);
}

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

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

/* --- GALERIE PLACEHOLDER --- */
.galerie-placeholder {
  border: 1px dashed var(--border-default);
  background: var(--surface-elevated);
  padding: 4rem 2rem;
  text-align: center;
}

/* --- GOOGLE MAP --- */
.map-container {
  width: 100%;
  height: 400px;
  border: 1px solid var(--border-default);
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- STAR RATING --- */
.star-copper {
  color: var(--accent-primary);
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .hero-content { padding: 1.5rem; }
}

@media (max-width: 768px) {
  .site-header { padding: 1rem 1.25rem; }
  .site-header.scrolled { padding-top: 0.75rem; padding-bottom: 0.75rem; }
  .hamburger { display: flex; }
  .nav-links { display: none !important; }
  .map-container { height: 300px; }
  .hero-equerres { gap: 1rem; }
}

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

  [data-animate="letters"] .letter {
    opacity: 1;
    transform: none;
  }

  .equerre-svg path,
  .section-title-wrap .equerre-corner path,
  .card-equerre path {
    stroke-dashoffset: 0 !important;
  }

  .equerre-breathe {
    animation: none;
    opacity: 0.6;
  }

  .equerre-svg {
    opacity: 1;
  }
}
