/* ==========================================================================
   Urgence Repair — Base : tokens, reset, typographie, utilitaires, reveals
   ========================================================================== */

:root {
  /* Couleurs — un seul accent : le rouge de la marque Urgence Repair.
     Pour changer la couleur du site, modifiez ces 6 lignes. */
  --accent: #b21a19;        /* boutons pleins, états sélectionnés */
  --accent-hover: #c9211f;
  --accent-text: #a8161a;   /* liens, boutons contour */
  --accent-glow: #ff3b30;   /* décoratif : lueurs, lignes, texte sur fond noir */
  --carbon: #1d1d1f;        /* texte principal */
  --frost: #f5f5f7;         /* fond de page */
  --ice: #fdf2f1;
  --smoke: #333333;
  --graphite: #474747;
  --ash: #707070;           /* texte secondaire */
  --mist: #858585;
  --pebble: #e2e2e5;
  --accent-rgb: 178, 26, 25;   /* rouge de la marque, pour les transparences */
  --glow-rgb: 255, 59, 48;
  --hairline: #d2d2d7;
  --white: #ffffff;
  --black: #000000;
  --dark-2: #a1a1a6;        /* texte secondaire sur fond noir */
  --green: #34c759;         /* pastille « ouvert » */

  /* Typographie */
  --font-text: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Formes */
  --radius: 8px;            /* cartes, images, champs */
  --radius-pill: 980px;     /* boutons, tags */
  --shadow-xl: rgba(0, 0, 0, .22) 3px 5px 30px 0;

  /* Mise en page */
  --nav-h: 52px;
  --gutter: clamp(20px, 4vw, 48px);
  --maxw: 1200px;
  --maxw-narrow: 980px;

  /* Mouvement */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.016em;
  color: var(--carbon);
  background: var(--frost);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent-text); text-decoration: none; }
h1, h2, h3, h4, p, ol, ul, figure, fieldset, legend, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
[hidden] { display: none !important; }

::selection { background: rgba(var(--glow-rgb), .25); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 16px; top: 12px; z-index: 1000;
  padding: 10px 18px; border-radius: var(--radius-pill);
  background: var(--carbon); color: var(--white); font-size: 14px;
  transform: translateY(-160%); transition: transform .3s var(--ease-out);
}
.skip-link:focus { transform: none; }

/* ---------- Mise en page ---------- */
.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(var(--maxw-narrow) + var(--gutter) * 2); }

.section { position: relative; padding-block: clamp(96px, 13vw, 176px); }
.section--white { background: var(--white); }
.section--frost { background: var(--frost); }
.section--dark { background: var(--black); color: var(--frost); }

.section-head { max-width: 820px; margin-bottom: clamp(48px, 6vw, 80px); }
.section-head--center { margin-inline: auto; text-align: center; }

/* ---------- Typographie ---------- */
.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--ash);
}
.section--dark .eyebrow { color: var(--dark-2); }

.h2 {
  font-family: var(--font-display);
  font-size: clamp(40px, 6.2vw, 80px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.034em;
}
.h3 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.14;
  font-weight: 600;
  letter-spacing: -0.022em;
}
.lead {
  margin-top: 22px;
  font-size: clamp(19px, 1.9vw, 24px);
  line-height: 1.38;
  font-weight: 300;
  letter-spacing: -0.014em;
  color: var(--smoke);
}
.section--dark .lead { color: var(--dark-2); }

.muted { color: var(--ash); }
.section--dark .muted { color: #6e6e73; }

.gradient-text {
  background: linear-gradient(100deg, #b21a19 0%, #ff3b30 30%, #b21a19 60%, #ff3b30 90%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }

.tabular { font-variant-numeric: tabular-nums; }

.h2, .hero__title, .cta__title, .modal__title { text-wrap: balance; }
.lead, .hero__lead, .cta__text { text-wrap: pretty; }

/* Lien « ghost » : soulignement animé */
.link {
  position: relative;
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--accent-text);
}
.link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease-out);
}
.link:hover::after { transform: scaleX(1); transform-origin: left; }
.link svg { width: 12px; height: 12px; transition: transform .45s var(--ease-out); }
.link:hover svg { transform: translateX(3px); }

/* ---------- Apparitions au scroll ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 44px, 0);
  filter: blur(8px);
  transition:
    opacity 1s var(--ease-out),
    transform 1.3s var(--ease-out),
    filter 1s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.js [data-reveal="scale"] { transform: scale(.94); }
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal].is-in { opacity: 1; transform: none; filter: none; }

/* Titres découpés mot à mot (voir core.js) */
.js [data-split] .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: .12em;
  margin-bottom: -.12em;
}
.js [data-split] .w > span {
  display: inline-block;
  transform: translate3d(0, 108%, 0) rotate(4deg);
  transform-origin: 0 100%;
  transition: transform 1.2s var(--ease-out);
  transition-delay: calc(var(--wi, 0) * 60ms + var(--d, 0s));
}
.js [data-split].is-in .w > span { transform: none; }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; filter: none; }
  .js [data-split] .w > span { transform: none; }
}
