/* ════════════════════════════════════════════════
   ALMOKI 3D — Minimal Style
   ════════════════════════════════════════════════ */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0806;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  color: #d4a23f;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  outline: none;
}

/* ── Globus-Leuchter (Floating Back-Button) ── */
#almoki-back-globe {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: #d4a23f;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.3s ease;
}
#almoki-back-globe:hover { transform: scale(1.1); }

.globe-orb {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(212, 162, 63, 0.55), rgba(212, 162, 63, 0.05) 70%);
  border: 1px solid rgba(212, 162, 63, 0.7);
  box-shadow: 0 0 24px rgba(212, 162, 63, 0.45), inset 0 0 12px rgba(212, 162, 63, 0.25);
  overflow: hidden;
}
.globe-grid {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(212, 162, 63, 0.45);
  animation: globe-spin 8s linear infinite;
}
.globe-grid::before, .globe-grid::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  border-top: 1px solid rgba(212, 162, 63, 0.3);
}
.globe-grid::before { top: 33%; }
.globe-grid::after  { top: 66%; }
.globe-grid-2 {
  animation-duration: 12s;
  animation-direction: reverse;
  transform: rotate(60deg);
}
@keyframes globe-spin {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(360deg); }
}

/* ── Pose-Editor Panel (mit ?pose=1) ── */
.pose-panel {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  width: 300px;
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(10, 8, 6, 0.92);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(212, 162, 63, 0.35);
  border-radius: 8px;
  color: #d4a23f;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  padding: 0.9rem;
  line-height: 1.4;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.pose-header { font-size: 13px; font-weight: 600; margin-bottom: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.pose-section { margin-bottom: 0.7rem; }
.pose-section label { display: block; margin-bottom: 0.25rem; opacity: 0.7; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.pose-section input,
.pose-section select,
.pose-section button {
  width: 100%;
  padding: 0.4rem 0.6rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(212,162,63,0.25);
  color: #d4a23f;
  font: inherit;
  border-radius: 4px;
  outline: none;
}
.pose-section button { cursor: pointer; transition: background 0.15s; }
.pose-section button:hover { background: rgba(212,162,63,0.15); }
.pose-section button.primary { background: rgba(212,162,63,0.2); border-color: #d4a23f; }
.pose-section button.primary:hover { background: rgba(212,162,63,0.35); }
.pose-current { background: rgba(212,162,63,0.08); padding: 0.5rem; border-radius: 4px; }
.pose-current strong { display: block; margin-bottom: 0.3rem; color: #f0c060; }
.pose-row { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.2rem; }
.pose-row span { width: 14px; opacity: 0.6; }
.pose-row input[type=range] { flex: 1; padding: 0; height: 14px; }
.pose-row input[type=number] { width: 70px; padding: 0.2rem 0.3rem; font-size: 10px; }
#pose-list { list-style: none; padding: 0; margin: 0; max-height: 200px; overflow-y: auto; }
#pose-list li { display: flex; gap: 0.3rem; margin-bottom: 0.25rem; }
#pose-list li button { flex: 1; text-align: left; }
#pose-list li button.del { flex: 0 0 28px; text-align: center; color: #d44; border-color: rgba(220,68,68,0.4); }
#pose-list li button.del:hover { background: rgba(220,68,68,0.2); }
.pose-empty { opacity: 0.5; font-style: italic; }

/* ── Glasmorphism-Pfeile zum Kamera-Schwenk ── */
.cam-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(212, 162, 63, 0.25);
  border-radius: 14px;
  color: #d4a23f;
  font-size: 30px;
  font-weight: 300;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  z-index: 100;
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.cam-arrow:hover {
  background: rgba(212, 162, 63, 0.12);
  border-color: rgba(212, 162, 63, 0.5);
}
.cam-arrow.active,
.cam-arrow:active {
  background: rgba(212, 162, 63, 0.22);
  transform: translateY(-50%) scale(0.96);
}
#cam-arrow-left  { left: 1rem; }
#cam-arrow-right { right: 1rem; }

/* ── Über-mich Overlay (erscheint nach Klick auf Mo) ── */
.about-overlay {
  position: fixed;
  left: 50%;
  bottom: 5rem;
  transform: translateX(-50%) translateY(20px);
  z-index: 105;
  width: min(90vw, 520px);
  padding: 1.8rem 2rem 1.6rem;
  background: rgba(10, 8, 6, 0.78);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(212, 162, 63, 0.4);
  border-radius: 14px;
  color: #d4a23f;
  box-shadow: 0 10px 40px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.about-overlay.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.about-eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.5rem;
}
.about-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.6rem 0;
  color: #f0c060;
}
.about-text {
  font-family: "Inter", sans-serif;
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0 0 0.8rem 0;
  color: rgba(212, 162, 63, 0.92);
}
.about-text-muted { color: rgba(212, 162, 63, 0.72); font-size: 0.85rem; }
.about-role {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0 0 1rem 0;
  color: rgba(212, 162, 63, 0.7);
}
.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(212, 162, 63, 0.18);
}
.about-links a {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: #d4a23f;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(212, 162, 63, 0.3);
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s;
}
.about-links a:hover {
  background: rgba(212, 162, 63, 0.15);
  border-color: rgba(212, 162, 63, 0.6);
}

/* Globaler Zurück-Button im Globus-Modus */
.globe-back {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 110;
  padding: 0.65rem 1.2rem;
  background: rgba(10, 8, 6, 0.7);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(212, 162, 63, 0.5);
  border-radius: 999px;
  color: #d4a23f;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.globe-back:hover {
  background: rgba(212, 162, 63, 0.2);
  transform: scale(1.04);
}
.globe-back[hidden] { display: none; }

/* Embedded-Page Overlay (Klick auf Frame → Kamera zoomt ran → iframe öffnet) */
.frame-iframe-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(10, 8, 6, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 1.5rem 1.5rem;
  animation: frame-iframe-fade 0.5s ease;
  pointer-events: auto;
}
.frame-iframe-overlay[hidden] { display: none; }
.frame-iframe-overlay iframe {
  width: 100%;
  height: 100%;
  max-width: 1400px;
  border: 1px solid rgba(212, 162, 63, 0.45);
  border-radius: 14px;
  background: #0a0806;
  box-shadow: 0 0 80px rgba(212, 162, 63, 0.18), 0 20px 60px rgba(0,0,0,0.6);
  user-select: auto;
  -webkit-user-select: auto;
}
@keyframes frame-iframe-fade {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.about-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid rgba(212, 162, 63, 0.3);
  border-radius: 50%;
  color: #d4a23f;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s ease;
}
.about-close:hover { background: rgba(212, 162, 63, 0.18); }

/* ── Fade-Out beim Verlassen — die Camera-Animation ist die räumliche Bewegung,
      das CSS macht nur den finalen Bildschirm-Übergang ── */
body.zoom-out-3d { overflow: hidden; }
body.zoom-out-3d #canvas {
  animation: room-fadeout 0.55s ease forwards;
}
@keyframes room-fadeout {
  0%   { opacity: 1; filter: blur(0); }
  100% { opacity: 0; filter: blur(10px); }
}
body.zoom-out-3d #almoki-back-globe,
body.zoom-out-3d .cam-arrow,
body.zoom-out-3d .globe-back,
body.zoom-out-3d #about-overlay,
body.zoom-out-3d #frame-iframe-overlay {
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

/* ── Loading-Screen ── erscheint sofort, fade-out wenn alle Assets bereit sind ── */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: radial-gradient(ellipse at center, #1a1208 0%, #0a0806 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s ease;
}
#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}
#loading-screen .loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
#loading-screen .loading-logo {
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-size: clamp(2.6rem, 7vw, 4rem);
  font-weight: 400;
  letter-spacing: 0.18em;
  color: #f0c060;
  background: linear-gradient(180deg, #f0c060 0%, #d4a23f 60%, #8a6420 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(212, 162, 63, 0.35));
  animation: loading-logo-pulse 2.4s ease-in-out infinite;
}
@keyframes loading-logo-pulse {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(212, 162, 63, 0.35)); }
  50%      { filter: drop-shadow(0 0 22px rgba(212, 162, 63, 0.7)); }
}
#loading-screen .loading-spinner {
  width: 38px;
  height: 38px;
  border: 2px solid rgba(212, 162, 63, 0.18);
  border-top-color: #d4a23f;
  border-radius: 50%;
  animation: loading-spin 1s linear infinite;
}
@keyframes loading-spin {
  to { transform: rotate(360deg); }
}
#loading-screen .loading-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(212, 162, 63, 0.7);
}

/* ── Mobile-Onboarding-Hint ── erscheint nur auf Mobile, ~3 Sekunden,
      zeigt dass man durch Touch-Drag umschauen kann ── */
.mobile-hint {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 5vw, 2.5rem);
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(10, 8, 6, 0.4) 0%, rgba(10, 8, 6, 0) 70%);
  opacity: 0;
  animation: hint-fade-in-out 5s ease forwards;
}
@keyframes hint-fade-in-out {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; }
}
.mobile-hint-arrow {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  color: rgba(212, 162, 63, 0.85);
  filter: drop-shadow(0 0 12px rgba(212, 162, 63, 0.6));
  animation: hint-arrow-bounce 1.2s ease-in-out infinite;
}
.mobile-hint-arrow-left  { animation-delay: 0s; }
.mobile-hint-arrow-right { animation-delay: 0.6s; }
@keyframes hint-arrow-bounce {
  0%, 100% { transform: translateX(0);    opacity: 0.6; }
  50%      { transform: translateX(-8px); opacity: 1;   }
}
.mobile-hint-arrow-right {
  animation-name: hint-arrow-bounce-right;
}
@keyframes hint-arrow-bounce-right {
  0%, 100% { transform: translateX(0);   opacity: 0.6; }
  50%      { transform: translateX(8px); opacity: 1;   }
}
.mobile-hint-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.mobile-hint-line {
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.4rem, 4.5vw, 1.9rem);
  color: #f0c060;
  text-shadow: 0 0 18px rgba(212, 162, 63, 0.5);
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
}
.mobile-hint-line-1 { animation: hint-line 5s ease forwards; }
.mobile-hint-line-2 { animation: hint-line 5s ease 1.5s forwards; }
@keyframes hint-line {
  0%   { opacity: 0; transform: translateY(6px); }
  15%  { opacity: 1; transform: translateY(0);   }
  82%  { opacity: 1; transform: translateY(0);   }
  100% { opacity: 0; transform: translateY(-4px); }
}
