/* ==========================================================================
   MilDexScrollyScanner – Igloo-HUD-Bühne (gepinnte 4-Phasen-Sektion)
   ========================================================================== */
.sx-section { position: relative; padding: 96px 0 0; border-top: 1px solid var(--border-subtle); background: radial-gradient(ellipse at 50% 0%, rgba(63, 191, 143, 0.06), transparent 60%); }
.sx-intro { margin-bottom: 28px; }
.mono { font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.04em; }

.sx-pin { height: 100vh; height: 100dvh; padding-top: var(--sx-header, 80px); box-sizing: border-box; }
.sx-stage { height: 100%; max-width: 1320px; margin: 0 auto; padding: 14px 24px 22px; display: flex; flex-direction: column; gap: 14px; }

/* --- HUD-Kopfzeile --- */
.sx-hud-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid rgba(127, 227, 196, 0.16); border-radius: 14px; background: rgba(7, 10, 8, 0.78); backdrop-filter: blur(10px); }
.sx-telemetry { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.7rem; color: #8FA394; text-transform: uppercase; }
.sx-telemetry b { color: #7FE3C4; font-weight: 600; }
.sx-status { color: var(--gold-accent); }
.sx-rec { display: inline-flex; align-items: center; gap: 6px; color: #d9e4dc; }
.sx-rec i { width: 7px; height: 7px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 8px #ff4d4d; will-change: opacity; animation: sxBlink 1.2s ease-in-out infinite; }
@keyframes sxBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.15; } }
.sx-picker { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.sx-picker::-webkit-scrollbar { display: none; }
.sx-picker-label { font-size: 0.66rem; color: #8FA394; text-transform: uppercase; margin-right: 4px; }
.sx-pick { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 3px 12px 3px 3px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.03); color: var(--text-secondary); font: 600 0.74rem/1 var(--font-body); cursor: pointer; transition: border-color 0.25s, color 0.25s, box-shadow 0.25s; }
.sx-pick img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.sx-pick:hover { color: #fff; border-color: rgba(255, 255, 255, 0.22); }
.sx-pick.is-active { color: #fff; border-color: rgba(212, 175, 55, 0.7); box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.25), 0 0 18px rgba(212, 175, 55, 0.18); }
.sx-pick:focus-visible { outline: 2px solid var(--gold-accent); outline-offset: 2px; }

/* --- Hauptbühne --- */
.sx-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr); gap: 20px; }
.sx-viewport { position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; border-radius: 22px; border: 1px solid rgba(255, 255, 255, 0.08); background: radial-gradient(circle at 50% 45%, #151c17 0%, #080a09 70%); overflow: hidden; }

/* Störender Messe-Hintergrund (Phase 1 wird weggefiltert) */
.sx-clutter { position: absolute; inset: 0; z-index: 1; will-change: filter, opacity; background: radial-gradient(ellipse at 18% 12%, rgba(255, 214, 150, 0.38), transparent 42%), radial-gradient(ellipse at 88% 8%, rgba(255, 242, 205, 0.3), transparent 38%), repeating-linear-gradient(92deg, rgba(120, 80, 40, 0.22) 0 2px, transparent 2px 24px), linear-gradient(165deg, #3d2b1d 0%, #23190f 60%, #170f0a 100%); }
.sx-lamp { position: absolute; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 250, 225, 0.95), rgba(255, 210, 140, 0.3) 45%, transparent 70%); }
.sx-lamp--a { top: -30px; left: 8%; }
.sx-lamp--b { top: -40px; right: 6%; width: 160px; height: 160px; }
.sx-table { position: absolute; left: -5%; right: -5%; bottom: -8%; height: 38%; background: linear-gradient(180deg, #24402c, #142319); transform: perspective(600px) rotateX(38deg); box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5); }
.sx-tag { position: absolute; right: 12%; bottom: 18%; padding: 6px 10px; background: #f3ead2; color: #2b2116; font: 700 0.8rem/1 var(--font-body); transform: rotate(-9deg); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45); }
.sx-hand { position: absolute; left: 4%; bottom: 6%; width: 150px; height: 64px; border-radius: 40px 60px 50px 30px; background: linear-gradient(120deg, #c99a7b, #a0705a); filter: blur(1px); transform: rotate(-18deg); opacity: 0.9; }

/* Fadenkreuze */
.sx-crosshair { position: absolute; inset: 18px; z-index: 4; pointer-events: none; }
.sx-crosshair i { position: absolute; width: 26px; height: 26px; border-color: rgba(127, 227, 196, 0.7); border-style: solid; border-width: 0; }
.sx-crosshair i:nth-child(1) { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.sx-crosshair i:nth-child(2) { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.sx-crosshair i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.sx-crosshair i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }
.sx-crosshair b { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; background: linear-gradient(rgba(127, 227, 196, 0.6), rgba(127, 227, 196, 0.6)) center / 1px 100% no-repeat, linear-gradient(rgba(127, 227, 196, 0.6), rgba(127, 227, 196, 0.6)) center / 100% 1px no-repeat; }

/* 3D-Exponat-Karte */
.sx-card-wrap { position: relative; z-index: 2; width: min(66%, 58vh); aspect-ratio: 1 / 1; perspective: 1400px; border-radius: 20px; overflow: hidden; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212, 175, 55, 0.16); will-change: transform; }
.sx-card { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.sx-face { position: absolute; inset: 0; overflow: hidden; border-radius: 20px; background: #0a0e0b; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.sx-face--back { transform: rotateY(180deg); }
.sx-face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sx-bp-tag { position: absolute; left: 12px; bottom: 12px; padding: 4px 8px; font-size: 0.62rem; color: #7FE3C4; background: rgba(0, 0, 0, 0.65); border: 1px solid rgba(127, 227, 196, 0.35); border-radius: 6px; text-transform: uppercase; }
.sx-bp-tag[hidden] { display: none; }

/* Basement-Studio X-Ray Topografie-Raster */
.sx-wire { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; clip-path: inset(0% 0% 100% 0%); background: repeating-radial-gradient(circle at 50% 55%, rgba(127, 227, 196, 0) 0 14px, rgba(127, 227, 196, 0.22) 14px 15px), linear-gradient(rgba(127, 227, 196, 0.16) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(127, 227, 196, 0.16) 1px, transparent 1px) 0 0 / 24px 24px; }
.sx-laser { position: absolute; left: -4%; right: -4%; top: 0; height: 3px; z-index: 3; pointer-events: none; opacity: 0; will-change: transform, opacity; background: linear-gradient(90deg, transparent, #7FE3C4 18%, #ffffff 50%, #7FE3C4 82%, transparent); box-shadow: 0 0 18px 4px rgba(127, 227, 196, 0.6); }
.sx-laser::after { content: ""; position: absolute; left: 0; right: 0; bottom: 3px; height: 70px; background: linear-gradient(0deg, rgba(127, 227, 196, 0.22), transparent); }
.sx-glint { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; will-change: transform, opacity; mix-blend-mode: screen; background: linear-gradient(100deg, transparent 38%, rgba(255, 226, 140, 0.15) 45%, rgba(255, 230, 160, 0.85) 50%, rgba(212, 175, 55, 0.2) 55%, transparent 62%); }

/* Dual-Layer 4K-Makro-Lupe */
.sx-loupe { position: absolute; top: 0; left: 0; z-index: 5; width: clamp(120px, 14vw, 190px); aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden; pointer-events: none; background: #000; border: 2px solid #7FE3C4; box-shadow: 0 0 0 6px rgba(127, 227, 196, 0.12), 0 18px 40px rgba(0, 0, 0, 0.65), inset 0 0 28px rgba(0, 0, 0, 0.7); opacity: 0; will-change: transform, opacity; }
.sx-loupe--gold { border-color: var(--gold-accent); box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.14), 0 18px 40px rgba(0, 0, 0, 0.65), inset 0 0 28px rgba(0, 0, 0, 0.7); }
.sx-loupe-inner { position: absolute; inset: 0; background-repeat: no-repeat; }
.sx-loupe::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.35)) center / 1px 30% no-repeat, linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.35)) center / 30% 1px no-repeat, radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.18), transparent 40%); }
.sx-loupe-label { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 1; padding: 2px 6px; font-size: 0.56rem; color: #fff; background: rgba(0, 0, 0, 0.6); border-radius: 4px; white-space: nowrap; }

/* Phase 4: Vault-Dossier */
.sx-dossier { position: absolute; z-index: 6; inset: 0 4% 0 auto; margin: auto 0; height: max-content; width: min(48%, 440px); padding: 22px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.1); background: linear-gradient(160deg, rgba(20, 27, 22, 0.94), rgba(9, 12, 10, 0.96)); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.sx-js .sx-dossier { opacity: 0; pointer-events: none; }
.sx-js[data-phase="4"] .sx-dossier { pointer-events: auto; }
.sx-dossier-badge { display: inline-block; padding: 5px 10px; border-radius: 999px; font: 700 0.75rem/1 var(--font-body); color: #9FF0CF; background: rgba(63, 191, 143, 0.14); border: 1px solid rgba(63, 191, 143, 0.45); }
.sx-dossier-title { margin: 12px 0 14px; font-size: 1.3rem; color: #fff; }
.sx-dossier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
.sx-dossier-grid div { padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.07); }
.sx-dossier-grid .sx-span2 { grid-column: span 2; }
.sx-dossier-grid dt { font-size: 0.62rem; text-transform: uppercase; color: #8FA394; }
.sx-dossier-grid dd { margin: 4px 0 0; font-size: 0.9rem; color: #EBD9A0; }
.sx-dossier-note { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 14px; }
.sx-dossier-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.sx-dossier-cta .btn { padding: 11px 16px; font-size: 0.85rem; }

/* --- Telemetrie & Story-Cards --- */
.sx-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.sx-readout { padding: 14px 16px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(7, 10, 8, 0.78); }
.sx-score-row { display: flex; align-items: baseline; justify-content: space-between; font-size: 0.68rem; text-transform: uppercase; color: #8FA394; }
.sx-score { font-size: 2.3rem; font-weight: 600; color: #7FE3C4; font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(127, 227, 196, 0.35); }
.sx-meter { height: 4px; margin: 8px 0 10px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.sx-meter span { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #D4AF37, #3FBF8F); }
.sx-checks { list-style: none; margin: 0; padding: 0; font-size: 0.72rem; color: #8FA394; }
.sx-checks li { display: flex; gap: 8px; padding: 7px 0; border-top: 1px dashed rgba(255, 255, 255, 0.08); transition: color 0.3s; }
.sx-checks li::before { content: "○"; color: #8FA394; }
.sx-checks li.is-ok { color: #d6e6dc; }
.sx-checks li.is-ok::before { content: "✓"; color: #3FBF8F; }
.sx-checks em { font-style: normal; min-width: 58px; text-transform: uppercase; color: var(--gold-accent); }
.sx-stories { position: relative; flex: 1; min-height: 210px; }
.sx-story { padding: 20px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.1); background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)), rgba(10, 13, 11, 0.85); }
.sx-js .sx-story { position: absolute; top: 0; left: 0; width: 100%; }
.sx-js .sx-story:not(:first-child) { opacity: 0; pointer-events: none; }
.sx-kicker { font-size: 0.68rem; text-transform: uppercase; color: var(--gold-accent); }
.sx-story h3 { margin: 8px 0; font-size: 1.22rem; color: #fff; line-height: 1.3; }
.sx-story p { font-size: 0.92rem; line-height: 1.6; color: var(--text-secondary); }
.sx-hint { font-size: 0.68rem; color: #8FA394; text-align: center; text-transform: uppercase; }

/* --- Ohne JS / Reduced Motion: statische, vollständig lesbare Darstellung --- */
.sx-section:not(.sx-js) .sx-pin, .sx-static .sx-pin { height: auto; padding-top: 0; }
.sx-section:not(.sx-js) .sx-stories, .sx-static .sx-stories { display: grid; gap: 12px; }
.sx-static .sx-story { position: relative; }
.sx-section:not(.sx-js) .sx-clutter, .sx-static .sx-clutter, .sx-static .sx-hint { display: none; }
.sx-section:not(.sx-js) .sx-viewport, .sx-static .sx-viewport { min-height: 520px; }
.sx-static .sx-dossier { opacity: 1; pointer-events: auto; }

/* --- Tablet --- */
@media (max-width: 1100px) {
  .sx-main { grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr); }
  .sx-story h3 { font-size: 1.08rem; }
  .sx-story p { font-size: 0.85rem; }
}

/* --- Smartphone (< 768px): alles passt in 100dvh, Story-Cards im unteren Drittel --- */
@media (max-width: 767px) {
  .sx-section { padding-top: 64px; }
  .sx-stage { padding: 8px 10px 10px; gap: 8px; }
  .sx-hud-top { padding: 6px 8px; gap: 6px; border-radius: 12px; }
  .sx-telemetry { gap: 4px 10px; font-size: 0.58rem; width: 100%; justify-content: space-between; }
  .sx-picker { width: 100%; }
  .sx-picker-label { display: none; }
  .sx-pick { padding: 2px; font-size: 0.68rem; }
  .sx-pick img { width: 30px; height: 30px; }
  .sx-pick span { display: none; }
  .sx-pick.is-active { padding-right: 10px; }
  .sx-pick.is-active span { display: inline; }
  .sx-main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 8px; }
  .sx-viewport { border-radius: 16px; }
  .sx-card-wrap { width: min(74vw, 38dvh); border-radius: 16px; }
  .sx-face { border-radius: 16px; }
  .sx-crosshair { inset: 10px; }
  .sx-loupe { width: clamp(84px, 24vw, 110px); }
  .sx-side { gap: 6px; }
  .sx-readout { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 12px; padding: 8px 12px; border-radius: 12px; }
  .sx-score-row { flex-direction: column; align-items: flex-start; gap: 2px; font-size: 0.56rem; }
  .sx-score { font-size: 1.45rem; }
  .sx-meter { margin: 0; }
  .sx-checks { display: none; }
  .sx-stories { flex: none; min-height: 0; height: clamp(118px, 22dvh, 160px); }
  .sx-story { padding: 12px 14px; border-radius: 12px; }
  .sx-story h3 { margin: 4px 0; font-size: 0.98rem; }
  .sx-story p { font-size: 0.8rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .sx-hint { display: none; }
  .sx-dossier { inset: auto 3% 3% 3%; margin: 0; width: auto; padding: 14px; border-radius: 14px; }
  .sx-dossier-title { margin: 8px 0 10px; font-size: 1rem; }
  .sx-dossier-grid { gap: 6px; margin-bottom: 8px; }
  .sx-dossier-grid div { padding: 7px 9px; }
  .sx-dossier-note { display: none; }
  .sx-dossier-cta { flex-wrap: nowrap; gap: 8px; }
  .sx-dossier-cta .btn { flex: 1 1 0; min-width: 0; padding: 10px 8px; font-size: 0.72rem; white-space: nowrap; text-align: center; justify-content: center; }
}
