/* ─────────────────────────────────────────────────────────────────────
   Luzern 3D – App Styles
   Einbinden im CMS-Head (zusätzlich zu style-cms.css):
     <link rel="stylesheet" href="./luzern-app.css">
──────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Futura PT";
  src: url('./font/futura-pt_book.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Futura PT";
  src: url('./font/futura-pt_medium.woff2') format('woff2');
  font-weight: 450;
  font-style: normal;
  font-display: swap;
}

/* Standalone: Hintergrund und Scroll; im CMS nicht nötig */
html,
body:has(> #luzern-app) {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #c2d8ec; /* sky horizon — fills Safari overscroll rubber-band gap */
}

body:has(> #luzern-app) {
  overflow-x: hidden;
  overflow-y: scroll; /* body scrolls; #canvas-container stays fixed behind it */
}

/* ── Intro-Screen ────────────────────────────────────────────────── */
#intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 56px;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

body.intro-active #info-panel { opacity: 0; }
#intro.hidden { opacity: 0; }

#intro-content { max-width: 600px; width: 100%; }

#intro-title {
  color: #fff;
  margin: 0 0 12px;
}

#intro-body {
  color: rgba(255,255,255,0.85);
  margin: 0 0 28px;
}

#intro-slot {
  position: relative;
  height: 52px;
}
#intro-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  transition: opacity 0.5s ease;
}
#intro-loading-bar-wrap {
  width: 200px;
  height: 2px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px;
  overflow: hidden;
}
#intro-loading-bar {
  height: 100%;
  width: 0%;
  background: rgba(255,255,255,0.80);
  border-radius: 2px;
  transition: width 0.3s ease;
}

#scroll-hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  color: rgba(255,255,255,0.95);
  opacity: 0;
  transition: opacity 0.6s ease;
}
#scroll-hint svg { flex-shrink: 0; width: 26px; height: 26px; }
#scroll-hint.visible { opacity: 1; }

#scroll-hint.pulsing {
  animation: pulse-hint 1.8s ease-in-out infinite;
}
@keyframes pulse-hint {
  0%, 100% { opacity: 1;   transform: translateY(0); }
  50%       { opacity: 0.5; transform: translateY(4px); }
}

@media (max-width: 768px) {
  #intro { padding: 32px 24px 32px 46px; align-items: center; justify-content: center; }
}

/* ── Outro-Screen ────────────────────────────────────────────────── */
#outro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 56px;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
#outro.hidden { opacity: 0; }

#outro-content { max-width: 600px; width: 100%; }

#outro-title {
  color: #fff;
  margin: 0 0 12px;
}

#outro-body {
  color: rgba(255,255,255,0.85);
  margin: 0;
}

#outro-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
  margin-top: 24px;
}

@media (max-width: 768px) {
  #outro-links { grid-template-columns: 1fr; }
}
#outro-links .default_icon {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
}
#outro:not(.hidden) #outro-links .default_icon,
#outro:not(.hidden) .survey-btn,
#outro:not(.hidden) #outro-survey-send,
#outro:not(.hidden) #outro-survey-text {
  pointer-events: auto;
}
#outro-links .default_icon:hover { color: #fff; }

@media (max-width: 768px) {
  #outro { padding: 32px 24px 32px 46px; }
}

/* ── Grundstruktur ───────────────────────────────────────────────── */
#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0;
  transition: opacity 2.5s ease;
}

#scroll-space {
  position: relative;
  height: 900vh; /* 9 Segmente: 1× Überblick + 4× Räume + 4× Verkehr */
  z-index: 1;
  pointer-events: none;
}


/* ── Scroll-Navigation ───────────────────────────────────────────── */
#nav-wrapper {
  position: fixed;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#scroll-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  width: 28px;
  overflow: visible; /* 48px touch targets extend beyond the 28px visual capsule */
}

#exit-btn-inner {
  position: relative;
  width: 48px;  /* touch target */
  height: 48px; /* touch target */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.40);
  border: 0.5px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  flex-shrink: 0;
  transition: color 0.2s ease, background 0.2s ease;
  margin-top: 10px;
}
#exit-btn-inner svg { width: 12px; height: 12px; }
#exit-btn-inner:hover,
#exit-btn-inner.onboarding { color: #fff; background: rgba(0,0,0,0.60); }

#exit-btn-inner::after {
  content: 'Erlebnis verlassen';
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.40);
  border: 0.5px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 450;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
#exit-btn-inner:hover::after,
#exit-btn-inner.onboarding::after { opacity: 1; }

#scroll-nav-dots {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  width: 100%;
}

.nav-step {
  width: 48px;  /* touch target — overflows visual capsule by 10px each side */
  height: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  padding: 0;
  position: relative;
}
.nav-step::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.40);
  border: 0.5px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 450;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.nav-step:hover::after { opacity: 1; }

/* Kapiteltrennung: Abstand vor dem zweiten und dritten Hauptkapitel */
.nav-step[data-step="1"],
.nav-step[data-step="5"] { margin-top: 10px; }

.nav-dot {
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  border: none;
  transition: background 0.3s, transform 0.3s;
  box-shadow: 0 0 3px 1px rgba(0,0,0,0.35);
}
.nav-main .nav-dot { width: 6px; height: 6px; }
.nav-sub  .nav-dot { width: 4px; height: 4px; }

.nav-step.past   .nav-dot { background: rgba(255,255,255,0.60); }
.nav-step.active .nav-dot { background: #fff; transform: scale(1.4); }


/* ── Map-Pins ──────────────────────────────────────────────────── */
.icon-pin {
  position: relative;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.6s ease;
}

.icon-pin__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(-50%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.icon-pin__leader {
  position: absolute;
  left: 50%;
  bottom: 50%;
  height: 1.5px;
  width: 0;
  transform-origin: left center;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: -1;
}

.icon-pin__bubble {
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;   /* Kartenpin-Form */
  transform: rotate(-45deg);
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-pin__bubble svg,
.icon-pin__bubble img {
  width: 24px;
  height: 24px;
  transform: rotate(45deg);
  stroke: none;
  fill: white;
}

.icon-pin__stem {
  width: 2px;
  height: 12px;
  background: #333;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Farbvarianten pro Verkehrsträger */
.icon-pin--bus        .icon-pin__bubble { background: #302ae8; }
.icon-pin--bus        .icon-pin__stem   { background: #302ae8; }
.icon-pin--velo       .icon-pin__bubble { background: #009c56; }
.icon-pin--velo       .icon-pin__stem   { background: #009c56; }
.icon-pin--miv        .icon-pin__bubble { background: #E52C4D; }
.icon-pin--miv        .icon-pin__stem   { background: #E52C4D; }
.icon-pin--verbot     .icon-pin__bubble { background: #E52C4D; }
.icon-pin--verbot     .icon-pin__stem   { background: #E52C4D; }
.icon-pin--crossing   .icon-pin__bubble { background: #D49500; }
.icon-pin--crossing   .icon-pin__stem   { background: #D49500; }
.icon-pin--parking    .icon-pin__bubble { background: #E52C4D; }
.icon-pin--parking    .icon-pin__stem   { background: #E52C4D; }


/* ── Info-Panel (Fade-Overlay) ─────────────────────────────────── */
#info-panel {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 500px;
  padding: 120px 40px 60px;
  background: none;
  z-index: 10;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#info-panel.fading { opacity: 0; }
#info-panel.hidden { opacity: 0; transition: none; pointer-events: none; }

/* Gradient grösser als Panel – unabhängig von Textbreite */
#info-panel::before {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 1100px;
  height: 75vh;
  background: radial-gradient(
    ellipse 100% 100% at 100% 115%,
    rgba(0,0,0,0.78) 0%,
    rgba(0,0,0,0.78) 40%,
    rgba(0,0,0,0.18) 70%,
    transparent 82%
  );
  z-index: -1;
  pointer-events: none;
}

#info-badge {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
#info-badge.hidden { display: none; }

.info-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.info-badge-icon svg { width: 22px; height: 22px; stroke: none; fill: white; }

#info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  pointer-events: auto;
}

#info-title {
  margin: 0;
  color: #fff;
  max-width: none;
  min-height: auto;
}

#info-chevron {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.40);
  border: 0.5px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  flex-shrink: 0;
  pointer-events: auto;
  transition: transform 0.3s ease, color 0.2s ease, background 0.2s ease;
  padding: 0;
}
#info-chevron:hover { color: #fff; background: rgba(0,0,0,0.60); }
#info-panel.expanded #info-chevron { transform: rotate(180deg); }

/* Body-Wrap: collapsed by default */
#info-body-wrap {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  pointer-events: none;
}
#info-panel.expanded #info-body-wrap {
  max-height: 300px;
  opacity: 1;
  pointer-events: auto;
}

#info-body {
  margin: 10px 0 0;
  color: rgba(255,255,255,0.92);
  max-width: none;
}

#info-link {
  margin-top: 16px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  pointer-events: auto;
  display: none;
}
#info-link.visible { display: inline-flex; }
#info-link:hover { color: #fff; }

/* .default_icon .icon im dunklen Kontext: kein heller Hover-Kreis */
#info-link .icon,
#outro-links .default_icon .icon {
  color: inherit;
}
#info-link:hover .icon,
#outro-links .default_icon:hover .icon {
  background-color: rgba(255,255,255,0.15);
}

@keyframes chevron-ripple {
  0%   { box-shadow: 0 0 0 0px rgba(255,255,255,0.45); }
  60%  { box-shadow: 0 0 0 10px rgba(255,255,255,0.0); }
  100% { box-shadow: 0 0 0 0px rgba(255,255,255,0.0); }
}

#info-chevron.pulsing {
  animation: chevron-ripple 2s ease-out 3;
}

/* ── POI-Labels ──────────────────────────────────────────────────── */
.poi-label {
  padding: 4px 10px;
  border-radius: 6px;
  transition: opacity 0.6s ease;
  background: rgba(0,0,0,0.40);
  border: 0.5px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 18px;
  font-weight: 450;
  color: #fff;
  white-space: normal;
  text-align: center;
  pointer-events: none;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #nav-wrapper {
    display: contents; /* Wrapper verschwindet; Kinder erhalten eigene fixed-Positionierung */
  }

  #scroll-nav {
    position: fixed;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 120;
  }

  #exit-btn-inner {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: 16px;
    left: auto;
    margin-top: 0;
    z-index: 120;
  }

  #exit-btn-inner::after {
    left: auto;
    right: calc(100% + 8px);
  }

  #info-panel {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 55vh;
    padding: 0 24px max(28px, calc(env(safe-area-inset-bottom) + 24px)) 46px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: none;
  }

  #info-panel::before {
    width: 100%;
    height: 22vh;
    background: linear-gradient(
      to top,
      rgba(0,0,0,0.72) 0%,
      transparent 100%
    );
    transition: height 0.4s ease;
  }
  #info-panel.expanded::before {
    height: 55vh;
  }

  .poi-label { font-size: 16px; }
}

/* ─── Micro-Umfrage ──────────────────────────────────────────────────────── */

#outro-survey {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 0.5px solid rgba(255,255,255,0.15);
}

#outro-survey-question {
  color: rgba(255,255,255,0.85);
  margin: 0 0 14px;
}

#outro-survey-buttons {
  display: flex;
  gap: 12px;
}

.survey-btn {
  background: rgba(255,255,255,0.10);
  border: 0.5px solid rgba(255,255,255,0.20);
  border-radius: 999px;
  width: 44px;
  height: 44px;
  font-size: 22px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.survey-btn:hover  { background: rgba(255,255,255,0.20); }
.survey-btn.active { background: rgba(255,255,255,0.30); transform: scale(1.15); }
.survey-btn.hidden { display: none; }

#outro-survey-feedback {
  margin-top: 16px;
}
#outro-survey-feedback.hidden { display: none; }

#outro-survey-text {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 0.5px solid rgba(255,255,255,0.20);
  border-radius: 8px;
  color: #fff;
  padding: 10px 12px;
  font-family: inherit;
  resize: none;
  margin-bottom: 10px;
  box-sizing: border-box;
}
#outro-survey-text::placeholder { color: rgba(255,255,255,0.40); }

#outro-survey-send {
  background: rgba(255,255,255,0.15);
  border: 0.5px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  color: #fff;
  padding: 8px 20px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease;
}
#outro-survey-send:hover { background: rgba(255,255,255,0.25); }

#outro-survey-thanks {
  color: rgba(255,255,255,0.75);
  margin-top: 12px;
}
#outro-survey-thanks.hidden { display: none; }
