:root {
  --bg: #f3f1ea;
  --surface: #ffffff;
  --text: #1b1e2b;
  --muted: #5c6070;
  --accent: #7a4fd8;
  --accent-dark: #6239c0;
  --line: #dcd8cc;
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: 0 max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px, env(safe-area-inset-left));
}

main, .top, .foot { max-width: 960px; margin: 0 auto; }

/* ---------- Kopf ---------- */
.top {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: max(14px, env(safe-area-inset-top)) 0 12px;
  font-size: 15px; font-weight: 600; color: var(--muted);
}
.top .kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .08em; font-weight: 750; }

/* ---------- 3D-Ansicht ---------- */
model-viewer {
  display: block;
  width: 100%;
  height: 60vh;
  height: 60svh;
  min-height: 340px;
  max-height: 720px;
  background: radial-gradient(ellipse at 50% 40%, #ffffff 0%, #ebe8de 100%);
  border-radius: var(--radius);
  --poster-color: transparent;
  position: relative;
}

/* AR-Button */
.ar-btn {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; width: calc(100% - 32px); max-width: 420px;
  padding: 12px 22px;
  border: 0; border-radius: 14px;
  background: var(--accent); color: #fff;
  font: 650 17px/1.25 var(--font); text-align: center;
  box-shadow: 0 6px 18px rgba(122, 79, 216, .35);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ar-btn:active { background: var(--accent-dark); transform: translateX(-50%) scale(.98); }
.ar-btn:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }

/* Ladeanzeige */
.progress {
  position: absolute; left: 16px; right: 16px; top: 14px;
  height: 5px; border-radius: 3px; background: rgba(122, 79, 216, .18); overflow: hidden;
  transition: opacity .4s;
}
.progress.done { opacity: 0; }
.progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* Hotspots */
.hotspot {
  display: block;
  width: 48px; height: 48px;          /* Touch-Ziel */
  padding: 0; border: 0; background: none;
  cursor: pointer; position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .3s;
}
.hotspot:not([data-visible]) { opacity: 0; pointer-events: none; }
.hotspot .dot {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  display: grid; place-items: center;
  font: 750 15px/1 var(--font);
}
.hotspot[aria-expanded="true"] .dot { background: var(--text); }
.hotspot .note {
  display: none;
  position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%);
  width: max-content; max-width: min(240px, 70vw);
  padding: 10px 14px; border-radius: 12px;
  background: var(--surface); color: var(--text);
  font: 550 15px/1.35 var(--font); text-align: left;
  box-shadow: 0 6px 20px rgba(27, 30, 43, .18);
}
.hotspot[aria-expanded="true"] .note { display: block; }
.hotspot:focus-visible .dot { outline: 3px solid var(--text); outline-offset: 2px; }

/* ---------- Fallback & Infos ---------- */
.fallback {
  margin: 14px 0 0; padding: 14px 18px; border-radius: 12px;
  background: #e9e3f8; color: #3d2a75; font-weight: 550;
}

.info { padding: 8px 2px 4px; }
.info h1 { font-size: 26px; line-height: 1.2; margin: 18px 0 8px; letter-spacing: -.01em; }
.info p { margin: 0 0 10px; max-width: 62ch; }
.info .hint { color: var(--muted); font-size: 15px; }

.foot {
  padding: 18px 2px 24px; margin-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}

@media (min-width: 720px) {
  body { font-size: 18px; }
  .info h1 { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
