/* Essais de l'écran « plan » (A, B, C) et visite complète. Le SVG du plan est le même partout ; seul le thème change. */

.warn {
	position: fixed; left: 50%; bottom: 14px; translate: -50% 0; z-index: 60; max-width: calc(100% - 32px);
	background: rgba(20,20,24,.92); border: 1px dashed rgba(252,71,23,.7); color: var(--ink-2);
	font-size: 12px; padding: 8px 14px; border-radius: 999px; text-align: center; backdrop-filter: blur(6px);
}
.warn strong { color: var(--orange); }
.tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--bg); background: var(--ink); padding: 4px 10px; border-radius: 4px; margin: 0 0 22px; }

/* Le SVG — valeurs par défaut (thème nuit) */
.plan-svg { display: block; width: 100%; height: auto; overflow: visible; font-family: 'Montserrat', sans-serif; }
.plan-svg .floor { fill: var(--p-floor, transparent); transition: fill .35s; }
.plan-svg .floor--garden { fill: url(#herbe); }
.plan-svg .hatch { stroke: var(--p-hatch, rgba(120,190,120,.35)); stroke-width: .07; }
.plan-svg .ph { opacity: 0; transition: opacity .45s; }
.plan-svg .wall { fill: none; stroke: var(--p-wall, #f4f1ec); stroke-width: var(--p-wall-w, .14); pointer-events: none; }
.plan-svg .part { stroke: var(--p-wall, #f4f1ec); stroke-width: calc(var(--p-wall-w, .14) * .6); pointer-events: none; }
.plan-svg .gap { stroke: var(--p-bg, #0b0b0d); stroke-width: calc(var(--p-wall-w, .14) * 2.4); pointer-events: none; }
.plan-svg .swing { fill: none; stroke: var(--p-line, rgba(244,241,236,.4)); stroke-width: .04; stroke-dasharray: .12 .1; pointer-events: none; }
.plan-svg .furn { fill: none; stroke: var(--p-line, rgba(244,241,236,.4)); stroke-width: .045; pointer-events: none; }
.plan-svg .furn--table { fill: var(--p-line-soft, rgba(244,241,236,.06)); }
.plan-svg .furn-l { fill: var(--p-furn-l, rgba(244,241,236,.55)); font-size: .42px; font-weight: 600; letter-spacing: .03em; pointer-events: none; }
.plan-svg .num { fill: var(--orange); font-size: .5px; font-weight: 800; letter-spacing: .08em; pointer-events: none; }
.plan-svg .name { fill: var(--p-name, #f4f1ec); font-size: .62px; font-weight: 800; letter-spacing: -.01em; pointer-events: none; }
.plan-svg .meta { fill: var(--p-line, rgba(244,241,236,.4)); stroke: var(--p-line, rgba(244,241,236,.4)); stroke-width: .04; font-size: .36px; }
.plan-svg .meta text { stroke: none; }
.plan-svg a { cursor: pointer; outline: none; }
.plan-svg a:focus-visible .floor { stroke: var(--orange); stroke-width: .12; }

.variant { min-height: 100vh; min-height: 100svh; padding: 110px var(--pad) 80px; display: grid; gap: 40px; align-items: center; border-top: 1px solid var(--line); }

/* Légende numérotée, partagée */
.legend { list-style: none; padding: 0; margin: 34px 0 0; display: grid; gap: 2px; }
.legend a { display: grid; grid-template-columns: 34px 1fr auto; align-items: baseline; gap: 10px; text-decoration: none; padding: 12px 0; border-bottom: 1px solid var(--line); transition: color .2s, padding .3s; }
.legend b { color: var(--orange); font-size: 13px; }
.legend span { font-weight: 800; font-size: 17px; }
.legend em { font-style: normal; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.legend a.is-on { color: var(--orange); padding-left: 8px; }

/* A — plan d'architecte de nuit */
.va {
	grid-template-columns: minmax(260px, 360px) 1fr;
	--p-bg: #0a1024; --p-wall: #dfe6ff; --p-line: rgba(200,212,255,.45); --p-line-soft: rgba(200,212,255,.06);
	--p-furn-l: rgba(200,212,255,.6); --p-floor: rgba(31,46,224,.08);
	background:
		linear-gradient(rgba(140,160,255,.07) 1px, transparent 1px) 0 0 / 28px 28px,
		linear-gradient(90deg, rgba(140,160,255,.07) 1px, transparent 1px) 0 0 / 28px 28px,
		#0a1024;
}
.va h2 { font-size: clamp(30px, 3.2vw, 46px); }
.va .hint { color: var(--ink-2); font-size: 13px; margin-top: 22px; }
.va .r.is-on .ph { opacity: .9; }
.va .r.is-on .floor { fill: rgba(31,46,224,.3); }
.va .r.is-on .name { fill: #fff; }
.va .plan-svg .name, .va .plan-svg .num { paint-order: stroke; stroke: rgba(10,16,36,.75); stroke-width: .16; }

/* B — plan papier, murs pochés */
.vb {
	grid-template-columns: 1fr minmax(280px, 380px);
	background: #ece6da; color: #141414;
	--p-bg: #ece6da; --p-wall: #141414; --p-wall-w: .42; --p-line: rgba(20,20,20,.45); --p-line-soft: rgba(20,20,20,.05);
	--p-furn-l: rgba(20,20,20,.55); --p-name: #141414; --p-hatch: rgba(40,90,40,.35); --p-floor: #ece6da;
}
.vb .tag { background: #141414; color: #ece6da; }
.vb .r.is-on .floor { fill: rgba(252,71,23,.16); }
.vb .r.is-on .name { fill: var(--orange); }
.vb__card .card img, .vb__card .todo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; margin-bottom: 20px; }
.vb__card .todo { color: var(--orange); border-color: rgba(252,71,23,.6); }
.vb__card h3 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1; margin: 0 0 12px; }
.vb__card p { margin: 0 0 14px; }
.vb__card .kicker { margin-bottom: 8px; }
.lnk { font-weight: 800; text-decoration: none; color: var(--orange); }
.card { animation: fade .45s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* C — écran partagé */
.vc { grid-template-columns: 1.35fr 1fr; padding: 72px 0 0; gap: 0; align-items: stretch; --p-floor: transparent; }
.vc__photos { position: relative; min-height: calc(100vh - 72px); overflow: hidden; }
.vc__photos figure { position: absolute; inset: 0; margin: 0; }
.vc__photos img, .vc__photos .todo { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.vc__photos figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 120px var(--pad) 40px; background: linear-gradient(transparent, rgba(0,0,0,.8)); }
.vc__photos h3 { font-size: clamp(34px, 4.4vw, 64px); font-weight: 800; letter-spacing: -.035em; line-height: .95; margin: 0 0 12px; }
.vc__photos figcaption p { margin: 0; max-width: 520px; }
.vc__photos figcaption .kicker { margin-bottom: 10px; }
.vc__side { padding: 40px var(--pad); display: flex; flex-direction: column; justify-content: center; }
.vc .r.is-on .floor { fill: var(--orange); }
.vc .r.is-on .name, .vc .r.is-on .num { fill: #fff; }
.vc .r.is-on .floor--garden { fill: var(--orange); }
.legend--inline { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 18px; }
.legend--inline a { grid-template-columns: 26px 1fr; }
.legend--inline em { display: none; }
.legend--inline span { font-size: 14px; }

@media (max-width: 900px) {
	.va, .vb, .vc { grid-template-columns: 1fr; }
	.vb__card { order: 2; }
	.vc__photos { min-height: 62vh; }
}

/* ——— Visite complète ——— */
.tour { overflow: hidden; height: 100vh; height: 100svh; }
.tour .top { background: linear-gradient(to bottom, rgba(0,0,0,.7), transparent); }
.tour__count { margin: 0 0 0 auto; font-weight: 800; font-size: 14px; letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.tour__count #n { color: var(--orange); }
.tour__bar { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 60; background: rgba(255,255,255,.08); }
.tour__bar i { display: block; height: 100%; width: 0; background: var(--orange); transition: width .6s cubic-bezier(.2,.7,.2,1); }
.tour__stage { position: fixed; inset: 0; }
.step { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility 0s .9s; }
.step.is-on { opacity: 1; visibility: visible; transition: opacity .9s ease; }
.step img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 9s linear; }
.step.is-on img { transform: scale(1.0); }
.step::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,0) 55%); pointer-events: none; }
.todo--full { width: 100%; height: 100%; border-radius: 0; font-size: 18px; background: repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 2px, transparent 2px 16px), #10170f; }
.step__cap { position: absolute; z-index: 2; left: var(--pad); bottom: clamp(90px, 12vh, 120px); max-width: min(620px, 55vw); }
.step__cap h1 { font-size: clamp(40px, 6.4vw, 96px); margin-bottom: 14px; }
.step__cap p { margin: 0; font-size: clamp(16px, 1.4vw, 20px); }
.step__cap .kicker { margin-bottom: 12px; }
.step.is-on .step__cap > * { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.step.is-on .step__cap > :nth-child(2) { animation-delay: .08s; }
.step.is-on .step__cap > :nth-child(3) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.tour__map {
	position: fixed; z-index: 40; right: var(--pad); bottom: 96px; width: clamp(220px, 24vw, 360px);
	background: rgba(11,11,13,.72); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
	backdrop-filter: blur(8px); --p-floor: transparent; --p-bg: #121214;
}
.tour__map .name { font-size: .9px; }
.tour__map .num, .tour__map .furn-l, .tour__map .meta { display: none; }
.tour__map .r.is-on .floor { fill: rgba(252,71,23,.28); }
.tour__map .r.is-on .floor--garden { fill: rgba(252,71,23,.28); }
.you { transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.you__dot { fill: var(--orange); stroke: #fff; stroke-width: .12; }
.you__halo { fill: rgba(252,71,23,.35); animation: halo 1.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes halo { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.tour__nav { position: fixed; z-index: 40; right: var(--pad); bottom: 28px; display: flex; gap: 10px; }
.tour__btn {
	width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--line); background: rgba(11,11,13,.6);
	color: var(--ink); font: 800 20px/1 'Montserrat', sans-serif; cursor: pointer; transition: background .2s, transform .2s;
}
.tour__btn:hover { background: rgba(255,255,255,.1); transform: translateY(-2px); }
.tour__btn--next { background: var(--orange); border-color: var(--orange); }
.tour__btn--next:hover { background: #ff5a2e; }
.tour__btn:disabled { opacity: .3; cursor: default; transform: none; }
@media (max-width: 720px) {
	.tour__map { left: 16px; right: auto; top: 70px; bottom: auto; width: 170px; padding: 8px; }
	.step__cap { max-width: none; right: var(--pad); bottom: 100px; }
	.tour__nav { left: var(--pad); right: var(--pad); justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
	.step img, .step.is-on img { transform: none; transition: none; }
	.you, .you__halo { transition: none; animation: none; }
}

/* corrections après rendu */
.essais .top { background: rgba(11,11,13,.94); backdrop-filter: blur(8px); }
.vc__side .tag { align-self: flex-start; }
.plan-svg .meta path { transform: scale(.7); transform-box: fill-box; transform-origin: center; }

/* ——— Des pièces vivantes (photo dans la pièce, dérive lente, silhouettes) ——— */
.plan-svg .ph { opacity: 1; transform-box: fill-box; transform-origin: center; animation: drift 18s ease-in-out infinite alternate; }
.plan-svg .ph--left { animation-duration: 21s; animation-delay: -4s; }
.plan-svg .ph--right { animation-duration: 16s; animation-delay: -9s; }
.plan-svg .ph--top { animation-duration: 24s; animation-delay: -2s; }
@keyframes drift { from { transform: translate(-.5px, -.3px) scale(1.0); } to { transform: translate(.5px, .3px) scale(1.06); } }
.plan-svg .tint { fill: var(--p-tint, rgba(0,0,0,.45)); transition: fill .45s; pointer-events: none; }
.plan-svg .r.is-on .tint { fill: var(--p-tint-on, rgba(0,0,0,.08)); }
.plan-svg .leaves { fill: url(#herbe); }
.plan-svg .floor--garden { fill: #16301a; }
.plan-svg .who circle { fill: var(--p-who, #fff); stroke: var(--orange); stroke-width: .1; opacity: .9; pointer-events: none; }
.plan-svg .r--right .floor { fill: #0b1060; }

/* A : plan de nuit — les photos passent en bleu, la pièce survolée reprend ses couleurs */
.va .plan-svg .ph { filter: grayscale(1) contrast(1.1); }
.va .plan-svg .r.is-on .ph { filter: none; }
.va { --p-tint: rgba(18,30,140,.55); --p-tint-on: rgba(18,30,140,.0); }
/* B : plan papier — photos sépia fondues dans le papier, en couleur au survol */
.vb .plan-svg .ph { filter: sepia(.6) grayscale(.4); opacity: .55; transition: opacity .45s, filter .45s; }
.vb .plan-svg .r.is-on .ph { filter: none; opacity: 1; }
.vb { --p-tint: rgba(236,230,218,.35); --p-tint-on: rgba(0,0,0,0); --p-who: #141414; }
.vb .plan-svg .name { paint-order: stroke; stroke: #ece6da; stroke-width: .18; }
/* C : couleur pleine, contour orange sur la pièce active */
.vc { --p-tint: rgba(0,0,0,.55); --p-tint-on: rgba(0,0,0,.1); }
.vc .r.is-on .floor { fill: transparent; }
.vc .plan-svg .r.is-on .wall-on { stroke: var(--orange); }
.va .r.is-on .floor, .vb .r.is-on .floor { fill: transparent; }
@media (prefers-reduced-motion: reduce) { .plan-svg .ph { animation: none; } .plan-svg .who { display: none; } }
.plan-svg .hl { fill: none; stroke: transparent; stroke-width: .22; transition: stroke .3s; pointer-events: none; }
.plan-svg .r.is-on .hl { stroke: var(--orange); }
.vd { grid-template-columns: minmax(260px, 400px) 1fr; }
.vd h2 { font-size: clamp(28px, 3vw, 44px); margin-bottom: 18px; }
.vd__q { color: var(--ink-2); font-size: 15px; }
.vd__q b { color: var(--ink); } .vd__q em { color: var(--orange); font-style: normal; font-weight: 800; }
.vd__plan { margin: 0; background: #f4f1ec; border-radius: var(--radius); padding: 18px; }
.vd__plan img { width: 100%; }
@media (max-width: 900px) { .vd { grid-template-columns: 1fr; } }

/* Plan réel (v0.5) : le tracé du DWG par-dessus les zones, les deux étages, l'escalier qui les relie */
.plan-svg .base { color: var(--p-wall, #f4f1ec); pointer-events: none; }
.plan-svg .link { fill: none; stroke: var(--orange); stroke-width: .09; stroke-dasharray: .35 .25; pointer-events: none; }
.plan-svg .meta .floor-t { fill: var(--p-name, #f4f1ec); font-size: .8px; font-weight: 800; letter-spacing: .02em; }
.plan-svg .lbl { pointer-events: none; }
.plan-svg .name--s { font-size: .48px; }
.plan-svg .lbl .name { paint-order: stroke; stroke: var(--p-bg, #0b0b0d); stroke-width: .2; stroke-linejoin: round; }
.plan-svg .r .floor { stroke: none; }
.vb .plan-svg .lbl .name { stroke: #ece6da; }
