@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #f6f5f0;
  --paper: #fffefa;
  --ink: #242c27;
  --muted: #596159;
  --line: #e1e3da;
  --forest: #263a31;
  --soft-green: #e9efdf;
  --highlight: #d8f39e;
  --max: 1536px;
  font-family: "Instrument Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, a { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, #panorama:focus-visible {
  outline: 3px solid #527745;
  outline-offset: 4px;
}
a { color: inherit; }
h1, h2, p { margin: 0; }
img { display: block; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.svg-staging { position: fixed; top: 0; left: -10000px; visibility: hidden; pointer-events: none; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .page {
  width: min(100% - clamp(32px, 8vw, 112px), var(--max));
  margin-inline: auto;
}
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wordmark { display: flex; align-items: center; gap: 11px; font-size: 1rem; font-weight: 650; }
.mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--forest);
  color: #f0f5df;
}
.mark .icon { width: 23px; height: 23px; }
.demo-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .105em;
  font-weight: 650;
  font-size: .68rem;
}
.demo-label > span { width: 6px; height: 6px; border-radius: 50%; background: #79915e; }

.heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(21px, 3vw, 38px) 25px;
}
h1 {
  font: 400 clamp(3.1rem, 6vw, 5.2rem)/.97 "Instrument Serif", Georgia, serif;
  letter-spacing: -.035em;
  padding-bottom: 3px;
}
.heading p { color: var(--muted); margin-top: 9px; font-size: clamp(.88rem, 1vw, 1rem); line-height: 1.45; }
.room-position { display: flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--muted); font-size: .83rem; padding-bottom: 3px; }
.room-position .icon { width: 16px; height: 16px; }

.tour-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(264px, 25vw, 340px); gap: 23px; align-items: start; padding-bottom: 50px;}
.viewer-shell {
  position: relative;
  isolation: isolate;
  height: clamp(430px, 56vh, 650px);
  min-width: 0;
  overflow: hidden;
  background: #353a33;
  border-radius: 17px;
}
.viewer-shell:fullscreen, .viewer-shell.immersive-fallback {
  width: 100%;
  height: 100%;
  height: 100dvh;
  border-radius: 0;
}
.viewer-shell.immersive-fallback { position: fixed; inset: 0; z-index: 10; }
body.immersive { overflow: hidden; }
#panorama { width: 100%; height: 100%; touch-action: none; background: #353a33; }
#panorama:focus-visible { outline: 3px solid var(--highlight); outline-offset: -4px; }
#panorama.on-item .pnlm-grab { cursor: pointer; }
#panorama .pnlm-load-box, #panorama .pnlm-error-msg { display: none; }
.zone-projection { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.room-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.viewer-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 12px;
  padding: 24px;
  color: white;
  background: #202b255c;
}
.viewer-state span { font-size: .93rem; max-width: 39ch; line-height: 1.5; }
.viewer-state button { min-height: 44px; background: #f1f4e9; color: var(--forest); font-weight: 650; border: 0; padding-inline: 15px; border-radius: 9px; }
.viewer-guide {
  position: absolute;
  bottom: 17px;
  left: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  background: #202822c9;
  color: #fffdf6;
  border: 1px solid #fff3;
  border-radius: 9px;
  pointer-events: none;
  font-size: .75rem;
}
.viewer-guide .icon { width: 16px; height: 16px; }
.viewer-controls { position: absolute; bottom: 17px; right: 17px; display: flex; align-items: center; gap: 6px; }
.glass-button {
  display: grid;
  place-items: center;
  height: 44px;
  width: 44px;
  padding: 0;
  color: #fffdf6;
  background: #202822df;
  border: 1px solid #fff4;
  border-radius: 9px;
}
.glass-button:not(:disabled):hover { background: #17251b; }
.glass-button:focus-visible { outline-color: var(--highlight); }
.glass-button:disabled { opacity: .47; }
.zoom-controls { display: flex; }
.zoom-controls > button:first-child { border-radius: 9px 0 0 9px; }
.zoom-controls > button:last-child { border-radius: 0 9px 9px 0; border-left: 0; }
.debug {
  position: absolute;
  top: 13px;
  left: 13px;
  background: #17251be8;
  padding: 8px 10px;
  border-radius: 7px;
  color: white;
  font: 12px/1.4 ui-monospace, monospace;
  pointer-events: none;
}

.tour-hotspot { width: 44px; height: 44px; }
.tour-hotspot button, .tour-hotspot a {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  position: relative;
  text-decoration: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: white;
}
.tour-hotspot button::before, .tour-hotspot a::before {
  content: "";
  position: absolute;
  inset: var(--marker-inset, 4px);
  background: #26382d;
  border: 1px solid #fffad9c7;
  box-shadow: 0 2px 12px #0005;
  border-radius: inherit;
}
.tour-hotspot .icon, .tour-hotspot img { position: relative; z-index: 1; }
.tour-hotspot img { width: 29px; height: 29px; object-fit: contain; border-radius: 50%; }
.tour-hotspot button:hover::before, .tour-hotspot a:hover::before { background: #476044; }
.tour-hotspot button:focus-visible, .tour-hotspot a:focus-visible { outline-color: var(--highlight); }
.hotspot-label {
  position: absolute;
  top: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 8px;
  border-radius: 5px;
  background: #202822e3;
  color: white;
  font: 550 .74rem/1.2 "Instrument Sans", sans-serif;
  white-space: nowrap;
  pointer-events: none;
}

.inventory {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-self: stretch;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: clamp(18px, 2vw, 27px);
  min-width: 0;
}
.inventory-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 9px; }
.inventory-icon {
  width: 39px;
  height: 39px;
  border-radius: 10px;
  background: var(--soft-green);
  color: var(--forest);
  display: grid;
  place-items: center;
}
.item-count {
  background: #f0f1e8;
  color: #455447;
  border-radius: 100px;
  padding: 4px 9px;
  font-size: .74rem;
  white-space: nowrap;
}
.inventory h2 { font-size: clamp(1.22rem, 2vw, 1.56rem); line-height: 1.15; font-weight: 650; letter-spacing: -.043em; }
.inventory-intro { margin-top: 8px; color: var(--muted); font-size: .87rem; line-height: 1.45; }
.item-list { margin-block: 17px; }
.item-row {
  display: grid;
  width: 100%;
  grid-template-columns: 46px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  border-radius: 0;
  text-align: left;
  padding: 10px 4px;
}
.item-row:last-child { border-bottom-color: transparent; }
.item-row:hover, .item-row.is-highlighted {
  background: #f1f5e9;
  border-color: #e4eadb;
  border-radius: 8px;
}
.item-thumb {
  width: 46px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  overflow: hidden;
  color: #50634f;
  background: #e9ece1;
}
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-name, .item-ref { display: block; overflow-wrap: anywhere; }
.item-name { font-size: .87rem; font-weight: 650; }
.item-ref { color: var(--muted); font-size: .71rem; margin-top: 3px; }
.item-row > .icon { width: 16px; height: 16px; color: #536459; }
.zone-control {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  cursor: pointer;
  font-weight: 600;
  font-size: .85rem;
}
.zone-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { position: relative; flex: 0 0 38px; height: 22px; border: 1px solid #7e8c80; border-radius: 99px; background: #d9ddd4; }
.switch-track::before {
  content: "";
  border-radius: 50%;
  background: white;
  width: 14px;
  height: 14px;
  position: absolute;
  top: 3px;
  left: 3px;
  box-shadow: 0 1px 2px #19221d55;
  transition: transform .18s ease;
}
.zone-control input:checked + .switch-track { background: #3f5d44; border-color: #3f5d44; }
.zone-control input:checked + .switch-track::before { transform: translateX(16px); }
.zone-control input:focus-visible + .switch-track { outline: 3px solid #527745; outline-offset: 4px; }
.inventory-notice { color: #70491e; font-size: .8rem; line-height: 1.45; overflow-wrap: anywhere; }

.rooms { grid-column: 1 / -1; }
.rooms h2 { font-size: 1.04rem; font-weight: 650; margin-bottom: 10px; }
.room-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; }
.room-card {
  min-height: 73px;
  display: grid;
  grid-template-columns: 71px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 11px;
  padding: 8px 12px 8px 8px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: .9rem;
  font-weight: 650;
}
.room-card:hover { background: #eff1e8; }
.room-card[aria-current="true"] { border-color: #536b51; background: #edf1e6; }
.room-thumb { width: 71px; height: 55px; display: grid; place-items: center; color: var(--forest); background: var(--soft-green); border-radius: 6px; overflow: hidden; }
.room-thumb img { width: 100%; height: 100%; object-fit: cover; }
.room-card > .icon { width: 17px; height: 17px; color: #526655; }
footer { font-size: .73rem; color: var(--muted); padding-block: 24px 26px; }
footer a { text-underline-offset: .16em; }

#item-dialog {
  max-width: min(430px, calc(100% - 36px));
  width: 100%;
  max-height: calc(100% - 36px);
  overscroll-behavior: contain;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  overflow: auto;
  box-shadow: 0 20px 65px #17231e45;
}
#item-dialog::backdrop { background: #202922a1; }
.close-dialog {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
}
.close-dialog:hover { background: var(--soft-green); }
.item-image { width: 100%; max-height: 250px; object-fit: cover; }
.item-body { padding: 23px; }
.item-body h2 { font: 400 2.6rem/1 "Instrument Serif", Georgia, serif; letter-spacing: -.022em; padding-right: 28px; }
.item-reference { margin-top: 12px; color: var(--forest); font-size: .86rem; font-weight: 650; }
.item-brand { margin-top: 5px; color: var(--muted); font-size: .86rem; }
#item-description { margin-top: 11px; color: var(--muted); font-size: .94rem; line-height: 1.5; }
.item-body p:empty { display: none; }
.item-link { display: inline-flex; margin-top: 14px; min-height: 44px; align-items: center; gap: 8px; color: var(--forest); font-weight: 650; text-underline-offset: .2em; }
.item-link .icon { width: 17px; height: 17px; }

@media (max-width: 890px) {
  .tour-layout { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .inventory { padding: 17px 19px; }
  .viewer-shell { height: clamp(380px, 54vh, 540px); }
  .inventory-heading { margin-bottom: 10px; }
  .inventory-icon { width: 33px; height: 33px; }
  .item-list { margin-block: 9px; }
}

@media (max-width: 520px) {
  .header-inner { min-height: 56px; }
  .heading { padding-block: 21px 17px; align-items: start; }
  .heading p { margin-top: 6px; }
  .room-position { padding-top: 5px; }
  .room-position .icon { display: none; }
  .viewer-shell { height: clamp(340px, 51svh, 440px); border-radius: 13px; }
  .viewer-guide { left: 8px; bottom: 9px; padding: 8px; font-size: .69rem; }
  .viewer-guide .icon { display: none; }
  .viewer-controls { right: 8px; bottom: 9px; gap: 4px; }
  .room-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 105px), 1fr)); gap: 6px; }
  .room-card { grid-template-columns: minmax(0, 1fr) 16px; gap: 6px; padding: 6px; font-size: .8rem; min-height: 46px; }
  .room-thumb { grid-column: 1 / -1; width: 100%; height: 42px; }
  .room-card > .icon { width: 14px; height: 14px; }
}

@media (max-width: 365px) {
  .viewer-guide { display: none; }
  .room-position { font-size: .72rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}

/* tour.js gère l’affichage du chargement et des erreurs. */
#panorama .pnlm-load-box,
#panorama .pnlm-error-msg {
    display: none !important;
}

/* Place le message au-dessus des calques du panorama. */
#viewer-state {
    z-index: 3;
}

body.viewer-seul {
    margin: 0;
    overflow: hidden;
}

.viewer-seul #viewer-shell {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
}