/* ============================================================
   DB Finance — Shared foundation
   Tokens, reset, shared primitives (nav, modal, footer, reveals)
   Section layout lives in each direction's own stylesheet.
   ============================================================ */

:root {
  /* Brand palette (refined from charte) */
  --marine:        #00195b;
  --marine-700:    #0a2a73;
  --ink:           #141a33;   /* titres secondaires */
  --teal:          #0b7c74;
  --teal-light:    #45b8ae;
  --lavender:      #8e9cc7;
  --lavender-line: #dce3f3;
  --lavender-bg:   #eef1fa;
  --slate:         #5b6b86;   /* corps de texte, légèrement réchauffé */
  --slate-soft:    #8a96ac;
  --white:         #ffffff;
  --paper:         #ffffff;   /* surcouché par direction */

  /* Typography — set per direction */
  --font-display: Georgia, serif;
  --font-sans: system-ui, sans-serif;

  /* Radii — généreux */
  --r-xs: 8px;
  --r-sm: 12px;
  --r:    18px;
  --r-lg: 28px;
  --r-xl: 40px;
  --r-pill: 999px;

  /* Soft shadows, teintées marine */
  --shadow-xs: 0 1px 2px rgba(0,25,91,.05);
  --shadow-sm: 0 4px 16px -6px rgba(0,25,91,.12);
  --shadow:    0 22px 60px -28px rgba(0,25,91,.28);
  --shadow-lg: 0 40px 100px -40px rgba(0,25,91,.34);

  /* Layout */
  --container: 1240px;
  --container-wide: 1400px;
  --gutter: clamp(20px, 5vw, 56px);

  /* Motion */
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--slate);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; color: var(--ink); line-height: 1.05; font-weight: 500; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--teal-light); color: var(--marine); }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container-wide { max-width: var(--container-wide); }
.section { padding-block: clamp(54px, 6.5vw, 100px); }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: .7em;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--teal-light);
  display: inline-block;
}
.eyebrow.no-rule::before { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  padding: 15px 28px;
  border-radius: var(--r-pill);
  font-weight: 600; font-size: 15px; letter-spacing: .01em;
  transition: transform .4s var(--ease-out), background .4s var(--ease), color .4s var(--ease), box-shadow .4s var(--ease);
  will-change: transform;
}
.btn .arrow { transition: transform .4s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }

.btn-primary { background: var(--marine); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--teal); transform: translateY(-2px); box-shadow: 0 18px 40px -18px rgba(11,124,116,.5); }

.btn-ghost { color: var(--marine); border: 1px solid var(--lavender-line); background: rgba(255,255,255,.5); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-2px); }

.link-arrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-weight: 600; color: var(--marine);
  position: relative;
}
.link-arrow .arrow { transition: transform .4s var(--ease-out); color: var(--teal); }
.link-arrow:hover { color: var(--teal); }
.link-arrow:hover .arrow { transform: translateX(5px); }

/* ---------- Top navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 22px var(--gutter);
  transition: padding .45s var(--ease), background .45s var(--ease), box-shadow .45s var(--ease), border-color .45s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  padding-block: 13px;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom-color: var(--lavender-line);
}
.brand { display: inline-flex; align-items: center; gap: 13px; color: var(--marine); }
.brand .logo {
  width: 34px; height: 34px; color: var(--marine);
  transform: rotate(90deg);
  transition: transform .6s var(--ease-out);
}
.brand:hover .logo { transform: rotate(90deg) scale(1.06); }
.brand .brand-name {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 500; letter-spacing: .01em;
  color: var(--marine);
  line-height: 1;
}
.brand .brand-name b { font-weight: 600; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; margin-right: 14px; }
.nav-links a {
  padding: 9px 16px; border-radius: var(--r-pill);
  font-size: 14.5px; font-weight: 500; color: var(--ink);
  position: relative; white-space: nowrap;
  transition: color .35s var(--ease), background .35s var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 4px;
  height: 1.5px; background: var(--teal);
  transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease-out);
}
.nav-links a:hover { color: var(--marine); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.active { color: var(--marine); }
.nav-links a.active::after { transform: scaleX(1); }

.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; }

@media (max-width: 1020px) {
  .nav-links { display: none; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; gap: 5px;
    width: 44px; height: 44px; align-items: center; justify-content: center;
    border-radius: var(--r-pill); border: 1px solid var(--lavender-line);
  }
  .nav-toggle span { width: 18px; height: 1.5px; background: var(--marine); transition: transform .3s var(--ease), opacity .3s; }
  .nav-cta .btn-text { display: none; }
}

/* Mobile menu sheet */
.mobile-menu {
  position: fixed; inset: 0; z-index: 49;
  background: var(--paper);
  padding: 110px var(--gutter) 48px;
  display: flex; flex-direction: column; gap: 6px;
  transform: translateY(-100%);
  transition: transform .55s var(--ease-out);
  visibility: hidden;
}
.mobile-menu.open { transform: translateY(0); visibility: visible; }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: clamp(28px, 8vw, 44px);
  color: var(--marine); padding: 14px 0;
  border-bottom: 1px solid var(--lavender-line);
}
.mobile-menu .btn { margin-top: 28px; align-self: flex-start; }

/* ---------- Contact modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: clamp(16px, 4vw, 40px);
  background: rgba(8,14,40,.42);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden;
  transition: opacity .45s var(--ease), visibility .45s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  width: min(820px, 100%);
  max-height: 92vh; overflow-y: auto;
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(28px, 4vw, 52px);
  transform: translateY(28px) scale(.98);
  opacity: 0;
  transition: transform .55s var(--ease-out), opacity .45s var(--ease);
  position: relative;
}
.modal-overlay.open .modal { transform: none; opacity: 1; }
.modal-close {
  position: absolute; top: 20px; right: 20px;
  width: 42px; height: 42px; border-radius: var(--r-pill);
  border: 1px solid var(--lavender-line);
  display: grid; place-items: center; color: var(--marine);
  transition: background .3s var(--ease), transform .3s var(--ease), border-color .3s;
}
.modal-close:hover { background: var(--lavender-bg); transform: rotate(90deg); border-color: var(--teal); }
.modal h3 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); margin-bottom: 8px; }
.modal .modal-sub { color: var(--slate); margin-bottom: 30px; max-width: 46ch; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; color: var(--ink); }
.field input, .field textarea {
  font: inherit; font-size: 15px; color: var(--ink);
  padding: 14px 16px;
  border: 1px solid var(--lavender-line);
  border-radius: var(--r-sm);
  background: var(--lavender-bg);
  transition: border-color .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
  width: 100%;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input::placeholder, .field textarea::placeholder { color: var(--slate-soft); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--teal); background: #fff;
  box-shadow: 0 0 0 4px rgba(69,184,174,.16);
}
.modal .form-actions { margin-top: 26px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.modal .form-note { font-size: 13px; color: var(--slate-soft); }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--marine);
  color: rgba(255,255,255,.7);
  padding: clamp(44px, 5vw, 64px) 0 28px;
}
.site-footer a { color: rgba(255,255,255,.7); transition: color .3s var(--ease); }
.site-footer a:hover { color: var(--teal-light); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 38px; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer-brand .logo { width: 38px; height: 38px; color: #fff; transform: rotate(90deg); margin-bottom: 18px; }
.footer-brand .brand-name { font-family: var(--font-display); font-size: 24px; color: #fff; display: block; margin-bottom: 14px; }
.footer-brand p { max-width: 34ch; font-size: 14.5px; }
.footer-col h5 { color: #fff; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; margin-bottom: 20px; }
.footer-col ul { display: flex; flex-direction: column; gap: 12px; font-size: 14.5px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding-top: 24px; flex-wrap: wrap; font-size: 13px; color: rgba(255,255,255,.5); }
.footer-legal { display: flex; gap: clamp(16px, 3vw, 28px); flex-wrap: wrap; }
@media (max-width: 880px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-top { grid-template-columns: 1fr; } }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(42px); transition: opacity 1s var(--ease-out), transform 1.05s var(--ease-out); transition-delay: var(--d, 0ms); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-fade { opacity: 0; transition: opacity 1.2s var(--ease); transition-delay: var(--d, 0ms); }
.reveal-fade.is-visible { opacity: 1; }
.reveal-clip { clip-path: inset(0 100% 0 0); transition: clip-path 1.15s var(--ease-out); transition-delay: var(--d, 0ms); }
.reveal-clip.is-visible { clip-path: inset(0 0 0 0); }
/* directional + scaled variants (opt-in via extra class) */
.reveal.from-left { transform: translateX(-46px); }
.reveal.from-right { transform: translateX(46px); }
.reveal.zoom { transform: scale(.94); }
.reveal.is-visible.from-left, .reveal.is-visible.from-right, .reveal.is-visible.zoom { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-fade, .reveal-clip { opacity: 1 !important; transform: none !important; clip-path: none !important; }
}

/* ---------- Marquee ribbon (slow sliding band) ---------- */
.marquee {
  overflow: hidden;
  background: var(--paper);
  border-top: 1px solid var(--lavender-line);
  border-bottom: 1px solid var(--lavender-line);
  padding: clamp(20px, 2.4vw, 32px) 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marqueeSlide 46s linear infinite; will-change: transform; }
.marquee-set { display: flex; flex-shrink: 0; }
.marquee-item {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: clamp(22px, 2.6vw, 38px); letter-spacing: -.01em; color: var(--marine);
  padding: 0 clamp(28px, 4vw, 56px);
  display: inline-flex; align-items: center;
}
.marquee-item::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal-light); margin-right: clamp(28px, 4vw, 56px); }
@keyframes marqueeSlide { from { transform: translate3d(0,0,0); } to { transform: translate3d(-50%,0,0); } }
.marquee.is-static .marquee-track { animation: none; }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ---------- Intro / opening animation (signature draw + zoom-through) ---------- */
.intro {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  overflow: hidden;
  --mw: clamp(150px, 21vmin, 250px);   /* mark size = curtain hole size */
}

/* ivory field that matches the site background, with a logo-shaped hole
   (the site shows THROUGH the logo). The element itself is NOT rotated — it
   stays axis-aligned and full-bleed so it always covers the whole viewport;
   only the hole inside the SVG is rotated 90deg to match the mark. */
.intro-curtain {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  transform-origin: center;
  z-index: 0;
  will-change: transform;
  backface-visibility: hidden;
}

/* solid ivory backing — hides the hole (and the site) during phase 1 */
.intro-backing {
  position: absolute; inset: 0; z-index: 1;
  background: var(--paper);
}

/* the marine monogram, drawn then filled, sits exactly over the (hidden) hole.
   Rotated 90deg to the right. */
.intro-mark {
  position: relative; z-index: 2;
  width: 12.1vmax; height: auto; overflow: visible;
  transform: rotate(90deg);
  transform-origin: center;
  will-change: transform, opacity;
  backface-visibility: hidden;
}
.intro-mark path {
  fill: rgba(0,25,91,0);
  stroke: var(--marine); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 1000; stroke-dashoffset: 1000;
  animation: introDraw 1.25s linear .25s forwards,
             introFill .7s var(--ease) 1.65s forwards;
}
@keyframes introDraw { to { stroke-dashoffset: 0; } }
@keyframes introFill { to { fill: rgba(0,25,91,1); stroke-width: 0; } }

/* ---- Phase 2 : the site opens THROUGH the logo (it rushes toward us) ----
   The ivory backing drops away, then curtain + mark accelerate toward the
   viewer. The reveal comes PURELY from the logo-shaped hole growing past the
   screen edges — the ivory frame stays fully opaque around it so the site is
   never visible early. The mark fades only in the final stretch, and a short
   tail-fade cleans up the very end for a seamless, un-cut landing. */
.intro--zoom .intro-backing { display: none; }
.intro--zoom {
  animation: introTail .25s ease-out .98s forwards;
}
.intro--zoom .intro-curtain {
  animation: introZoom 1.2s cubic-bezier(.5,0,.75,.5) forwards;
}
.intro--zoom .intro-mark {
  animation: introMarkZoom 1.2s cubic-bezier(.5,0,.75,.5) forwards;
}

@keyframes introZoom     { from { transform: scale(1); }
                           to   { transform: scale(40); } }
@keyframes introMarkZoom { 0%   { transform: rotate(90deg) scale(1); opacity: 1; }
                           60%  { opacity: 1; }
                           100% { transform: rotate(90deg) scale(40); opacity: 0; } }
@keyframes introTail     { to { opacity: 0; } }

html.no-intro .intro { display: none; }
@media (prefers-reduced-motion: reduce) { .intro { display: none !important; } }

/* ---------- Reporting dashboard mockup (shared) ---------- */
.dash {
  background: #fff;
  border: 1px solid var(--lavender-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 22px;
  width: 100%;
  font-family: var(--font-sans);
}
.dash-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.dash-head .dash-title { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--marine); font-size: 15px; }
.dash-head .dash-dot { width: 26px; height: 26px; border-radius: var(--r-xs); background: var(--lavender-bg); color: var(--marine); display: grid; place-items: center; transform: rotate(90deg); }
.dash-head .dash-dot svg { width: 16px; height: 16px; }
.dash-period { font-size: 12px; color: var(--slate-soft); display: inline-flex; gap: 6px; align-items: center; }
.dash-period b { color: var(--ink); font-weight: 600; }
.dash-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--lavender-bg); border-radius: var(--r-sm); padding: 14px; }
.kpi .kpi-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--slate-soft); font-weight: 600; }
.kpi .kpi-val { font-family: var(--font-display); font-size: 26px; color: var(--marine); margin-top: 6px; line-height: 1; }
.kpi .kpi-delta { font-size: 11.5px; font-weight: 600; margin-top: 7px; display: inline-flex; align-items: center; gap: 4px; }
.kpi .kpi-delta.up { color: var(--teal); }
.kpi .kpi-delta.down { color: #b4708a; }
.dash-chart { background: var(--lavender-bg); border-radius: var(--r-sm); padding: 16px 16px 10px; }
.dash-chart .chart-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.dash-chart .chart-top span { font-size: 12px; color: var(--slate-soft); font-weight: 600; }
.dash-chart .chart-top b { font-family: var(--font-display); font-size: 18px; color: var(--marine); font-weight: 500; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 96px; }
.bars .bar { flex: 1; border-radius: 5px 5px 0 0; background: var(--lavender-line); position: relative; transform-origin: bottom; transform: scaleY(0); transition: transform .9s var(--ease-out); }
.bars .bar.fill { background: linear-gradient(var(--teal-light), var(--teal)); }
.bars .bar.accent { background: var(--marine); }
.is-visible .bars .bar { transform: scaleY(1); }
.dash-foot { display: flex; gap: 14px; margin-top: 14px; }
.dash-foot .mini { flex: 1; display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--slate); }
.dash-foot .ring { width: 30px; height: 30px; border-radius: 50%; background: conic-gradient(var(--teal) var(--p,60%), var(--lavender-line) 0); display: grid; place-items: center; flex-shrink: 0; }
.dash-foot .ring::after { content: ""; width: 20px; height: 20px; border-radius: 50%; background: #fff; }
.dash-foot .mini b { display: block; color: var(--marine); font-family: var(--font-display); font-size: 14px; }

/* ---------- Prise de rendez-vous (Microsoft Bookings, chargé à la demande) ---------- */
.modal-booking { width: min(920px, 100%); }

/* Hauteur explicite : l'iframe Bookings n'apporte pas la sienne et
   retomberait sur les 150px par défaut des iframes. */
.booking {
  position: relative;
  height: clamp(420px, 64vh, 720px);
  border: 1px solid var(--lavender-line);
  border-radius: var(--r);
  background: var(--lavender-bg);
  overflow: hidden;
}
.booking-embed { position: absolute; inset: 0; }
.booking-embed iframe { display: block; border: 0; width: 100%; height: 100%; }

.booking-status {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; gap: 16px;
  align-items: center; justify-content: center;
  text-align: center; padding: 24px;
  background: var(--lavender-bg);
  color: var(--slate); font-size: 14.5px;
  transition: opacity .4s var(--ease);
}
.booking.is-ready .booking-status { opacity: 0; pointer-events: none; }
.booking-spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--lavender-line);
  border-top-color: var(--teal);
  animation: bookingSpin .8s linear infinite;
}
@keyframes bookingSpin { to { transform: rotate(360deg); } }
.booking.is-error .booking-spinner { display: none; }
.booking-status-text a { color: var(--marine); text-decoration: underline; text-underline-offset: 3px; }

.booking-alt { margin-top: 18px; font-size: 14px; color: var(--slate-soft); text-align: center; }
.booking-alt a {
  color: var(--marine); font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--lavender-line);
  text-underline-offset: 3px; transition: text-decoration-color .3s var(--ease);
}
.booking-alt a:hover { text-decoration-color: var(--teal); }

@media (prefers-reduced-motion: reduce) { .booking-spinner { animation-duration: 2.4s; } }
