/* ==========================================================
   RXS — Race-Xperts · feuille de style commune (site v2)
   Charte : noir / bleu marine / doré · Barlow Condensed + Inter
   ========================================================== */

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

:root {
  --black:    #14140F;
  --ink:      #1D1D1B;
  --navy:     #003C71;
  --gold:     #C19A6A;
  --gold-2:   #D8B888;
  --white:    #FFFFFF;
  --off:      #F5F4F0;
  --line:     #E6E5E0;
  --muted:    #2E2E2B;
  --muted-2:  #6B6B67;
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --pad: clamp(20px, 4vw, 64px);
  --nav-h: 88px;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

/* ---------- Typo ---------- */
.h-display {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: .95;
  letter-spacing: -.01em;
}
.h-xl { font-size: clamp(42px, 7.5vw, 120px); overflow-wrap: anywhere; }
.h-lg { font-size: clamp(38px, 6vw, 92px); overflow-wrap: anywhere; }
.h-md { font-size: clamp(30px, 4.2vw, 64px); overflow-wrap: anywhere; }
.h-sm { font-size: clamp(26px, 2.6vw, 38px); }
.h-display em { font-style: normal; color: var(--gold); }

.label {
  display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold);
}
.label::before { content: ''; width: 28px; height: 1px; background: currentColor; }
.lead { font-size: clamp(18px, 1.45vw, 22px); font-weight: 400; line-height: 1.65; color: var(--muted); }
.on-dark .lead { color: rgba(255,255,255,.85); }
.on-dark { color: var(--white); }

.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 34px;
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; border-radius: 2px;
  background: var(--gold); color: var(--black);
  transition: transform .2s, background .2s;
}
.btn:hover { background: var(--gold-2); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,.45); }
.btn-outline:hover { background: rgba(255,255,255,.08); }
.btn-dark { background: var(--black); color: var(--white); }
.btn-dark:hover { background: var(--navy); }
.link-arrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--gold); padding-bottom: 4px;
}
.link-arrow::after { content: '→'; transition: transform .2s; }
.link-arrow:hover::after { transform: translateX(4px); }
.on-dark .link-arrow { color: var(--white); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--pad);
  transition: background .3s, box-shadow .3s, height .3s;
}
.nav-left, .nav-right { display: flex; gap: clamp(20px, 3vw, 48px); list-style: none; }
.nav-left { justify-content: flex-start; }
.nav-right { justify-content: flex-end; }
.nav a { text-decoration: none; }
.nav-left a, .nav-right a {
  font-size: 14px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.92); transition: color .2s;
  padding: 6px 0; border-bottom: 1px solid transparent;
}
.nav-left a:hover, .nav-right a:hover, .nav a[aria-current="page"] { color: var(--white); border-bottom-color: var(--gold); }
.nav-logo { display: block; justify-self: center; }
.nav-logo img { height: 52px; width: auto; transition: height .3s; }
.nav-logo .logo-dark { display: none; }

.nav.scrolled, .nav.light {
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--line);
  height: 72px;
}
.nav.scrolled .nav-logo img, .nav.light .nav-logo img { height: 42px; }
.nav.scrolled .nav-left a, .nav.scrolled .nav-right a,
.nav.light .nav-left a, .nav.light .nav-right a { color: var(--ink); }
.nav.scrolled .nav-left a:hover, .nav.scrolled .nav-right a:hover, .nav.scrolled a[aria-current="page"],
.nav.light .nav-left a:hover, .nav.light .nav-right a:hover, .nav.light a[aria-current="page"] { color: var(--ink); }
.nav.scrolled .logo-light, .nav.light .logo-light { display: none; }
.nav.scrolled .logo-dark, .nav.light .logo-dark { display: block; }

.nav-burger {
  display: none; justify-self: end; grid-column: 3;
  width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.nav-burger span { width: 26px; height: 2px; background: var(--white); transition: transform .25s, opacity .25s; }
.nav.scrolled .nav-burger span, .nav.light .nav-burger span, .nav.open .nav-burger span { background: var(--ink); }
.nav.open .nav-burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav.open .nav-burger span:nth-child(2) { opacity: 0; }
.nav.open .nav-burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero plein écran ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: flex-end;
  padding: calc(var(--nav-h) + 40px) var(--pad) clamp(56px, 8vh, 96px);
  overflow: hidden; color: var(--white);
}
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,14,22,.92) 0%, rgba(10,14,22,.45) 45%, rgba(10,14,22,.25) 100%); }
.hero-content { position: relative; z-index: 2; max-width: 1100px; }
.hero-content .lead { color: rgba(255,255,255,.9); max-width: 640px; margin: 28px 0 40px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-credit { position: absolute; right: var(--pad); bottom: 22px; z-index: 2;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.4); }
.hero.short { min-height: 72svh; }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 9vw, 140px) var(--pad); }
.section.tight { padding-top: clamp(48px, 6vw, 96px); padding-bottom: clamp(48px, 6vw, 96px); }
.section.dark { background: var(--black); color: var(--white); }
.section.navy { background: var(--navy); color: var(--white); }
.section.off { background: var(--off); }
.container { max-width: 1440px; margin: 0 auto; }
.narrow { max-width: 960px; }
.stack > * + * { margin-top: 24px; }

.statement { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(32px, 5vw, 96px); align-items: end; }
.statement .lead { max-width: 520px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: clamp(48px, 6vw, 96px); }
.stat { background: var(--white); padding: 36px 28px; }
.dark .stats, .navy .stats { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.12); }
.dark .stat { background: var(--black); }
.navy .stat { background: var(--navy); }
.stat-n { font-family: var(--font-display); font-weight: 700; font-size: clamp(48px, 5vw, 76px); line-height: 1; }
.stat-n sup { font-size: .45em; color: var(--gold); vertical-align: top; top: .25em; position: relative; }
.stat-l { margin-top: 8px; font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: .02em; }
.dark .stat-l, .navy .stat-l { color: rgba(255,255,255,.75); }

/* ---------- Grille expertises (accueil) ---------- */
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-top: clamp(40px, 5vw, 72px); }
.tile { position: relative; display: block; overflow: hidden; text-decoration: none; color: var(--white); background: var(--black); aspect-ratio: 16/10; }
.tile:nth-child(1), .tile:nth-child(2), .tile:nth-child(6), .tile:nth-child(7) { grid-column: span 3; }
.tile:nth-child(3), .tile:nth-child(4), .tile:nth-child(5) { grid-column: span 2; aspect-ratio: 4/3; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1), opacity .4s; opacity: .92; }
.tile:hover img { transform: scale(1.05); opacity: 1; }
.tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,14,22,.85) 0%, rgba(10,14,22,0) 55%); }
.tile-body { position: absolute; left: 24px; right: 24px; bottom: 22px; z-index: 2; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.tile-title { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: clamp(24px, 2.2vw, 34px); line-height: 1; }
.tile-num { font-size: 11px; font-weight: 700; letter-spacing: .2em; color: var(--gold); }

/* ---------- Bandeau marques ---------- */
.brands { padding: 44px var(--pad); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.brands-head { text-align: center; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 28px; }
.marquee { display: flex; gap: 0; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover { animation-play-state: paused; }
.marquee span { font-family: var(--font-display); font-weight: 600; font-size: 26px; letter-spacing: .06em; text-transform: uppercase; color: #B9B8B2; padding: 0 44px; white-space: nowrap; }
.marquee span::after { content: '·'; margin-left: 44px; color: var(--gold); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee { animation: none; flex-wrap: wrap; width: auto; justify-content: center; } }

/* ---------- Bloc image + texte ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 96px); align-items: center; }
.split.rev > :first-child { order: 2; }
.split img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; }
.split .stack .h-display { margin-bottom: 8px; }
.split .link-arrow { margin-top: 8px; }

/* ---------- Page expertises : rangées ---------- */
.exp-row { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(28px, 4vw, 72px); align-items: center; padding: clamp(40px, 5vw, 80px) 0; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.exp-row:first-of-type { border-top: 0; }
.exp-row:nth-child(even) .exp-media { order: 2; }
.exp-media { overflow: hidden; background: var(--off); }
.exp-media img { width: 100%; aspect-ratio: 3/2; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.exp-row:hover .exp-media img { transform: scale(1.03); }
.exp-num { font-family: var(--font-display); font-size: 14px; letter-spacing: .3em; color: var(--gold); font-weight: 700; margin-bottom: 14px; }
.exp-text p { font-size: clamp(17px, 1.25vw, 20px); font-weight: 400; line-height: 1.65; color: var(--muted); margin-top: 20px; max-width: 480px; }
.exp-text .h-display { font-size: clamp(34px, 3.8vw, 58px); }

/* ---------- Bandeau photo pleine largeur ---------- */
.banner { position: relative; height: clamp(320px, 48vw, 640px); overflow: hidden; }
.banner img { width: 100%; height: 100%; object-fit: cover; }
.banner .banner-text { position: absolute; left: var(--pad); bottom: clamp(28px, 5vw, 64px); color: var(--white); z-index: 2; }
.banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,14,22,.7), rgba(10,14,22,0) 60%); }

/* ---------- Citation ---------- */
.quote { max-width: 1000px; }
.quote blockquote { font-family: var(--font-display); font-weight: 500; font-style: italic; font-size: clamp(30px, 3.6vw, 54px); line-height: 1.12; }
.quote blockquote::before { content: '“'; color: var(--gold); }
.quote blockquote::after { content: '”'; color: var(--gold); }
.quote cite { display: block; margin-top: 28px; font-style: normal; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.quote cite small { display: block; margin-top: 4px; letter-spacing: .08em; text-transform: none; color: rgba(255,255,255,.55); font-size: 13px; }

/* ---------- Grille valeurs / équipe ---------- */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: clamp(40px, 5vw, 72px); }
.cell { background: var(--white); padding: 36px 30px; min-height: 240px; display: flex; flex-direction: column; }
.off .cell { background: var(--off); }
.cell .num { font-size: 11px; font-weight: 700; letter-spacing: .2em; color: var(--gold); margin-bottom: auto; }
.cell h3 { font-family: var(--font-display); text-transform: uppercase; font-size: 26px; line-height: 1; margin: 28px 0 12px; }
.cell p { font-size: 15px; font-weight: 400; line-height: 1.6; color: var(--muted); }

/* ---------- CTA contact ---------- */
.cta { text-align: center; }
.cta .h-display { margin: 18px 0 20px; }
.cta .lead { max-width: 520px; margin: 0 auto 36px; }
.cta-mail { font-family: var(--font-display); font-weight: 600; font-size: clamp(22px, 3vw, 40px); text-decoration: none; color: var(--gold); letter-spacing: .01em; border-bottom: 2px solid transparent; transition: border-color .2s; }
.cta-mail:hover { border-bottom-color: var(--gold); }
.cta-meta { margin-top: 22px; font-size: 14px; color: rgba(255,255,255,.7); letter-spacing: .04em; }
.cta-meta a { color: rgba(255,255,255,.8); text-decoration: none; }

/* ---------- Footer ---------- */
.footer { background: var(--black); color: rgba(255,255,255,.75); padding: 56px var(--pad) 32px; border-top: 1px solid rgba(255,255,255,.08); }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 28px; }
.footer-top img { height: 40px; width: auto; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 28px; list-style: none; }
.footer-nav a { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: rgba(255,255,255,.7); }
.footer-nav a:hover { color: var(--white); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.footer-bottom a { text-decoration: none; color: rgba(255,255,255,.6); margin-left: 20px; }
.footer-bottom a:hover { color: var(--white); }

/* ---------- Animations d'apparition ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .exp-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  :root { --nav-h: 72px; }
  .nav { grid-template-columns: 44px 1fr 44px; grid-template-rows: var(--nav-h) auto auto; align-items: center; align-content: start; }
  .nav-logo { grid-column: 2; grid-row: 1; }
  .nav-logo img { height: 40px; }
  .nav-burger { display: flex; grid-column: 3; grid-row: 1; justify-self: end; }
  .nav-left, .nav-right { display: none; }
  .nav.open { background: var(--white); height: 100svh; overflow-y: auto; box-shadow: none; }
  .nav.open .nav-logo img { height: 40px; }
  .nav.open .nav-left, .nav.open .nav-right { display: flex; flex-direction: column; gap: 0; grid-column: 1 / -1; }
  .nav.open .nav-left { grid-row: 2; margin-top: 16px; border-top: 1px solid var(--line); }
  .nav.open .nav-right { grid-row: 3; }
  .nav.open .nav-left li, .nav.open .nav-right li { display: block; }
  .nav.open .nav-left a, .nav.open .nav-right a {
    display: flex; align-items: center; justify-content: space-between;
    color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 28px; letter-spacing: .04em;
    padding: 18px 0; border-bottom: 1px solid var(--line);
  }
  .nav.open .nav-left a::after, .nav.open .nav-right a::after { content: '→'; font-size: 20px; color: var(--gold); }
  .nav.open a[aria-current="page"] { color: var(--gold); }
  .nav.open .logo-light { display: none; } .nav.open .logo-dark { display: block; }
  .nav-home.open .nav-logo { opacity: 1; pointer-events: auto; }
  .statement, .split, .exp-row { grid-template-columns: 1fr; }
  .split.rev > :first-child, .exp-row:nth-child(even) .exp-media { order: 0; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile, .tile:nth-child(n) { grid-column: span 1; aspect-ratio: 4/3; }
  .tile:nth-child(7) { grid-column: span 2; aspect-ratio: 16/9; }
  .stats { grid-template-columns: 1fr; }
  .hero { padding-bottom: 64px; }
}
@media (max-width: 520px) {
  .tiles { grid-template-columns: 1fr; }
  .tile:nth-child(7) { grid-column: span 1; aspect-ratio: 4/3; }
  .grid-4 { grid-template-columns: 1fr; }
  .cell { min-height: 0; }
  .tile-title { font-size: 26px; }
}

/* ---------- Accueil : gros logo dans la photo ---------- */
.hero-home { flex-direction: column; align-items: stretch; justify-content: space-between; }
.hero-logo { position: relative; z-index: 2; align-self: center; width: clamp(200px, 26vw, 400px); height: auto; margin: 4vh auto 40px; filter: drop-shadow(0 6px 24px rgba(0,0,0,.35)); }
.hero-home .hero-content .h-display { max-width: 900px; }
.nav-home:not(.scrolled):not(.open) .nav-logo { opacity: 0; pointer-events: none; }
.nav-logo { transition: opacity .3s; }
@media (max-width: 820px) { .hero-logo { width: clamp(170px, 48vw, 240px); margin: 2vh auto 28px; } }
.hero.short { min-height: 64svh; }

/* ---------- Titres : remplissage au scroll ---------- */
.fill .c { opacity: .22; transition: opacity .12s linear; }
.fill .c.on { opacity: 1; }
.on-dark .fill .c, .hero .fill .c { opacity: .35; }
.on-dark .fill .c.on, .hero .fill .c.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .fill .c { opacity: 1 !important; } }
