/* ==========================================================
   MAIN – Variablen, Grundlayout, Typografie
   ========================================================== */
:root {
  --bg: #06060b;
  --bg-2: #0c0c14;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.075);
  --border-2: rgba(255, 255, 255, 0.14);
  --text: #ecebf5;
  --text-2: #a7a6ba;
  --text-3: #6e6d82;
  --accent: #8b7bff;          /* überschrieben aus config.js */
  --accent-2: #3de0ff;        /* überschrieben aus config.js */
  --accent-grad: linear-gradient(120deg, var(--accent), var(--accent-2));
  --danger: #ff5d7a;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --gap: 14px;
  --sidebar-l: 288px;
  --sidebar-r: 300px;
  --topbar: 58px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 12% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(900px 600px at 105% 110%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body::before { /* feine Körnung für Tiefe */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- App-Gitter ---------- */
.app {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-l) minmax(0, 1fr) var(--sidebar-r);
  grid-template-rows: var(--topbar) minmax(0, 1fr);
  grid-template-areas: "top top top" "left stage right";
  gap: var(--gap);
  height: 100vh; height: 100dvh;
  padding: var(--gap);
  opacity: 0; transition: opacity .6s var(--ease);
}
body:not(.is-loading) .app { opacity: 1; }

.glass {
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 50px -20px rgba(0,0,0,.6);
}

/* ---------- Kopfzeile ---------- */
.topbar {
  grid-area: top;
  display: flex; align-items: center; gap: 16px;
  padding: 0 4px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-width: 0; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-grad);
  color: #0b0b12; font-weight: 800; font-size: 17px; letter-spacing: -.02em;
  box-shadow: 0 6px 24px -6px color-mix(in srgb, var(--accent) 70%, transparent);
  overflow: hidden;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { margin: 0; font-size: 16px; font-weight: 750; letter-spacing: .14em; line-height: 1.1; white-space: nowrap; }
.brand-sub { font-size: 11.5px; color: var(--text-3); letter-spacing: .04em; white-space: nowrap; }
.topbar-center {
  flex: 1; display: flex; justify-content: center; align-items: center; gap: 10px; min-width: 0;
  font-size: 13px; color: var(--text-2);
}
.now-chip { padding: 5px 11px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-weight: 600; white-space: nowrap; }
.now-sep { color: var(--text-3); }
.now-variant { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Seitenleisten ---------- */
.sidebar { overflow-y: auto; overflow-x: hidden; padding: 6px 0; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.sidebar-left { grid-area: left; }
.sidebar-right { grid-area: right; }
.panel { padding: 14px 16px 16px; border-bottom: 1px solid var(--border); }
.panel:last-child { border-bottom: 0; }
.panel-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 12px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3);
}

/* ---------- Bühne ---------- */
.stage {
  grid-area: stage;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 0; min-width: 0;
}
.stage-inner {
  position: relative; flex: 1; min-height: 0;
  display: grid; place-items: center;
  border-radius: var(--radius);
  background:
    radial-gradient(60% 60% at 50% 45%, rgba(255,255,255,.035), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 12px, transparent 12px 24px);
  border: 1px dashed rgba(255,255,255,.05);
  overflow: hidden;
}
.canvas-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.06);
  background: #000;
  transition: box-shadow .6s var(--ease);
}
.art-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.art-canvas.front { position: relative; }
.art-canvas.back { opacity: 0; transition: opacity .55s var(--ease), filter .55s var(--ease); pointer-events: none; }
.art-canvas.back.progressive { opacity: .85; filter: blur(2px) saturate(.9); }
.art-canvas.back.reveal { opacity: 1; filter: none; }

.site-footer { position: fixed; left: 0; right: 0; bottom: 2px; display: flex; justify-content: center; align-items: center; gap: 14px; font-size: 10.5px; color: var(--text-3); pointer-events: none; z-index: 2; }
.site-footer > span { opacity: .6; }
.footer-legal { display: flex; align-items: center; gap: 6px; pointer-events: auto; }
.footer-legal .link-btn { font-size: 10.5px; font-weight: 600; color: var(--text-2); letter-spacing: .02em; }
.footer-legal .link-btn:hover { color: var(--text); }

/* ---------- No-JS-Seite ---------- */
.noscript-page { position: relative; z-index: 5; max-width: 720px; margin: 10vh auto; padding: 32px; line-height: 1.65; }
.noscript-page h1 { font-size: 40px; letter-spacing: -.02em; margin: 0 0 12px; }
.noscript-page h2 { margin-top: 28px; }
body:has(noscript) { overflow: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
