:root {
  --ink: #efe6d8;
  --ink-2: #e6dac8;
  --copper: #a8693f;
  --copper-2: #8a5230;
  --sand: #fbf7f0;
  --text: #2b221c;
  --body-text: #5b4c40;
  --muted: #8c7a68;
  --card: rgba(249, 244, 236, .84);
  --display: 'Josefin Sans', 'Jost', system-ui, sans-serif;
  --body: 'Jost', system-ui, sans-serif;
  --gut: clamp(16px, 6vw, 96px);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--ink); color: var(--text); font-family: var(--body); -webkit-font-smoothing: antialiased; }
body { background: var(--ink); overflow-x: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }
#grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: 0.07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
#track { height: 1800vh; position: relative; z-index: 2; }
#track .anchor { position: absolute; top: 7.5%; }
#cap-plan { left: auto; right: var(--gut); }
.clean .overlay, .clean #bar, .clean #rail, .clean #markers, .clean #ba, .clean #grain { display: none !important; }
.cap.work .no { color: #b8662b; }

/* ouverture : voile papier derrière le texte, sur le salon existant */
#veil { inset: 0; z-index: 2; background: linear-gradient(90deg, rgba(239, 230, 216, .94) 0, rgba(239, 230, 216, .82) 32%, rgba(239, 230, 216, 0) 62%); }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.actions .cta { margin-top: 0; }
.ghost { display: inline-flex; align-items: center; pointer-events: auto; color: var(--copper-2); border: 1px solid rgba(168, 105, 63, .5); padding: .9rem 1.4rem; border-radius: 999px; font: 500 11.5px var(--body); letter-spacing: .16em; text-transform: uppercase; text-decoration: none; background: rgba(249, 244, 236, .6); transition: background .3s; }
.ghost:hover { background: var(--sand); }
.today { margin-top: 2.2rem; font: 500 10px var(--body); letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
#hero .cta, #hero .ghost { pointer-events: auto; }

/* repères du diagnostic, accrochés à la 3D */
#markers { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.marker { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: .7rem; opacity: 0; visibility: hidden; will-change: transform; }
.marker i { position: relative; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--copper); box-shadow: 0 0 0 4px rgba(249, 244, 236, .7); flex: none; }
.marker i::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 1px solid var(--copper); animation: ping 1.8s ease-out infinite; }
@keyframes ping { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.marker span { margin-top: -7px; background: var(--card); border: 1px solid rgba(168, 105, 63, .3); border-radius: 3px; padding: .55rem .75rem; font: 400 12.5px/1.35 var(--body); color: var(--body-text); box-shadow: 0 10px 30px -18px rgba(80, 50, 30, .5); white-space: nowrap; }
.marker b { display: block; font: 600 10px var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--copper-2); margin-bottom: .2rem; }
.capture .marker i::after { animation: none; }
.marker.flip { flex-direction: row-reverse; }
.marker.flip i { margin: -7px -7px 0 0; }

/* étapes à venir sur le rail */
#rail button.next { color: #cdbfae; cursor: default; }
#rail button.next::after { width: 8px; }

.overlay { position: fixed; z-index: 3; pointer-events: none; opacity: 0; visibility: hidden; transform: translateY(var(--shift, 0)); }

/* barre */
#bar { position: fixed; top: 0; left: 0; right: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 18px clamp(16px, 3vw, 40px); }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--copper); text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
.brand span { font-family: var(--display); font-weight: 300; letter-spacing: .48em; font-size: 15px; color: var(--text); }
#hud { display: flex; gap: 1.6rem; font: 500 10px/1 var(--body); letter-spacing: .2em; color: var(--muted); }
#hud b { color: var(--copper); font-weight: 500; margin-left: .35em; font-variant-numeric: tabular-nums; }
.cta-mini { color: var(--sand); background: var(--copper); padding: .62rem 1.15rem; border-radius: 999px; font: 500 11px var(--body); letter-spacing: .16em; text-transform: uppercase; text-decoration: none; transition: background .3s; }
.cta-mini:hover, .cta:hover { background: var(--copper-2); }

/* ouverture */
#hero { left: var(--gut); top: 50%; translate: 0 -50%; width: min(520px, 38vw); }
.eyebrow { font: 500 11px var(--body); letter-spacing: .24em; text-transform: uppercase; color: var(--copper); }
h1 { font-family: var(--display); font-weight: 300; font-size: clamp(42px, 5.2vw, 82px); line-height: 1.04; letter-spacing: -.005em; margin: 1.2rem 0 1.3rem; }
h1 .l { display: block; }
h1 em { font-style: normal; color: var(--copper); }
.lede { font-weight: 400; font-size: clamp(15px, 1.15vw, 18px); line-height: 1.65; color: var(--body-text); max-width: 36ch; }
.cue { margin-top: 2.2rem; font: 500 10px var(--body); letter-spacing: .32em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: .8rem; }
.cue i { display: block; width: 1px; height: 42px; background: linear-gradient(var(--copper), transparent); animation: cue 2.4s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* légendes */
.cap { left: var(--gut); bottom: clamp(24px, 8vh, 88px); max-width: 430px; padding: 1.3rem 1.5rem 1.45rem; background: var(--card); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(168, 105, 63, .25); border-radius: 3px; box-shadow: 0 18px 40px -24px rgba(80, 50, 30, .35); }
.cap .no { display: flex; align-items: center; gap: .55rem; font: 500 10.5px var(--body); letter-spacing: .26em; text-transform: uppercase; color: var(--copper); margin-bottom: .65rem; }
.cap .say { font-family: var(--display); font-weight: 300; font-size: clamp(18px, 1.55vw, 23px); line-height: 1.38; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }
.cap.exist .no { color: #6f7a80; }
.cap.idea .no { color: var(--copper); }
.cap.real .no { color: #b8732f; }
#cap-end { left: auto; right: var(--gut); }
.cta { display: inline-flex; margin-top: 1.1rem; pointer-events: auto; color: var(--sand); background: var(--copper); padding: .9rem 1.4rem; border-radius: 999px; font: 500 11.5px var(--body); letter-spacing: .16em; text-transform: uppercase; text-decoration: none; transition: background .3s; }

/* rail */
#rail { position: fixed; right: clamp(14px, 2.4vw, 34px); top: 50%; translate: 0 -50%; z-index: 4; display: flex; flex-direction: column; align-items: flex-end; gap: .85rem; }
#rail button { display: flex; align-items: center; gap: .6rem; font: 500 9.5px var(--body); letter-spacing: .22em; text-transform: uppercase; color: #b3a28f; transition: color .4s; }
#rail button::after { content: ''; width: 14px; height: 1px; background: currentColor; transition: width .4s; }
#rail button.on { color: var(--copper); }
#rail button.on::after { width: 30px; }
#rail button:hover { color: var(--copper-2); }

/* cartouche */
#cartouche { left: var(--gut); bottom: clamp(18px, 4vh, 36px); display: grid; grid-template-columns: repeat(3, auto); border: 1px solid rgba(168, 105, 63, .55); font: 500 9px var(--body); letter-spacing: .16em; text-transform: uppercase; color: #6b5a4c; background: rgba(249, 244, 236, .7); }
#cartouche div { padding: .55rem .85rem; border: 1px solid rgba(168, 105, 63, .22); }
#cartouche b { display: block; color: var(--copper); font-weight: 500; margin-bottom: .3rem; font-size: 8px; letter-spacing: .24em; }
#cartouche .c-brand b { font-family: var(--display); font-weight: 400; font-size: 13px; letter-spacing: .42em; color: var(--text); }
#cartouche .north { display: flex; align-items: center; gap: .4rem; color: var(--copper); }
#cartouche .north svg { width: 16px; height: 16px; }

/* avant / après */
#ba { position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .6s; --split: .5; }
#ba.on { opacity: 1; }
#ba.on .knob { pointer-events: auto; }
#ba .line { position: absolute; top: 0; bottom: 0; left: calc(var(--split) * 100%); width: 2px; margin-left: -1px; background: #f3d3a8; box-shadow: 0 0 22px rgba(243, 211, 168, .9); }
#ba .knob { position: absolute; top: 50%; left: calc(var(--split) * 100%); width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; border: 1px solid var(--copper); background: var(--card); backdrop-filter: blur(6px); color: var(--copper); font-size: 20px; cursor: ew-resize; touch-action: none; }
#ba .knob:focus-visible { outline: 2px solid var(--sand); outline-offset: 4px; }
#ba .lbl { position: absolute; top: 92px; font: 500 10.5px var(--body); letter-spacing: .32em; text-transform: uppercase; padding: .5rem .85rem; border: 1px solid rgba(168, 105, 63, .3); background: var(--card); }
#ba .lbl.l { left: var(--gut); color: #5f6a70; }
#ba .lbl.r { right: clamp(80px, 9vw, 140px); color: #a8693f; }

/* chargement */
#loading { position: fixed; inset: 0; z-index: 20; background: var(--ink); display: grid; place-items: center; transition: opacity .9s ease, visibility .9s; }
#loading span { font: 500 10.5px var(--body); letter-spacing: .34em; text-transform: uppercase; color: var(--copper); }
#loading i { position: absolute; left: 50%; top: calc(50% + 24px); width: 140px; height: 1px; margin-left: -70px; background: rgba(168, 105, 63, .2); overflow: hidden; }
#loading i::after { content: ''; position: absolute; inset: 0; background: var(--copper); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform .4s; }
#loading.done { opacity: 0; visibility: hidden; pointer-events: none; }

/* contact */
#contact { position: relative; z-index: 5; background: var(--sand); border-top: 1px solid rgba(168, 105, 63, .25); padding: clamp(72px, 14vh, 150px) var(--gut); }
#contact .wrap { max-width: 1080px; }
#contact h2 { font-family: var(--display); font-weight: 300; font-size: clamp(34px, 4vw, 60px); line-height: 1.08; margin: 1rem 0 1.2rem; }
.services { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1px; margin: 2.6rem 0 2rem; background: rgba(168, 105, 63, .22); border: 1px solid rgba(168, 105, 63, .22); }
.services li { background: var(--sand); padding: 1.6rem 1.5rem; color: var(--body-text); font-weight: 300; line-height: 1.6; }
.services b { display: block; font-family: var(--display); font-weight: 400; font-size: 19px; color: var(--copper); letter-spacing: .04em; margin-bottom: .5rem; }
.soon { font: 500 11px var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

/* secours sans 3D */
#fallback { position: relative; z-index: 2; padding: 110px var(--gut) 40px; }
#fallback svg { width: 100%; max-width: 900px; height: auto; display: block; margin: 0 auto; border: 1px solid rgba(168, 105, 63, .35); }
.fb-note { text-align: center; color: var(--muted); font-size: 14px; margin-top: 1rem; }
.no-gl #gl, .no-gl #ba, .no-gl #rail, .no-gl #hud, .no-gl #track, .no-gl #cartouche, .no-gl #cap-end { display: none; }
.no-gl .overlay { position: relative; inset: auto; translate: none; transform: none; opacity: 1 !important; visibility: visible !important; width: auto; max-width: 720px; margin: 24px auto; left: auto; right: auto; bottom: auto; }
.no-gl #hero { top: auto; left: auto; translate: none; width: auto; padding-top: 110px; }
.no-gl #fallback { padding-top: 24px; }

/* capture vidéo : pas de grain animé, pas de curseur */
.capture .cue i { animation: none; transform: scaleY(1); }

@media (max-width: 1100px) {
  #hud { display: none; }
}
@media (max-width: 760px) {
  #hero { top: 92px; translate: none; width: auto; right: 16px; left: 16px; }
  h1 { font-size: 40px; margin: .9rem 0 1rem; }
  .lede { font-size: 15px; }
  .cue { display: none; }
  .cap, #cap-end { left: 16px; right: 16px; bottom: 16px; max-width: none; padding: 1rem 1.15rem 1.15rem; }
  .cap .say { font-size: 17px; }
  #rail, #cartouche { display: none; }
  #veil { background: linear-gradient(180deg, rgba(239, 230, 216, .96) 0, rgba(239, 230, 216, .88) 48%, rgba(239, 230, 216, 0) 78%); }
  .marker span { white-space: normal; max-width: 180px; }
  .today { display: none; }
  .brand span { letter-spacing: .36em; }
  #ba .lbl { top: 80px; }
  #ba .lbl.r { right: 16px; }
  #ba .lbl.l { left: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .cue i { animation: none; }
  .overlay { transform: none; }
}
