/* ==========================================================================
   KF BTP — base styles (tokens, layout, nav, buttons, footer) shared by all pages
   ========================================================================== */

:root {
  /* Palette — near-black full-width sections, travertine accent */
  --bg: #1a2124;
  --bg-alt: #141a1d;
  --bg-bar: #0f1416;
  --frame: #ebe6dc;      /* light travertine frame around header + page */
  --card: #1a2124;
  --card-raised: #222a2e;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #eef0ee;
  --muted: #9ba5a9;
  --accent: #d9c4a0;
  --accent-hover: #e8d7b8;
  --accent-ink: #171d20;

  /* Type */
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --wide: 125%;
  --semi-wide: 112%;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
  --text-h3: clamp(0.95rem, 0.85rem + 0.35vw, 1.1rem);
  --text-h2: clamp(1.55rem, 0.9rem + 3.4vw, 3.6rem);

  /* Space & shape */
  --gutter: clamp(12px, 3vw, 40px);
  --card-pad: clamp(20px, 3.6vw, 56px);
  --stack: clamp(16px, 2.4vw, 32px);
  --radius: 14px;
  --frame-gap: 10px;
  --header-h: 68px;
  --radius-sm: 8px;
  --max: 1360px;
  /* Side padding that keeps content aligned to --max inside full-width sections */
  --edge: max(var(--card-pad), calc((100% - var(--max)) / 2));

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 180ms;
  --slow: 700ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
/* App-shell layout: fixed header bar on top, one rounded scrolling container below */
body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--frame);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
svg.i { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol, dl, dd, figure, p, h1, h2, h3 { margin: 0; padding: 0; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  padding: 10px 16px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  transform: translateY(-200%);
  transition: transform var(--fast) var(--ease);
}
.skip-link:focus { transform: none; }

/* ---------- Layout ---------- */
.site-header { flex: none; position: relative; z-index: 30; padding: var(--frame-gap); }
.page {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 var(--frame-gap) var(--frame-gap);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  /* Rows always take their content height: inside this fixed-height scroller a row whose
     section has overflow:hidden (footer, hero) could otherwise be squeezed to nothing */
  grid-auto-rows: max-content;
  align-content: start;
  border-radius: var(--radius);
  background: var(--bg);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}
.page::-webkit-scrollbar { width: 10px; }
.page::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.25); border-radius: 10px; border: 3px solid var(--bg); }
/* Full-width section; content is kept on the --max column through --edge padding */
.card {
  min-width: 0;
  position: relative;
  background: var(--bg);
  padding: clamp(40px, 5.2vw, 80px) var(--edge); /* vertical rhythm of every section */
}

.stack { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.stack > .card:nth-child(even) { background: var(--bg-alt); }
.stack > .card + .card { border-top: 1px solid var(--line); }

/* ---------- Type helpers ---------- */
.display {
  font-stretch: var(--wide);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.98;
  letter-spacing: -0.01em;
}
.h2 { font-size: var(--text-h2); }
.label {
  font-stretch: var(--semi-wide);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.muted { color: var(--muted); }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: clamp(24px, 3.5vw, 48px);
}
.section-head p { max-width: 38ch; color: var(--muted); font-size: var(--text-sm); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--accent);
  --btn-ink: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-stretch: var(--semi-wide);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; transition: transform var(--fast) var(--ease); }
.btn:hover { --btn-bg: var(--accent-hover); }
.btn:hover svg { transform: translate(2px, -2px); }
.btn:active { transform: scale(0.97); }
.btn--ghost {
  --btn-bg: transparent;
  --btn-ink: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn--ghost:hover { --btn-bg: rgba(255, 255, 255, 0.08); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: var(--text-xs); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.link-arrow svg { width: 16px; height: 16px; transition: transform var(--fast) var(--ease); }
.link-arrow:hover { border-color: var(--accent); color: var(--accent); }
.link-arrow:hover svg { transform: translate(2px, -2px); }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo__mark { width: 34px; height: 34px; flex: none; }
.logo__text {
  font-stretch: var(--wide);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  line-height: 1;
}
.logo__text span { font-weight: 300; margin-left: 0.3em; }

/* ---------- Nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
  padding: 0 12px 0 clamp(14px, 2vw, 24px);
  border-radius: var(--radius);
  background: var(--bg-bar);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.6);
}
.nav__links { display: flex; gap: clamp(16px, 2vw, 30px); }
.nav__links a {
  position: relative;
  padding-block: 6px;
  color: rgba(255, 255, 255, 0.78);
  transition: color var(--fast);
}
.nav__links a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform 300ms var(--ease);
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: #fff; }
.nav__links a:hover::after, .nav__links a[aria-current="page"]::after { transform: scaleX(1); }
.nav__actions { display: flex; align-items: center; gap: 12px; }
.nav__phone {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px;
  padding-inline: 4px;
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--fast);
}
.nav__phone svg { width: 18px; height: 18px; color: var(--accent); }
.nav__phone:hover { color: var(--accent); }
.nav__burger {
  display: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  place-items: center;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.nav__burger svg { width: 20px; height: 20px; }


/* ---------- Language switch ---------- */
.lang {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.lang button {
  min-width: 36px; height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  transition: background var(--fast), color var(--fast);
}
.lang button[aria-pressed="true"] { background: var(--text); color: var(--accent-ink); }
.lang button:not([aria-pressed="true"]):hover { color: var(--text); }

/* ---------- Mobile menu ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 20px var(--gutter) 32px;
  background: rgba(20, 26, 29, 0.97);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms var(--ease), visibility 0s linear 300ms;
}
.menu.is-open { opacity: 1; visibility: visible; transition: opacity 300ms var(--ease); }
.menu__top { display: flex; justify-content: space-between; align-items: center; }
.menu__links { margin-block: 40px auto; display: grid; gap: 6px; }
.menu__links a {
  display: flex; align-items: baseline; gap: 14px;
  padding-block: 10px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  transform: translateY(16px);
  opacity: 0;
  transition: transform 500ms var(--ease), opacity 500ms var(--ease), color var(--fast);
}
.menu__links a small { font-size: var(--text-xs); color: var(--muted); font-stretch: 100%; }
.menu__links a[aria-current="page"], .menu__links a:hover { color: var(--accent); }
.menu.is-open .menu__links a { transform: none; opacity: 1; }
.menu.is-open .menu__links li:nth-child(2) a { transition-delay: 40ms; }
.menu.is-open .menu__links li:nth-child(3) a { transition-delay: 80ms; }
.menu.is-open .menu__links li:nth-child(4) a { transition-delay: 120ms; }
.menu.is-open .menu__links li:nth-child(5) a { transition-delay: 160ms; }
.menu__foot { display: grid; gap: 18px; margin-top: 40px; }
.menu__foot .btn { width: 100%; }
.menu__foot .lang { justify-self: start; }
.menu__contact { display: grid; gap: 8px; color: var(--muted); }
.menu__contact a { color: var(--text); }

/* ---------- Footer ---------- */
.footer {
  display: grid;
  gap: clamp(36px, 4vw, 56px);
  overflow: hidden;
  isolation: isolate;
  padding-block: clamp(44px, 5vw, 72px) 24px;
  background:
    radial-gradient(70% 60% at 0% 0%, rgba(217, 196, 160, 0.08), transparent 60%),
    var(--bg-bar);
}
/* Thin travertine line across the top */
.footer::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217, 196, 160, 0.55), transparent);
}
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 48px);
}
.footer__pitch { max-width: 36ch; margin-top: 18px; color: var(--muted); font-size: var(--text-sm); }
.footer__free { display: grid; gap: 8px; margin-top: 22px; color: rgba(238, 240, 238, 0.85); }
.footer__free li { display: flex; align-items: center; gap: 8px; }
.footer__free svg { width: 15px; height: 15px; color: var(--accent); }
.footer h3 {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
  color: var(--accent);
}
.footer h3::after { content: ""; flex: 1; max-width: 36px; height: 1px; background: rgba(217, 196, 160, 0.4); }
.footer__links li + li { margin-top: 10px; }
.footer__links a {
  display: inline-flex; align-items: center; gap: 8px;
  color: rgba(238, 240, 238, 0.82);
  transition: color var(--fast), transform var(--fast) var(--ease);
}
.footer__links a::before {
  content: ""; width: 0; height: 1px; background: var(--accent);
  transition: width var(--fast) var(--ease);
}
.footer__links a:hover { color: var(--accent); }
.footer__links a:hover::before { width: 12px; }
.footer__contact { display: grid; gap: 12px; }
.footer__contact a { display: flex; align-items: center; gap: 12px; min-width: 0; overflow-wrap: anywhere; transition: color var(--fast); }
.footer__contact a:hover { color: var(--accent); }
.footer__icon {
  display: grid; place-items: center;
  width: 36px; height: 36px; flex: none;
  border-radius: 50%;
  background: rgba(217, 196, 160, 0.1);
  box-shadow: inset 0 0 0 1px rgba(217, 196, 160, 0.25);
  color: var(--accent);
}
.footer__icon svg { width: 16px; height: 16px; }
.footer__cta { margin-top: 22px; }

/* Large outlined signature, echoing the hero title */
.footer__wordmark-wrap { container-type: inline-size; margin-block: -8px -18px; pointer-events: none; user-select: none; }
.footer__wordmark {
  display: block;
  font-size: 22cqw;
  line-height: 0.8;
  letter-spacing: -0.02em;
  text-align: center;
  white-space: nowrap;
  /* Soft fill only: a stroke on this variable font shows its overlapping contours as grainy edges */
  color: transparent;
  background: linear-gradient(180deg, rgba(217, 196, 160, 0.2) 0%, rgba(217, 196, 160, 0.07) 55%, rgba(217, 196, 160, 0) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-font-smoothing: antialiased;
}

.footer__bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-xs);
}
.footer__bottom-actions { display: flex; align-items: center; gap: 12px; }
.footer__top {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text);
  font-size: var(--text-xs);
  transition: background var(--fast), box-shadow var(--fast);
}
.footer__top svg { width: 15px; height: 15px; transition: transform var(--fast) var(--ease); }
.footer__top:hover { background: rgba(217, 196, 160, 0.1); box-shadow: inset 0 0 0 1px rgba(217, 196, 160, 0.5); }
.footer__top:hover svg { transform: translateY(-2px); }

/* ---------- Mobile action bar (phones) ----------
   Part of the app-shell flex column, under #page, so it never covers content. */
svg.i-fill { fill: currentColor; }
.mobile-bar { display: none; }
@media (max-width: 760px) {
  .page { margin-bottom: 0; }
  .mobile-bar {
    flex: none;
    position: relative;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 6px var(--frame-gap) calc(var(--frame-gap) + env(safe-area-inset-bottom, 0px));
    padding: 6px;
    border-radius: var(--radius);
    background: var(--bg-bar);
    box-shadow: 0 -8px 24px -16px rgba(0, 0, 0, 0.6);
  }
  .mobile-bar__btn {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 48px;
    padding: 0 8px;
    border-radius: calc(var(--radius) - 4px);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 1px var(--line);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background var(--fast), transform var(--fast) var(--ease);
  }
  .mobile-bar__btn:active { transform: scale(0.97); }
  .mobile-bar__btn svg { width: 18px; height: 18px; flex: none; }
  .mobile-bar__btn--quote { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
  .mobile-bar__btn--wa svg { color: #25d366; }
}
@media (max-width: 360px) {
  .mobile-bar__btn { gap: 5px; font-size: 0.74rem; }
}

/* ---------- Reveal on scroll ---------- */
/* Hidden only once main.js has started (html.js-reveal), so content never stays invisible if JS fails */
.js-reveal .reveal { opacity: 0; transform: translateY(28px); transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease); }
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  /* Phone shrinks to a round icon button */
  .nav__phone { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-strong); }
  .nav__phone span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 1080px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: grid; }
}
@media (max-width: 1080px) {
  .footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__col:last-child { grid-column: 1 / -1; }
  .nav .lang { display: none; }
}
@media (max-width: 520px) {
  :root { --frame-gap: 6px; --header-h: 60px; }
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 20px; }
  .footer__bottom { flex-direction: column-reverse; align-items: center; text-align: center; }
  .footer__bottom-actions { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
  .page { scroll-behavior: auto; }
  .js-reveal .reveal { opacity: 1; transform: none; }
}

/* A saved English choice: hide the shell for the few ms before i18n.js swaps the text (no French flash) */
html.lang-pending .site-header, html.lang-pending .page { visibility: hidden; }

/* ---------- Print: undo the app shell so every section prints ---------- */
@media print {
  html, body { height: auto; overflow: visible; display: block; background: #fff; }
  .site-header, .menu, .lightbox, .skip-link, .subnav { display: none !important; }
  .page { margin: 0; border-radius: 0; overflow: visible; display: block; }
  .reveal, .js-reveal .reveal { opacity: 1 !important; transform: none !important; }
}
