/* ================================================
   AFTER France — Refonte Premium V2
   Design: dark industrial, grille 8px, Cabinet Grotesk + Switzer
   V2: Service blocks with photos + Project gallery
   ================================================ */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}
img, picture, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.15; }
p, li, figcaption { text-wrap: pretty; }

/* === TOKENS === */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 2.5rem;
  --space-6: 3rem;
  --space-8: 4rem;
  --space-10: 5rem;
  --space-12: 6rem;
  --space-15: 7.5rem;

  --color-bg: #0C0C0C;
  --color-surface: #141414;
  --color-surface-2: #1A1A1A;
  --color-border: #2A2A2A;
  --color-border-light: #333333;
  --color-text: #E8E6E1;
  --color-text-muted: #8A877F;
  --color-text-faint: #5A5852;
  --color-accent: #C8A872;
  --color-accent-hover: #D4B882;
  --color-red: #D42B2B;
  --color-white: #FFFFFF;

  --font-display: 'Cabinet Grotesk', 'Helvetica Neue', sans-serif;
  --font-body: 'Switzer', 'Helvetica Neue', sans-serif;

  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --content-wide: 1320px;
}

body {
  min-height: 100dvh;
  line-height: 1.8;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

::selection { background: rgba(200, 168, 114, 0.25); color: var(--color-text); }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* === CONTAINER === */
.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(var(--space-3), 5vw, var(--space-8));
}

/* === HEADER === */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: var(--space-3) 0;
  background: rgba(12, 12, 12, 0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s ease, padding 0.4s ease;
}
.header--scrolled { border-bottom-color: var(--color-border); padding: var(--space-2) 0; }
.header__inner { display: flex; align-items: center; justify-content: space-between; }

.header__logo { display: flex; align-items: center; text-decoration: none; }
.header__logo-img { height: 40px; width: auto; }

.header__nav { display: flex; align-items: center; gap: var(--space-5); }
.header__nav a {
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 400;
  color: var(--color-text-muted); text-decoration: none;
  letter-spacing: 0.06em; text-transform: uppercase;
  transition: color var(--transition);
}
.header__nav a:hover { color: var(--color-text); }
.header__cta {
  font-weight: 500 !important; color: var(--color-bg) !important;
  background: var(--color-accent); padding: 0.625rem 1.75rem;
  transition: background var(--transition), transform var(--transition);
}
.header__cta:hover { background: var(--color-accent-hover); transform: translateY(-1px); }

.header__menu-btn { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.header__menu-btn span { display: block; width: 24px; height: 2px; background: var(--color-text); }

.mobile-nav {
  display: none; position: fixed; inset: 0; z-index: 99;
  background: rgba(12, 12, 12, 0.98); backdrop-filter: blur(20px);
  flex-direction: column; align-items: center; justify-content: center; gap: var(--space-5);
}
.mobile-nav.active { display: flex; }
.mobile-nav a {
  font-family: var(--font-display); font-size: var(--text-xl); font-weight: 500;
  color: var(--color-text); text-decoration: none; letter-spacing: 0.08em; text-transform: uppercase;
}
.mobile-nav__close {
  position: absolute; top: var(--space-3); right: var(--space-3);
  color: var(--color-text); font-size: 2rem; line-height: 1; padding: 8px;
}

@media (max-width: 768px) {
  .header__nav { display: none; }
  .header__menu-btn { display: flex; }
  .hero__bg img { object-position: 40% center; }
  .hero { min-height: 85vh; padding-bottom: clamp(3rem, 8vh, 5rem); }
}

/* === HERO === */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 8rem 0 clamp(4rem, 10vh, 8rem); overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: center center; }
.hero__bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(12,12,12,0.15) 0%, rgba(12,12,12,0.6) 60%, rgba(12,12,12,0.92) 100%);
}
.hero__content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.hero__tagline {
  font-family: var(--font-body); font-size: var(--text-lg); font-weight: 400;
  color: var(--color-text); letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: var(--space-6);
  text-shadow: 0 2px 12px rgba(0,0,0,0.7), 0 0 40px rgba(0,0,0,0.5);
}
.hero__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; justify-content: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
  padding: 1.125rem 3rem; min-width: 200px;
  position: relative; overflow: hidden;
  transition: all 0.35s var(--ease-out);
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  opacity: 0; transition: opacity 0.35s var(--ease-out);
}
.btn:hover::after { opacity: 1; }

.btn--primary {
  background: var(--color-accent); color: var(--color-bg);
  box-shadow: 0 4px 24px rgba(200, 168, 114, 0.2);
}
.btn--primary:hover {
  background: var(--color-accent-hover); transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(200, 168, 114, 0.35);
}
.btn--primary:active { transform: translateY(0); box-shadow: 0 2px 12px rgba(200, 168, 114, 0.15); }

.btn--outline {
  background: rgba(255,255,255,0.04); color: var(--color-text);
  border: 1px solid var(--color-border-light);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.btn--outline:hover {
  border-color: var(--color-accent); color: var(--color-accent);
  background: rgba(200, 168, 114, 0.06); transform: translateY(-2px);
}
.btn--outline:active { transform: translateY(0); }

/* === SECTIONS === */
.section {
  padding-top: clamp(var(--space-8), 8vw, var(--space-15));
  padding-bottom: clamp(var(--space-8), 8vw, var(--space-15));
}
.section + .section { margin-top: clamp(var(--space-4), 4vw, var(--space-8)); }
.section__header { margin-bottom: clamp(var(--space-6), 6vw, var(--space-10)); }

.section__tag {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-body); font-size: var(--text-xs); font-weight: 500;
  color: var(--color-accent); letter-spacing: 0.2em; text-transform: uppercase;
  margin-bottom: var(--space-3);
}
.section__tag::before { content: ''; display: block; width: 32px; height: 1px; background: var(--color-accent); }
.section__title {
  font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700;
  color: var(--color-white); letter-spacing: -0.02em; line-height: 1.1;
}

/* === STATS BAR === */
.stats {
  padding: var(--space-10) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}
.stat { text-align: center; padding: var(--space-3); }
.stat__number {
  font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 800;
  color: var(--color-accent); line-height: 1; margin-bottom: var(--space-1);
}
.stat__label {
  font-family: var(--font-body); font-size: var(--text-xs);
  color: var(--color-text-muted); letter-spacing: 0.12em; text-transform: uppercase;
}
@media (max-width: 768px) {
  .stats__grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-5); }
}

/* === ENTREPRISE === */
.entreprise__content {
  max-width: 840px; margin-bottom: var(--space-10);
  padding: clamp(var(--space-5), 4vw, var(--space-8));
  background: var(--color-surface); border: 1px solid var(--color-border);
}
.entreprise__content p { color: var(--color-text-muted); line-height: 1.8; margin-bottom: var(--space-3); }
.entreprise__content p:last-child { margin-bottom: 0; }
.entreprise__lead { color: var(--color-text) !important; font-size: var(--text-lg); font-weight: 400; }
.entreprise__lead strong { color: var(--color-white); font-weight: 700; }

/* Clients */
.clients-block {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--color-border);
}
.clients-block__intro p { color: var(--color-text-muted); line-height: 1.8; margin-bottom: var(--space-4); max-width: 840px; }

.clients-list {
  list-style: none; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-1) var(--space-6);
}
.clients-list li {
  font-family: var(--font-body); font-size: var(--text-sm);
  color: var(--color-text-muted); line-height: 1.8;
  padding-left: var(--space-3); position: relative;
}
.clients-list li::before {
  content: ''; position: absolute; left: 0; top: 0.85em;
  width: 6px; height: 1px; background: var(--color-accent);
}

.clients-categories {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-5);
}
.clients-category__title {
  font-family: var(--font-display); font-size: var(--text-sm); font-weight: 700;
  color: var(--color-accent); letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: var(--space-2);
}
.clients-list--compact { display: flex; flex-direction: column; gap: var(--space-1); }

/* Egapro */
.egapro {
  margin-top: var(--space-8); padding: var(--space-6);
  background: var(--color-surface); border: 1px solid var(--color-border);
}
.egapro__header {
  display: flex; align-items: center; gap: var(--space-2);
  margin-bottom: var(--space-4); padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.egapro__icon {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: rgba(200, 168, 114, 0.1); border-radius: 50; color: var(--color-accent); flex-shrink: 0;
}
.egapro__title {
  font-family: var(--font-display); font-size: var(--text-sm); font-weight: 600;
  color: var(--color-text); letter-spacing: 0.02em;
}
.egapro__stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4); margin-bottom: var(--space-4);
}
.egapro__stat { text-align: center; }
.egapro__stat-value {
  font-family: var(--font-display); font-size: var(--text-xl); font-weight: 800;
  color: var(--color-accent); line-height: 1; margin-bottom: 0.25rem;
}
.egapro__stat-value span {
  font-size: 0.6em; font-weight: 500; color: var(--color-text-faint);
}
.egapro__stat-label {
  font-size: var(--text-xs); color: var(--color-text-muted);
  letter-spacing: 0.04em;
}
.egapro__note {
  font-size: var(--text-xs); color: var(--color-text-faint); line-height: 1.6;
  margin-bottom: var(--space-3);
}
.egapro__link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: var(--text-xs); color: var(--color-text-faint);
  text-decoration: none; letter-spacing: 0.02em;
  transition: color var(--transition);
}
.egapro__link:hover { color: var(--color-accent); }
@media (max-width: 480px) {
  .egapro__stats { grid-template-columns: 1fr; gap: var(--space-3); }
}

/* === SERVICE BLOCKS (V2 — full-width with photos) === */
.section--services { padding-bottom: 0; }
.section--services .section__header { text-align: center; }
.section--services .section__tag { justify-content: center; }
.section--services .section__tag::before { display: none; }

.service-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 500px;
}

.service-block--reverse .service-block__image { order: 2; }
.service-block--reverse .service-block__content { order: 1; }

.service-block__image {
  position: relative; overflow: hidden;
}
.service-block__image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.8s var(--ease-out);
}
.service-block:hover .service-block__image img {
  transform: scale(1.03);
}
.service-block__image::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(12,12,12,0.3), transparent);
  pointer-events: none;
}
.service-block--reverse .service-block__image::after {
  background: linear-gradient(to left, rgba(12,12,12,0.3), transparent);
}

.service-block__content {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(var(--space-6), 5vw, var(--space-12));
  background: var(--color-surface);
}

.service-block__icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  border-radius: 50%; margin-bottom: var(--space-4);
}
.service-block__icon img {
  width: 28px; height: 28px;
  filter: brightness(0) invert(1); opacity: 0.8;
}

.service-block__title {
  font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700;
  color: var(--color-white); margin-bottom: var(--space-3); line-height: 1.2;
}

.service-block__desc {
  font-family: var(--font-body); font-size: var(--text-base);
  color: var(--color-text-muted); line-height: 1.8;
  max-width: 480px;
}

@media (max-width: 768px) {
  .service-block {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .service-block__image { min-height: 280px; }
  .service-block--reverse .service-block__image { order: 0; }
  .service-block--reverse .service-block__content { order: 0; }
  .service-block__content { padding: var(--space-6) var(--space-4); }
}

/* === GALLERY (V2 — project photos grid) === */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.gallery__item {
  position: relative; overflow: hidden;
  display: block; text-decoration: none;
  aspect-ratio: 4 / 3;
}

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

.gallery__item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s var(--ease-out), filter 0.6s var(--ease-out);
}

.gallery__overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  justify-content: flex-end; padding: var(--space-4);
  background: linear-gradient(to top, rgba(12,12,12,0.85) 0%, rgba(12,12,12,0.3) 40%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

.gallery__item:hover .gallery__overlay { opacity: 1; }
.gallery__item:hover img { transform: scale(1.05); }

.gallery__cat {
  font-family: var(--font-body); font-size: var(--text-xs); font-weight: 500;
  color: var(--color-accent); letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.gallery__label {
  font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700;
  color: var(--color-white); line-height: 1.2;
}

@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-1);
  }
  .gallery__item--tall { grid-row: span 1; aspect-ratio: 4 / 3; }
  .gallery__overlay { opacity: 1; padding: var(--space-2); }
  .gallery__cat { font-size: 0.65rem; }
  .gallery__label { font-size: var(--text-sm); }
}

@media (max-width: 480px) {
  .gallery { grid-template-columns: 1fr; }
}

/* === DIVIDER === */
.divider-image {
  position: relative; width: 100%;
  height: clamp(200px, 30vw, 400px); overflow: hidden;
  margin-top: clamp(var(--space-6), 8vw, var(--space-15));
}
.divider-image img { width: 100%; height: 100%; object-fit: cover; }
.divider-image::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(12,12,12,0.8) 0%, transparent 30%, transparent 70%, rgba(12,12,12,0.8) 100%),
    linear-gradient(to bottom, rgba(12,12,12,0.4) 0%, transparent 30%, transparent 70%, rgba(12,12,12,0.4) 100%);
}

/* === CONTACT === */
.contact__grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-6), 6vw, var(--space-12));
}
.contact__info { display: flex; flex-direction: column; gap: var(--space-5); }
.contact__block { padding-bottom: var(--space-5); border-bottom: 1px solid var(--color-border); }
.contact__block:last-child { border-bottom: none; }
.contact__label {
  font-family: var(--font-body); font-size: var(--text-xs); font-weight: 500;
  color: var(--color-accent); letter-spacing: 0.15em; text-transform: uppercase;
  margin-bottom: var(--space-1);
}
.contact__value { font-family: var(--font-body); font-size: var(--text-base); color: var(--color-text); line-height: 1.8; }
.contact__value a { color: var(--color-text); text-decoration: none; transition: color var(--transition); }
.contact__value a:hover { color: var(--color-accent); }

.contact__map {
  position: relative; background: var(--color-surface);
  border: 1px solid var(--color-border); overflow: hidden; min-height: 400px;
}
.contact__map iframe { width: 100%; height: 100%; min-height: 400px; }

@media (max-width: 768px) {
  .contact__grid { grid-template-columns: 1fr; }
}

/* === FOOTER === */
.footer {
  margin-top: clamp(var(--space-8), 10vw, var(--space-15));
  padding: var(--space-6) 0; border-top: 1px solid var(--color-border);
}
.footer__inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--space-3);
}
.footer__logo { height: 32px; width: auto; opacity: 0.6; }
.footer__copy { font-size: var(--text-xs); color: var(--color-text-faint); letter-spacing: 0.06em; }
.footer__links { display: flex; gap: var(--space-4); }
.footer__links a {
  font-size: var(--text-xs); color: var(--color-text-faint); text-decoration: none;
  letter-spacing: 0.06em; text-transform: uppercase; transition: color var(--transition);
}
.footer__links a:hover { color: var(--color-accent); }

/* === ANIMATIONS === */
.fade-in { opacity: 1; }
@supports (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0; transform: translateY(24px);
    animation: reveal-fade 0.6s var(--ease-out) both;
    animation-timeline: view(); animation-range: entry 0% entry 80%;
  }
}
@keyframes reveal-fade { to { opacity: 1; transform: translateY(0); } }
