/* ═══════════════════════════════════════════════════════════
   H2H AGENCE IA — site simple et clair.
   Couleurs, polices et espacements sont tous définis ici (tokens :root).
   Chargé après demo.css : il pose la base et ajuste les composants du formulaire.
   ═══════════════════════════════════════════════════════════ */

:root {
  --ink-rgb: 21, 39, 30;
  --bone: #ffffff;        /* fond */
  --white: #f7f3ea;       /* surfaces (cartes, sections alternées) */
  --ink: #15271e;         /* texte */
  --ash: #5f6a62;         /* texte secondaire */
  --lime: #1e4d38;        /* accent (boutons, pastilles) */
  --accent-ink: #1e4d38;   /* accent quand il sert de TEXTE sur fond blanc (contraste lisible) */
  --lime-ink: #ffffff;    /* texte posé sur l'accent */
  --ink-faint: rgba(var(--ink-rgb), 0.16);

  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: var(--sans);
  --radius: 16px;
  --gutter: clamp(20px, 5vw, 64px);
  --t-heading: clamp(30px, 4.4vw, 52px);
  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior-y: none; }
body {
  background: var(--bone); color: var(--ink);
  font-family: var(--sans); font-size: 18px; line-height: 1.45; letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden; -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a, button, select, label { touch-action: manipulation; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.035em; line-height: 1.08; }
section[id] { scroll-margin-top: 76px; }

.mono { font-family: var(--sans); font-size: 11.5px; font-weight: 500; letter-spacing: 0.08em; line-height: 1.35; text-transform: uppercase; }
.ash { color: var(--ash); }
.wrap { width: min(1120px, 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ═══════════ BOUTONS ═══════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 999px;
  font-size: 15px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.2; white-space: nowrap;
  transition: transform .3s var(--ease-out), filter .3s, background .3s, border-color .3s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--lime); color: var(--lime-ink); box-shadow: 0 8px 28px -10px var(--lime); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border: 1px solid var(--ink-faint); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* boutons du formulaire : même style que le reste du site */
.demo-btn, .demo-btn.mono {
  border-radius: 999px; padding: 15px 26px;
  font-size: 15px; font-weight: 600; letter-spacing: -0.005em; text-transform: none;
  box-shadow: 0 8px 28px -10px var(--lime);
}

/* ═══════════ BARRE DU HAUT ═══════════ */
.topbar {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 50;
  width: min(1120px, 100% - 24px);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 9px 10px 9px 20px;
  background: rgba(20, 50, 37, 0.96);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(241, 236, 224, 0.12); border-radius: 18px;
  box-shadow: 0 10px 30px -14px rgba(20, 50, 37, .55);
}
.brand { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; }
.topnav { display: flex; gap: 26px; margin-left: auto; margin-right: 10px; }
.topnav a { font-size: 14px; color: rgba(241, 236, 224, 0.78); transition: color .25s; }
.topnav a:hover { color: #ffffff; }
.topbar .btn { padding: 10px 18px; font-size: 14px; background: #f1ece0; color: #143225; box-shadow: none; }

/* ═══════════ ACCUEIL ═══════════ */
.hero { position: relative; padding: 130px 0 90px; overflow: hidden; background: linear-gradient(180deg, #bcd6c7 0%, #e3efe8 38%, #ffffff 80%); }
.hero::before, .hero::after {
  content: ''; position: absolute; z-index: 0; pointer-events: none; border-radius: 50%; will-change: transform;
}
.hero::before { width: 520px; height: 520px; left: -120px; top: -140px; background: radial-gradient(circle, rgba(30, 77, 56, .12), transparent 70%); animation: drift 16s ease-in-out infinite alternate; }
.hero::after { width: 460px; height: 460px; right: -100px; bottom: -120px; background: radial-gradient(circle, rgba(30, 77, 56, .07), transparent 70%); animation: drift 20s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate3d(60px, 40px, 0) scale(1.1); } }

.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(38px, 5.6vw, 68px); letter-spacing: -0.045em; line-height: 1.04; margin: 18px 0 20px; }
.hero h1 em { font-style: normal; color: var(--accent-ink); }
.hero-sub { font-size: clamp(17px, 1.6vw, 20px); color: var(--ash); max-width: 30em; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-note { margin-top: 22px; color: var(--ash); font-size: 14px; }
.hero-copy > * { animation: rise .9s var(--ease-out) both; }
.hero-copy > :nth-child(2) { animation-delay: .08s; } .hero-copy > :nth-child(3) { animation-delay: .16s; }
.hero-copy > :nth-child(4) { animation-delay: .24s; } .hero-copy > :nth-child(5) { animation-delay: .32s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* la conversation qui se joue toute seule */
.chat {
  position: relative; background: var(--white); border: 1px solid var(--ink-faint); border-radius: 26px;
  padding: 18px 22px 24px; box-shadow: 0 30px 80px -36px rgba(30, 77, 56, .35);
  animation: rise 1s .2s var(--ease-out) both;
}
.chat-head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--ink-faint); margin-bottom: 18px; }
.chat-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.chat-body { display: grid; gap: 12px; min-height: 330px; align-content: start; }
.chat-body > * { opacity: 0; transform: translateY(10px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.chat-body > .on { opacity: 1; transform: none; }
.chat-meta { text-align: center; }
.c-msg { max-width: 86%; padding: 13px 17px; border-radius: 20px; font-size: 16px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.c-client { justify-self: end; background: var(--lime); color: var(--lime-ink); border-bottom-right-radius: 6px; }
.c-bot { justify-self: start; background: var(--bone); border: 1px solid var(--ink-faint); border-bottom-left-radius: 6px; }
.c-dots { justify-self: start; display: inline-flex; gap: 6px; padding: 15px 18px; background: var(--bone); border: 1px solid var(--ink-faint); border-radius: 20px; border-bottom-left-radius: 6px; }
.c-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); opacity: .3; animation: dot 1.1s infinite ease-in-out; }
.c-dots i:nth-child(2) { animation-delay: .18s; } .c-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.c-badge { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border: 1px solid var(--accent-ink); border-radius: 999px; color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.c-text { display: grid; }
.c-text > * { grid-area: 1 / 1; white-space: pre-wrap; overflow-wrap: anywhere; }
.c-sizer { visibility: hidden; }

/* ═══════════ SECTIONS ═══════════ */
.section { padding: clamp(72px, 11vh, 130px) 0; }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 6vh, 64px); }
.section-head h2 { font-size: var(--t-heading); margin: 14px 0 14px; }
.section-head p { color: var(--ash); font-size: clamp(17px, 1.5vw, 20px); }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(14px, 2vw, 24px); }
.card { background: var(--white); border: 1px solid var(--ink-faint); border-radius: 24px; overflow: hidden; }
.card-media { aspect-ratio: 4 / 3; background: var(--white); }
.card-media img { width: 100%; height: 100%; object-fit: contain; }
.card-body { padding: 4px 26px 28px; }
.card-body h3 { font-size: 24px; margin-bottom: 8px; }
.card-body p { color: var(--ash); font-size: 16.5px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2vw, 24px); counter-reset: s; }
.step { border-top: 1px solid var(--ink-faint); padding-top: 22px; }
.step .step-num { font-size: 56px; font-weight: 200; letter-spacing: -0.05em; color: var(--accent-ink); line-height: 1; margin-bottom: 14px; }
.step h3 { font-size: 26px; margin-bottom: 8px; }
.step p { color: var(--ash); font-size: 16.5px; }

/* la phrase H2H */
.h2h { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(24px, 5vw, 64px); align-items: center; margin-bottom: clamp(48px, 8vh, 90px); }
.h2h h2 { font-size: var(--t-heading); }
.h2h p { color: var(--ash); font-size: clamp(17px, 1.5vw, 20px); margin-top: 14px; }
.h2h img { border-radius: 26px; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

/* avis */
.quote { background: var(--white); padding: clamp(60px, 9vh, 110px) 0; }
.quote-card { max-width: 820px; margin-inline: auto; }
.quote-text { font-size: clamp(24px, 3vw, 38px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.2; }
.quote-by { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; padding-top: 18px; border-top: 1px solid var(--ink-faint); }
.quote-by strong { font-weight: 600; font-size: 17px; }
.quote-fig { margin-left: auto; font-size: 34px; font-weight: 300; letter-spacing: -0.04em; color: var(--accent-ink); }

/* démo et réservation : espacement simple */
.demo { padding: clamp(72px, 11vh, 130px) var(--gutter); }
.book { padding: clamp(72px, 11vh, 130px) var(--gutter); }
.demo-head { margin-bottom: clamp(32px, 5vh, 56px); }
.demo-title { font-size: var(--t-heading); letter-spacing: -0.035em; font-weight: 600; }

/* ═══════════ PIED DE PAGE ═══════════ */
.footer { border-top: 1px solid var(--ink-faint); padding: clamp(56px, 9vh, 100px) 0 36px; background: linear-gradient(180deg, #ffffff 0%, #e3efe8 55%, #bcd6c7 100%); }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.footer-mail { display: inline-block; font-size: clamp(16px, 4.6vw, 40px); font-weight: 600; letter-spacing: -0.035em; overflow-wrap: anywhere; margin-top: 12px; }
.footer-mail:hover { color: var(--accent-ink); }
.footer-phone { display: block; margin-top: 14px; color: var(--ash); }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: flex-start; }
.footer-links a { color: var(--ash); font-size: 15px; transition: color .25s; }
.footer-links a:hover { color: var(--ink); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--ink-faint); color: var(--ash); font-size: 13px; }

/* apparition douce au défilement */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }

/* ═══════════ TÉLÉPHONE ═══════════ */
@media (max-width: 900px) {
  body { font-size: 17px; }
  .topnav { display: none; }
  .topbar { padding-left: 16px; }
  .hero { padding: 108px 0 64px; }
  .hero-grid { grid-template-columns: 1fr; }
  .h2h { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .chat-body { min-height: 300px; }
}
@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
  .hero-buttons .btn { flex: 1 1 100%; }
  .card-body { padding: 4px 20px 24px; }
  .quote-fig { margin-left: 0; }
  .brand { font-size: 16px; }
  .topbar .btn { padding: 9px 14px; font-size: 13px; }
}

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

/* utilitaires */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.section-tight { padding-top: 0; }
@media (max-width: 480px) {
  .hero h1 { font-size: clamp(31px, 9vw, 38px); }
}

/* alternance des fonds, dans l'ordre de la page :
   accueil (sombre) · solution (sombre) · étapes (sombre) · essai (surface) · avis (sombre) · réservation (surface) */
.quote { background: var(--bone); }
.book { background: var(--white); }
.book .demo-field input, .book .demo-field select, .book .demo-field textarea { background: var(--bone); }
.demo { border-top: 1px solid var(--ink-faint); }
.quote + .book, .book { border-top: 1px solid var(--ink-faint); }

/* ═══════════ LOGO ═══════════ */
.brand { display: inline-flex; align-items: center; }
.brand img { display: block; height: 52px; width: auto; }
.footer-logo { display: block; height: 66px; width: auto; margin-bottom: 26px; }
@media (max-width: 640px) {
  .brand img { height: 42px; }
  .footer-logo { height: 52px; }
}
