/* La Batisse V3 — accueil (la scène 3D est dans v3.js) */
@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin.woff2') format('woff2'); font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrainsmono-latin.woff2') format('woff2'); font-weight: 500 700; font-display: swap; }

:root {
  /* réécrites à chaque image par la page selon la section affichée */
  --papier: rgb(239 233 221);
  --texte: rgb(11 13 16);
  --encre: rgb(26 63 255);

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gut: clamp(16px, 3.4vw, 48px);
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--papier); color: var(--texte);
  font: 400 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--encre); outline-offset: 3px; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.sans-3d #scene { display: none; }
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .1; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .4 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Typo ---------- */
.titre { font-weight: 600; letter-spacing: -0.052em; line-height: .92; margin: 0; }
.encre { color: var(--encre); }
.mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; }
.discret { opacity: .66; }

/* Ligne de titre qui monte depuis son masque */
.ligne { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.ligne > span { display: block; transform: translate3d(0, 120%, 0); transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms + var(--d, 0ms)); }
.vu .ligne > span, .est-active .ligne > span { transform: none; }

/* ---------- Navigation : une pilule centrée ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 16px; border-radius: 999px;
  background: color-mix(in srgb, var(--papier) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--texte) 14%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.nav__logo { white-space: nowrap; font-weight: 600; letter-spacing: -0.03em; text-decoration: none; margin-right: 12px; font-size: 16px; }
.nav__lien { white-space: nowrap; font-size: 14px; text-decoration: none; padding: 8px 12px; border-radius: 999px; transition: background-color .2s ease; }
@media (hover: hover) and (pointer: fine) { .nav__lien:hover { background: color-mix(in srgb, var(--texte) 8%, transparent); } }
@media (max-width: 720px) { .nav__lien { display: none; } }
.coin { position: fixed; top: 26px; z-index: 9; }
.coin--g { left: var(--gut); } .coin--d { right: var(--gut); }
@media (max-width: 980px) { .coin { display: none; } }

.btn {
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 20px; border-radius: 999px;
  text-decoration: none; font-weight: 500; font-size: 15px; line-height: 1;
  background: var(--texte); color: var(--papier);
  transition: transform .16s var(--ease-out);
}
.btn:active { transform: scale(.97); }
.btn--petit { padding: 10px 16px; font-size: 14px; }
.btn--ligne { background: transparent; color: var(--texte); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--texte) 35%, transparent); }
.fleche { transition: transform .2s var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .btn:hover .fleche { transform: translateX(3px); } }

main { position: relative; z-index: 2; }
section { position: relative; }
.repere { position: absolute; left: 0; width: 1px; height: 0; pointer-events: none; }

/* ---------- 1. Hero ---------- */
.hero { min-height: 100svh; padding: 112px var(--gut) 28px; display: flex; flex-direction: column; justify-content: space-between; }
.hero .titre { font-size: clamp(52px, 9vw, 150px); text-align: center; }
.hero__bas { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.hero__lede { max-width: 360px; margin: 0 0 16px; font-size: 16px; }
.hero__prix { text-align: right; }
.hero__prix strong { font-weight: 600; font-size: 28px; letter-spacing: -0.03em; display: block; font-family: var(--sans); text-transform: none; }

/* ---------- 2. Chantier (épinglé) ---------- */
.chantier { height: 440vh; }
.chantier__fixe { position: sticky; top: 0; height: 100svh; padding: 0 var(--gut); display: flex; align-items: center; }
.chantier__texte { width: min(560px, 100%); position: relative; }
/* voile de papier derrière le texte : le paysage passe dessous sans gêner la lecture */
.chantier__fixe::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to right, color-mix(in srgb, var(--papier) 82%, transparent) 0%, color-mix(in srgb, var(--papier) 55%, transparent) 30%, transparent 50%);
}
.compteur { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; }
.compteur__n { font-family: var(--sans); font-weight: 600; font-size: 15px; letter-spacing: 0; }
.scene-pas { position: relative; height: 300px; }
.pas { position: absolute; inset: 0; pointer-events: none; }
.pas .titre { font-size: clamp(40px, 5.4vw, 84px); margin-bottom: 22px; }
.pas p { max-width: 400px; margin: 0; opacity: 0; transform: translate3d(0, 12px, 0); transition: opacity .5s var(--ease-out), transform .7s var(--ease-out); }
.pas.est-active p { opacity: .82; transform: none; transition-delay: .18s; }
.pas:not(.est-active) .ligne > span { transform: translate3d(0, -120%, 0); transition-duration: .5s; transition-delay: 0s; }
.jauge { height: 2px; width: 220px; background: color-mix(in srgb, var(--texte) 18%, transparent); margin-top: 10px; }
.jauge__barre { height: 100%; background: var(--texte); transform-origin: left; transform: scaleX(0); }

/* ---------- 3. Offre ---------- */
.offre { min-height: 100svh; padding: 18vh var(--gut); display: grid; grid-template-columns: 1fr minmax(0, 520px); }
.offre__col { grid-column: 2; }
.offre .titre { font-size: clamp(44px, 5.2vw, 80px); margin: 14px 0 28px; }
.tarif {
  border-radius: 22px; padding: 26px 26px 24px; margin-bottom: 14px;
  background: color-mix(in srgb, var(--papier) 70%, white); color: var(--texte);
  border: 1px solid color-mix(in srgb, var(--texte) 12%, transparent);
}
.tarif--plein { background: var(--texte); color: var(--papier); }
.tarif__tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tarif__montant { font-weight: 600; font-size: 64px; letter-spacing: -0.05em; line-height: 1; margin: 10px 0 2px; }
.tarif__note { font-size: 12px; line-height: 1.5; opacity: .75; margin: 0 0 18px; }
.tarif__note a { color: inherit; }
.tarif ul { list-style: none; padding: 0; margin: 16px 0 20px; display: grid; gap: 6px; font-size: 15px; }
.tarif li::before { content: '—  '; opacity: .5; }
.tarif--plein .btn { background: var(--papier); color: var(--texte); }
/* Avis Google (accueil) */
.avis-bloc { border-radius: 22px; padding: 22px 24px; margin-bottom: 14px; background: color-mix(in srgb, var(--papier) 70%, white); color: var(--texte); border: 1px solid color-mix(in srgb, var(--texte) 12%, transparent); }
.avis-bloc__note { margin: 0 0 14px; font-size: 15px; }
.avis-bloc__etoiles { letter-spacing: .1em; margin-right: 4px; }
.avis-bloc__liste { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 14px; }
.avis-bloc blockquote { margin: 0 0 4px; font-size: 15px; line-height: 1.5; }
.avis-bloc__liste p { margin: 0; font-size: 11px; opacity: .65; text-transform: uppercase; letter-spacing: .04em; }
.avis-bloc__liens { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.avis-bloc__liens a { color: inherit; text-underline-offset: 3px; }
@media (max-width: 860px) { .offre { grid-template-columns: 1fr; padding-top: 52vh; } .offre__col { grid-column: 1; } }

/* ---------- 4. Exemples : carrousel horizontal ---------- */
.carrousel { height: 420vh; }
.carrousel__fixe { position: sticky; top: 0; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 4vh; }
.carrousel__tete { padding: 0 var(--gut); display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.carrousel .titre { font-size: clamp(44px, 5.2vw, 80px); }
.piste { display: flex; gap: 2.4vw; width: max-content; padding: 0 var(--gut); will-change: transform; }
.carte {
  width: clamp(280px, 34vw, 520px); flex: none; text-decoration: none; transform-origin: 50% 120%;
  border-radius: 22px; overflow: hidden; background: color-mix(in srgb, var(--papier) 60%, white);
  border: 1px solid color-mix(in srgb, var(--texte) 12%, transparent);
}
.carte img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.carte__meta { padding: 16px 18px 18px; }
.carte h3 { font-weight: 600; font-size: 26px; letter-spacing: -0.035em; margin: 6px 0 4px; }
.carte p { margin: 0; font-size: 14.5px; opacity: .78; }
.carte--vide { display: flex; flex-direction: column; justify-content: space-between; background: var(--texte); color: var(--papier); padding: 22px; aspect-ratio: auto; }
.carte--vide h3 { font-size: 44px; letter-spacing: -0.05em; line-height: .95; }

/* ---------- 5. Agents IA ---------- */
@font-face { font-family: 'Instrument Serif'; src: url('/fonts/instrumentserif-italic.woff2') format('woff2'); font-style: italic; font-weight: 400; font-display: swap; }
.serif { font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif; font-style: italic; font-weight: 400; color: #1A3FFF; letter-spacing: -.01em; }
.agents__questions {
  list-style: none; margin: 0; padding: 0; width: min(100%, 1180px);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.question {
  border-radius: 18px; padding: 22px 20px 24px;
  background: color-mix(in srgb, var(--papier) 70%, white);
  border: 1px solid color-mix(in srgb, var(--texte) 12%, transparent);
}
.question h3 { margin: 12px 0 10px; font-size: clamp(21px, 1.7vw, 25px); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.question p { margin: 0; font-size: 15.5px; line-height: 1.5; }
.question .mono { font-size: 11.5px; margin: 0; }
.agents__invite { margin: 0; font-size: 11.5px; text-align: center; }
@media (max-width: 1000px) { .agents__questions { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .agents__questions { grid-template-columns: 1fr; } }
.agents { padding: 16vh var(--gut) 14vh; display: grid; gap: 5vh; justify-items: center; }
.agents__carte {
  justify-self: start; width: min(100%, 600px); border-radius: 22px; padding: 26px; margin: 0;
  background: color-mix(in srgb, var(--papier) 70%, white);
  border: 1px solid color-mix(in srgb, var(--texte) 12%, transparent);
}
.agents .titre { font-size: clamp(44px, 5.2vw, 80px); margin: 14px 0 18px; }
.agents__carte p { margin: 0 0 12px; font-size: 17px; max-width: 520px; }
.agents__carte .mono { font-size: 11.5px; line-height: 1.8; margin: 0; }
/* La bâtisse découpée, posée sans cadre : tout le visuel est le lien vers la démo. */
.agents__lien {
  position: relative; display: block; width: min(100%, 1180px); border-radius: 18px; text-decoration: none; color: inherit;
  scroll-margin-top: 14vh;
}
/* Le visuel : l'image (affichage immédiat), puis la vraie scène 3D par-dessus, même cadrage (zoom.js, vitrine.js). */
.agents__visuel {
  position: relative; display: block; view-transition-name: batisse;
  filter: drop-shadow(0 18px 26px rgb(27 14 5 / .28));
  transition: transform .5s var(--ease-out);
}
.agents__lien img { display: block; width: 100%; height: auto; aspect-ratio: 2400 / 1444; }
.agents__visuel .batisse3d { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .45s var(--ease-out); }
.agents__visuel.vivant .batisse3d { opacity: 1; }
.agents__visuel.vivant img { visibility: hidden; transition: visibility 0s .45s; }
.agents__pilule { position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); box-shadow: 0 6px 18px rgb(27 14 5 / .25); }
.agents__lien:focus-visible { outline: 3px solid var(--texte); outline-offset: 8px; }
@media (hover: hover) and (pointer: fine) {
  .agents__lien:hover .agents__visuel:not(.vivant) { transform: scale(1.03); }
  .agents__lien:hover .fleche { transform: translateX(3px); }
}
@media (max-width: 600px) {
  .agents__pilule { position: static; transform: none; margin-top: 16px; display: flex; justify-content: center; }
}

/* ---------- 6. Contact ---------- */
.contact { min-height: 100svh; padding: 0 var(--gut) 64px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; text-align: center; }
.contact .titre { font-size: clamp(52px, 8vw, 132px); margin-bottom: 22px; }
.contact p { max-width: 440px; margin: 0 auto 26px; opacity: .8; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

footer { position: relative; z-index: 2; padding: 22px var(--gut); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
footer a { text-decoration: none; display: inline-block; padding-block: 9px; } /* cible tactile d'au moins 24 px */

/* Mobile : la bâtisse au-dessus, le texte en bas */
@media (max-width: 860px) {
  .chantier__fixe { align-items: flex-end; padding-bottom: 28px; }
  .chantier__fixe::before { background: linear-gradient(to bottom, transparent 46%, color-mix(in srgb, var(--papier) 86%, transparent) 64%); }
  .scene-pas { height: 220px; }
  .hero .titre { text-align: left; }
}

/* ---------- Le seuil : intro avant le site ---------- */
html.intro, html.intro body { overflow: hidden; }
html.sans-seuil .seuil { display: none; }
.seuil {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: var(--gut); color: var(--texte); transition: opacity .6s var(--ease-out);
}
.seuil::before { content: ''; position: absolute; inset: 0; background: #EFE9DD; opacity: 0; transition: opacity .22s var(--ease-out); pointer-events: none; }
.seuil.voile::before { opacity: 1; }
.seuil.parti { opacity: 0; pointer-events: none; }
.seuil__centre { position: relative; display: flex; flex-direction: column; align-items: center; transition: opacity .8s var(--ease-out) .2s, transform 2.4s var(--ease-out); }
.seuil.en-route .seuil__centre { opacity: 0; transform: scale(1.05); }
.seuil.voile .seuil__centre, .seuil.voile .seuil__passer { opacity: 0; transition-duration: .2s; transition-delay: 0s; }
.seuil__marque { margin: 0; font-weight: 600; letter-spacing: -0.058em; line-height: .9; font-size: clamp(68px, 13.5vw, 220px); }
.seuil__ligne { margin: 20px 0 34px; font-size: clamp(15px, 1.35vw, 19px); }
.seuil__ligne > .ligne > span { opacity: .86; }
.seuil__entrer { transition: transform .16s var(--ease-out), opacity .35s var(--ease-out); }
.seuil.en-route .seuil__entrer { opacity: 0; pointer-events: none; }
.seuil__jauge { width: 72px; height: 1px; margin-top: 18px; background: color-mix(in srgb, var(--texte) 22%, transparent); overflow: hidden; }
.seuil__jauge::after { content: ''; display: block; height: 100%; background: var(--texte); transform: scaleX(0); transform-origin: left; }
.seuil.vu .seuil__jauge::after { animation: jauge 2.6s linear forwards; }
@keyframes jauge { to { transform: scaleX(1); } }
.seuil__passer {
  position: absolute; right: var(--gut); bottom: 22px; padding: 10px 2px; border: 0; background: none;
  color: inherit; cursor: pointer; opacity: .78; transition: opacity .2s ease;
}
@media (hover: hover) and (pointer: fine) { .seuil__passer:hover { opacity: 1; } }
html.intro .nav, html.intro .coin, html.intro .hero__bas { opacity: 0; }
.nav, .coin, .hero__bas { transition: opacity .9s var(--ease-out) .3s; }
html.intro .hero .ligne > span { transform: translate3d(0, 120%, 0); }

@media (prefers-reduced-motion: reduce) {
  .ligne > span, .pas p { transform: none !important; transition: opacity .3s ease; }
  .chantier, .carrousel { height: auto; }
  .chantier__fixe { position: static; height: auto; padding: 16vh var(--gut); }
  .scene-pas { height: auto; }
  .pas { position: static; margin-bottom: 28px; }
  .pas p { opacity: .82; }
  .carrousel__fixe { position: static; height: auto; padding: 14vh 0; }
  .piste { width: auto; overflow-x: auto; }
}

/* ---------- Formulaire de contact (section nuit) ---------- */
.contact p a { color: inherit; text-underline-offset: 3px; }
.formulaire {
  width: min(640px, 100%); margin: 0 auto 22px; padding: 22px; text-align: left; border-radius: 22px;
  background: color-mix(in srgb, var(--papier) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--texte) 16%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.champs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 620px) { .champs { grid-template-columns: 1fr; } }
.champ { display: grid; gap: 6px; margin-bottom: 12px; }
.champ .mono { opacity: .7; }
.champ input, .champ textarea {
  font: inherit; font-size: 16px; color: var(--texte); width: 100%; padding: 12px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--texte) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--texte) 22%, transparent);
  transition: border-color .2s ease, background-color .2s ease;
}
.champ textarea { resize: vertical; min-height: 84px; }
.champ input::placeholder, .champ textarea::placeholder { color: color-mix(in srgb, var(--texte) 45%, transparent); }
.champ input:focus, .champ textarea:focus { outline: none; border-color: var(--texte); background: color-mix(in srgb, var(--texte) 10%, transparent); }
.consentement { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; opacity: .85; margin: 4px 0 16px; }
.consentement input { margin-top: 2px; accent-color: #FFB547; width: 16px; height: 16px; flex: none; }
.formulaire__bas { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.champ--piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact { padding-top: 22vh; }
/* Ordinateur : texte à gauche, formulaire à droite, la maison allumée reste dégagée au-dessus */
@media (min-width: 1000px) {
  .contact {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 600px); column-gap: 6vw;
    grid-template-areas: "titre form" "texte form" "actions form"; align-content: end; align-items: end;
    text-align: left; padding-top: 52vh;
  }
  .contact .titre { grid-area: titre; font-size: clamp(52px, 6.2vw, 104px); }
  .contact > p { grid-area: texte; margin: 0 0 22px; }
  .contact .actions { grid-area: actions; justify-content: flex-start; }
  .contact .formulaire { grid-area: form; margin: 0; }
}
@media (max-width: 999px) { .contact { padding-top: 48vh; } }

/* ---------- Zoom entre l'accueil et /demo-agents/ (View Transitions, même origine) ---------- */
@view-transition { navigation: auto; }
/* Fond de page : un fondu court, qui accompagne le zoom au lieu de l'éclair. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; animation-timing-function: ease; }
::view-transition-group(batisse) { animation-duration: .65s; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
::view-transition-old(batisse), ::view-transition-new(batisse) { height: 100%; object-fit: cover; }
@keyframes vt-sortie { to { opacity: 0; } }
@keyframes vt-entree { from { opacity: 0; } }
/* Retour : la scène de la démo (fond plein) s'efface tout de suite, la bâtisse à fond transparent rétrécit seule. */
::view-transition-old(batisse) { animation: vt-sortie .14s ease both; }
::view-transition-new(batisse) { animation: vt-entree .14s ease both; }
/* zoom.js : le groupe est animé en JS (échelle uniforme, point visé sur point visé) ; l'ancienne image est recalée */
html.vt-zoom::view-transition-group(batisse) { animation-name: none; transform-origin: 0 0; }
html.vt-zoom::view-transition-old(batisse) { inset: auto; left: var(--vt-ox); top: var(--vt-oy); width: var(--vt-ow); height: var(--vt-oh); object-fit: fill; }
html.vt-zoom::view-transition-new(batisse) { width: 100%; height: 100%; object-fit: fill; }
@media (prefers-reduced-motion: reduce) {
  .agents__visuel { view-transition-name: none; } /* simple fondu de la page entière */
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }
}
