:root { color-scheme: dark; font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: linear-gradient(180deg,#0f1720,#1b2a36); color: #f6efe4; }
.topbar { position: absolute; z-index: 8; top: 0; left: 0; right: 0; padding: 13px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: linear-gradient(180deg,#16222eea,#243647c7); backdrop-filter: blur(8px); box-shadow: 0 10px 28px rgba(0,0,0,.18); }
.identity { display: flex; flex-direction: column; gap: 2px; }
.identity strong { font-family: Georgia,serif; font-size: 21px; letter-spacing: .025em; }
.kicker { font-size: 10px; font-weight: 650; letter-spacing: .17em; color: #e8c898; }
.top-actions { display:flex; align-items:center; gap: 16px; font-size: 12px; color: #ded4c6; }
button { cursor: pointer; font: inherit; color: #171b1e; border: 0; border-radius: 9px; padding: 10px 15px; background: linear-gradient(180deg,#e0bf8e,#c89d63); font-weight: 600; box-shadow: 0 2px 12px rgba(0,0,0,.12); }
button:hover { background: linear-gradient(180deg,#eccd9d,#d9ab6f); }
main, a-scene { display: block; width: 100%; height: 100%; }
.help { position: absolute; z-index: 7; top: 90px; left: 24px; width: min(390px, calc(100vw - 48px)); border: 1px solid #c7ab835c; border-radius: 16px; padding: 22px; background: linear-gradient(180deg,#1a2835f2,#213445eb); box-shadow: 0 18px 55px rgba(0,0,0,.32); }
.help h1 { font-family: Georgia,serif; margin: 0 0 12px; font-size: 25px; }
.help p { line-height: 1.5; font-size: 14px; color: #ddd5c9; }
.help strong { color: #f7e7c7; }
.hidden { display: none !important; }
.detail { position:fixed; z-index:15; inset:0; background:rgba(8,12,17,.82); backdrop-filter: blur(5px); display:grid; place-items:center; padding:24px; }
.detail-content { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(320px,1fr); width:min(1220px,100%); max-height:92vh; position:relative; background:linear-gradient(180deg,#1b2733,#243442); border:1px solid rgba(201,167,121,.35); border-radius:18px; overflow:hidden; box-shadow: 0 24px 70px rgba(0,0,0,.34); }
.detail-close { position:absolute; z-index:2; right:12px; top:12px; border-radius:50%; width:38px; height:38px; padding:0; }
.detail-media { position:relative; min-height:420px; display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; gap:14px; background:linear-gradient(180deg,#0d1218,#111923); padding:18px; }
.detail-media img, .detail-media video { display:block; width:auto; height:auto; max-width:100%; max-height:calc(90vh - 150px); object-fit:contain; }
.detail-media img[hidden], .detail-media video[hidden] { display:none; }
.detail-copy { padding:42px 34px 28px; overflow:auto; background:linear-gradient(180deg,rgba(255,248,237,.04),rgba(255,248,237,.02)); }
.detail-copy h2 { font: 27px/1.17 Georgia,serif; margin:11px 0 24px; }
.detail-copy dl { display:grid; grid-template-columns:90px 1fr; gap:9px 10px; font-size:14px; line-height:1.35; }
.detail-copy dt { color:#bcb0a0; }
.detail-copy dd { margin:0; color:#fff1dd; overflow-wrap:anywhere; }
.detail-copy p { font-size:15px; line-height:1.55; color:#e2dbd0; }
@media(max-width:740px){ .identity strong{font-size:16px}.topbar{padding:11px 12px}.top-actions{gap:7px}#status{max-width:105px;font-size:10px}.help{top:75px;left:12px;width:calc(100vw - 24px);padding:16px}.detail{padding:8px}.detail-content{grid-template-columns:1fr;max-height:98vh;overflow:auto}.detail-media{min-height:220px;max-height:50vh}.detail-media img,.detail-media video{max-height:45vh}.detail-copy{padding:20px}.detail-copy h2{font-size:21px} }

/* Consultation haute résolution : zoom, déplacement et accès à l'original. */
.zoom-stage { position:relative; flex:1 1 auto; min-height:340px; display:flex; align-items:center; justify-content:center; overflow:hidden; cursor:zoom-in; touch-action:none; border-radius:14px; background:linear-gradient(180deg,#111922,#0c1219); border:1px solid rgba(202,168,122,.14); }
.zoom-stage[hidden], .zoom-tools[hidden] { display:none !important; }
.zoom-stage img { width:auto; height:auto; max-width:calc(100% - 32px); max-height:calc(90vh - 190px); object-fit:contain; user-select:none; pointer-events:none; transform-origin:center center; will-change:transform; filter: drop-shadow(0 8px 24px rgba(0,0,0,.30)); }
.zoom-stage img[hidden] { display:none; }
.zoom-stage.dragging { cursor:grabbing !important; }
.zoom-tools { position:relative; z-index:3; display:flex; align-items:center; justify-content:flex-start; gap:8px; border-radius:12px; background:rgba(20,31,42,.92); padding:10px 12px; box-shadow:0 8px 24px rgba(0,0,0,.22); flex-wrap:wrap; width:100%; border:1px solid rgba(202,168,122,.18); }
.zoom-tools button, .zoom-tools a { font:600 13px/1.2 system-ui,sans-serif; border:1px solid rgba(208,172,122,.28); color:#faecd8; background:#2b3c4d; padding:9px 11px; border-radius:8px; text-decoration:none; white-space:nowrap; }
.zoom-tools button:hover, .zoom-tools a:hover { background:#425a71; }
.zoom-tools button:disabled { cursor:default; opacity:.4; }
.zoom-tools #zoomValue { min-width:54px; font-variant-numeric:tabular-nums; text-align:center; font-weight:650; color:#fff4dc; }
@media(max-width:740px){.zoom-tools{gap:5px;padding:8px 9px}.zoom-tools button,.zoom-tools a{font-size:12px;padding:7px 8px}.zoom-tools #zoomValue{min-width:45px}.zoom-stage{min-height:250px}.zoom-stage img{max-height:38vh;}}

/* Architecture v2 : navigation dans les galeries et pagination. */
.topbar { padding-bottom: 12px; }
.room-nav { position:absolute; top:74px; left:0; right:0; z-index:8; display:flex; gap:7px; padding:10px 20px; justify-content:center; flex-wrap:wrap; background:linear-gradient(180deg,rgba(24,36,49,.92),rgba(29,44,59,.70)); backdrop-filter:blur(6px); box-shadow: 0 6px 20px rgba(0,0,0,.10); }
.room-nav button { border:1px solid rgba(214,177,126,.33); padding:7px 11px; background:#243748; color:#f6ead6; font-size:12px; }
.room-nav button.active { background:linear-gradient(180deg,#ddbd8b,#c49b62); color:#121a24; border-color:#e6c58c; }
.room-nav button:hover { background:#43536a; color:white; }
.room-nav button.active:hover { background:#d8ae70; color:#121a24; }
.paging { position:absolute; z-index:8; bottom:18px; left:50%; transform:translateX(-50%); display:flex; align-items:center; gap:12px; background:rgba(25,38,51,.94); border:1px solid rgba(211,175,126,.42); padding:8px 14px; border-radius:14px; box-shadow:0 10px 26px rgba(0,0,0,.22); white-space:nowrap; }
.paging span { font-size:13px; font-variant-numeric:tabular-nums; }
.paging button { padding:8px 12px; font-size:12px; }
.paging button:disabled { opacity:.45; cursor:default; }
.help { top:148px; }
@media(max-width:850px){
 .room-nav{top:67px;padding:7px;gap:4px;justify-content:flex-start;overflow-x:auto;flex-wrap:nowrap;white-space:nowrap;scrollbar-width:thin;}
 .room-nav button{flex:0 0 auto;font-size:11px;padding:7px 9px;}
 .help{top:124px;}
 .paging{bottom:9px;gap:6px;padding:6px;max-width:96vw;}
 .paging button{padding:7px 8px;}
}

.detail-copy .kicker { color:#e7c792; }
.detail-copy h2 { color:#fff4e4; }
.detail-copy p { max-width: 62ch; }


/* V4 — Présentation historique du hall, sans modifier les galeries V3. */
#hallIntroButton { border-color:rgba(236,198,139,.65); background:#6b4c2f; color:#fff0d6; }
#hallIntroButton:hover { background:#8b6540; }
.intro-overlay { position:fixed; z-index:14; inset:0; display:flex; align-items:center; justify-content:center; padding:22px; background:rgba(6,11,17,.78); backdrop-filter:blur(5px); }
.intro-card { position:relative; width:min(1050px,100%); max-height:min(90vh,900px); overflow-y:auto; padding:34px 42px; background:linear-gradient(145deg,#233547,#162634); color:#f5ebdd; border:1px solid rgba(217,181,129,.5); border-radius:18px; box-shadow:0 22px 70px rgba(0,0,0,.46); }
.intro-close { position:absolute; top:15px; right:15px; width:39px; height:39px; padding:0; border-radius:50%; }
.intro-eyebrow { color:#e7bd85; font-size:11px; font-weight:700; letter-spacing:.19em; margin-right:48px; }
.intro-card h2 { font: normal clamp(28px,4vw,43px)/1.1 Georgia,serif; margin:14px 0 18px; color:#fff2df; }
.intro-card h2 span { color:#dfbe8c; font-size:.66em; white-space:nowrap; }
.intro-lead { font: clamp(17px,2vw,21px)/1.5 Georgia,serif; max-width:780px; color:#eae0d2; margin-bottom:20px; }
.intro-separator { height:1px; background:linear-gradient(90deg,#bb8c51,rgba(187,140,81,0)); margin:22px 0 26px; }
.intro-grid { display:grid; grid-template-columns:1fr 1fr; gap:32px; }
.intro-section h3 { font:normal 24px Georgia,serif; color:#f0d4ab; margin:0 0 15px; }
.intro-section p { color:#e2ded7; font-size:15px; line-height:1.7; margin:0 0 14px; }
.intro-timeline { padding:0; margin:0; list-style:none; display:grid; gap:9px; }
.intro-timeline li { display:grid; grid-template-columns:100px 1fr; align-items:start; gap:10px; border-left:2px solid #c7a473; padding:7px 0 8px 14px; font-size:14px; line-height:1.45; }
.intro-timeline b { color:#f0c789; font-variant-numeric:tabular-nums; }
.intro-timeline span { color:#f4eadd; }
.intro-principle { border-left:3px solid #d3ab73; padding:9px 14px; background:rgba(237,207,161,.07); border-radius:2px 8px 8px 2px; }
.intro-footer { display:flex; justify-content:space-between; gap:18px; align-items:center; margin-top:22px; border-top:1px solid rgba(211,174,125,.25); padding-top:18px; }
.intro-footer p { font-size:12px; line-height:1.45; color:#c5c6c9; max-width:420px; margin:0; }
.intro-actions { display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; }
.intro-actions button { font-size:13px; }
@media(max-width:740px) {
  .intro-overlay { padding:8px; }
  .intro-card { padding:29px 20px; max-height:96vh; }
  .intro-grid { grid-template-columns:1fr; gap:22px; }
  .intro-footer { flex-direction:column; align-items:flex-start; }
  .intro-actions { justify-content:flex-start; }
}

/* V5 — Hall épuré, sans table ; portrait du corpus au fond de la perspective. */
#timelineButton { background:#385366; color:#fff3e0; border:1px solid rgba(232,196,145,.5); }
#timelineButton:hover { background:#506d7e; }
.intro-hero { display:grid; grid-template-columns:minmax(0,1fr) 154px; align-items:center; gap:28px; }
.intro-hero-copy { min-width:0; }
.intro-hero h2 { margin-bottom:14px; }
.intro-hero .intro-lead { margin-bottom:0; }
.intro-portrait-button { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:8px; width:154px; min-height:182px; padding:9px; background:#162432; color:#eacda3; border:1px solid #c3a173; box-shadow:0 7px 20px rgba(0,0,0,.22); cursor:pointer; }
.intro-portrait-button img { display:block; max-width:128px; max-height:148px; width:auto; height:auto; object-fit:contain; }
.intro-portrait-button img[hidden] { display:none; }
.intro-portrait-button small { font-size:10px; font-weight:650; letter-spacing:.11em; }
.intro-portrait-button:disabled { cursor:default; opacity:.65; }
.intro-portrait-button #hallPortraitFallback { font-size:13px; text-align:center; }
.intro-portrait-button #hallPortraitFallback[hidden] { display:none; }
.timeline-overlay { position:fixed; z-index:16; inset:0; display:grid; place-items:center; padding:20px; background:rgba(7,12,17,.83); backdrop-filter:blur(5px); }
.timeline-card { position:relative; max-height:88vh; width:min(890px,100%); padding:33px 37px; overflow:auto; border:1px solid rgba(209,171,117,.4); border-radius:18px; background:linear-gradient(145deg,#263a4b,#172633); box-shadow:0 22px 70px #0007; }
.timeline-card h2 { font:normal clamp(26px,3vw,42px)/1.1 Georgia,serif; margin:16px 0 18px; }
.timeline-card p { font-size:15px; line-height:1.65; color:#e8e0d6; max-width:72ch; }
.timeline-years { display:flex; gap:10px; flex-wrap:wrap; margin:23px 0; }
.timeline-years button { padding:11px 13px; font-size:14px; border:1px solid rgba(224,183,122,.45); background:#35495b; color:#f9e8cc; }
.timeline-years button:hover { background:#526e82; }
.timeline-hint { font-size:12px !important; color:#b7c1c8 !important; border-top:1px solid rgba(238,207,161,.2); padding-top:14px; }
@media(max-width:740px) {
  .intro-hero { grid-template-columns:1fr; gap:16px; }
  .intro-portrait-button { width:145px; }
  .timeline-card { padding:28px 18px; }
  .timeline-years { gap:6px; }
  .timeline-years button { padding:9px; }
}

.guide-panel { width:min(580px, calc(100% - 32px)); padding:24px; border:1px solid #ac8b61; border-radius:14px; background:#1b2936; color:#f6efe4; }
.guide-panel::backdrop { background:#0a1119cc; }
.guide-panel h2 { margin-top:0; font-family:Georgia,serif; }
.guide-panel p { line-height:1.65; }
.guide-status:not(:empty) { position:absolute; z-index:9; bottom:76px; right:16px; padding:10px 14px; border-radius:8px; background:#1b2936; color:#f6efe4; }
@media(max-width:740px) {
  .top-actions button { padding:7px 6px; }
  .topbar { gap:5px; }
}
