/* ============================================================
   ONZE — Collection privée · Salle XI
   Palette: smoke #16120E · travertine #E4DACA · bronze #C6A15B
            oxblood #6E1F26 · lamplight #FFE7C4
   Type: Zodiak (display) · General Sans (body)
   ============================================================ */

:root {
  --smoke: #16120e;
  --smoke-2: #0f0c09;
  --trav: #e4daca;
  --trav-dim: #b9ad99;
  --bronze: #c6a15b;
  --bronze-dim: #8a7140;
  --oxblood: #6e1f26;
  --oxblood-bright: #96323c;
  --lamp: #ffe7c4;
  --font-display: 'Zodiak', 'Times New Roman', serif;
  --font-body: 'General Sans', -apple-system, 'Helvetica Neue', sans-serif;
  --ease-lux: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--smoke-2);
  color: var(--trav);
  font-family: var(--font-body);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

#stage {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
}

/* ---- static vignette over canvas ---- */
#veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(8, 6, 4, 0.55) 100%);
  z-index: 2;
}

/* ============ chrome ============ */
.chrome {
  position: fixed;
  z-index: 10;
  user-select: none;
}

#brand {
  top: 28px;
  left: 34px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#brand .word {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 26px;
  letter-spacing: 0.42em;
  color: var(--trav);
  text-indent: 0.06em;
}
#brand .sub {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.34em;
  color: var(--bronze);
  text-transform: uppercase;
}

#sound {
  top: 30px;
  right: 34px;
  background: none;
  border: none;
  color: var(--trav-dim);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px 2px;
  transition: color 0.4s;
}
#sound:hover, #sound:focus-visible { color: var(--bronze); }
#sound .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid currentColor; margin-left: 8px; vertical-align: 1px;
  transition: background 0.4s; }
#sound[aria-pressed="true"] .dot { background: var(--bronze); border-color: var(--bronze); }

/* brand & sound step aside while inspecting */
#brand, #sound { transition: opacity 0.5s var(--ease-lux); }
body.inspecting #brand,
body.inspecting #sound { opacity: 0; pointer-events: none; }

/* ============ numeral index ============ */
#index {
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 30px;
  align-items: baseline;
}
#index button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--trav-dim);
  opacity: 0.55;
  padding: 10px 4px;
  position: relative;
  transition: color 0.5s, opacity 0.5s, transform 0.5s var(--ease-lux);
}
#index button::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--oxblood-bright);
  transform: translateX(-50%) scale(0);
  transition: transform 0.4s var(--ease-lux);
}
#index button:hover, #index button:focus-visible { opacity: 1; color: var(--trav); }
#index button.active {
  opacity: 1;
  color: var(--bronze);
  transform: translateY(-3px);
}
#index button.active::after { transform: translateX(-50%) scale(1); }
#index button:focus-visible { outline: 1px solid var(--bronze); outline-offset: 3px; }

/* ============ progress thread ============ */
#thread {
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(198, 161, 91, 0.12);
}
#thread .fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--bronze-dim), var(--bronze));
  transition: none;
}

/* ============ placard ============ */
#placard {
  left: 34px;
  bottom: 64px;
  width: 300px;
  padding: 22px 24px 20px;
  background: linear-gradient(160deg, rgba(22, 18, 14, 0.82), rgba(15, 12, 9, 0.88));
  border: 1px solid rgba(198, 161, 91, 0.22);
  border-radius: 2px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease-lux), transform 0.6s var(--ease-lux);
  pointer-events: none;
}
#placard.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
#placard .eyebrow {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 10px;
}
#placard h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: 24px;
  line-height: 1.15;
  color: var(--trav);
  margin-bottom: 8px;
}
#placard .medium {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--trav-dim);
  margin-bottom: 12px;
}
#placard .note {
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(228, 218, 202, 0.8);
  margin-bottom: 14px;
}
#placard .hint {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--bronze);
  font-style: italic;
  margin-bottom: 16px;
}
#placard .inspect-btn {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--smoke);
  background: var(--bronze);
  border: none;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.35s;
}
#placard .inspect-btn:hover, #placard .inspect-btn:focus-visible { background: var(--lamp); }
#placard .inspect-btn:focus-visible { outline: 1px solid var(--lamp); outline-offset: 2px; }

/* ============ inspect bar ============ */
#inspect-bar {
  top: 0;
  left: 0;
  width: 100%;
  padding: 24px 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.55s var(--ease-lux), transform 0.55s var(--ease-lux);
  background: linear-gradient(180deg, rgba(10, 8, 6, 0.7), transparent);
}
#inspect-bar.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
#inspect-bar .title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 19px;
  color: var(--trav);
}
#inspect-bar .title .num {
  font-style: normal;
  font-size: 12px;
  color: var(--bronze);
  letter-spacing: 0.2em;
  margin-right: 14px;
}
#close-inspect {
  background: none;
  border: 1px solid rgba(198, 161, 91, 0.35);
  color: var(--trav);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  padding: 9px 16px;
  cursor: pointer;
  transition: border-color 0.35s, color 0.35s;
}
#close-inspect:hover, #close-inspect:focus-visible { border-color: var(--bronze); color: var(--bronze); }

/* ============ cursor chip ============ */
#chip {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--smoke);
  background: var(--lamp);
  padding: 6px 11px 5px 13px;
  border-radius: 999px;
  opacity: 0;
  transform: translate(14px, 14px) scale(0.85);
  transition: opacity 0.25s, transform 0.25s var(--ease-lux);
  white-space: nowrap;
}
#chip.show { opacity: 1; transform: translate(14px, 14px) scale(1); }

/* ============ hint ============ */
#hint {
  bottom: 34px;
  right: 34px;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--trav-dim);
  opacity: 0;
  transition: opacity 1.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}
#hint.show { opacity: 0.85; }
#hint .line {
  display: inline-block;
  width: 34px;
  height: 1px;
  background: var(--bronze-dim);
  animation: hintPulse 2.6s ease-in-out infinite;
}
@keyframes hintPulse { 0%,100% { transform: scaleX(0.5); opacity:.5 } 50% { transform: scaleX(1); opacity:1 } }

/* ============ preloader ============ */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--smoke-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  transition: opacity 1.1s var(--ease-lux);
}
#preloader.done { opacity: 0; pointer-events: none; }
#preloader .numeral {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(64px, 12vw, 120px);
  color: var(--trav);
  line-height: 1;
  min-height: 1em;
}
#preloader .label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--bronze);
}
#preloader .bar {
  width: 120px;
  height: 1px;
  background: rgba(198, 161, 91, 0.18);
  overflow: hidden;
}
#preloader .bar .fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--bronze);
  transition: width 0.4s ease;
}

/* ============ webgl fallback ============ */
#fallback {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 40px;
  background:
    radial-gradient(80% 60% at 50% 30%, rgba(198,161,91,0.08), transparent),
    var(--smoke-2);
}
#fallback.show { display: flex; }
#fallback h1 { font-family: var(--font-display); font-weight: 300; letter-spacing: .3em; font-size: 34px; }
#fallback p { max-width: 420px; color: var(--trav-dim); line-height: 1.6; font-size: 13px; }

/* ============ a11y ============ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
:focus-visible { outline-color: var(--bronze); }

/* ============ responsive ============ */
@media (max-width: 720px) {
  #brand { top: 20px; left: 20px; }
  #brand .word { font-size: 20px; }
  #sound { top: 20px; right: 20px; }
  #placard {
    left: 16px;
    right: 16px;
    width: auto;
    bottom: 76px;
    padding: 16px 18px 15px;
  }
  #placard h2 { font-size: 20px; }
  #placard .note { display: none; }
  #index { gap: 18px; bottom: 18px; }
  #index button { font-size: 13px; padding: 8px 3px; }
  #hint { display: none; }
  #chip { display: none; }
  #inspect-bar { padding: 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  #hint .line { animation: none; }
}
