/* =================================================================
   Eric's Digital Orchidarium — visual style
   The orchids ARE the scene now: each hotspot renders the real photo
   as a soft, feathered circular bloom hanging in the panorama, not a
   marker hovering over it.  Background is muted so blooms dominate.
   ================================================================= */

:root {
  --ink:        #1f1a13;
  --ink-soft:   #5b5040;
  --paper:      #faf6ee;
  --paper-2:    #f0e8d6;
  --gold:       #b88840;
  --gold-soft:  #d9b56e;
  --gold-glow:  rgba(255, 220, 150, 0.85);
  --rule:       rgba(31, 26, 19, 0.18);

  --serif-en:   "Cormorant Garamond", "Times New Roman", serif;
  --serif-zh:   "Noto Serif SC", "Source Han Serif SC", serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0d0a;
  color: var(--ink);
  font-family: var(--serif-zh);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Pannellum container -------------------------------- */

#panorama {
  position: fixed;
  inset: 0;
  z-index: 0;
  /* Darkened + slightly desaturated so the orchid blooms read as
     the foreground subject rather than competing detail. */
  filter: brightness(0.62) saturate(0.78) contrast(1.05);
  transition: filter 0.6s ease;
}

/* Hide Pannellum's default UI chrome — we draw our own */
.pnlm-load-box,
.pnlm-controls-container,
.pnlm-zoom-controls,
.pnlm-fullscreen-toggle-button,
.pnlm-orientation-button,
.pnlm-about-msg { display: none !important; }

.pnlm-hotspot-base { z-index: 5; }
.pnlm-hotspot {
  background: none !important;
  border: none !important;
  width: 320px !important;
  height: 320px !important;
  margin: -160px 0 0 -160px !important;
  cursor: pointer;
}

/* ---------- The orchid bloom hotspot --------------------------- */
/*
   Each hotspot is a circular cut-out of the real orchid photo with
   feathered edges — it reads as a soft bloom placed in the scene.
   On hover, the bloom scales up slightly and casts a warm glow.
*/

.orchid-bloom {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.orchid-bloom * { pointer-events: none; }

.orchid-bloom .photo {
  position: absolute;
  inset: 6%;
  background-size: cover;
  background-position: center;
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle at 50% 50%,
    rgba(0,0,0,1)    32%,
    rgba(0,0,0,0.95) 46%,
    rgba(0,0,0,0.55) 64%,
    transparent      82%);
          mask-image: radial-gradient(circle at 50% 50%,
    rgba(0,0,0,1)    32%,
    rgba(0,0,0,0.95) 46%,
    rgba(0,0,0,0.55) 64%,
    transparent      82%);
  filter: drop-shadow(0 22px 36px rgba(0, 0, 0, 0.65));
  transition: transform 0.55s cubic-bezier(.2,.7,.2,1),
              filter    0.55s ease;
}

.orchid-bloom .glow {
  position: absolute;
  inset: -2%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    rgba(255, 220, 150, 0.10) 0%,
    rgba(255, 220, 150, 0.04) 38%,
    transparent 60%);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.orchid-bloom .ring {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 1px solid rgba(217, 181, 110, 0);
  transition: inset 0.5s ease, border-color 0.5s ease;
}
.orchid-bloom .name {
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%) translateY(8px);
  background: rgba(15, 12, 8, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--paper);
  padding: 7px 16px 8px;
  border-radius: 2px;
  border-left: 2px solid var(--gold);
  white-space: nowrap;
  font-family: var(--serif-zh);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.16em;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.4s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.orchid-bloom .name .en {
  display: block;
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.05em;
  opacity: 0.7;
  margin-top: 2px;
  font-weight: 300;
}

/* Idle: a subtle slow breathing so the bloom feels alive */
.orchid-bloom .photo {
  animation: bloomBreathe 7s ease-in-out infinite;
}
@keyframes bloomBreathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.025); }
}

/* Hover: lift, glow, name */
.pnlm-hotspot:hover .orchid-bloom .photo {
  animation: none;
  transform: scale(1.08);
  filter: drop-shadow(0 28px 44px rgba(255, 220, 150, 0.55))
          drop-shadow(0 0 24px rgba(255, 220, 150, 0.35));
}
.pnlm-hotspot:hover .orchid-bloom .glow { opacity: 1; }
.pnlm-hotspot:hover .orchid-bloom .ring {
  inset: -2%;
  border-color: rgba(217, 181, 110, 0.6);
}
.pnlm-hotspot:hover .orchid-bloom .name {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Splash --------------------------------------------- */

.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(184, 136, 64, 0.12) 0%, transparent 60%),
    linear-gradient(180deg, #1a1611 0%, #0d0b08 100%);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.splash.is-hidden { opacity: 0; visibility: hidden; }
.splash-mark {
  width: 60px; height: 60px;
  color: var(--gold-soft);
  margin-bottom: 28px;
  animation: splashFloat 3s ease-in-out infinite;
}
@keyframes splashFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.splash-zh {
  font-family: var(--serif-zh);
  font-size: 30px;
  font-weight: 300;
  letter-spacing: 0.5em;
  margin-right: -0.5em;
}
.splash-en {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.25em;
  opacity: 0.6;
  margin-top: 12px;
}
.splash-meta {
  font-family: var(--serif-zh);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.22em;
  opacity: 0.45;
  margin-top: 32px;
  margin-bottom: 36px;
}
.splash-enter {
  font-family: var(--serif-zh);
  background: transparent;
  color: var(--gold-soft);
  border: 1px solid var(--gold-soft);
  padding: 14px 48px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.4em;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(.7,0,.3,1);
  position: relative;
  overflow: hidden;
}
.splash-enter::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold-soft);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(.7,0,.3,1);
  z-index: 0;
}
.splash-enter:hover::before { transform: scaleX(1); }
.splash-enter:hover { color: #1a1611; }
.splash-enter .zh,
.splash-enter .en { position: relative; z-index: 1; }
.splash-enter .en {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.2em;
  margin-left: 18px;
  opacity: 0.85;
}
.splash-foot {
  position: absolute;
  bottom: 36px;
  font-family: var(--serif-zh);
  font-size: 11px;
  letter-spacing: 0.18em;
  opacity: 0.35;
}

/* ---------- HUD: title + audio ------------------------ */

.hud {
  position: fixed;
  top: 24px;
  left: 32px;
  right: 32px;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  color: var(--paper);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.hud-title { display: flex; flex-direction: column; line-height: 1; }
.hud-title .zh {
  font-family: var(--serif-zh);
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.4em;
  margin-right: -0.4em;
}
.hud-title .en {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.1em;
  opacity: 0.7;
  margin-top: 6px;
}

.hud-controls {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.now-playing {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--paper);
  opacity: 0.5;
  white-space: nowrap;
  min-width: 130px;
  text-align: right;
}
.now-playing .label-zh {
  display: block;
  font-family: var(--serif-zh);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.3em;
  opacity: 0.85;
  margin-bottom: 2px;
}

.audio-btn {
  width: 44px; height: 44px;
  background: rgba(15, 12, 8, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(217, 181, 110, 0.35);
  color: var(--gold-soft);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, border-color 0.25s;
}
.audio-btn:hover {
  background: rgba(184, 136, 64, 0.25);
  border-color: var(--gold-soft);
}
.audio-btn svg { width: 22px; height: 22px; display: none; }
.audio-btn[data-state="on"]  .ic-on  { display: block; }
.audio-btn[data-state="off"] .ic-off { display: block; }

.hud-hint {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  color: var(--paper);
  font-family: var(--serif-zh);
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.2em;
  display: flex;
  gap: 14px;
  align-items: center;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  opacity: 0.8;
  transition: opacity 0.6s ease;
}
.hud-hint.is-faded { opacity: 0; }
.hud-hint .dot { opacity: 0.4; }

/* ---------- Bottom thumbnail strip --------------------------- */

.strip {
  position: fixed;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(15, 12, 8, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(217, 181, 110, 0.22);
  border-radius: 60px;
  max-width: calc(100vw - 80px);
  overflow-x: auto;
  scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }

.strip-thumb {
  flex: none;
  width: 48px; height: 48px;
  border-radius: 50%;
  background-color: var(--paper-2);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1),
              border-color 0.3s ease;
  padding: 0;
}
.strip-thumb:hover {
  transform: translateY(-4px) scale(1.1);
  border-color: var(--gold-soft);
}
.strip-thumb.is-current {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 136, 64, 0.25),
              0 0 18px var(--gold-glow);
}
.strip-thumb .strip-name {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 12, 8, 0.92);
  color: var(--paper);
  padding: 6px 12px;
  border-radius: 2px;
  border-left: 2px solid var(--gold);
  font-size: 12px;
  font-family: var(--serif-zh);
  letter-spacing: 0.14em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.strip-thumb .strip-name::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(15, 12, 8, 0.92);
}
.strip-thumb:hover .strip-name { opacity: 1; }

/* ---------- Footer captions + compass ------------------------ */

.hud-foot {
  position: fixed;
  bottom: 18px;
  left: 32px;
  right: 32px;
  z-index: 28;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  color: var(--paper);
  pointer-events: none;
}
.caption {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.4;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  max-width: 50%;
}
.compass {
  width: 56px; height: 56px;
  color: var(--paper);
  opacity: 0.85;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}
#compassNeedle {
  transform-origin: 40px 40px;
  transition: transform 0.1s linear;
}

/* ---------- Detail card ------------------------------------- */

.card {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 92vw;
  background: var(--paper);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.6s cubic-bezier(.7,.05,.2,1);
  box-shadow: -28px 0 80px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.card.is-open { transform: translateX(0); }
.card-close {
  position: absolute;
  top: 22px; right: 22px;
  width: 38px; height: 38px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 20px;
  font-family: var(--serif-en);
  cursor: pointer;
  border-radius: 50%;
  z-index: 10;
  transition: background 0.25s, transform 0.4s, color 0.25s;
}
.card-close:hover {
  background: var(--ink);
  color: var(--paper);
  transform: rotate(90deg);
}
.card-photo {
  position: relative;
  width: 100%;
  height: 320px;
  flex: none;
  background-color: var(--paper-2);
  background-size: cover;
  background-position: center;
}
.card-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(250, 246, 238, 0.92) 100%);
}
.card-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 44px 44px;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
.card-body::-webkit-scrollbar { width: 6px; }
.card-body::-webkit-scrollbar-thumb {
  background: var(--rule);
  border-radius: 3px;
}
.card-eyebrow {
  display: inline-block;
  font-family: var(--serif-en);
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--gold);
  padding: 4px 10px 3px;
  border-radius: 1px;
  margin-bottom: 16px;
}
.card-eyebrow:empty { display: none; }
.card-name {
  font-family: var(--serif-en);
  font-style: italic;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  color: var(--ink);
}
.card-name-zh {
  font-family: var(--serif-zh);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.16em;
  margin-top: 4px;
  color: var(--ink);
}
.card-sci {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  margin: 14px 0 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.card-meta {
  display: grid;
  grid-template-columns: 80px 1fr;
  row-gap: 10px;
  column-gap: 16px;
  font-size: 14px;
  margin-bottom: 30px;
}
.card-meta dt {
  font-family: var(--serif-en);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  align-self: center;
}
.card-meta dd {
  font-family: var(--serif-zh);
  font-weight: 400;
  color: var(--ink);
  font-size: 14px;
}
.card-section {
  font-family: var(--serif-zh);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--ink-soft);
  margin-bottom: 16px;
  padding-left: 22px;
  position: relative;
}
.card-section::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 14px; height: 1px;
  background: var(--gold);
}
.card-facts {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card-facts li {
  font-family: var(--serif-zh);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink);
  padding-left: 22px;
  position: relative;
}
.card-facts li::before {
  content: "❋";
  position: absolute;
  left: 0;
  top: 4px;
  color: var(--gold);
  font-size: 11px;
}

/* ---------- Mobile ------------------------------------------- */

@media (max-width: 720px) {
  .hud { left: 16px; right: 16px; top: 16px; }
  .hud-title .zh { font-size: 18px; }
  .now-playing { display: none; }
  .hud-hint { font-size: 10px; gap: 6px; top: auto; bottom: 156px; }
  .hud-foot { left: 16px; right: 16px; bottom: 14px; }
  .compass  { width: 48px; height: 48px; }
  .caption  { font-size: 9px; max-width: 60%; }
  .strip    { bottom: 64px; padding: 10px 14px; gap: 8px; }
  .strip-thumb { width: 40px; height: 40px; }
  .pnlm-hotspot { width: 240px !important; height: 240px !important; margin: -120px 0 0 -120px !important; }
  .card { width: 100vw; }
  .card-photo { height: 240px; }
  .card-body { padding: 20px 24px 32px; }
  .card-name { font-size: 24px; }
  .card-name-zh { font-size: 20px; }
}
