/* ==========================================================================
   2BS Fermetures Serrurerie — Base : tokens, reset, typographie, composants
   Structure inspirée de Stripe, couleurs de la charte 2BS (logo)
   ========================================================================== */

/* Polices hébergées sur le site (licence libre OFL, voir assets/fonts/OFL.txt) :
   aucun appel à Google Fonts, meilleur pour le RGPD et la vitesse. */
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-tight-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Lora gras italique, proche du logo : seulement « 2 », « B » et « S » (grand « 2BS » du Hero) */
@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 700;
  font-display: block;
  src: url("../fonts/lora-bold-italic-2bs.woff2") format("woff2");
  unicode-range: U+32, U+42, U+53;
}

:root {
  /* Couleurs de la charte (relevées sur le logo) */
  --brand: #083b66;            /* bleu marine de la maison et du cercle */
  --brand-hover: #0f4f86;
  --brand-deep: #062c4d;
  --brand-mid: #2a4872;        /* marine du texte « 2BS Fermetures Serrurerie » */
  --accent: #ce1716;           /* rouge de la clé : actions principales, petits repères */
  --accent-hover: #a91211;
  --accent-wash: #fdeceb;
  --grey: #6c6d71;             /* gris du toit et de l'anneau */

  /* Neutres et teintes dérivées */
  --ink: #0b1f33;
  --slate: #5d6978;
  --steel: #475466;
  --muted: #8b9bb0;
  --white: #ffffff;
  --mist: #f6f8fb;
  --frost: #e3e9f0;
  --brand-line: #b4c3d6;
  --brand-line-soft: #d5dee9;
  --brand-wash: #e8eef6;
  --grid-line: #edf1f6;

  /* Typographie */
  --font: "Inter Tight", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --fs-caption: 12px;
  --fs-body-sm: 14px;
  --fs-body: 16px;
  --fs-body-lg: clamp(17px, 1rem + 0.35vw, 20px);
  --fs-sub: clamp(19px, 1rem + 0.5vw, 22px);
  --fs-h-sm: clamp(22px, 1.1rem + 0.6vw, 26px);
  --fs-h: clamp(26px, 1.2rem + 1vw, 32px);
  --fs-h-lg: clamp(34px, 1.4rem + 2.2vw, 48px);
  --fs-display: clamp(40px, 1.2rem + 4.2vw, 76px);

  /* Espacements */
  --s-8: 8px;
  --s-16: 16px;
  --s-24: 24px;
  --s-32: 32px;
  --s-40: 40px;
  --s-48: 48px;
  --s-64: 64px;
  --s-80: 80px;
  --s-96: 96px;
  --section-gap: clamp(64px, 5vw + 32px, 96px);

  /* Layout */
  --max: 1320px;
  --gutter: clamp(16px, 3vw, 32px);
  --nav-h: 76px;
  --radius: 4px;
  --pill: 9999px;

  /* Mouvement */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
:where(ul, ol)[role="list"] { list-style: none; padding: 0; }
img, svg, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  font-family: var(--font);
  font-weight: 300;
  font-size: var(--fs-body);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: var(--white);
  font-feature-settings: "ss01" on, "tnum" on;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: var(--brand-wash); color: var(--brand); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 2px;
}

.sr-only {
  position: absolute !important;
  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; top: 12px; left: 12px; z-index: 200;
  padding: 10px 16px; border-radius: var(--radius);
  background: var(--brand); color: var(--white);
  font-weight: 400; font-size: var(--fs-body-sm);
  transform: translateY(-150%);
  transition: transform 0.3s var(--ease-out);
}
.skip-link:focus { transform: none; }

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

.section {
  position: relative;
  padding-block: var(--section-gap);
}

.divider {
  height: 1px;
  background: var(--frost);
  transform-origin: left center;
}

/* ---------- Typographie ---------- */
.display {
  font-size: var(--fs-display);
  line-height: 1.03;
  letter-spacing: -0.03em;
  font-weight: 300;
}
.h-lg {
  font-size: var(--fs-h-lg);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 300;
}
.h {
  font-size: var(--fs-h);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 300;
}
.h-sm {
  font-size: var(--fs-h-sm);
  line-height: 1.12;
  letter-spacing: -0.01em;
  font-weight: 300;
}
.lead {
  font-size: var(--fs-sub);
  line-height: 1.4;
  color: var(--slate);
  font-weight: 300;
}
.body-lg { font-size: var(--fs-body-lg); line-height: 1.45; }
.muted { color: var(--muted); }
.soft { color: var(--slate); }
.accent { color: var(--brand); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-caption);
  line-height: 1.45;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .num { color: var(--accent); }
.eyebrow::after {
  content: "";
  width: 32px; height: 1px;
  background: var(--brand-line-soft);
}

.section-head {
  display: grid;
  gap: var(--s-24);
  max-width: 860px;
  margin-bottom: var(--s-64);
}
.section-head .lead { max-width: 640px; }

/* ---------- Tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 10px;
  border-radius: var(--pill);
  background: var(--brand-wash);
  color: var(--brand);
  font-size: var(--fs-body-sm);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.pulse {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.pulse::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s var(--ease-out) infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(3.2); opacity: 0; }
}

/* ---------- Boutons ---------- */
.btn {
  --bg: transparent;
  --fg: var(--brand);
  --bd: var(--brand-line);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 14.5px 24px 15.5px;
  border-radius: var(--radius);
  border: 1px solid var(--bd);
  background: var(--bg);
  color: var(--fg);
  font-size: var(--fs-body-sm);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.4s var(--ease-out), border-color 0.4s var(--ease-out), background-color 0.4s var(--ease-out);
  will-change: transform;
}
.btn::before {
  content: "";
  position: absolute; inset: -1px;
  z-index: -1;
  background: var(--fill, var(--brand-wash));
  transform: translateY(101%);
  transition: transform 0.55s var(--ease-out);
}
.btn:hover::before, .btn:focus-visible::before { transform: translateY(0); }

/* Rouge de la clé ; au survol, le marine du logo remonte comme un store */
.btn--primary {
  --bg: var(--accent);
  --fg: var(--white);
  --bd: var(--accent);
  --fill: var(--brand);
}
.btn--primary:hover { --bd: var(--brand); }

.btn--ghost { --fill: var(--brand-wash); }
.btn--ghost:hover { --bd: var(--brand-mid); }

.btn--tertiary { --bd: var(--brand-line-soft); --fill: var(--mist); min-height: 40px; padding: 11px 18px 12px; }

.btn--white {
  --bg: var(--white);
  --fg: var(--brand);
  --bd: var(--white);
  --fill: var(--brand-wash);
}
.btn--outline-white {
  --bg: transparent;
  --fg: var(--white);
  --bd: rgba(255, 255, 255, 0.45);
  --fill: rgba(255, 255, 255, 0.12);
}
.btn--outline-white:hover { --bd: var(--white); }

.btn--lg { min-height: 56px; padding: 18px 28px 19px; font-size: var(--fs-body); }

/* Libellé qui « roule » au survol */
.btn .roll {
  position: relative;
  display: inline-block;
  overflow: hidden;
  line-height: 1.15;
}
.btn .roll > span {
  display: block;
  transition: transform 0.55s var(--ease-out);
}
.btn .roll > span + span {
  position: absolute; left: 0; top: 0;
  transform: translateY(110%);
}
.btn:hover .roll > span:first-child,
.btn:focus-visible .roll > span:first-child { transform: translateY(-110%); }
.btn:hover .roll > span + span,
.btn:focus-visible .roll > span + span { transform: translateY(0); }

.btn .icon { width: 16px; height: 16px; flex: none; }
.btn .icon-phone { transform-origin: 50% 50%; }
.btn:hover .icon-phone { animation: ring 0.9s var(--ease-out); }
@keyframes ring {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(-16deg); }
  30% { transform: rotate(14deg); }
  45% { transform: rotate(-10deg); }
  60% { transform: rotate(6deg); }
  75% { transform: rotate(-2deg); }
}

.cta-pair { display: flex; flex-wrap: wrap; gap: var(--s-8); }

/* Lien texte avec chevron */
.link-chevron {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.2;
}
.link-chevron .chev {
  display: inline-block;
  transition: transform 0.45s var(--ease-out);
}
.link-chevron:hover .chev,
a:hover .link-chevron .chev,
.card:hover .link-chevron .chev { transform: translateX(5px); }

/* Lien souligné animé */
.u-link {
  color: var(--brand);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0% 1px no-repeat;
  transition: background-size 0.5s var(--ease-out);
  padding-bottom: 1px;
}
.u-link:hover, .u-link:focus-visible { background-size: 100% 1px; }

/* ---------- Icônes line-art ---------- */
.i-stroke {
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Barre de progression du scroll ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 120;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  transition: background-color 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom-color: var(--frost);
}
.nav .container {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--s-32);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
}
.brand-logo {
  display: block;
  height: 46px;
  width: auto;
  transform-origin: 20% 60%;
  transition: transform 0.6s var(--ease-out);
}
.brand:hover .brand-logo { transform: scale(1.04) rotate(-1.5deg); }
.brand-icon { display: inline-block; width: 30px; height: 30px; flex: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-8);
  margin-left: auto;
}
.nav-links a {
  position: relative;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: var(--fs-body-sm);
  font-weight: 400;
  color: var(--ink);
  transition: color 0.3s ease, background-color 0.3s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 6px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.45s var(--ease-out);
}
.nav-links a:hover { color: var(--brand); }
.nav-links a:hover::after,
.nav-links a.is-active::after { transform: scaleX(1); transform-origin: left center; }
.nav-links a.is-active { color: var(--brand); }

.nav-actions { display: flex; align-items: center; gap: var(--s-8); }
.nav-actions .btn { min-height: 40px; padding: 11px 16px 12px; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  margin-left: auto;
  border-radius: var(--radius);
  border: 1px solid var(--frost);
  position: relative;
}
.nav-toggle span {
  position: absolute;
  left: 13px; right: 13px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.45s var(--ease-out), opacity 0.3s ease;
}
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 26px; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* Menu mobile */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--white);
  padding: calc(var(--nav-h) + 16px) var(--gutter) 24px;
  display: flex;
  flex-direction: column;
  gap: var(--s-24);
  overflow-y: auto;
  overscroll-behavior: contain;
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path 0.7s var(--ease-in-out), visibility 0s linear 0.7s;
}
.nav-open .mobile-menu {
  clip-path: inset(0 0 0 0);
  visibility: visible;
  transition: clip-path 0.7s var(--ease-in-out), visibility 0s;
}
.mobile-menu nav { display: grid; }
.mobile-menu nav a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--frost);
  font-size: clamp(22px, 6.4vw, 30px);
  letter-spacing: -0.02em;
  transform: translateY(24px);
  opacity: 0;
  transition: transform 0.6s var(--ease-out), opacity 0.6s var(--ease-out), color 0.3s ease;
}
.mobile-menu nav a small { font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }
.mobile-menu nav a:hover { color: var(--brand); }
.nav-open .mobile-menu nav a { transform: none; opacity: 1; }
.nav-open .mobile-menu nav a:nth-child(1) { transition-delay: 0.15s; }
.nav-open .mobile-menu nav a:nth-child(2) { transition-delay: 0.2s; }
.nav-open .mobile-menu nav a:nth-child(3) { transition-delay: 0.25s; }
.nav-open .mobile-menu nav a:nth-child(4) { transition-delay: 0.3s; }
.nav-open .mobile-menu nav a:nth-child(5) { transition-delay: 0.35s; }
.nav-open .mobile-menu nav a:nth-child(6) { transition-delay: 0.4s; }
.nav-open .mobile-menu nav a:nth-child(7) { transition-delay: 0.45s; }
.nav-open .mobile-menu nav a:nth-child(8) { transition-delay: 0.5s; }
.mobile-menu .cta-pair { margin-top: auto; }
.mobile-menu .cta-pair .btn { flex: 1; }

@media (max-width: 1080px) {
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
  .nav .container { gap: var(--s-8); }
  .nav-toggle { display: block; margin-left: 0; }
}
@media (max-width: 640px) {
  .nav-actions { display: none; }
  .nav-toggle { margin-left: auto; }
  .brand-logo { height: 40px; }
}

/* ---------- Révélations (actives seulement si JS + GSAP) ---------- */
.js-anim [data-reveal],
.js-anim [data-hero],
.js-anim [data-hero-panel] { opacity: 0; }
.js-anim [data-split] { opacity: 0; }
.js-anim [data-split].is-split { opacity: 1; }
.nowrap { white-space: nowrap; }   /* ex. « Hauts-de-Seine » jamais coupé au trait d'union */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.wi { display: inline-block; will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
