:root {
  --gold: #e8c27a;
  --gold-dim: rgba(232, 194, 122, 0.4);
  --ink: #f5ead2;
  --panel: rgba(10, 14, 26, 0.82);
  --panel-border: rgba(232, 194, 122, 0.35);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: #0d1220;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--ink);
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
#scene:active { cursor: grabbing; }

#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(4, 6, 12, 0.55) 100%);
}

/* ---------- cinematic letterbox ---------- */
.letterbox {
  position: fixed;
  pointer-events: none;
  left: 0;
  right: 0;
  height: 7.5vh;
  background: #05070d;
  z-index: 3;
  transition: transform 0.9s cubic-bezier(0.6, 0, 0.2, 1);
}
#letterboxTop { top: 0; transform: translateY(-100%); }
#letterboxBottom { bottom: 0; transform: translateY(100%); }
body.tour .letterbox { transform: translateY(0); }

/* ---------- loading ---------- */
#loading {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: radial-gradient(ellipse at 50% 40%, #1a2138 0%, #0b0f1c 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.2s ease;
}
#loading.done { opacity: 0; pointer-events: none; }
.loader-inner { text-align: center; }
.loader-kicker {
  font-family: 'Marcellus', serif;
  font-size: 10px;
  letter-spacing: 0.42em;
  color: var(--gold);
  opacity: 0.8;
  margin-bottom: 18px;
}
.loader-title {
  font-family: 'Marcellus', serif;
  font-size: clamp(40px, 7vw, 68px);
  color: #f5ead2;
  line-height: 1.05;
  text-shadow: 0 0 40px rgba(232, 194, 122, 0.25);
}
.loader-sub {
  font-style: italic;
  font-size: clamp(18px, 2.6vw, 26px);
  color: #c9b98f;
  margin-top: 6px;
}
.loader-line {
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 22px auto;
}
.loader-note {
  font-style: italic;
  font-size: 15px;
  color: #8b8064;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ---------- tour UI ---------- */
#tourUI { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
body:not(.tour) #tourUI { display: none; }

#kicker {
  position: absolute;
  bottom: 21%;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'Marcellus', serif;
  font-size: 11px;
  letter-spacing: 0.34em;
  color: var(--gold);
  opacity: 0;
  transition: opacity 0.6s ease;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}
#caption {
  position: absolute;
  bottom: 12.5%;
  left: 0;
  right: 0;
  padding: 0 6vw;
  text-align: center;
  font-size: clamp(20px, 2.6vw, 28px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.45;
  color: #f7efdc;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.85), 0 1px 3px rgba(0, 0, 0, 0.9);
  max-width: 760px;
  margin: 0 auto;
  opacity: 0;
  transition: opacity 0.4s ease;
}
#skipBtn {
  position: absolute;
  top: 9.5%;
  right: 3.2vw;
  pointer-events: auto;
  font-family: 'Marcellus', serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(10, 14, 26, 0.55);
  border: 1px solid var(--panel-border);
  padding: 11px 18px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
#skipBtn:hover { background: var(--gold); color: #171106; border-color: var(--gold); }
#skipBtn .arrow { margin-left: 6px; }

#progress {
  position: absolute;
  bottom: 7.5vh;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(245, 234, 210, 0.14);
}
#progressFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #b98a3e, var(--gold));
  box-shadow: 0 0 8px rgba(232, 194, 122, 0.7);
}

/* ---------- explore UI ---------- */
#exploreUI { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#exploreUI.hidden { display: none; }
#exploreTitle {
  position: absolute;
  top: 3.4vh;
  left: 3vw;
  pointer-events: auto;
}
#exploreTitle h1 {
  font-family: 'Marcellus', serif;
  font-weight: 400;
  font-size: clamp(20px, 2.4vw, 30px);
  letter-spacing: 0.06em;
  color: #f5ead2;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}
#exploreTitle p {
  font-style: italic;
  font-size: 15px;
  color: rgba(230, 216, 178, 0.85);
  margin-top: 4px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}
#exploreBtns {
  position: absolute;
  top: 3.4vh;
  right: 3vw;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: auto;
}
#exploreBtns button, #skipBtn {
  /* shared base */
}
#exploreBtns button {
  font-family: 'Marcellus', serif;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(10, 14, 26, 0.6);
  border: 1px solid var(--panel-border);
  padding: 10px 16px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.25s, color 0.25s;
}
#exploreBtns button:hover { background: var(--gold); color: #171106; border-color: var(--gold); }

#chips {
  position: absolute;
  bottom: 2.6vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 92vw;
  pointer-events: auto;
}
#chips button {
  font-family: 'Marcellus', serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e5d6b2;
  background: rgba(10, 14, 26, 0.62);
  border: 1px solid rgba(232, 194, 122, 0.3);
  padding: 8px 13px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
#chips button:hover { background: rgba(232, 194, 122, 0.2); border-color: var(--gold); }
#chips button.active { background: var(--gold); color: #171106; border-color: var(--gold); }

#hint {
  position: absolute;
  bottom: 2.9vh;
  left: 3vw;
  font-style: italic;
  font-size: 14px;
  color: rgba(230, 216, 178, 0.75);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  max-width: 240px;
  line-height: 1.5;
  pointer-events: none;
}

#infoCard {
  position: absolute;
  left: 3vw;
  bottom: 9.5vh;
  max-width: 350px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--gold);
  padding: 20px 22px 18px;
  backdrop-filter: blur(10px);
  pointer-events: auto;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
#infoCard.hidden { opacity: 0; transform: translateY(14px); pointer-events: none; }
#infoCard h2 {
  font-family: 'Marcellus', serif;
  font-weight: 400;
  font-size: 19px;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 9px;
  padding-right: 22px;
}
#infoCard p {
  font-size: 17.5px;
  line-height: 1.55;
  color: #e8ddc6;
}
#infoClose {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: #b7a67c;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
#infoClose:hover { color: var(--gold); }

/* ---------- about modal ---------- */
#aboutModal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(5, 7, 13, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
#aboutModal.hidden { display: none; }
.modal-inner {
  position: relative;
  max-width: 580px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-top: 3px solid var(--gold);
  padding: 34px 38px 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}
.modal-kicker {
  font-family: 'Marcellus', serif;
  font-size: 9px;
  letter-spacing: 0.38em;
  color: var(--gold);
  margin-bottom: 12px;
}
.modal-inner h2 {
  font-family: 'Marcellus', serif;
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 0.05em;
  color: #f5ead2;
  margin-bottom: 16px;
}
.modal-inner p {
  font-size: 18px;
  line-height: 1.6;
  color: #ddd1b4;
  margin-bottom: 13px;
}
.modal-inner p:last-child { margin-bottom: 0; }
#aboutClose {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: #b7a67c;
  font-size: 30px;
  cursor: pointer;
  line-height: 1;
}
#aboutClose:hover { color: var(--gold); }

@media (max-width: 760px) {
  #hint { display: none; }
  #infoCard { left: 3vw; right: 3vw; max-width: none; bottom: 12vh; }
  #exploreBtns { top: auto; bottom: 12vh; right: 3vw; flex-direction: column; }
  #chips { bottom: 2.2vh; max-width: 96vw; }
}
