:root {
  --bg: #0a0a12;
  --card: #0f172a;
  --card2: #111827;
  --border: #1e293b;
  --blau: #60a5fa;
  --pink: #f472b6;
  --lila: #a78bfa;
  --gruen: #4ade80;
  --orange: #fb923c;
  --text: #e2e8f0;
  --muted: #64748b;
  --yellow: #facc15;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Starfield background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 70%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 25%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 60%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 10%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 20% 90%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 85%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 45%, rgba(255,255,255,0.15) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 80% 35%, rgba(167,139,250,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 15% 50%, rgba(96,165,250,0.3) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

section, footer { position: relative; z-index: 1; }

/* ── Typography ── */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 600; line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

.accent { color: var(--lila); }

/* ── Buttons ── */
.btn-primary {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: var(--lila);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: #8b5cf6; transform: translateY(-1px); }

.btn-secondary {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.15s;
}
.btn-secondary:hover { border-color: var(--lila); transform: translateY(-1px); }

/* ── Hero ── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  padding: 6rem 8vw 4rem;
}

.hero-content { flex: 1; max-width: 600px; }

.hero-badge {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  background: rgba(167,139,250,0.15);
  border: 1px solid rgba(167,139,250,0.3);
  border-radius: 100px;
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--lila);
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.hero-text {
  margin: 1.5rem 0 2rem;
  color: #94a3b8;
  font-size: 1.05rem;
  max-width: 520px;
}

.hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Hero orb */
.hero-visual {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-orb {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(167,139,250,0.2);
  animation: orb-spin linear infinite;
}
.r1 { width: 240px; height: 240px; animation-duration: 20s; border-color: rgba(167,139,250,0.25); }
.r2 { width: 170px; height: 170px; animation-duration: 14s; animation-direction: reverse; border-color: rgba(96,165,250,0.2); }
.r3 { width: 100px; height: 100px; animation-duration: 9s; border-color: rgba(244,114,182,0.2); }

.orb-center {
  width: 30px; height: 30px;
  background: radial-gradient(circle, var(--lila), #6d28d9);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(167,139,250,0.6);
}

@keyframes orb-spin {
  from { transform: rotate(0deg) rotateX(60deg); }
  to { transform: rotate(360deg) rotateX(60deg); }
}

/* ── Section shared ── */
section { padding: 6rem 8vw; }

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--lila);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.75rem;
}

.section-header p {
  color: #94a3b8;
  margin-top: 0.75rem;
  font-size: 1rem;
}

/* ── Fade-in ── */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── Achsen ── */
#achsen { background: rgba(15,23,42,0.4); }

.achsen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.achse-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
}
.achse-card:hover { border-color: var(--lila); transform: translateY(-2px); }

.achse-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.achse-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}

.achse-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.pole-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.pole {
  font-size: 0.75rem;
  font-family: 'DM Mono', monospace;
  white-space: nowrap;
}
.pole.male { color: var(--blau); }
.pole.female { color: var(--pink); }

.bar-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 50%;
  border-radius: 2px;
  opacity: 0.7;
}

.marker-list { margin-bottom: 1rem; }
.marker-list.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.marker-group { margin-bottom: 0.75rem; }

.marker-weight {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}
.marker-weight.strong { color: #f87171; }
.marker-weight.medium { color: #fbbf24; }
.marker-weight.weak { color: var(--muted); }

.marker-items { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.marker-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.72rem;
  color: #94a3b8;
}
.marker-tag.blue { background: rgba(96,165,250,0.1); border-color: rgba(96,165,250,0.2); color: var(--blau); }
.marker-tag.pink { background: rgba(244,114,182,0.1); border-color: rgba(244,114,182,0.2); color: var(--pink); }

.achse-note {
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  font-style: italic;
}

/* ── Sphäre ── */
#sphare { padding: 6rem 4vw; }

.sphere-layout {
  display: grid;
  grid-template-columns: 200px 1fr 240px;
  grid-template-rows: auto;
  gap: 1.5rem;
  align-items: start;
}

.sphere-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ctrl-btn {
  padding: 0.55rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: left;
}
.ctrl-btn:hover { background: rgba(167,139,250,0.1); border-color: var(--lila); }
.ctrl-btn.active { background: rgba(167,139,250,0.15); border-color: var(--lila); color: var(--lila); }
.ctrl-btn.regen { color: var(--gruen); }
.ctrl-btn.regen:hover { border-color: var(--gruen); background: rgba(74,222,128,0.1); }

.sidebar-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}

.sidebar-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.legend-item, .axis-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.4rem;
}

.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.axis-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hint-text {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.5;
  font-family: 'DM Mono', monospace;
}

/* Sphere canvas */
.sphere-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #050510;
  border: 1px solid var(--border);
  aspect-ratio: 1;
  min-height: 500px;
}

#sphereCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
#sphereCanvas:active { cursor: grabbing; }

/* Tooltip */
.tooltip {
  position: absolute;
  background: rgba(15,23,42,0.95);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.78rem;
  color: var(--text);
  pointer-events: none;
  font-family: 'DM Mono', monospace;
  white-space: nowrap;
  z-index: 10;
  backdrop-filter: blur(8px);
  line-height: 1.6;
}
.tooltip.hidden { display: none; }

/* Detail panel */
.detail-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  position: relative;
}
.detail-panel.hidden { display: none; }

.close-btn {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.25rem;
  transition: color 0.15s;
}
.close-btn:hover { color: var(--text); }

.dp-gender-badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-family: 'DM Mono', monospace;
  margin-bottom: 0.5rem;
}

#dpName {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.dp-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  font-family: 'DM Mono', monospace;
}

.dp-stats { display: flex; flex-direction: column; gap: 0.9rem; }

.dp-stat-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.dp-stat-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.2rem;
}

.dp-stat-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.dp-stat-val {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
}

/* ── Fragebogen ── */
#fragebogen { background: rgba(15,23,42,0.4); }

.fragebogen-container {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.fragen-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
}

.fragen-group-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.achse-icon-sm {
  width: 30px; height: 30px;
  border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
}

.fragen-list { display: flex; flex-direction: column; gap: 1.25rem; }

.frage-item { display: flex; flex-direction: column; gap: 0.5rem; }

.frage-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.4;
}

.frage-scale {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.scale-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
  white-space: nowrap;
}

.frage-scale input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.frage-scale input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  background: var(--lila);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s;
}
.frage-scale input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* Bio slider */
.bio-note {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 1rem;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.slider-row input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: linear-gradient(to right, var(--blau), var(--pink));
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.slider-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: var(--lila);
  border-radius: 50%;
  cursor: pointer;
}

.slider-val {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.fq-actions { text-align: center; }

.fq-result {
  background: rgba(167,139,250,0.08);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}
.fq-result.hidden { display: none; }

.fq-scores {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.fq-score { text-align: center; }

.fq-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.3rem;
}

.fq-val {
  font-family: 'DM Mono', monospace;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text);
}

.fq-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* ── Footer ── */
footer {
  padding: 3rem 8vw;
  border-top: 1px solid var(--border);
}

.footer-inner { max-width: 800px; margin: 0 auto; }

.footer-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--lila);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.sources {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.sources li {
  font-size: 0.8rem;
  color: #64748b;
}

.sources em { color: #94a3b8; font-style: italic; }

.footer-note {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .sphere-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .sphere-sidebar { flex-direction: row; flex-wrap: wrap; }
  .control-group { flex-direction: row; flex-wrap: wrap; }
  .ctrl-btn { flex: 1 1 auto; text-align: center; }
  .detail-panel { order: 3; }
}

@media (max-width: 768px) {
  #hero { flex-direction: column; padding: 5rem 6vw 3rem; text-align: center; }
  .hero-btns { justify-content: center; }
  .hero-visual { display: none; }
  section { padding: 4rem 6vw; }
  .achsen-grid { grid-template-columns: 1fr; }
  .marker-list.two-col { grid-template-columns: 1fr; }
  .fq-scores { gap: 1rem; }
  .sphere-wrap { min-height: 320px; }
}
