:root {
  --bg: #f5ede1;
  --ink: #2b2622;
  --muted: #6d6358;
  --pill: rgba(233, 222, 205, .85);
  --pill-hover: #fff;
  --orange: #f57c14;
  --navy: #1f3a78;
  --badge-bg: #e1f4fd;
  --badge-line: #b9e3f7;
  --badge-ink: #2fa8e2;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  overflow-x: hidden;
}
a { color: inherit; }

#scene {
  position: fixed; left: 0; top: 0;
  display: block;
  touch-action: pan-y;
}
.scroll-space { height: 260vh; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 12px; left: 16px; right: 16px;
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  z-index: 20; pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-mode {
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: var(--ink);
  background: var(--pill); backdrop-filter: blur(8px);
  transition: transform .2s;
}
.nav-mode:hover { transform: rotate(-15deg); }
.nav-mode svg { width: 22px; height: 22px; }
.nav-cta {
  font: 700 15px/1 Outfit, sans-serif; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--orange);
  border: 0; border-radius: 999px; padding: 15px 26px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(245, 124, 20, .3);
  transition: transform .2s;
}
.nav-cta:hover { transform: translateY(-2px); }

/* ---------- Hero ---------- */
.hero {
  position: fixed; left: clamp(20px, 6vw, 110px); top: 50%;
  transform: translateY(-40%);
  z-index: 10; pointer-events: none;
  max-width: 480px;
}
.hero h1 {
  margin: 0;
  font: 800 clamp(56px, 7.6vw, 124px)/.92 Outfit, sans-serif;
  letter-spacing: -.01em;
}
.stamp {
  display: inline-block; margin: 10px 0 0 clamp(60px, 9vw, 150px);
  font: 400 clamp(14px, 1.5vw, 22px)/1 "Rubik Mono One", sans-serif;
  color: #fff; background: var(--navy);
  padding: 9px 14px 8px; transform: rotate(-4deg);
  box-shadow: 3px 3px 0 rgba(0,0,0,.12);
}
.hero p {
  margin: 26px 0 0; max-width: 360px;
  font-size: 17px; line-height: 1.55; color: var(--muted);
}
.hint {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 10; pointer-events: none;
  font: 600 13px/1 Outfit, sans-serif; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.hint i {
  width: 22px; height: 34px; border: 2px solid var(--muted); border-radius: 12px; position: relative;
}
.hint i::after {
  content: ""; position: absolute; left: 50%; top: 6px; width: 4px; height: 7px; margin-left: -2px;
  background: var(--muted); border-radius: 2px; animation: wheel 1.6s infinite;
}
@keyframes wheel { 0% { opacity: 1; transform: translateY(0) } 100% { opacity: 0; transform: translateY(10px) } }

.tip {
  position: fixed; z-index: 30; pointer-events: none;
  font: 600 13px/1 Outfit, sans-serif; color: #fff; background: #2b2622;
  padding: 8px 12px; border-radius: 8px; opacity: 0; transition: opacity .15s;
  transform: translate(14px, 14px); white-space: nowrap;
}
.speech-bubble {
  position: fixed; z-index: 25; pointer-events: none;
  max-width: min(240px, calc(100vw - 24px));
  padding: 10px 14px; border: 2px solid #2b2622; border-radius: 16px;
  background: #fffaf1; color: #2b2622;
  box-shadow: 0 5px 0 rgba(43, 38, 34, .16);
  font: 700 14px/1.35 Outfit, sans-serif; text-align: center;
  opacity: 0; visibility: hidden; transform: translate(-50%, -100%) scale(.9);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.speech-bubble::after {
  content: ""; position: absolute; left: calc(50% - 7px); bottom: -10px;
  width: 14px; height: 14px; background: #fffaf1;
  border-right: 2px solid #2b2622; border-bottom: 2px solid #2b2622;
  transform: rotate(45deg);
}
.speech-bubble.visible {
  opacity: 1; visibility: visible; transform: translate(-50%, -100%) scale(1);
}
/* Druckerkamera (Bild-in-Bild): Rahmen in HTML, das Bild selbst rendert app.js per Scissor in .pcam-view */
.pcam {
  position: fixed; right: 18px; bottom: 18px; z-index: 36;
  width: 350px; display: flex; flex-direction: column;
  border-radius: 14px; overflow: hidden;
  background: transparent; color: #e9e4dc;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 14px 34px rgba(0, 0, 0, .35);
  font: 600 13px/1.2 Outfit, sans-serif;
  transition: width .25s ease;
}
.pcam[hidden] { display: none; }
.pcam.big { width: min(620px, calc(100vw - 36px)); }
.pcam.away { opacity: 0; visibility: hidden; pointer-events: none; }
.pcam-bar, .pcam-status { background: #1d1b21; display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 12px; }
.pcam-led { width: 8px; height: 8px; border-radius: 50%; background: #ff4b3e; box-shadow: 0 0 6px #ff4b3e; animation: pcamLed 1.6s ease-in-out infinite; }
@keyframes pcamLed { 50% { opacity: .35; } }
.pcam-title { flex: 1; letter-spacing: .02em; }
.pcam-btn {
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px;
  display: grid; place-items: center;
  background: transparent; color: #b9b2a8; font: 400 22px/1 sans-serif; cursor: pointer;
}
.pcam-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pcam-btn:hover, .pcam-btn:focus-visible { background: rgba(255, 255, 255, .12); color: #fff; outline: 0; }
.pcam-btn[aria-pressed="true"] { color: var(--orange); }
.pcam-view { aspect-ratio: 4 / 3; background: transparent; border-top: 2px solid var(--orange); }
.pcam-status { flex-wrap: wrap; gap: 6px 10px; padding: 8px 12px 10px; font-weight: 500; }
.pcam-label { flex: 1 1 100%; }
.pcam-prog { flex: 1; display: flex; align-items: center; gap: 10px; }
.pcam-prog[hidden] { display: none; }
.pcam-prog i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .14); overflow: hidden; position: relative; }
.pcam-prog i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: var(--orange); border-radius: 3px; }
.pcam-prog b { font-weight: 700; min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }

/* Easter Egg: Terminal (5× auf den linken Monitor) */
.term {
  position: fixed; top: 14px; left: 50%; z-index: 40;
  width: min(440px, calc(100vw - 32px)); transform: translateX(-50%);
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
  padding: 9px 10px 9px 14px; border-radius: 10px;
  background: rgba(20, 22, 26, .94); color: #7ee787;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  font: 500 14px/1.4 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}
.term[hidden] { display: none; }
.term-prompt { color: #8ab4f8; white-space: nowrap; }
.term-input {
  flex: 1; min-width: 0; padding: 0; border: 0; outline: 0;
  background: transparent; color: #e6edf3; caret-color: #7ee787; font: inherit;
}
.term-close {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: #9aa4ae; font: 400 20px/1 sans-serif; cursor: pointer;
}
.term-close:hover, .term-close:focus-visible { background: rgba(255, 255, 255, .12); color: #fff; outline: 0; }
.term-msg { flex-basis: 100%; color: #f0b072; font-size: 12px; }
.term-msg:empty { display: none; }
.term-msg.is-help { color: #c9d1d9; white-space: pre; overflow-x: auto; line-height: 1.5; }
.scene-view-btn {
  position: fixed; left: 18px; bottom: 18px; z-index: 35;
  display: grid; place-items: center;
  width: 36px; height: 36px; padding: 0;
  border: 1.5px solid var(--navy); border-radius: 50%;
  color: var(--navy); background: rgba(255, 255, 255, .72);
  cursor: pointer;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(8px);
  transition: opacity .35s, transform .35s, background-color .2s, visibility .35s;
}
.scene-view-btn.available, .cinema-view .scene-view-btn {
  opacity: .88; visibility: visible; pointer-events: auto; transform: translateY(0);
}
.scene-view-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.scene-view-btn:hover { opacity: 1; background: #fff; }
/* Hover-Hinweis rechts neben dem Knopf (Text aus data-tip, wechselt mit dem Modus) */
.scene-view-btn::after {
  content: attr(data-tip);
  position: absolute; left: calc(100% + 10px); top: 50%;
  padding: 7px 11px; border-radius: 8px; white-space: nowrap;
  font: 600 13px/1 Outfit, sans-serif; color: #fff; background: var(--navy);
  opacity: 0; transform: translate(-4px, -50%); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.scene-view-btn:hover::after, .scene-view-btn:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
.scene-view-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
body.cinema-view .nav,
body.cinema-view .hero,
body.cinema-view .hint,
body.cinema-view .tip,
body.cinema-view .speech-bubble {
  opacity: 0 !important; visibility: hidden !important; pointer-events: none !important;
  transition: opacity .4s ease, visibility .4s;
}
/* aktiv: Farben invertiert (blau mit weißem Symbol), Hinweis dann weiß mit blauer Schrift */
body.cinema-view .scene-view-btn { background: var(--navy); color: #fff; border-color: #fff; opacity: .95; }
body.cinema-view .scene-view-btn:hover { background: #2a4b94; }
body.cinema-view .scene-view-btn::after { background: #fff; color: var(--navy); }
html.cinema-view { scrollbar-width: none; }
html.cinema-view::-webkit-scrollbar { display: none; }

.loader {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
  display: grid; place-items: center;
  font: 700 15px/1 Outfit, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  transition: opacity .6s;
}
.loader.done { opacity: 0; pointer-events: none; }

/* ---------- Monitor-Inhalt (liegt exakt über dem 3D-Bildschirm) ---------- */
.screen-ui {
  position: fixed; z-index: 15;
  --ink: #2b2622; --muted: #6d6358;
  left: 0; top: 0; width: 0; height: 0;
  opacity: 0; pointer-events: none;
  background: #f6f1e8; color: var(--ink);
  border-radius: 4px; overflow: hidden;
  container-type: inline-size;
  display: flex; flex-direction: column;
}
.screen-ui.live { pointer-events: auto; }
.screen-ui.sheet {
  left: 12px !important; top: 76px !important;
  width: calc(100vw - 24px) !important; height: calc(100vh - 88px) !important;
  border-radius: 20px; box-shadow: 0 20px 60px rgba(60, 40, 20, .25);
}
.sui-bar {
  flex: none; display: flex; align-items: center; gap: max(8px, 1.2cqw);
  height: max(44px, 4.67cqw); padding: 0 max(14px, 2.2cqw);
  background: #ebe3d6;
}
.sui-bar .dot { width: max(9px, .9cqw); height: max(9px, .9cqw); border-radius: 50%; }
.sui-url {
  flex: 1; max-width: 50%; margin-left: max(8px, 1cqw);
  font: 500 max(12px, 1.2cqw)/1 Inter, sans-serif; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: #f6f1e8; border-radius: 999px; padding: max(7px, .7cqw) max(12px, 1.3cqw);
}
.sui-back {
  margin-left: auto;
  font: 700 max(12px, 1.15cqw)/1 Outfit, sans-serif; letter-spacing: .05em; text-transform: uppercase;
  background: var(--ink); color: #fff; border: 0; border-radius: 999px;
  padding: max(8px, .8cqw) max(14px, 1.5cqw); cursor: pointer;
}
/* Karten-Raster im 2×2-Layout des 3D-Monitors – gilt auch während des Überblendens */
.sui-body {
  flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column;
  padding: max(18px, 3.2cqw) max(16px, 4.67cqw) max(18px, 3cqw);
}
.sui-body h2 { margin: 0; font: 800 max(26px, 4cqw)/1.05 Outfit, sans-serif; }
.sui-body > p { flex: none; margin: max(6px, .8cqw) 0 0; font-size: max(14px, 1.87cqw); color: var(--muted); }
.sui-grid {
  flex: 1; min-height: 0; margin-top: 12px;
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}
.qcard {
  --bg: #fff; --fg: #111; --muted: #555; --eyebrow: #2a8fbf; --mark: rgba(0,0,0,.06);
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0; min-height: 0;
  padding: clamp(8px, 1.5cqw, 16px);
  border-radius: 14px;
  background: var(--bg); color: var(--fg);
  text-decoration: none;
  transition: transform .25s, box-shadow .25s;
}
.qcard:hover, .qcard:focus-visible { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(40, 20, 10, .22); outline: none; }
.qcard .mark {
  position: absolute; right: -2%; top: -8%; z-index: -1;
  font: 700 clamp(64px, 12cqw, 120px)/1 Fraunces, serif; color: var(--mark);
}
.qcard .eyebrow { font: 700 clamp(10px, 1cqw, 13px)/1 Inter, sans-serif; letter-spacing: .14em; color: var(--eyebrow); }
/* großer Titel wie im Monitorbild (Canvas: 76·0.72 px auf 1500 px Breite ≈ 3.65cqw) */
.qcard .title { margin: 2px 0 4px; font: 700 clamp(22px, 3.65cqw, 60px)/1.05 Fraunces, serif; letter-spacing: -.01em; }
.badge {
  flex: none;
  font: 700 clamp(11px, 1.15cqw, 15px)/1 Inter, sans-serif; color: var(--badge-ink);
  background: var(--badge-bg); border: 1px solid var(--badge-line);
  padding: 5px 11px; border-radius: 999px;
}
.qcard .desc { font-size: clamp(11px, 1.15cqw, 15px); line-height: 1.3; color: var(--muted); }
/* unten: „Quiz starten“ links, Fragenanzahl rechts */
.qcard .foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.qcard .go { font: 700 clamp(12px, 1.3cqw, 16px)/1 Outfit, sans-serif; white-space: nowrap; }
.qcard .foot .badge { margin-left: auto; }   /* bleibt rechts, auch wenn sie auf schmalen Karten umbricht */
.qcard.soon {
  background: transparent; color: var(--muted);
  border: 3px dashed #cbbfae; align-items: center; justify-content: center; text-align: center;
}
.qcard.soon .eyebrow { color: var(--orange); letter-spacing: .12em; }
.qcard.soon .title { font: 700 clamp(17px, 2cqw, 28px)/1.2 Outfit, sans-serif; color: var(--ink); }
.qcard.soon .desc { max-width: 28ch; }

noscript .fallback, .no-webgl-list { padding: 120px 20px 40px; max-width: 640px; margin: auto; }

@media (max-width: 760px), (max-aspect-ratio: 11/10) {
  .nav-mode { width: 42px; height: 42px; }
  .nav-cta { padding: 13px 16px; font-size: 13px; }
  .hero { top: 92px; transform: none; }
  .hero p { font-size: 15px; margin-top: 18px; max-width: 300px; }
  .scene-view-btn { left: 12px; bottom: 12px; }
  .term { top: 66px; }
  .pcam, .pcam.big { left: 12px; right: 12px; bottom: 60px; width: auto; }   /* über dem Kinomodus-Knopf */
  .pcam-view { aspect-ratio: 16 / 9; }
}
@media (max-height: 500px) and (min-aspect-ratio: 11/10) {
  .hero h1 { font-size: 52px; }
  .hero p { font-size: 14px; margin-top: 16px; }
  .stamp { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .hint i::after, .pcam-led { animation: none; }
  .pcam { transition: none; }
  .scene-view-btn, body.cinema-view .nav, body.cinema-view .hero,
  body.cinema-view .hint, body.cinema-view .tip, body.cinema-view .speech-bubble {
    transition-duration: .01ms;
  }
}
