:root {
  --bg-a: #f4f8ef;
  --bg-b: #cfe6df;
  --panel: #172119;
  --panel-soft: #223129;
  --text: #ebf6e8;
  --surface-text: #ebf6e8;
  --field-bg: rgba(255, 255, 255, 0.08);
  --field-fg: #ebf6e8;
  --accent-soft: #ffd9dd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  background: radial-gradient(circle at 15% 10%, #f8ffd9 0%, transparent 35%),
    linear-gradient(120deg, var(--bg-a), var(--bg-b));
  color: var(--text);
}

.stage {
  display: none;
  min-height: 100vh;
  padding: 14px;
}

body[data-stage="select"] .stage--select,
body[data-stage="tour"] .stage--tour {
  display: flex;
}

.stage--select {
  align-items: center;
  justify-content: center;
}

.stage--tour {
  flex-direction: column;
}

.landing {
  width: min(100%, 680px);
  padding: 24px;
  background: linear-gradient(180deg, var(--panel), var(--panel-soft));
  border-radius: 20px;
  text-align: left;
}

.landing-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.landing-header__text {
  flex: 1 1 auto;
  min-width: 0;
}

.landing-tagline {
  margin: 0 0 6px;
  font-size: 0.9rem;
  opacity: 0.85;
  white-space: nowrap;
}

.landing-credit {
  margin: 0 0 10px;
  font-size: 0.8rem;
  opacity: 0.7;
  white-space: nowrap;
}

.landing-mode {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 1px;
  font-size: 1.3rem;
  color: var(--accent-soft, #7ac74f);
}

.brand-logo {
  display: block;
  width: auto;
  max-width: 118px;
  flex: 0 0 auto;
  border-radius: 12px;
}

.brand-logo-link {
  display: inline-block;
  border-radius: 12px;
}

.brand-logo-link:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

.brand-logo-link:hover .brand-logo {
  filter: brightness(1.05);
}

.logo-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 6000;
}

.logo-modal:target {
  display: block;
}

.logo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 12, 0.78);
  backdrop-filter: blur(4px);
}

.logo-modal-content {
  position: relative;
  z-index: 1;
  width: min(90vw, 760px);
  margin: 6vh auto 0;
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(23, 33, 25, 0.96), rgba(34, 49, 41, 0.96));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.logo-modal-close {
  position: absolute;
  right: 10px;
  top: 6px;
  color: #f4fff8;
  text-decoration: none;
  font-size: 30px;
  line-height: 1;
}

.logo-modal-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

h1 {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 1px;
  font-size: 2.1rem;
  margin: 0 0 4px;
}

.subtitle {
  margin: 0 0 18px;
  opacity: 0.8;
}

.section-block {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
}

.section-block h2 {
  margin: 2px 0 10px;
  font-size: 1rem;
}

.viewer-help-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.viewer-help-list li {
  opacity: 0.95;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

select,
button {
  width: 100%;
  margin-top: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  padding: 8px 10px;
  font: inherit;
}

select {
  background: var(--field-bg);
  color: var(--field-fg);
}

button {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

button.primary {
  background: rgba(63, 189, 181, 0.28);
  border-color: rgba(63, 189, 181, 0.55);
}

.micro {
  margin: 8px 2px 0;
  font-size: 0.78rem;
  color: var(--accent-soft);
}

.viewer-wrap {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  border-radius: 20px;
  overflow: hidden;
  padding: 10px;
  background: rgba(11, 17, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.viewer-exit {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  width: auto;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(10, 16, 12, 0.82);
  font-size: 0.84rem;
}

/* Touch devices get no fullscreen affordance, including Pannellum's own control. */
@media (hover: none) and (pointer: coarse) {
  .pnlm-fullscreen-toggle-button {
    display: none !important;
  }
}

.hotspot-legend {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 40;
  max-width: min(220px, calc(100% - 32px));
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 16, 12, 0.82);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(8px);
  color: #f4fff8;
  font-size: 0.84rem;
  pointer-events: none;
}

.hotspot-legend__title {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.92;
}

.hotspot-legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hotspot-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  flex-shrink: 0;
}

.hotspot-legend__swatch--scene {
  background: #3fbdb5;
}

.hotspot-legend__swatch--graph {
  background: #e84855;
}

.hotspot-legend__swatch--image {
  background: #f7b538;
}

.hotspot-legend__swatch--text {
  background: #7ac74f;
}

.hotspot-legend__swatch--text-link {
  background: #8b5cf6;
}

/* Floating text panels are always visible, so hide their marker dot in the
   read-only viewer. The editor keeps the dot for repositioning/deletion. */
.hotspot-wrap--textPanel .hotspot-dot {
  display: none;
}

#viewer {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
}

@media (max-width: 768px) {
  .hotspot-legend {
    top: 12px;
    right: 12px;
    max-width: min(200px, calc(100% - 24px));
  }
}

.viewer-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  font-size: 1rem;
  color: #f4fff6;
  background: radial-gradient(circle at 20% 20%, rgba(232, 72, 85, 0.22), transparent 45%),
    linear-gradient(135deg, #0e1510, #1f2b24);
}

@media (max-width: 900px) {
  .stage {
    padding: 0;
  }

  .stage--select {
    padding: 14px;
  }

  .viewer-wrap {
    padding: 0;
    border: 0;
    border-radius: 0;
  }
}