/* ============================================================
   cv.joelduss.xyz — Themen-Galaxie (map.html) · V2 SYNTHWAVE/TRON
   Full-bleed WebGPU-Canvas mit Neon-Chrome-Overlay, Legende,
   Detail-Panel und 2D-Fallback. Benannter Stil: Synthwave/Tron —
   deep-purple-schwarzer Verlauf, Glas-Panels mit Neon-Kanten-Glow
   (cyan/magenta), Orbitron-Display-Type. Eine Akzent-Paarung.
   CSP-konform: font-src 'self' (Fonts vendored, kein CDN).
   ============================================================ */

/* ───────────────────────── fonts (vendored, OFL) ─────────────
   Orbitron — SIL OFL 1.1, instanziert + subset (Latin + de) auf
   /assets/fonts/orbitron/. Nur Display: h1 + Legende-/Cluster-Labels.
   font-display: swap → kein FOIT, kein Layout-Sprung der Chrome. */
@font-face {
  font-family: "Orbitron";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/orbitron/orbitron-400.woff2") format("woff2");
}
@font-face {
  font-family: "Orbitron";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/orbitron/orbitron-700.woff2") format("woff2");
}

/* ───────────────────────── reset ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; }

/* ───────────────────────── tokens (V2 NEON-Palette) ──────────
   Verbindlicher Farb-Kontrakt mit Generator + Szene. APCA-geprüft
   (Lc gegen --bg #0a0118): --fg 95.8 · --fg-subtle 73.3 ·
   --fg-muted 54.6 (Body-/Meta-Floor) · cyan 78.9. Das alte
   #6e7781 (30 Lc) ist verboten und durch --fg-subtle ersetzt. */
:root {
  /* Hintergrund — deep-purple-schwarz */
  --bg:            #0a0118;
  --bg-subtle:     #140b2e;
  --bg-muted:      #1d1240;

  /* Glas-Panel-Flächen (halbtransparent über Canvas) */
  --glass:         rgba(20, 11, 46, 0.72);
  --glass-strong:  rgba(16, 9, 38, 0.90);
  --glass-pill:    rgba(20, 11, 46, 0.62);

  /* Kanten */
  --border:        rgba(0, 229, 255, 0.28);   /* cyan, dezent */
  --border-muted:  rgba(168, 163, 201, 0.18);

  /* Text */
  --fg:            #ecebff;
  --fg-muted:      #a8a3c9;   /* Floor laut Spec — Body/Meta */
  --fg-subtle:     #cac4e8;   /* heller, für kleine Uppercase-Labels */

  /* Neon-Akzente (Akzent-Paarung) */
  --accent:        #00e5ff;   /* cyan — primär, Focus-Ring */
  --accent-emph:   #5cefff;
  --accent-2:      #ff2ec4;   /* magenta — sekundär, Glow */

  /* Glow-Tints (für box-shadow / Borders) */
  --glow-cyan:     rgba(0, 229, 255, 0.55);
  --glow-cyan-soft: rgba(0, 229, 255, 0.22);
  --glow-magenta:  rgba(255, 46, 196, 0.45);
  --glow-magenta-soft: rgba(255, 46, 196, 0.18);

  /* Cluster-/Skill-Farben — V2 Neon (Kontrakt mit JSON) */
  --c-ai-llm:      #bd00ff;
  --c-web:         #00e5ff;
  --c-agents:      #ff2ec4;
  --c-devops:      #ff7a00;
  --c-data-rag:    #00ffb2;
  --c-games:       #ffe600;
  --c-tools:       #94a3b8;
  --c-grey:        #94a3b8;

  /* Panel-Schatten + Neon-Glow */
  --shadow-medium: 0 8px 24px rgba(4, 0, 14, 0.6),
                   0 0 0 1px var(--border) inset;
  --shadow-large:  0 16px 48px rgba(4, 0, 14, 0.78),
                   0 0 24px var(--glow-cyan-soft),
                   0 0 1px var(--accent) inset;

  --f-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont,
            "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif,
            "Apple Color Emoji", "Segoe UI Emoji";
  --f-display: "Orbitron", var(--f-sans);
  --f-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
            "Liberation Mono", monospace;

  --fs-meta:   12px;
  --fs-body:   14px;
  --fs-md:     16px;
  --fs-lg:     20px;
  --fs-xl:     24px;
  --fs-2xl:    32px;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;

  --gutter: clamp(0.9rem, 2.5vw, 1.6rem);

  --panel-w: min(380px, 92vw);
}

/* ───────────────────────── base ──────────────────────────── */
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--f-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--fg);
  /* Deep-purple-schwarzer Radial-Verlauf hinter dem Canvas */
  background:
    radial-gradient(1400px 1000px at 72% -8%, var(--bg-subtle), transparent 62%),
    radial-gradient(1100px 900px at 12% 108%, rgba(189, 0, 255, 0.10), transparent 60%),
    var(--bg);
  overflow: hidden; /* Canvas füllt den Viewport, Chrome ist overlay */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: rgba(0, 229, 255, 0.32); color: var(--fg); }

/* ───────────────────────── focus ring (Neon cyan) ────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
  box-shadow: 0 0 0 4px var(--glow-cyan-soft);
}

/* ───────────────────────── visually-hidden ───────────────── */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ───────── Screenreader-/Tastatur-Index (Tab → Projekt-Buttons) ────────── */
#sr-index:focus-within {
  position: fixed !important;
  inset: auto auto 1rem 1rem;
  width: min(92vw, 30rem);
  max-height: 70vh;
  height: auto;
  margin: 0;
  padding: 1rem 1.1rem;
  overflow: auto;
  clip: auto;
  clip-path: none;
  white-space: normal;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-large);
  backdrop-filter: blur(12px);
  z-index: 60;
  list-style: none;
}
#sr-index:focus-within h2 {
  font-size: var(--fs-meta);
  color: var(--fg-subtle);
  margin: 0.6rem 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--f-display);
  font-weight: 700;
}
#sr-index:focus-within ul { list-style: none; padding: 0; margin: 0; }
#sr-index:focus-within li { margin: 0; }
.sr-index__btn {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  padding: 0.4rem 0.5rem;
  min-height: 44px;        /* Touch-Target ≥ 44px */
  cursor: pointer;
}
#sr-index:focus-within .sr-index__btn:hover,
.sr-index__btn:focus-visible {
  background: rgba(0, 229, 255, 0.14);
}

/* ───────────────────────── full-bleed canvas ─────────────── */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: transparent; /* Body-Verlauf scheint durch, bis map.js rendert */
  touch-action: none;      /* Orbit-Gesten gehören der Szene */
}
/* map.js setzt im 2D-Fallback [hidden] auf #scene (Review-Major). */
#scene[hidden] { display: none; }

/* ───────────────────────── chrome overlay ────────────────── */
.map-chrome {
  position: fixed;
  top: var(--gutter);
  left: var(--gutter);
  z-index: 20;
  max-width: min(36rem, calc(100% - 2 * var(--gutter)));
  display: grid;
  gap: 6px;
  pointer-events: none; /* Klicks gehen an die Szene durch … */
}
.map-chrome > * { pointer-events: auto; } /* … ausser interaktiven Elementen */

.map-chrome h1 {
  font-family: var(--f-display);
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg);
  /* Synthwave-Doppelglow: cyan + magenta Saum */
  text-shadow:
    0 0 1px var(--accent),
    0 0 14px var(--glow-cyan),
    0 0 28px var(--glow-magenta-soft);
}
.map-chrome .meta {
  font-size: var(--fs-meta);
  color: var(--fg-muted);
  text-shadow: 0 1px 10px rgba(4, 0, 14, 0.9);
}
.map-chrome .meta time { font-variant-numeric: tabular-nums; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: start;
  padding: 6px 12px 6px 10px;
  min-height: 32px;
  font-size: var(--fs-meta);
  font-weight: 600;
  color: var(--fg-muted);
  background: var(--glass-pill);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 0 12px var(--glow-cyan-soft);
  backdrop-filter: blur(8px);
  text-decoration: none;
  transition: color 140ms ease, border-color 140ms ease,
              background-color 140ms ease, box-shadow 140ms ease;
}
.back:hover {
  color: var(--fg);
  border-color: var(--accent);
  background: var(--bg-muted);
  box-shadow: 0 0 16px var(--glow-cyan);
}
.back-icon { width: 14px; height: 14px; fill: currentColor; flex-shrink: 0; }

/* ───────────────────────── legend (unten links) ──────────────
   Accordion: pro Cluster eine Gruppe mit aufklappbarer Projektliste.
   Nur eine Gruppe gleichzeitig offen (Logik in map.js). */
.legend {
  position: fixed;
  left: var(--gutter);
  bottom: var(--gutter);
  z-index: 20;
  max-width: min(22rem, calc(100% - 2 * var(--gutter)));
}
/* map.js setzt im 2D-Fallback [hidden] auf .legend (Review-Major). */
.legend[hidden] { display: none; }

.legend__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.legend__group {
  display: flex;
  flex-direction: column;
}

/* gemeinsamer Pill-/Glas-Stil für Header- und Projekt-Buttons */
.legend__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;          /* Touch-Target ≥ 44px */
  padding: 8px 14px;
  font-family: var(--f-display);
  font-size: var(--fs-meta);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: var(--glass-pill);
  border: 1px solid var(--border-muted);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(4, 0, 14, 0.4);
  backdrop-filter: blur(8px);
  transition: color 140ms ease, border-color 140ms ease,
              background-color 140ms ease, box-shadow 140ms ease;
}
.legend__btn:hover,
.legend__btn[aria-pressed="true"],
.legend__head[aria-expanded="true"] {
  color: var(--fg);
  border-color: var(--accent);
  background: var(--bg-muted);
  box-shadow: 0 0 14px var(--glow-cyan-soft);
}

/* ── Header-Button: Dot · Icon · Label · Anzahl · Chevron ── */
.legend__head {
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.legend__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.legend__count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5em;
  height: 1.5em;
  padding: 0 0.4em;
  font-size: 0.82em;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--fg-subtle);
  background: rgba(0, 229, 255, 0.10);
  border: 1px solid var(--border-muted);
  border-radius: 999px;
}
.legend__head[aria-expanded="true"] .legend__count {
  color: var(--accent-emph);
  border-color: var(--accent);
}
.legend__chevron {
  flex-shrink: 0;
  font-size: 1.15em;
  line-height: 1;
  color: var(--fg-muted);
  transform: rotate(90deg);   /* › zeigt nach unten = zugeklappt */
  transition: transform 200ms ease, color 140ms ease;
}
.legend__head[aria-expanded="true"] .legend__chevron {
  transform: rotate(-90deg);  /* zeigt nach oben = offen */
  color: var(--accent);
}

/* ── Projektliste: grid-template-rows-Trick (0fr→1fr), kein height-animate ── */
.legend__subwrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 220ms ease;
}
.legend__group.is-open .legend__subwrap {
  grid-template-rows: 1fr;
}
.legend__sub {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 0;             /* nötig, damit der 0fr-Track wirklich kollabiert */
  overflow: hidden;          /* clippt Inhalt während der Animation */
}
.legend__group.is-open .legend__sub {
  /* lange Listen: innerhalb scrollen statt den Screen zu fluten */
  overflow-y: auto;
  overscroll-behavior: contain;
  max-height: 40vh;
  margin-top: 6px;
  padding: 6px;
  background: var(--glass-pill);
  border: 1px solid var(--border-muted);
  border-radius: 16px;
  box-shadow: 0 0 12px rgba(4, 0, 14, 0.4);
  backdrop-filter: blur(8px);
}
.legend__sub li { margin: 0; }
.legend__sub li + li { margin-top: 3px; }

/* Projekt-Button: kompaktere Glas-Zeile, kein Uppercase (Projekttitel lesbar) */
.legend__project {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;          /* Touch-Target ≥ 44px */
  padding: 8px 12px;
  text-align: left;
  font-family: var(--f-display);
  font-size: var(--fs-meta);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease,
              background-color 140ms ease;
}
/* Mini-Dot in der Cluster-Farbe vor jedem Projekt */
.legend__project::before {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot, var(--c-grey));
  box-shadow: 0 0 6px var(--dot, var(--c-grey));
}
.legend__project:hover {
  color: var(--fg);
  background: rgba(0, 229, 255, 0.08);
  border-color: var(--border-muted);
}

.legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor, 0 0 14px currentColor;
  background: var(--dot, var(--c-grey));
  color: var(--dot, var(--c-grey)); /* glow via currentColor */
}
/* Cluster-Icon (simple-icons SVG) in der Legende — neon-getintet.
   Wird von map.js als <img class="legend__icon"> erzeugt, sobald
   cluster.icon im JSON steht; fehlt es, bleibt nur der Dot. */
.legend__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  /* SVG (typ. schwarz/currentColor) in cyan-weiss kippen + leuchten */
  filter: brightness(0) saturate(100%) invert(86%) sepia(18%)
          saturate(900%) hue-rotate(140deg) brightness(105%)
          drop-shadow(0 0 4px var(--glow-cyan-soft));
}

/* ───────────────────────── detail panel (rechts) ─────────── */
.detail {
  position: fixed;
  top: var(--gutter);
  right: var(--gutter);
  bottom: var(--gutter);
  z-index: 30;
  width: var(--panel-w);
  display: flex;
  flex-direction: column;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-large);
  backdrop-filter: blur(16px);
  overflow: hidden;

  /* Tron-Kante: dünner Neon-Verlauf am oberen Rand */
  background-image: linear-gradient(180deg,
    rgba(0, 229, 255, 0.10), transparent 14%);

  /* slide-in: nur transform/opacity */
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 240ms ease, transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.detail.is-open {
  opacity: 1;
  transform: translateX(0);
}
.detail[hidden] { display: none; }

.detail__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--fg-muted);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  transition: color 140ms ease, background-color 140ms ease,
              border-color 140ms ease, box-shadow 140ms ease;
}
.detail__close:hover {
  color: var(--fg);
  background: var(--bg-muted);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--glow-cyan-soft);
}
.detail__close svg { width: 16px; height: 16px; fill: currentColor; }

.detail__body {
  padding: 20px 20px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Panel-Inhalt (von map.js erzeugt; Klassen hier vorbereitet) */
.detail__title {
  font-family: var(--f-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin: 0 32px 6px 0;
  color: var(--fg);
  text-shadow: 0 0 10px var(--glow-cyan-soft);
}
.detail__cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-display);
  font-size: var(--fs-meta);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 14px;
}
.detail__cluster .legend__dot { box-shadow: 0 0 6px currentColor; }
.detail__cluster .legend__icon { width: 14px; height: 14px; }

.detail__stats {
  display: flex;
  gap: 18px;
  margin-bottom: 16px;
}
.detail__stat { display: grid; gap: 2px; }
.detail__stat dt {
  font-family: var(--f-display);
  font-size: var(--fs-meta);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-subtle);  /* 73.3 Lc — klein, daher heller Ton */
  font-weight: 700;
}
.detail__stat dd {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.detail__section-label {
  font-family: var(--f-display);
  font-size: var(--fs-meta);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-subtle);  /* 73.3 Lc */
  font-weight: 700;
  margin: 16px 0 8px;
}

/* Sub-Kategorie-Zeile im Detail-Panel ('Bereich: <subcluster-label>').
   map.js fügt sie ein, sobald node.subcluster gesetzt ist. */
.detail__subcluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}
.detail__subcluster-label {
  font-family: var(--f-display);
  font-size: var(--fs-meta);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-subtle);
  font-weight: 700;
}
.detail__subcluster .detail__chip {
  border-color: var(--border);
  color: var(--fg);
  box-shadow: 0 0 8px var(--glow-cyan-soft);
}

.detail__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* Tech-Chip: Glas-Look (Portfolio-Stil), Logo + Name. Sitzt prominent oben
   im Panel (Variante --prominent setzt grössere Icons + Abstand). */
.detail__tech-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 9px;
  font-size: var(--fs-meta);
  font-weight: 600;
  color: var(--fg);
  background: var(--glass, var(--bg-muted));
  border: 1px solid var(--border-muted);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.04) inset,
              0 2px 10px rgba(4, 0, 14, 0.35);
  backdrop-filter: blur(6px);
}
.detail__tech-item img,
.detail__tech-item svg,
.detail__tech-icon { width: 14px; height: 14px; flex-shrink: 0; }
/* simple-icons sind fill="currentColor" (=schwarz im <img>) -> hell einfärben,
   damit sie auf dem dunklen Glas-Chip sichtbar sind. Dezent cyan getönt. */
.detail__tech-icon {
  filter: brightness(0) saturate(100%) invert(94%) sepia(6%)
          saturate(600%) hue-rotate(150deg) brightness(102%);
}
/* Prominente Tech-Zeile (ganz oben): grössere Logos (20px) + etwas Luft. */
.detail__tech--prominent { margin: 0 0 14px; gap: 8px; }
.detail__tech--prominent .detail__tech-item { padding: 7px 13px 7px 10px; }
.detail__tech--prominent .detail__tech-icon,
.detail__tech--prominent .detail__tech-item img,
.detail__tech--prominent .detail__tech-item svg { width: 20px; height: 20px; }

/* Monogramm-Fallback (Cluster-Farbkreis + Initiale), wenn ein Logo-SVG fehlt.
   Gleicher Look wie der 3D-Satelliten-Fallback. */
.detail__tech-mono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--mono, var(--c-grey));
  color: #0d1117;
  font-family: var(--f-mono, ui-monospace, monospace);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}
.detail__tech--prominent .detail__tech-mono {
  width: 20px; height: 20px; font-size: 12px;
}

.detail__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.detail__chip {
  padding: 3px 9px;
  font-size: var(--fs-meta);
  color: var(--fg-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-muted);
  border-radius: var(--r-sm);
}

/* ─────────── Hover-Tooltip: Name-Zeile + Mini-Tech-Icons (14px) ─────────
   Tooltip-Box selbst wird in map.js inline gestylt (aria-hidden). Hier nur
   die Icon-Reihe neben dem Projektnamen. */
.map-tooltip__name {
  display: flex;
  align-items: center;
  gap: 8px;
}
.map-tooltip__icons {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.map-tooltip__icons .detail__tech-icon,
.map-tooltip__icons .detail__tech-mono {
  width: 14px;
  height: 14px;
}

/* ─────────── Legende: Mini-Tech-Icons rechts je Projektzeile (14px) ──────
   Projekt-Button wird zur 2-Spalten-Zeile: Titel links (flex:1), Icons rechts
   (dezent, opacity 0.8). */
.legend__project-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.legend__project-icons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
  opacity: 0.8;
}
.legend__project-icons .detail__tech-icon,
.legend__project-icons .detail__tech-mono {
  width: 14px;
  height: 14px;
}
.legend__project:hover .legend__project-icons { opacity: 1; }

/* ───────────────────────── 2D fallback grid ──────────────── */
.fallback {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow-y: auto;
  background:
    radial-gradient(1200px 800px at 70% -10%, rgba(0, 229, 255, 0.07), transparent 60%),
    radial-gradient(900px 700px at 10% 110%, rgba(189, 0, 255, 0.10), transparent 60%),
    var(--bg);
}
.fallback[hidden] { display: none; }
body.is-fallback { overflow: auto; }

.fallback__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(var(--gutter) * 4) var(--gutter) calc(var(--gutter) * 2);
}
.fallback-note {
  font-size: var(--fs-body);
  color: var(--fg-muted);
  margin-bottom: 20px;
  max-width: 60ch;
}
.fallback__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.fallback-card {
  background: var(--glass);
  border: 1px solid var(--border-muted);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.06) inset,
              0 8px 24px rgba(4, 0, 14, 0.4);
  backdrop-filter: blur(6px);
}
.fallback-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.fallback-card__head .legend__icon { width: 16px; height: 16px; }
.fallback-card__title {
  font-family: var(--f-display);
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--fg);
}
.fallback-card__count {
  margin-left: auto;
  font-size: var(--fs-meta);
  color: var(--fg-subtle);
  font-variant-numeric: tabular-nums;
}
.fallback-card__list { display: grid; gap: 10px; margin-top: 12px; }

.fallback-node { display: grid; gap: 4px; }
.fallback-node__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.fallback-node__name {
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--fg);
}
.fallback-node__meta {
  font-size: var(--fs-meta);
  color: var(--fg-subtle);  /* 73.3 Lc — kleiner Meta-Ton */
  font-variant-numeric: tabular-nums;
}
.fallback-node__bar {
  height: 4px;
  border-radius: 999px;
  background: var(--bg-muted);
  overflow: hidden;
}
.fallback-node__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--bar, var(--c-grey));
  box-shadow: 0 0 8px var(--bar, var(--c-grey));
  width: var(--w, 0%);
}

/* ───────────────────────── noscript ──────────────────────── */
.noscript-note {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  text-align: center;
  font-size: var(--fs-md);
  color: var(--fg-muted);
  background: var(--bg);
}
.noscript-note a { color: var(--accent); text-decoration: none; }
.noscript-note a:hover { text-decoration: underline; }

/* ───────────────────────── responsive ────────────────────── */
@media (max-width: 600px) {
  .map-chrome h1 { font-size: var(--fs-xl); }
  .detail {
    top: auto;
    left: var(--gutter);
    right: var(--gutter);
    bottom: var(--gutter);
    width: auto;
    max-height: 60vh;
    transform: translateY(16px);
  }
  .detail.is-open { transform: translateY(0); }
  .legend {
    bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
    max-width: calc(100% - 2 * var(--gutter));
  }
  /* Mobil: offene Liste darf nicht den ganzen Screen verdecken. */
  .legend__group.is-open .legend__sub {
    max-height: 32vh;
  }
}

/* ───────────────────────── reduced motion ────────────────────
   prefers-reduced-motion: ALLE CSS-Animationen/Transitions aus. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .detail { transition: none; transform: none; }
  .back, .legend__btn, .detail__close { transition: none; }
  /* Accordion ohne Bewegung: kein Auf-/Zuklapp-Tween, Chevron springt. */
  .legend__subwrap { transition: none; }
  .legend__chevron, .legend__project { transition: none; }
}
