:root {
  --bg: #f6f3ee;
  --bg-2: #ece6dc;
  --ink: #1f1d1a;
  --ink-2: #6b645a;
  --line: #ddd6cb;
  --accent: #2f4a3a;
  --blood: #7d1f1a;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, Helvetica, sans-serif;
  --img-filter: saturate(.85);
}

/* Quand la maison se réveille */
body.rotten {
  --bg: #0b0a09;
  --bg-2: #14110f;
  --ink: #c9bfae;
  --ink-2: #7a7064;
  --line: #2a2420;
  --accent: #7d1f1a;
  --img-filter: grayscale(.75) sepia(.25) brightness(.55) contrast(1.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  transition: background 1.2s, color 1.2s;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; }
[hidden] { display: none !important; }

.btn {
  font: 500 13px/1 var(--sans);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 14px 22px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background .3s, color .3s, opacity .3s;
}
.btn:hover { filter: brightness(1.15); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn:disabled { opacity: .35; cursor: default; }

/* ---------- Bannière cookies ---------- */
#gate {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 18, 16, .45);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.gate-box {
  background: #fff; color: #1f1d1a;
  max-width: 460px; padding: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.gate-logo { font-family: var(--serif); letter-spacing: .3em; font-size: 14px; margin-bottom: 18px; }
.gate-box h2 { font-size: 26px; margin-bottom: 10px; }
.gate-box p { color: #5b554c; font-size: 14px; margin: 0 0 12px; }
.gate-box .gate-warn { font-size: 12px; color: #8a8378; border-left: 2px solid #c9bfae; padding-left: 10px; }
#gate-msg { color: #a3241b; font-weight: 600; font-size: 15px; margin: 6px 0 0; }
.gate-box.shake { animation: quake .45s linear; }
.gate-actions .btn { transition: transform .3s; }
.gate-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.gate-actions .btn.ghost { color: #1f1d1a; border-color: #ddd6cb; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px clamp(16px, 4vw, 48px);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: background 1.2s;
}
.logo { font-family: var(--serif); font-size: 22px; letter-spacing: .28em; color: var(--ink); text-decoration: none; line-height: 1.1; }
.logo small { display: block; font-family: var(--sans); font-size: 10px; letter-spacing: .14em; color: var(--ink-2); text-transform: uppercase; margin-top: 4px; }
.site-header nav { display: flex; gap: clamp(12px, 2.5vw, 32px); }
.site-header nav a { color: var(--ink-2); text-decoration: none; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.site-header nav a:hover { color: var(--ink); }

/* ---------- Accueil ---------- */
.hero { position: relative; height: min(86vh, 760px); overflow: hidden; background: #000; }
.hero-img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; filter: var(--img-filter); transition: filter 1.5s; }
.hero-ghost {
  position: absolute; right: 22%; top: 30%; height: 46%; width: auto;
  opacity: 0; pointer-events: none;
}
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 30%, rgba(0,0,0,.55)); pointer-events: none; }
.hero-text { position: absolute; left: clamp(16px, 5vw, 64px); right: clamp(16px, 5vw, 64px); bottom: clamp(24px, 6vh, 64px); z-index: 2; color: #fff; }
.eyebrow { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; margin: 0 0 12px; opacity: .85; }
.hero h1 { font-size: clamp(36px, 6vw, 72px); line-height: 1.02; max-width: 15ch; margin-bottom: 28px; }
.search { display: flex; flex-wrap: wrap; background: #fff; max-width: 860px; }
.search label { flex: 1 1 160px; padding: 12px 16px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #8a8378; border-right: 1px solid #ece6dc; }
.search input { display: block; width: 100%; border: 0; outline: 0; font: 15px var(--sans); color: #1f1d1a; padding: 4px 0 0; background: transparent; }
.search .btn { flex: 0 0 auto; }
body.rotten .search { background: #14110f; }
body.rotten .search label { border-color: #2a2420; color: #7a7064; }
body.rotten .search input { color: #c9bfae; }
body.rotten .search input::placeholder { color: #8a3a32; }

.block { padding: clamp(48px, 9vw, 110px) clamp(16px, 5vw, 64px); }
.block-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 36px; }
.block-head h2, .reviews h2 { font-size: clamp(30px, 4vw, 46px); }
.block-head p { max-width: 42ch; color: var(--ink-2); margin: 0; }

.listings { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; }
.card { cursor: pointer; }
.card-img { position: relative; aspect-ratio: 4/3; overflow: hidden; background: #000; }
.card-img img { width: 100%; height: 100%; object-fit: cover; filter: var(--img-filter); transition: transform 1.2s, filter 1.5s; }
.card:hover .card-img img { transform: scale(1.04); }
.card-tag { position: absolute; left: 12px; top: 12px; background: var(--bg); color: var(--ink); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; padding: 5px 9px; }
.card h3 { font-size: 26px; margin: 14px 0 2px; }
.card .place { color: var(--ink-2); font-size: 13px; }
.card .meta { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; font-size: 13px; }
.card .price { font-weight: 600; }

.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px; background: var(--bg-2); transition: background 1.2s; }
.why .num { font-family: var(--serif); font-size: 18px; color: var(--ink-2); }
.why h3 { font-size: 26px; margin: 6px 0 8px; }
.why p { color: var(--ink-2); margin: 0; }

.review-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; margin-top: 32px; }
blockquote { margin: 0; padding: 24px; border: 1px solid var(--line); }
blockquote p { font-family: var(--serif); font-size: 21px; font-style: italic; margin: 0 0 14px; }
cite { font-style: normal; font-size: 12px; color: var(--ink-2); }

.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 28px clamp(16px, 5vw, 64px); border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }

/* ---------- Fiche maison ---------- */
.house-hero { position: relative; height: min(70vh, 620px); background: #000; overflow: hidden; }
.house-hero img { width: 100%; height: 100%; object-fit: cover; filter: var(--img-filter); }
.house-hero .back { position: absolute; left: clamp(16px, 5vw, 64px); top: 20px; z-index: 2; color: #fff; background: rgba(0,0,0,.4); border: 0; padding: 8px 14px; font: 12px var(--sans); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.house-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); padding: clamp(36px, 6vw, 72px) clamp(16px, 5vw, 64px); }
.house-body h1 { font-size: clamp(38px, 5vw, 60px); line-height: 1.05; }
.house-body .place { color: var(--ink-2); margin: 6px 0 24px; }
.house-body .desc { font-size: 17px; max-width: 60ch; }
.story-title { font-family: var(--serif); font-size: 26px; margin: 36px 0 8px; }
.story { color: var(--ink-2); max-width: 60ch; }
.specs { border: 1px solid var(--line); padding: 24px; align-self: start; position: sticky; top: 90px; }
.specs .price { font-family: var(--serif); font-size: 34px; margin-bottom: 18px; }
.specs dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 22px; font-size: 13px; }
.specs dt { color: var(--ink-2); }
.specs dd { margin: 0; text-align: right; }
.specs .btn { width: 100%; }
.specs .note { font-size: 11px; color: var(--ink-2); margin-top: 10px; }

/* ---------- Visite ---------- */
#visit { position: fixed; inset: 0; z-index: 40; background: #000; color: #c9bfae; cursor: none; user-select: none; }
.visit-bar, .visit-foot { position: absolute; left: 0; right: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px clamp(16px, 3vw, 32px); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.visit-bar { top: 0; background: linear-gradient(#000c, transparent); font-family: ui-monospace, Menlo, monospace; }
.visit-foot { bottom: 0; background: linear-gradient(transparent, #000d); align-items: end; padding-bottom: 22px; cursor: auto; }
.rec i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c0261d; margin-right: 6px; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
#room-count { color: #7a7064; }
#room-name { font-family: var(--serif); font-size: clamp(26px, 4vw, 40px); letter-spacing: 0; text-transform: none; color: #e4dccd; }
#next { opacity: 0; pointer-events: none; transition: opacity 1.2s; }
#next.shown { opacity: 1; pointer-events: auto; }
#next { cursor: pointer; background: #7d1f1a; border-color: #a3332b; color: #f1e6d6; padding: 16px 28px; box-shadow: 0 0 24px rgba(125, 31, 26, .45); }

#stage-wrap, #haunt-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; pointer-events: none; }
#haunt-wrap { z-index: 4; }
#haunt { position: relative; width: min(100vw, calc(100vh * var(--ar, 1.5))); aspect-ratio: var(--ar, 1.5); animation: breathe 9s ease-in-out infinite; }
#stage {
  position: relative;
  width: min(100vw, calc(100vh * var(--ar, 1.5)));
  aspect-ratio: var(--ar, 1.5);
  background: #000 center / cover no-repeat;
  filter: grayscale(.45) sepia(.2) contrast(1.2) brightness(.8);
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.025); } }
#stage .ghost, #haunt .ghost { position: absolute; width: auto; opacity: 0; pointer-events: none; transition: opacity 1.8s; -webkit-mask-image: radial-gradient(ellipse at center, #000 55%, transparent 75%); mask-image: radial-gradient(ellipse at center, #000 55%, transparent 75%); }
/* Fantômes détourés (fond transparent) : pas de masque ni de fusion */
.ghost.screen { -webkit-mask-image: none !important; mask-image: none !important; }
.ghost.cover { object-fit: cover; }
.ghost.fast { transition: opacity .08s !important; }
#stage .shadow { position: absolute; width: 16%; height: 62%; top: 16%; left: -20%; background: radial-gradient(ellipse at center, #000 30%, transparent 70%); filter: blur(10px); opacity: .9; pointer-events: none; }

/* Maison des Hautes-Herbes : caméra infrarouge (plus d'électricité) */
body.ir #stage, body.ir #haunt { filter: grayscale(1) sepia(.55) hue-rotate(58deg) saturate(1.9) contrast(1.45) brightness(1.08); }
body.ir #stage-wrap::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .75)); }
body.ir #grain { opacity: .45; }
body.ir .visit-bar { color: #a8e6a0; }
.ghost.lighten { mix-blend-mode: lighten; -webkit-mask-image: radial-gradient(ellipse at center, #000 50%, transparent 74%); mask-image: radial-gradient(ellipse at center, #000 50%, transparent 74%); }

/* Manoir des Ifs : à la bougie */
body.candle #stage, body.candle #haunt { filter: sepia(.65) saturate(1.35) contrast(1.15) brightness(.85); }
body.candle #dark { background: radial-gradient(circle var(--r, 190px) at var(--x, 50%) var(--y, 50%), rgba(255, 150, 60, .1) 0%, rgba(20, 8, 0, .35) 45%, rgba(6, 3, 0, var(--amb, .9)) 100%); }
body.candle .visit-bar { color: #e8c48a; }

/* Refuge de la lande : la tempête, les éclairs */
body.storm #stage, body.storm #haunt { filter: grayscale(.5) saturate(.7) contrast(1.2) brightness(.8); }
#stage.bolt { filter: grayscale(.55) brightness(2.1) contrast(1.35) !important; }
#dark.bolt { opacity: 0; }
#bolt { position: absolute; inset: 0; z-index: 4; display: none; background: rgba(175, 195, 255, .16); pointer-events: none; }
#bolt.on { display: block; }

/* Écriture qui s'écrit toute seule */
#scrawl { position: absolute; left: 8%; right: 8%; top: 34%; z-index: 5; margin: 0; text-align: center; font: clamp(30px, 6vw, 74px)/1.2 "Homemade Apple", cursive; color: rgba(120, 12, 6, .88); transform: rotate(-6deg); text-shadow: 0 0 2px rgba(60, 0, 0, .7); opacity: 0; transition: opacity .4s; pointer-events: none; }
#scrawl.on { opacity: 1; }

/* Le reflet dans le miroir */
.mirrorbox { position: absolute; overflow: hidden; }
.mirrorbox .reflection { position: absolute; left: 50%; transform: translateX(-50%); width: auto; filter: brightness(.7) contrast(1.1); opacity: .88; transition: height 1.2s, bottom 1.2s; }
.mirrorbox svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Lumières vivantes : bougies, lampe, feu de cheminée, télé */
.glow { position: absolute; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; transition: opacity .15s; }
.glow.flame { background: radial-gradient(circle, rgba(255, 222, 150, .95) 0%, rgba(255, 160, 70, .5) 12%, rgba(255, 120, 40, .16) 38%, transparent 68%); animation: flame 1.8s infinite; }
.glow.lamp { background: radial-gradient(circle, rgba(255, 200, 130, .55) 0%, rgba(255, 150, 70, .18) 35%, transparent 70%); animation: flame 3s infinite; }
.glow.fire { aspect-ratio: 1.6; border-radius: 50%; background: radial-gradient(ellipse at 50% 75%, rgba(255, 170, 80, .55) 0%, rgba(255, 100, 30, .28) 28%, rgba(200, 60, 10, .1) 52%, transparent 72%); mix-blend-mode: screen; animation: fire .7s infinite; }
.glow.tv { border-radius: 0; aspect-ratio: auto; height: 100%; top: 50%; transform: translate(-30%, -50%); opacity: 0; background: radial-gradient(ellipse at 20% 50%, rgba(170, 200, 255, .55), rgba(120, 150, 230, .18) 45%, transparent 75%); }
.glow.tv.on { animation: tv .12s steps(2) infinite; }
@keyframes flame {
  0%, 100% { opacity: .95; transform: translate(-50%, -50%) scale(1); }
  18% { opacity: .75; transform: translate(-51%, -49%) scale(.94); }
  37% { opacity: 1; transform: translate(-49%, -51%) scale(1.06); }
  52% { opacity: .62; transform: translate(-50%, -50%) scale(.9); }
  70% { opacity: .9; transform: translate(-50%, -52%) scale(1.03); }
}
@keyframes fire {
  0%, 100% { opacity: .85; transform: translate(-50%, -50%) scale(1, 1); }
  25% { opacity: 1; transform: translate(-50%, -52%) scale(1.08, 1.14); }
  50% { opacity: .7; transform: translate(-49%, -50%) scale(.95, .92); }
  75% { opacity: .95; transform: translate(-51%, -51%) scale(1.04, 1.08); }
}
@keyframes tv { 0% { opacity: .9; } 50% { opacity: .35; } }
/* Quand tout s'éteint, les flammes aussi */
#dark.off ~ #haunt-wrap .glow { opacity: 0 !important; }

/* Ce que chuchotent les enfants */
#whisper { position: absolute; left: 16px; right: 16px; bottom: 24%; z-index: 6; margin: 0; text-align: center; font: italic clamp(20px, 3vw, 30px) var(--serif); color: #e2eedb; opacity: 0; transition: opacity .5s; text-shadow: 0 0 14px #000, 0 0 4px #000; pointer-events: none; }
#whisper.on { opacity: .92; }
/* Quand c'est son fantôme qui parle : rouge, plus grand */
#whisper.demon { font-style: normal; font-size: clamp(22px, 3.4vw, 36px); color: #ff3b2f; letter-spacing: .02em; text-shadow: 0 0 18px rgba(255, 0, 0, .55), 0 0 4px #000; }

/* Le tableau dont les enfants sont sortis : on l'emplit avec la tenture vide du fond de la photo */
.empty-frame {
  position: absolute;
  background: url(img/portrait-vide.jpg) center / cover no-repeat;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .55);
}
#stage.quake { animation: quake .45s linear; }
@keyframes quake { 20% { transform: translate(-10px, 6px) rotate(-.4deg); } 40% { transform: translate(9px, -7px); } 60% { transform: translate(-6px, -4px) rotate(.3deg); } 80% { transform: translate(5px, 6px); } }

#dark {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(circle var(--r, 190px) at var(--x, 50%) var(--y, 50%), rgba(0,0,0,0) 0%, rgba(0,0,0,.25) 45%, rgba(0,0,0,var(--amb, .9)) 100%);
}
#dark.off { background: #000; }

/* ---------- Fin ---------- */
#end { position: fixed; inset: 0; z-index: 45; background: #000; color: #c9bfae; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#end img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: grayscale(.3) contrast(1.2) brightness(.55); transform: scale(1.15); transition: opacity 6s, transform 20s linear; }
#end.on img { opacity: 1; transform: scale(1); }
.end-text { position: relative; z-index: 2; text-align: center; padding: 16px; max-width: 560px; background: radial-gradient(#000c, transparent 70%); }
.end-text h2 { font-size: clamp(40px, 7vw, 76px); line-height: 1; color: #efe6d6; margin-bottom: 18px; }
.end-text .small { font-size: 12px; color: #7a7064; }
.end-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
#end-quit { color: #c9bfae; border-color: #3a322c; position: relative; transition: transform .25s; }
#end .btn:not(.ghost) { background: #7d1f1a; border-color: #7d1f1a; }

/* ---------- Conseiller ---------- */
#advisor {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  width: 300px; max-width: calc(100vw - 32px);
  background: #fff; color: #1f1d1a;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
  font-size: 13px;
  transition: transform .4s;
}
.adv-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #ece6dc; }
.adv-avatar { width: 34px; height: 34px; border-radius: 50%; background: #2f4a3a; color: #fff; display: grid; place-items: center; font-family: var(--serif); font-size: 18px; background-size: cover; background-position: 48% 28%; }
.adv-who small { display: block; color: #6b645a; font-size: 11px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3aa35b; }
.adv-video { position: relative; display: none; aspect-ratio: 4/3; overflow: hidden; background: #000; }
/* Gaspard gentil : cadré sur son visage, image propre */
.adv-video .adv-face[src$="gentil.jpg"] { object-position: 47% 28%; transform-origin: 47% 30%; }
/* Pièce 3 : image saturée, il se rapproche */
body[data-level="2"] .adv-video .adv-face { filter: contrast(1.4) saturate(1.3) brightness(.8); animation-duration: 3.5s; }
body[data-level="2"] .adv-video::before { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(transparent 40%, rgba(120, 0, 0, .45)); pointer-events: none; }
/* Le visage animé remplace la photo fixe de Gaspard */
.adv-video .adv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; filter: contrast(1.15) saturate(.85); }
.adv-video .adv-face { visibility: hidden; }
#advisor.cam .adv-canvas { display: none; }
body[data-level="2"] .adv-video .adv-canvas { filter: contrast(1.4) saturate(1.3) brightness(.8); }
#advisor.glitch .adv-video .adv-canvas { filter: invert(1) contrast(2); transform: scale(1.6) translate(-4%, 6%); }
.adv-video .adv-face { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transform: scale(1.35); filter: contrast(1.15) saturate(.8); animation: lurk 7s ease-in-out infinite; }
@keyframes lurk { 50% { transform: scale(1.45) translate(1%, 2%); } }
.adv-video::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 3px); pointer-events: none; }
.adv-rec { position: absolute; left: 8px; top: 6px; font: 10px ui-monospace, Menlo, monospace; color: #e33; z-index: 2; }
.adv-lost { position: absolute; inset: 0; display: none; place-items: center; font: 11px ui-monospace, Menlo, monospace; letter-spacing: .2em; color: #ccc; background: #111; z-index: 3; }
#adv-text { margin: 0; padding: 12px 14px 14px; min-height: 44px; }

#advisor.clown .adv-avatar { background-image: url(img/clown-gentil.jpg); background-size: 420%; background-position: 47% 22%; color: transparent; }
#advisor.clown, #advisor.video { background: #0f0d0c; color: #d8cfbf; }
#advisor.clown .adv-head, #advisor.video .adv-head { border-color: #2a2420; }
#advisor.clown .adv-who small, #advisor.video .adv-who small { color: #7a7064; }
#advisor.video .adv-video { display: block; }
/* Pendant la visite, Gaspard passe en haut à droite pour ne pas cacher le bouton */
#advisor.video, body.visiting #advisor { top: 52px; bottom: auto; width: 260px; }
#advisor.video .adv-avatar { display: none; }
#advisor.lost .adv-lost { display: grid; }
#advisor.lost .dot { background: #c0261d; }
#advisor.glitch .adv-video .adv-face { filter: invert(1) contrast(2); transform: scale(2.2) translate(-4%, 6%); }

/* ---------- Effets ---------- */
#jump { position: fixed; inset: 0; z-index: 90; background: #000; display: none; pointer-events: none; }
#jump img { width: 100%; height: 100%; object-fit: cover; }
#jump.on { display: block; animation: shake .09s linear infinite; }
#jump.on img { animation: lunge 1s cubic-bezier(.2, .9, .2, 1) forwards; }
@keyframes shake { 25% { transform: translate(6px, -4px); } 50% { transform: translate(-5px, 5px); } 75% { transform: translate(4px, 3px); } }
@keyframes lunge { from { transform: scale(1.35); filter: contrast(1.6) brightness(1.4); } to { transform: scale(1); filter: contrast(1.2); } }

/* Webcam : le visiteur, et elle derrière lui */
#adv-cam { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); filter: grayscale(.55) contrast(1.25) brightness(.75); display: none; }
.adv-ghost { position: absolute; right: 4%; bottom: -2%; height: 82%; width: auto; opacity: 0; z-index: 1; filter: brightness(.85) contrast(1.1); transition: opacity 2.5s, height 2.8s ease-in, right 2.8s ease-in, bottom 2.8s ease-in; pointer-events: none; }
#advisor.cam { width: min(460px, calc(100vw - 32px)); }
#advisor.cam .adv-face { display: none; }
#advisor.cam #adv-cam { display: block; }
.adv-ghost.masked { -webkit-mask-image: radial-gradient(ellipse at center, #000 50%, transparent 72%); mask-image: radial-gradient(ellipse at center, #000 50%, transparent 72%); }
#advisor.behind .adv-ghost { opacity: .5; }
/* Le clown, plus large, apparaît par-dessus l'épaule */
.adv-ghost.wide { right: -38%; height: 92%; }
#advisor.closer .adv-ghost.wide { right: -12%; height: 175%; bottom: -78%; }
#advisor.closer .adv-ghost { opacity: .92; height: 160%; right: 18%; bottom: -55%; }

/* Appel entrant */
#call { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 4, 3, .78); backdrop-filter: blur(10px); }
.call-box { text-align: center; color: #e9e1d3; font-family: var(--sans); }
.call-avatar { width: 128px; height: 128px; margin: 0 auto 18px; border-radius: 50%; background: url(img/clown-gentil.jpg) 47% 20% / 380% no-repeat; box-shadow: 0 0 0 0 rgba(200, 40, 30, .5); animation: ringing 1.6s infinite; }
@keyframes ringing { 70% { box-shadow: 0 0 0 28px rgba(200, 40, 30, 0); } 100% { box-shadow: 0 0 0 0 rgba(200, 40, 30, 0); } }
.call-label { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #8a8070; margin: 0; }
.call-box h3 { font-size: 44px; margin: 4px 0; }
.call-sub { color: #8a8070; margin: 0 0 36px; }
.call-actions { display: flex; gap: 48px; justify-content: center; }
.call-btn { width: 76px; height: 76px; border-radius: 50%; border: 0; color: #fff; font: 600 11px var(--sans); cursor: pointer; }
.call-btn.no { background: #c0261d; }
.call-btn.yes { background: #2e9b4f; animation: blink 1s infinite; }

/* Image subliminale */
#sub { position: fixed; inset: 0; z-index: 88; background: #000; display: none; pointer-events: none; }
#sub img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.4) brightness(.8) blur(.6px); }
#sub.on { display: block; }

/* Les mains contre la vitre de l'écran */
#glass { position: fixed; inset: 0; z-index: 85; pointer-events: none; opacity: 0; transition: opacity 2.4s ease-in; }
#glass img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; filter: contrast(1.25) brightness(.9); transform: scale(1.08); transition: transform 4s ease-out; }
#glass.on { opacity: .82; }
#glass.on img { transform: scale(1); }
#glass.hit { opacity: 0; transition: opacity .15s; }

#flash { position: fixed; inset: 0; z-index: 95; background: #fff; opacity: 0; pointer-events: none; }
#flash.on { animation: flash .25s ease-out; }
@keyframes flash { from { opacity: .85; } to { opacity: 0; } }

#grain { position: fixed; inset: -50%; z-index: 80; pointer-events: none; opacity: .06; mix-blend-mode: overlay; animation: grain .5s steps(5) infinite; }
body.rotten #grain, body.visiting #grain { opacity: .3; }
@keyframes grain { 20% { transform: translate(-8%, 5%); } 40% { transform: translate(6%, -9%); } 60% { transform: translate(-4%, 11%); } 80% { transform: translate(10%, 3%); } }

body.glitch .hero-img, body.glitch .card-img img { filter: grayscale(1) brightness(.35) contrast(1.6); transform: translateX(-6px) scaleX(1.02); }
body.glitch .hero-ghost { opacity: .75; }
body.glitch main { animation: jitter .08s steps(2) infinite; }
@keyframes jitter { 50% { transform: translate(3px, -2px); } }
body.flicker { filter: brightness(.2); }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .site-header nav { display: none; }
  .house-body { grid-template-columns: 1fr; }
  .specs { position: static; }
  .search .btn { width: 100%; }
  #advisor { width: 220px; font-size: 12px; }
  #advisor.video, body.visiting #advisor { width: 150px; }
  body.visiting #advisor.cam { width: calc(100vw - 32px); }
  #advisor.video #adv-text { padding: 8px; min-height: 0; }
  #advisor.bubble #adv-text { display: none; }
  .visit-foot { flex-direction: column; align-items: stretch; }
}
