/* ==========================================================================
   pillkahn.de — Der Hub
   Bühne: tiefes Anthrazit mit Blaustich. Licht: Cyan-Weiß + acht Signaturen.
   Dramaturgie: Auftakt → Denkmaschine → Wer → Netzwerk (Finale).
   ========================================================================== */

/* ---------- Fonts (selbstgehostet, variable) ---------- */
@font-face {
  font-family: 'Space Grotesk';
  src: url('../assets/fonts/space-grotesk-var-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-var-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- Design-Tokens ---------- */
:root {
  /* Bühne */
  --bg: #07090e;
  --bg-deep: #05060a;
  --ink: #e9edf4;
  --ink-dim: #97a0af;
  --ink-faint: #5b6472;

  /* Leitlicht */
  --leit: #bdefff;
  --leit-glow: rgba(140, 225, 255, 0.35);

  /* Die acht Lichtsignaturen */
  --c-tech: #3d7bff;       /* technology-review.com — Elektrik-Blau  */
  --c-zukunft: #8b5cf6;    /* operation-zukunft.de — Violett         */
  --c-paul: #e8a33d;       /* pillkahn.com — Bernstein/Gold          */
  --c-abenteuer: #2dd4bf;  /* profandprompt.de — Türkis              */
  --c-szenario: #e04fd1;   /* picturesofthefuture.de — Magenta       */
  --c-innovation: #34d17a; /* innovation-review.de — Grün            */
  --c-claw: #a8f0ff;       /* agent-claw.de — Cyan-Weiß (Leitlicht)  */
  --c-lab: #ff5c6e;        /* picturesoftomorrow.com — Koralle (8.)  */

  /* Typo */
  --font-display: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-text: 'Inter', 'Helvetica Neue', Arial, sans-serif;

  /* Rhythmus */
  --space-act: clamp(6rem, 14vh, 12rem);
  --ease-cine: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Grundgerüst ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

.act { position: relative; }

.act-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4.5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
}

/* Scrollgesteuerte Reveals (JS setzt .is-visible) */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.1s var(--ease-cine), transform 1.1s var(--ease-cine);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   AKT 1 — Auftakt
   ========================================================================== */
.act-1 {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse 120% 90% at 50% 110%, #0a0e18 0%, var(--bg-deep) 60%);
}

/* Weicher Auslauf in den nächsten Akt */
.act-1::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 16vh;
  background: linear-gradient(to bottom, transparent, var(--bg-deep));
  pointer-events: none;
}

/* Lichtnebel: reine CSS-Bühne, langsam atmend */
.nebula {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 42% 30% at 32% 62%, rgba(94, 178, 255, 0.07), transparent 70%),
    radial-gradient(ellipse 36% 26% at 68% 38%, rgba(168, 240, 255, 0.06), transparent 70%),
    radial-gradient(ellipse 30% 22% at 52% 76%, rgba(139, 92, 246, 0.05), transparent 70%);
  animation: nebula-drift 26s ease-in-out infinite alternate;
}
@keyframes nebula-drift {
  from { transform: translate3d(-2.5%, -1.5%, 0) scale(1); }
  to   { transform: translate3d(2.5%, 2%, 0) scale(1.06); }
}

/* Blueprint-Ebene: feine weiße Linien, dieselbe Ingenieurs-Sprache
   wie die Denkmaschine */
.blueprint {
  position: absolute;
  top: 50%;
  left: 58%;
  width: 150vmin;
  height: 150vmin;
  transform: translate(-50%, -50%);
  opacity: 0.34;
  pointer-events: none;
}
.blueprint-rot {
  animation: bp-rotate 160s linear infinite;
  transform-origin: 500px 500px;
}
@keyframes bp-rotate {
  to { transform: rotate(360deg); }
}

.act-1-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(4rem, 12vh, 7rem) clamp(1.5rem, 6vw, 5rem) clamp(7rem, 18vh, 10rem);
  max-width: 74rem;
  width: 100%;
  margin: 0 auto;
}

.lead-line {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5.9vw, 7.5rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  white-space: nowrap;
  margin: 0 0 0 -0.03em;
  color: var(--leit);
  text-shadow: 0 0 60px var(--leit-glow);
}

.cascade {
  list-style: none;
  margin: clamp(2rem, 5.5vh, 3.2rem) 0 0 0.2rem;
  padding: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.15rem, 2.6vw, 1.9rem);
  line-height: 1.6;
  color: var(--ink-dim);
}
.cascade li {
  opacity: 0;
  transform: translateY(14px);
  animation: cascade-in 1.4s var(--ease-cine) forwards;
}
.cascade li:nth-child(1) { animation-delay: 1.0s; }
.cascade li:nth-child(2) { animation-delay: 2.1s; }
.cascade li:nth-child(3) { animation-delay: 3.2s; }
.cascade li:nth-child(4) { animation-delay: 4.3s; color: var(--leit); text-shadow: 0 0 40px var(--leit-glow); }
@keyframes cascade-in {
  to { opacity: 1; transform: none; }
}

/* Scroll-Hinweis */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 2.2rem;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink-faint);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0;
  animation: cascade-in 1.6s var(--ease-cine) 5.6s forwards;
}
.scroll-hint-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, transparent, var(--leit));
  animation: hint-pulse 2.6s ease-in-out infinite;
}
@keyframes hint-pulse {
  0%, 100% { opacity: 0.35; transform: scaleY(0.7); transform-origin: top; }
  50%      { opacity: 1;    transform: scaleY(1); }
}

/* ==========================================================================
   Video-Bühnen (gemeinsame Basis)
   16:9-Fläche, die den Viewport abdeckt; Hotspots bleiben deckungsgleich
   mit den Videopixeln, weil beide in % derselben Fläche leben.
   ========================================================================== */
.stage-wrap {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.stage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  aspect-ratio: 16 / 9;
  width: max(100vw, 177.78vh);
}
.stage-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg-deep);
}

/* ==========================================================================
   AKT 2 — Denkmaschine (Herzstück)
   ========================================================================== */
.act-machine {
  background: var(--bg-deep);
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
}
.act-machine .stage-wrap { position: absolute; inset: 0; height: auto; }
.act-machine .stage-video { opacity: 0.85; filter: brightness(0.82) contrast(1.05); }

/* Vignette: bindet das Video weich an die dunkle Bühne */
.act-machine .stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 65% at 62% 50%, transparent 55%, var(--bg-deep) 100%);
  pointer-events: none;
}

/* Leseschicht über dem Video */
.machine-captions {
  position: relative;
  z-index: 2;
  padding: var(--space-act) clamp(1.5rem, 6vw, 5rem);
  max-width: 42rem;
  background: linear-gradient(to right, rgba(5, 6, 10, 0.82) 40%, rgba(5, 6, 10, 0.35) 75%, transparent);
}
.machine-captions .act-title { margin-bottom: clamp(2rem, 5vh, 3.5rem); }

.layers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(1.4rem, 3.5vh, 2.4rem);
}
.layers li {
  position: relative;
  padding-left: 3.4rem;
  font-size: 0.98rem;
  color: var(--ink-dim);
  max-width: 26rem;
}
.layers li strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  color: var(--ink);
  margin-bottom: 0.15rem;
}
.layer-index {
  position: absolute;
  left: 0;
  top: 0.15rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--c);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
  box-shadow: 0 0 24px color-mix(in srgb, var(--c) 20%, transparent);
}
/* gestaffelte Reveals */
.layers li:nth-child(2) { transition-delay: 0.15s; }
.layers li:nth-child(3) { transition-delay: 0.3s; }
.layers li:nth-child(4) { transition-delay: 0.45s; }

@media (max-width: 700px) {
  .machine-captions {
    background: linear-gradient(to top, rgba(5, 6, 10, 0.88) 70%, transparent);
    align-self: flex-end;
    max-width: none;
  }
}

/* ==========================================================================
   AKT 3 — Wer (Erdung)
   ========================================================================== */
.act-bio {
  /* schwebt etwas heller zwischen den beiden dunklen Video-Akten,
     läuft oben und unten weich in bg-deep aus */
  background: linear-gradient(to bottom, var(--bg-deep), #0a0e18 45%, var(--bg-deep));
  padding: var(--space-act) clamp(1.5rem, 6vw, 5rem);
}
.act-bio-inner { max-width: 46rem; margin: 0 auto; }

.bio {
  margin: clamp(1.8rem, 4vh, 2.8rem) 0 0;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--ink-dim);
}
.bio p { margin: 0 0 0.9em; }
.bio p:first-child { color: var(--ink); }

/* Rechtstexte: gleiche Bühne, nur mit Gliederung */
.legal { font-size: clamp(0.92rem, 1.15vw, 1rem); }
.legal-lead { color: var(--ink); }
.legal h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--leit);
  margin: 2.4em 0 0.7em;
}
.legal ul {
  margin: 0 0 0.9em;
  padding-left: 1.2em;
}
.legal li { margin-bottom: 0.35em; }
.legal a { color: var(--leit); }
.legal strong { color: var(--ink); }

/* ==========================================================================
   AKT 4 — Netzwerk (Finale: die acht Ziele)
   ========================================================================== */
.act-network {
  background: var(--bg-deep);
  overflow: hidden;
}
/* Höher und etwas kleiner als in den anderen Akten, damit der Titel nicht
   in den Glow des oberen linken Knotens (21.8%/16.9%) läuft. */
.act-network .act-title {
  position: absolute;
  z-index: 3;
  top: clamp(1rem, 2.2vh, 1.75rem);
  left: clamp(1rem, 3vw, 2.5rem);
  font-size: clamp(1.35rem, 2.6vw, 2.8rem);
  color: var(--ink);
  pointer-events: none;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.8);
}

/* Vignette wie beim Maschinen-Akt — weicher Einstieg in die Bühne */
.act-network .stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 60%, var(--bg-deep) 100%);
  pointer-events: none;
}

/* Auf schmalen Screens: Video ganz zeigen (contain), damit alle
   acht Knoten erreichbar bleiben */
@media (max-aspect-ratio: 4/5) {
  .act-network .stage-wrap {
    height: auto;
    padding: 22vh 0 14vh;
  }
  .act-network .stage {
    position: relative;
    top: auto; left: auto;
    transform: none;
    width: 100vw;
  }
}

/* --- Achter Strahl (gezeichnet, weil das Video nur sieben rendert) --- */
.ray-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.ray-overlay .ray-stop-core { stop-color: var(--leit); stop-opacity: 0.75; }
.ray-overlay .ray-stop-mid  { stop-color: var(--c-lab); stop-opacity: 0.5; }
.ray-overlay .ray-stop-end  { stop-color: var(--c-lab); stop-opacity: 0.95; }
.ray-overlay .ray-glow { filter: blur(4px); opacity: 0.5; }
.ray-overlay .ray-core { opacity: 0.9; }

/* --- Hotspots --- */
.hotspots { position: absolute; inset: 0; z-index: 2; }

.hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  width: clamp(44px, 6vw, 76px);
  height: clamp(44px, 6vw, 76px);
  border-radius: 50%;
  text-decoration: none;
  outline-offset: 4px;
}
.hotspot:focus-visible { outline: 2px solid var(--c); }

.hotspot-dot {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 55%, transparent) 0%, transparent 62%);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.6s var(--ease-cine), transform 0.6s var(--ease-cine);
}
.hotspot:hover .hotspot-dot,
.hotspot:focus-visible .hotspot-dot {
  opacity: 1;
  transform: scale(1.35);
}

/* Label + Zweizeiler */
.hotspot-card {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.8rem);
  transform: translateX(-50%) translateY(6px);
  width: max-content;
  max-width: 17rem;
  padding: 0.7rem 0.95rem 0.8rem;
  border-radius: 10px;
  background: rgba(7, 9, 14, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--c) 18%, transparent);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease-cine), transform 0.45s var(--ease-cine), visibility 0s 0.45s;
  pointer-events: none;
  text-align: left;
  z-index: 4;
}
.hotspot:hover .hotspot-card,
.hotspot:focus-visible .hotspot-card {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.45s var(--ease-cine), transform 0.45s var(--ease-cine), visibility 0s;
}
.hotspot-card strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  color: var(--c);
  margin-bottom: 0.2rem;
  white-space: nowrap;
}
.hotspot-card span {
  display: block;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ink-dim);
}

/* Karten am Bühnenrand nicht abschneiden */
.hotspot.card-above .hotspot-card {
  top: auto;
  bottom: calc(100% + 0.8rem);
}

/* --- Achter Knoten: das Szenario-Labor ---
   Anders als die sieben gerenderten Knoten muss dieser hier selbst gezeichnet
   werden — und er ist der einzige, der dauerhaft beschriftet ist und pulsiert.
   Reihenfolge im Stylesheet ist Absicht: überschreibt .card-above. */
.hotspot--lab {
  width: clamp(52px, 7vw, 88px);
  height: clamp(52px, 7vw, 88px);
  z-index: 3;
}

/* Knotenform aus dem Video zitiert: Dunsthof, Ring, heller Kern */
.hotspot--lab .lab-node {
  position: absolute;
  inset: -22%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
      color-mix(in srgb, var(--c) 38%, transparent) 0%,
      color-mix(in srgb, var(--c) 12%, transparent) 32%,
      transparent 62%);
  animation: lab-pulse 3.6s var(--ease-cine) infinite;
}
.hotspot--lab .lab-node::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30%;
  height: 30%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--c) 85%, #fff);
  box-shadow:
    0 0 18px color-mix(in srgb, var(--c) 60%, transparent),
    inset 0 0 12px color-mix(in srgb, var(--c) 45%, transparent);
}
.hotspot--lab .lab-node::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11%;
  height: 11%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 16px 4px color-mix(in srgb, var(--c) 85%, #fff);
}

@keyframes lab-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50%      { transform: scale(1.09); opacity: 1; }
}

/* Karte dauerhaft sichtbar — hier soll nichts erst gesucht werden müssen */
.hotspot--lab .hotspot-card {
  top: calc(100% + 0.9rem);
  bottom: auto;
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  max-width: 22rem;
}
.hotspot--lab:hover .hotspot-card,
.hotspot--lab:focus-visible .hotspot-card {
  border-color: color-mix(in srgb, var(--c) 80%, transparent);
  box-shadow: 0 0 55px color-mix(in srgb, var(--c) 30%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .hotspot--lab .lab-node { animation: none; }
}

/* Schmale Screens: die Bühne schrumpft, die Karte nicht. Über dem Knoten würde
   sie den halben Kern verdecken — also darf sie unter die Bühne ragen, wo im
   Layout ohnehin Luft ist. Dafür muss das Cropping des Wrappers hier weg. */
@media (max-aspect-ratio: 4/5) {
  .act-network .stage-wrap { overflow: visible; }
  .hotspot--lab .hotspot-card {
    top: calc(100% + 0.9rem);
    bottom: auto;
    max-width: min(22rem, calc(100vw - 2rem));
  }
}

/* --- Kalibrier-Overlay (?debug=1) --- */
.debug-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  background-image:
    repeating-linear-gradient(to right, rgba(168, 240, 255, 0.12) 0 1px, transparent 1px 10%),
    repeating-linear-gradient(to bottom, rgba(168, 240, 255, 0.12) 0 1px, transparent 1px 10%);
  cursor: crosshair;
  font-family: monospace;
}
.debug-overlay .debug-readout {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 10;
  background: rgba(0, 0, 0, 0.85);
  color: #9fe8ff;
  padding: 0.8rem 1rem;
  font-size: 12px;
  line-height: 1.6;
  border: 1px solid rgba(168, 240, 255, 0.3);
  border-radius: 8px;
  max-width: 30rem;
  white-space: pre;
  pointer-events: none;
}
.debug-overlay .debug-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #ff5f8f;
  font-size: 11px;
  pointer-events: none;
}
body.debug .hotspot { outline: 1px dashed rgba(255, 95, 143, 0.8); }
body.debug .hotspot::after {
  content: attr(href);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  font: 10px monospace;
  color: #ff5f8f;
  white-space: nowrap;
}

/* ==========================================================================
   Fuß
   ========================================================================== */
.footer-wrap {
  background: var(--bg-deep);
  padding: 0 clamp(1.5rem, 6vw, 5rem);
}
.site-footer {
  max-width: 46rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 2rem 0 2.4rem;
  border-top: 1px solid rgba(151, 160, 175, 0.14);
  font-size: 0.82rem;
  color: var(--ink-faint);
}
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 1.6rem; }
.site-footer a {
  color: var(--ink-dim);
  text-decoration: none;
}
.site-footer a:hover { color: var(--leit); }

/* Ausklappbares Impressum */
.impressum { width: 100%; }
.impressum summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  color: var(--ink-dim);
  list-style: none;
  -webkit-user-select: none;
  user-select: none;
}
.impressum summary::-webkit-details-marker { display: none; }
.impressum summary::after {
  content: '';
  width: 0.45em;
  height: 0.45em;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-15%);
  transition: transform 0.3s var(--ease-cine);
}
.impressum[open] summary::after { transform: rotate(225deg) translateY(-15%); }
.impressum summary:hover { color: var(--leit); }

.impressum-body {
  max-width: 62ch;
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(151, 160, 175, 0.14);
  line-height: 1.7;
}
.impressum-body p { margin: 0 0 0.85em; }
.impressum-body p:first-child { color: var(--ink-dim); }
.impressum-body a { text-decoration: underline; text-underline-offset: 2px; }

/* ==========================================================================
   Reduced Motion — Standbilder statt Bewegung
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nebula, .scroll-hint-line, .blueprint-rot { animation: none; }
  .cascade li, .scroll-hint {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  /* Videos: JS verhindert Autoplay; Poster bleibt stehen */
}
