/* ============================================================
   HKIA // LABOR — Designsystem-Erweiterung
   Neue Komponenten: .holo-frame .sim-card .deck .exp-toggle .terminal
   Tokens: ausschließlich --p1/--p2/--p3/--ink/--muted/--line/--bg/--panel
   ============================================================ */

.labor-body { perspective: 1200px; }

#laborSpace {
  position: fixed; inset: 0; z-index: -2;
  width: 100vw; height: 100vh;
}
#scanlines {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, transparent 0 3px, rgba(0,0,0,.14) 3px 4px);
  opacity: .35; mix-blend-mode: overlay;
}
[data-theme="solar"] #scanlines { opacity: .22; }
html.reduced #scanlines { opacity: .18; }

/* ---------- Stationen: Kamera-Bühnen ---------- */
.station {
  min-height: 100vh;
  display: grid; align-content: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding: clamp(6rem, 14vh, 9rem) clamp(1.4rem, 6vw, 6rem);
  position: relative;
  transform-style: preserve-3d;
}
.s-holo, .s-sim {
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
}
.s-sim { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
.station-copy .display { font-size: clamp(2rem, 4.6vw, 3.4rem); margin: .7rem 0 1.1rem; }
.station-text { color: var(--muted); line-height: 1.8; max-width: 46ch; }
.station-text.center { margin: 0 auto; text-align: center; }
.micro-hint { margin-top: 1.1rem; font-size: .62rem; letter-spacing: .16em; color: var(--muted); opacity: .7; }

/* ---------- Hero ---------- */
.s-hero { text-align: center; justify-items: center; gap: 1.6rem; }
.kicker { color: var(--p1); letter-spacing: .28em; font-size: .72rem; }
.lab-title {
  font-size: clamp(3.4rem, 12vw, 9rem);
  line-height: .95; position: relative;
  background: linear-gradient(110deg, var(--p1) 10%, var(--p2) 50%, var(--p3) 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
/* Glitch nur bei Hover, zwei versetzte Schichten */
.lab-title::before, .lab-title::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  background: inherit; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0; pointer-events: none;
}
.lab-title:hover::before { opacity: .8; transform: translate(3px, -2px); clip-path: inset(12% 0 58% 0); animation: glitchA .5s steps(2) infinite; }
.lab-title:hover::after  { opacity: .8; transform: translate(-3px, 2px); clip-path: inset(62% 0 8% 0); animation: glitchB .44s steps(2) infinite; }
@keyframes glitchA { 50% { transform: translate(-4px, 1px); clip-path: inset(4% 0 72% 0); } }
@keyframes glitchB { 50% { transform: translate(4px, -1px); clip-path: inset(76% 0 2% 0); } }
html.reduced .lab-title::before, html.reduced .lab-title::after { display: none; }

.lab-sub { color: var(--muted); line-height: 1.85; }

.chips { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin-top: .6rem; }
.chip {
  font-size: .62rem; letter-spacing: .14em; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .55rem 1rem;
  background: var(--panel);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: chipFloat 6s ease-in-out infinite;
}
.chip b { color: var(--p1); font-weight: 600; }
.chip:nth-child(2) { animation-delay: -2s; }
.chip:nth-child(3) { animation-delay: -4s; }
@keyframes chipFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
html.reduced .chip { animation: none; }

.cue-line { display: block; width: 1px; height: 44px; background: linear-gradient(180deg, var(--p1), transparent); }

/* ---------- Komponente: Holo-Frame ---------- */
.holo-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 560px; width: 100%; justify-self: center;
  border: 1px solid var(--line); border-radius: 18px;
  background:
    radial-gradient(60% 60% at 50% 42%, rgba(70,243,255,.06), transparent 70%),
    var(--panel);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0,0,0,.45), inset 0 0 60px rgba(139,92,246,.05);
  transform: rotateX(4deg) rotateY(-6deg);
  transition: transform .8s var(--ease), box-shadow .8s var(--ease);
}
.holo-frame:hover { transform: rotateX(0) rotateY(0); box-shadow: 0 30px 90px rgba(0,0,0,.5), 0 0 60px rgba(70,243,255,.10), inset 0 0 60px rgba(139,92,246,.08); }
html.reduced .holo-frame { transform: none; }
#holo { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 18px; cursor: grab; touch-action: none; }
#holo.grabbing { cursor: grabbing; }
#holo.chroma { animation: chromaShift 7s linear infinite; }
@keyframes chromaShift { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }
html.reduced #holo.chroma { animation: none; }
.corner { position: absolute; width: 16px; height: 16px; border: 1px solid var(--p1); opacity: .9; }
.c1 { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.c2 { top: -1px; right: -1px; border-left: 0; border-bottom: 0; border-top-right-radius: 6px; }
.c3 { bottom: -1px; left: -1px; border-right: 0; border-top: 0; border-bottom-left-radius: 6px; }
.c4 { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }
.holo-stat {
  position: absolute; left: 1.1rem; bottom: .9rem;
  font-size: .6rem; letter-spacing: .14em; color: var(--muted);
}

/* ---------- Komponente: Sim-Card ---------- */
.sim-card {
  position: relative;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  overflow: hidden;
  aspect-ratio: 16 / 10; width: 100%;
}
#sim { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.sim-modes {
  position: absolute; top: .9rem; right: .9rem; z-index: 2;
  display: flex; gap: .5rem;
}
.sim-hint {
  position: absolute; left: 1.1rem; bottom: .9rem; z-index: 2;
  font-size: .6rem; letter-spacing: .14em; color: var(--muted);
}

/* ---------- Komponente: Exp-Button (Variante des Send-Buttons) ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.btn-exp {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em;
  color: var(--muted); background: rgba(0,0,0,.25);
  border: 1px solid var(--line); border-radius: 8px;
  padding: .6rem 1rem; cursor: pointer;
  transition: color .25s ease, border-color .25s ease, box-shadow .25s ease, transform .2s ease;
  will-change: transform;
}
.btn-exp:hover, .btn-exp:focus-visible { color: var(--ink); border-color: var(--p2); outline: none; }
.btn-exp.is-active {
  color: var(--p1); border-color: var(--p1);
  box-shadow: 0 0 16px rgba(70,243,255,.22), inset 0 0 12px rgba(70,243,255,.06);
}
[data-theme="solar"] .btn-exp.is-active { box-shadow: 0 0 16px rgba(255,170,80,.25), inset 0 0 12px rgba(255,170,80,.07); }

/* ---------- Komponente: Glass-Deck + Exp-Toggle ---------- */
.deck {
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  padding: clamp(1.2rem, 3vw, 2.2rem);
}
.deck-grid { display: grid; grid-template-columns: 1fr 1.2fr 1.6fr; gap: clamp(1.2rem, 3vw, 2.4rem); }
.deck-label { font-size: .62rem; letter-spacing: .18em; color: var(--muted); margin-bottom: .9rem; }
.deck-cell { min-width: 0; }

.exp-toggle {
  display: flex; align-items: center; gap: .7rem;
  width: 100%; margin-bottom: .6rem;
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .16em;
  color: var(--muted); background: rgba(0,0,0,.22);
  border: 1px solid var(--line); border-radius: 8px;
  padding: .65rem .9rem; cursor: pointer;
  transition: color .25s ease, border-color .25s ease;
}
.exp-toggle .led {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--line);
  box-shadow: none;
  transition: background .25s ease, box-shadow .25s ease;
}
.exp-toggle:hover { color: var(--ink); }
.exp-toggle.on { color: var(--p1); border-color: var(--p1); }
.exp-toggle.on .led { background: var(--p1); box-shadow: 0 0 10px var(--p1); }

input[type="range"] {
  width: 100%; margin: .2rem 0 1.4rem;
  -webkit-appearance: none; appearance: none;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--p1), var(--p2));
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--p1);
  box-shadow: 0 0 12px rgba(70,243,255,.4);
  cursor: pointer;
  transition: transform .2s ease;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.25); }
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--p1);
  box-shadow: 0 0 12px rgba(70,243,255,.4); cursor: pointer;
}

/* ---------- Komponente: Terminal ---------- */
.terminal {
  font-family: var(--font-mono); font-size: .68rem; line-height: 1.9;
  color: var(--muted);
  background: rgba(0,0,0,.3);
  border: 1px solid var(--line); border-radius: 10px;
  padding: .9rem 1rem; min-height: 172px; max-height: 172px;
  overflow: hidden;
}
.terminal .t-line b { color: var(--p1); font-weight: 500; }
.terminal .t-line:last-child::after {
  content: "▊"; color: var(--p1); margin-left: 2px;
  animation: caret 1s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
html.reduced .terminal .t-line:last-child::after { animation: none; }

/* ---------- Exit + Footer ---------- */
.s-exit { text-align: center; justify-items: center; min-height: 78vh; }
.exit-row { display: grid; justify-items: center; gap: 1.2rem; margin-top: 2.2rem; }
.exit-hint { font-size: .62rem; letter-spacing: .16em; color: var(--muted); opacity: .75; }
.footer-slim { padding: 2rem 1.5rem 2.6rem; }
.footer-slim .f-copy a { color: var(--muted); text-decoration: none; }
.footer-slim .f-copy a:hover { color: var(--p1); }
.nav-exit { color: var(--p3) !important; }
.brand-dot { color: var(--muted); font-weight: 400; letter-spacing: .04em; }

/* ---------- Responsiv ---------- */
@media (max-width: 980px) {
  .s-holo, .s-sim { grid-template-columns: 1fr; }
  .deck-grid { grid-template-columns: 1fr 1fr; }
  .deck-term { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .deck-grid { grid-template-columns: 1fr; }
  .sim-modes { top: auto; bottom: 2.6rem; right: .7rem; flex-direction: column; }
  .holo-frame { aspect-ratio: 1 / 1.05; }
}

/* ---------- Abflug (Rückkehr zur Hauptdimension) ---------- */
body.leaving main, body.leaving .nav, body.leaving footer {
  opacity: 0; transform: scale(.985);
  transition: opacity .55s ease, transform .55s var(--ease);
}
html.reduced body.leaving main { transition: none; }
