/* ===============================================================
   Knallwerdung — Negativ-Ästhetik · v4.1
   Cobaltblau Background · Schrift Weiss default · Auswahl Beige
   Typewriter Condensed
   Regelwerk:
     · Keine Transparenz auf Schriften (kein opacity, kein rgba alpha)
     · Default-Text:        #ffffff (--ink)
     · Auswahl / Hover:     #e2d4cc (--beige, --ink-active)
     · Buttons hover:       Negativ-Flip (Beige-Bg, Cobalt-Text)
     · Menüs Auswahl:       Unterstrich solid Beige
     · #f0c87a (--accent):  entfernt
   =============================================================== */

@font-face {
  font-family: 'TypewriterCondensed';
  src: url('fonts/typewcond_regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TypewriterCondensed';
  src: url('fonts/typewcond_bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Glyph-Fonts für Z-Zeichen (Symbole auf dem Resultat-Screen) */
@font-face {
  font-family: 'KnallSymbola';
  src: url('fonts/Symbola.otf') format('opentype');
  font-display: swap;
  unicode-range:
    U+0021-007E, U+0080-024F, U+0370-03FF,
    U+0900-097F,
    U+2000-2BFF, U+2E00-2E7F,
    U+3000-303F, U+4E00-9FFF,
    U+FE30-FE4F, U+FFF0-FFFF;
}
@font-face {
  font-family: 'KnallHieroglyphs';
  src: url('fonts/NotoSansEgyptianHieroglyphs-Regular.ttf') format('truetype');
  font-display: swap;
  unicode-range: U+13000-1342F;
}
@font-face {
  font-family: 'KnallCuneiform';
  src: url('fonts/NotoSansCuneiform-Regular.ttf') format('truetype');
  font-display: swap;
  unicode-range: U+12000-123FF;
}

:root {
  /* Hintergrund · Olive-Familie · v6.1 (vorher Cobalt) */
  --paper:        #405040;
  --paper-dark:   #2d3a2d;
  --paper-deep:   #1c241c;
  --paper-darker: #1c241c;
  --ink-dark:     #1c241c;
  --fog:          #2d3a2d;

  /* Schrift · NUR zwei Werte, beide solid, keine Transparenz */
  --ink:          #ffffff;   /* Default-Text · Weiss */
  --ink-active:   #e2d4cc;   /* Auswahl / Hover / Selected · Beige */
  --ink-strong:   #ffffff;   /* Legacy-Alias, identisch zu --ink */
  --beige:        #e2d4cc;   /* Klarname für Auswahl */

  /* Linien & Backgrounds · Transparenz NUR hier, niemals auf Text */
  --line:         rgba(255, 255, 255, 0.30);   /* Hairline-Border default */
  --line-soft:    rgba(255, 255, 255, 0.14);   /* Subtiler Border */
  --tint:         rgba(48, 60, 48, 0.45);
  --tint-light:   rgba(226, 212, 204, 0.06);

  /* Legacy-Aliases · Border-Verwendung beibehalten,
     in Text-Kontext werden sie unten konsequent durch --ink ersetzt */
  --ink-soft:     var(--line);
  --ink-faint:    var(--line);
  --ink-ghost:    var(--line-soft);

  /* Typografie */
  --serif:        'TypewriterCondensed', 'Courier New', monospace;
  --mono:         'TypewriterCondensed', 'Courier New', monospace;
  --glyph-font:   'KnallHieroglyphs', 'KnallCuneiform', 'KnallSymbola',
                  "Noto Sans Symbols 2", "Noto Color Emoji", "Apple Color Emoji",
                  "Segoe UI Emoji", "Apple Symbols", "Segoe UI Symbol",
                  "Noto Sans Symbols", "Symbola", "Courier New", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Hintergrund: tiefblau, leicht texturiert über Gradient */
.paper {
  min-height: 100vh;
  position: relative;
  background: var(--paper);
  background-image:
    radial-gradient(ellipse at top, rgba(255,255,255,.04) 0%, transparent 60%),
    radial-gradient(ellipse at bottom, rgba(0,0,0,.18) 0%, transparent 70%);
  padding: 0;
  max-width: 1440px;
  margin: 0 auto;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.25);
}
.paper::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(rgba(240,230,200,.04) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: .78;
}
.paper > * { position: relative; z-index: 1; }

/* Material Symbols */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: 300;
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
  vertical-align: middle;
  font-variation-settings: 'opsz' 24, 'wght' 300, 'FILL' 0, 'GRAD' 0;
}
.material-symbols-outlined.fill {
  font-variation-settings: 'opsz' 24, 'wght' 400, 'FILL' 1, 'GRAD' 0;
}

/* ============ HEADER ============ */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px 36px 16px;
  border-bottom: .5px solid var(--ink-faint);
  gap: 18px;
}
.site-brand {
  display: flex;
  align-items: baseline;
  gap: 22px;
  flex-wrap: wrap;
  justify-self: start;
}
.brand-name {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 1.5px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dotted var(--ink-soft);
}
.brand-name:hover { border-bottom-style: solid; }
.brand-tag {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 1px;
}
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  letter-spacing: 2px;
  justify-self: center;
}
.lang-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--ink);
  padding: 6px 8px;
  cursor: pointer;
  border-bottom: 1.5px solid transparent;
  transition: color .15s, border-color .15s;
}
.lang-btn:hover { color: var(--beige); }
.lang-btn.active {
  color: var(--beige);
  border-bottom-color: var(--beige);
  font-weight: 700;
}
.lang-sep {
  color: var(--ink);
  font-size: 15px;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}
.nav-link {
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: none;
  border-bottom: 1.5px solid transparent;
  cursor: pointer;
  text-transform: uppercase;
  transition: opacity .15s ease, border-color .15s ease;
}
.nav-link:hover { color: var(--beige); }
.nav-link.active {
  color: var(--beige); border-bottom-color: var(--beige);
}

/* ============ Screens ============ */
.screen {
  display: none;
  animation: fadeIn .4s ease-out;
  padding: 0 36px 40px;
}
.screen.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ Buttons ============ */
.btn {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 1.5px;
  padding: 12px 28px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.btn .material-symbols-outlined { font-size: 18px; }
.btn:hover:not(:disabled) { background: var(--ink); color: var(--ink-dark); }
.btn.primary { background: var(--ink); color: var(--ink-dark); }
.btn.primary:hover:not(:disabled) { background: var(--ink-strong); color: var(--ink-dark); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .72; cursor: not-allowed; }

/* ============ Schritt-Köpfe ============ */
.schritt-hint {
  font-family: var(--serif);
  font-size: 22px;
  margin-top: 14px;
  letter-spacing: 1px;
  font-style: italic;
}

/* ============ I. Auftakt ============ */
.auftakt {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 70vh;
  text-align: center;
  padding: 48px 24px;
  max-width: 680px;
  margin: 0 auto;
}
.punctuation {
  font-family: var(--serif);
  font-size: 24px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin: 14px 0;
}

.title {
  position: relative;
  font-family: var(--serif);
  font-size: 56px;
  letter-spacing: 10px;
  margin: 0 0 24px;
  font-weight: 400;
}
.subtitle {
  font-family: var(--serif);
  font-size: 24px; letter-spacing: 2px;
  margin: 0 0 32px;
  line-height: 1.35;
}
.intro {
  font-family: var(--mono);
  font-size: 22px;
  line-height: 1.4;
  margin: 0 0 32px;
}
.intro p { margin: 0 0 14px; }
.dazwischen { font-style: italic; }
.dedication {
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 1.5px;
  margin: 0 0 15px;
  line-height: 1.5;
}

/* ============ II. Portrait ============ */
.portrait-wahl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 920px;
  margin: 0 auto;
}
.portrait-wahl.two {
  grid-template-columns: repeat(2, 1fr);
  max-width: 620px;
}
@media (max-width: 700px) {
  .portrait-wahl { grid-template-columns: 1fr; }
}
.option {
  border: 1px solid var(--ink-faint);
  padding: 40px 28px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  background: var(--tint-light);
}
.option:hover {
  background: var(--ink);
  color: var(--ink-dark);
  border-color: var(--ink);
}
.option-icon {
  font-size: 56px !important;
  margin-bottom: 22px;
  display: block;
  font-variation-settings: 'opsz' 48, 'wght' 300, 'FILL' 0;
}
.option:hover .option-icon { color: var(--beige); }
.option-label {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 2px;
  margin-bottom: 10px;
}
.option-hint {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 1px;
}
.option:hover .option-hint { color: var(--beige); }

/* Skip-Button unter den Upload-Optionen — sichtbar als alternative Wahl */
.portrait-skip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 28px auto 0;
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--ink-faint);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 1.2px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.portrait-skip:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.portrait-skip .material-symbols-outlined {
  font-size: 18px;
}
.portrait-wahl + .portrait-skip {
  display: flex;
  justify-content: center;
  width: max-content;
}
/* zentriert den Skip-Button auf der Seite */
section[data-screen="2"] > .portrait-skip {
  margin-left: auto;
  margin-right: auto;
}

.webcam-box {
  max-width: 480px; margin: 36px auto 0;
  text-align: center;
}
.webcam-box video {
  width: 100%;
  border: 1px solid var(--ink);
  background: var(--ink);
}
.webcam-actions { margin-top: 18px; display: flex; gap: 12px; justify-content: center; }

.vorschau {
  max-width: 480px;
  margin: 36px auto 0;
  text-align: center;
}
.vorschau img {
  width: 100%;
  border: 1px solid var(--ink);
  display: block;
}
.vorschau-actions {
  margin-top: 20px;
  display: flex; gap: 12px; justify-content: center;
  flex-wrap: wrap;
}

.loader-inline {
  text-align: center;
  margin-top: 32px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 3px;
}
.flicker { animation: flicker 1.2s ease-in-out infinite; }
@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: .72; }
}

/* ============ III. Komposition ============ */
.komposition-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  align-items: start;
}
@media (max-width: 900px) {
  .komposition-grid { grid-template-columns: 1fr; }
}

/* Karten-Liste — Verdichtung über die Zeit */
.karten-wrap {
  background: var(--tint-light);
  border: .5px solid var(--ink-faint);
  padding: 16px;
}
.karten {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.karte {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 22px;
  align-items: center;
  padding: 22px 26px;
  border: 1px solid var(--ink-faint);
  background: var(--tint);
  color: var(--ink);
  cursor: pointer;
  transition: all .15s ease;
  position: relative;
  font-family: var(--mono);
  text-align: left;
}
.karte:hover {
  border-color: var(--ink);
  background: var(--paper-dark);
}
.karte.gewaehlt {
  background: var(--ink);
  color: var(--ink-dark);
  border-color: var(--ink);
}
.karte.locked {
  opacity: .72;
  cursor: not-allowed;
}
.karte.locked:hover {
  border-color: var(--ink);
  background: var(--tint);
}
.k-num {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
}
.k-content {
  font-family: var(--mono);
  letter-spacing: .3px;
  line-height: 1.55;
}

/* Verdichtung: Schriftgröße sinkt mit Ebenen-Nummer, Wörter rücken zusammen */
.karte[data-generation="1"]  .k-content,
.karte[data-generation="2"]  .k-content,
.karte[data-generation="3"]  .k-content { font-size: 22px; line-height: 1.7; }
.karte[data-generation="4"]  .k-content,
.karte[data-generation="5"]  .k-content,
.karte[data-generation="6"]  .k-content { font-size: 20px; line-height: 1.65; }
.karte[data-generation="7"]  .k-content,
.karte[data-generation="8"]  .k-content,
.karte[data-generation="9"]  .k-content { font-size: 18px; line-height: 1.6; }
.karte[data-generation="10"] .k-content,
.karte[data-generation="11"] .k-content,
.karte[data-generation="12"] .k-content { font-size: 17px; line-height: 1.55; }
.karte[data-generation="13"] .k-content,
.karte[data-generation="14"] .k-content { font-size: 16px; line-height: 1.5; }
.karte[data-generation="15"] .k-content,
.karte[data-generation="16"] .k-content,
.karte[data-generation="17"] .k-content { font-size: 15px; line-height: 1.5; }

/* Karte selbst wird auch enger / dichter */
.karte[data-generation="1"],
.karte[data-generation="2"],
.karte[data-generation="3"]  { padding: 22px 24px; }
.karte[data-generation="14"],
.karte[data-generation="15"],
.karte[data-generation="16"],
.karte[data-generation="17"] { padding: 14px 18px; }

@media (max-width: 700px) {
  .karte { grid-template-columns: 48px 1fr; gap: 12px; padding: 14px; }
  .k-num { font-size: 18px; }
  .karte[data-generation] .k-content { font-size: 12px !important; line-height: 1.5; }
}

/* Werkbank */
.werkbank {
  border: .5px solid var(--ink-faint);
  padding: 28px;
  background: var(--tint);
  font-family: var(--mono);
}
.wb-block { margin-bottom: 28px; }
.wb-label {
  font-size: 13px;
  letter-spacing: 3px;
  margin-bottom: 12px;
  display: flex; justify-content: space-between;
  text-transform: uppercase;
  font-weight: 700;
}
.wb-val { font-weight: 400; }
.wb-auswahl {
  font-family: var(--serif);
  font-size: 18px;
  min-height: 26px;
  letter-spacing: 1px;
  line-height: 1.5;
}
/* Lieblingswort-Eingabe */
.wb-lw {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ink-faint);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  padding: 8px 0 6px;
  outline: none;
  transition: border-color .15s ease;
}
.wb-lw::placeholder { color: var(--ink); font-style: italic; }
.wb-lw:focus { border-bottom-color: var(--ink); }

/* Regler · Knallfarben + Sättigung · v4.23 · zwei orthogonale Achsen */
.wb-regler-block .wb-regler-val {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 1px;
  font-weight: 400;
  min-width: 28px;
  text-align: right;
}
.wb-regler {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: var(--ink-faint);
  outline: none;
  margin: 6px 0 8px;
  border-radius: 1px;
  cursor: pointer;
}
.wb-regler::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  border: none;
  transition: transform .12s ease;
}
.wb-regler::-webkit-slider-thumb:hover { transform: scale(1.15); }
.wb-regler::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  border: none;
  transition: transform .12s ease;
}
.wb-regler::-moz-range-thumb:hover { transform: scale(1.15); }
.wb-regler-poles {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.wb-marker {
  border: 1px dashed var(--ink-faint);
  padding: 14px;
  min-height: 80px;
  text-align: center;
  font-size: 24px;
  letter-spacing: 8px;
  line-height: 1.6;
}
.wb-muted {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: none;
}
.wb-marker .marker-glyph {
  display: inline-block;
  margin: 4px;
  font-family: 'Noto Sans Symbols 2', 'Noto Sans Symbols', 'Special Elite', monospace;
}
.wb-scale {
  display: flex; justify-content: space-between;
  font-size: 12px; margin-top: 8px;
  letter-spacing: 1.5px;
  font-style: italic;
}
.wb-actions {
  display: flex; gap: 12px; flex-direction: column;
  margin-top: 32px;
}
.wb-actions .btn { width: 100%; font-size: 15px; padding: 12px; justify-content: center; }

/* ============ IV. Genesis – Urknall-Animation ============ */
.urknall {
  width: 320px;
  height: 320px;
  color: var(--ink);
  margin-bottom: 24px;
  overflow: visible;
}
.urknall .kern {
  transform-origin: 0 0;
  animation: kern-puls 1.4s ease-in-out infinite;
}
@keyframes kern-puls {
  0%, 100% { r: 5; opacity: 1; }
  50%      { r: 9; opacity: .85; }
}
.urknall .ring {
  transform-origin: 0 0;
  animation: schockwelle 3.4s cubic-bezier(.22,.61,.36,1) infinite;
  opacity: 0;
}
@keyframes schockwelle {
  0%   { r: 6;   opacity: .9; stroke-width: 1.4; }
  60%  {        opacity: .72; }
  100% { r: 145; opacity: 0;  stroke-width: .25; }
}
.urknall .ring-1 { animation-delay: 0s; }
.urknall .ring-2 { animation-delay: .85s; }
.urknall .ring-3 { animation-delay: 1.7s; }
.urknall .ring-4 { animation-delay: 2.55s; }

.urknall .p {
  transform-origin: 0 0;
  transform: rotate(var(--rot)) translate(0, -12px);
  animation: partikel 2.6s ease-out infinite;
  animation-delay: var(--delay);
  opacity: 0;
}
@keyframes partikel {
  0%   { transform: rotate(var(--rot)) translate(0, -8px);   opacity: 1; }
  100% { transform: rotate(var(--rot)) translate(0, -120px); opacity: 0; }
}

/* ============ V. Resultat ============ */
.meta {
  margin-bottom: 32px;
  display: flex; flex-direction: column;
  gap: 20px;
}
.meta-block {
  display: flex; flex-direction: column;
  gap: 6px;
  padding-bottom: 18px;
  border-bottom: .5px dashed var(--ink-faint);
}
.meta-block:last-child { border-bottom: none; padding-bottom: 0; }
.meta-k {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 700;
}
.meta-v {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
  letter-spacing: .5px;
  word-break: break-word;
}
.meta-v.meta-glyphs {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 1.5px;
  line-height: 1.5;
}

.gallery-dialog {
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed var(--ink);
  background: var(--tint);
}
.g-label {
  display: block; font-size: 14px; letter-spacing: 2px; margin-bottom: 6px; text-transform: uppercase;
}
.gallery-dialog input[type="text"] {
  width: 100%; padding: 8px;
  font-family: var(--mono); font-size: 15px;
  background: transparent; color: var(--ink);
  border: 1px solid var(--ink);
}
.g-hint { font-size: 14px; margin: 10px 0; letter-spacing: .5px; }
.g-actions { display: flex; gap: 10px; }
.g-actions .btn { flex: 1; font-size: 14px; padding: 8px; letter-spacing: 1.5px; }

.gallery-status {
  margin-top: 14px; padding: 10px;
  font-size: 14px; letter-spacing: 1px;
  border: .5px solid var(--ink); text-align: center;
}
.gallery-status a { color: var(--ink); }

/* ============ Verwandte Projekte (Kacheln) ============ */
/* ============ Video Player ============ */
.video-player {
  padding: 28px 40px 40px;
  background: var(--tint-light);
  border-top: .5px solid var(--ink-faint);
  margin-top: 60px;
  text-align: center;
}
.vp-kicker {
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 auto 18px;
  max-width: 720px;
  font-weight: 700;
}
.vp-kicker .ap-title { font-weight: 700; letter-spacing: 4px; }
.vp-kicker .ap-now   { font-weight: 700; letter-spacing: 4px; }
.video-player video {
  display: block;
  margin: 0 auto;
  max-width: 720px;
  width: 100%;
  height: auto;
  border: 1px solid var(--ink-faint);
  background: #000;
}
.vp-tracks {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
.ap-track {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 1.5px;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--ink-faint);
  color: var(--ink);
  cursor: pointer;
  transition: all .12s ease;
  text-transform: uppercase;
}
.ap-track:hover { border-color: var(--ink); }
.ap-track.active {
  background: var(--ink);
  color: var(--ink-dark);
  border-color: var(--ink);
}

.related-projects {
  padding: 40px 40px 24px;
  border-top: .5px solid var(--ink-faint);
  margin-top: 0;
}
.video-player + .related-projects { margin-top: 0; }
.rp-kopf {
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 18px;
  font-weight: 700;
}
.rp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.rp-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px 20px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--ink-faint);
  background: var(--tint-light);
  transition: all .2s ease;
  position: relative;
  overflow: hidden;
}
.rp-item::after {
  content: '→';
  position: absolute;
  right: 18px; bottom: 16px;
  font-family: var(--mono);
  font-size: 22px;
  opacity: 0;
  transform: translateX(-8px);
  transition: all .2s ease;
}
.rp-item:hover {
  background: var(--ink);
  color: var(--ink-dark);
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}
.rp-item:hover::after {
  opacity: 1;
  transform: translateX(0);
}
.rp-kicker {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.rp-name {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 1px;
  line-height: 1.3;
}

.related-projects + .site-footer { margin-top: 0; border-top: none; }

@media (max-width: 900px) {
  .rp-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .rp-grid { grid-template-columns: 1fr; }
  .video-player { padding: 18px 18px 24px; }
  .vp-tracks { flex-wrap: wrap; }
  .related-projects { padding: 40px 24px 16px; }
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 40px;
  border-top: .5px solid var(--ink-faint);
  margin-top: 48px;
}
.footer-icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: none; border: 1px solid var(--ink-faint);
  color: var(--ink); text-decoration: none;
  cursor: pointer;
  transition: all .15s ease;
}
.footer-icon:hover { background: var(--ink); color: var(--ink-dark); border-color: var(--ink); }
.footer-icon .material-symbols-outlined { font-size: 20px; }
.footer-copyright {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 1.5px;
}

/* ============ KNALLWERDUNG Poster Overlay ============ */
@keyframes fadeOverlay {
  to   { opacity: 1; }
}

/* ============ Fehler ============ */
.fehler {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--ink-dark);
  padding: 12px 44px 12px 18px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 1px;
  border: 1px solid var(--paper);
  z-index: 1500;
  max-width: 90%;
  display: flex; align-items: center; gap: 10px;
}
.fehler-x {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--ink);
  display: inline-flex;
}
.fehler-x:hover { color: var(--beige); }
.fehler-x .material-symbols-outlined { font-size: 16px; }

/* ============ Mobile ============ */
@media (max-width: 700px) {
  .site-header {
    grid-template-columns: 1fr;
    padding: 16px 18px;
    gap: 12px;
    justify-items: center;
    text-align: center;
  }
  .site-brand { justify-self: center; justify-content: center; }
  .lang-toggle { justify-self: center; }
  .site-nav { justify-self: center; flex-wrap: wrap; justify-content: center; }
  .screen { padding: 0 18px 48px; }
  .site-footer { padding: 18px; flex-wrap: wrap; gap: 12px; }
  .footer-copyright { width: 100%; text-align: center; order: 3; }
  .title { font-size: 38px; letter-spacing: 6px; }
}

/* ============ werk.php — Einzelwerk-Share-Seite ============ */
body.werk-page {
  background: var(--paper);
  color: var(--ink);
}
.werk-page .site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 32px;
  border-bottom: .5px solid var(--ink-faint);
  gap: 24px;
}
.werk-page .brand a {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
}
.werk-page .header-lang {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 2px;
}
.werk-page .header-lang .lang-btn {
  color: var(--ink);
  text-decoration: none;
  padding: 4px 6px;
  transition: opacity .15s ease;
}
.werk-page .header-lang .lang-btn:hover { color: var(--beige); }
.werk-page .header-lang .lang-btn.active { color: var(--beige); border-bottom: 1.5px solid var(--beige); }
.werk-page .header-nav {
  justify-self: end;
  display: inline-flex;
  gap: 18px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.werk-page .header-nav a {
  color: var(--ink);
  text-decoration: none;
}
.werk-page .header-nav a:hover { color: var(--beige); }

.werk-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  letter-spacing: .5px;
  line-height: 1.15;
  margin: 0;
}
.back-link {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.back-link:hover { color: var(--beige); }

.site-footer-min {
  border-top: .5px solid var(--ink-faint);
  padding: 18px 32px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 1.5px;
  text-align: center;
}

@media (max-width: 800px) {
  .werk-page .site-header { grid-template-columns: 1fr; text-align: center; gap: 10px; padding: 14px 18px; }
  .werk-page .header-lang, .werk-page .header-nav { justify-self: center; }
  .werk-main { margin: 18px auto 32px; padding: 0 16px; }
  .werk-title { font-size: 24px; }
}

/* ============ Share-Block in Save-Success + Lightbox ============ */
.share-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: .5px solid var(--ink-faint);
}
.share-label {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.share-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.share-input {
  flex: 1;
  font-family: var(--mono);
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--ink-faint);
  background: rgba(0,0,0,.03);
  color: var(--ink);
  cursor: text;
  min-width: 0;
}
.share-copy {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--ink-dark);
  border: 1px solid var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.share-copy:hover { background: var(--beige); color: var(--ink-dark); }

.lb-share {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: .5px solid var(--ink-faint);
}
.lb-open-werk {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-faint);
  padding-bottom: 2px;
}
.lb-open-werk:hover { border-bottom-color: var(--ink); }
.lb-copy-link {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 12px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  cursor: pointer;
  margin-left: auto;
}
.lb-copy-link:hover { background: var(--ink); color: var(--ink-dark); }

/* ============================================================
   Werk-Vertikal-Layout (Schritt V in index.html + werk.php)
   Eine Bühne — Bild oben, Text, Meta, Aktionen.
   Skeleton-State während Loading, ready-State wenn Bild da.
   ============================================================ */
.werk-vertikal {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
  gap: 36px;
}

/* Bild-Area: Skeleton-Animation und finales Bild überlagert,
   sauberer Übergang via data-state */
.werk-bild-area {
  position: relative;
  width: 100%;
  max-width: 820px;
  min-height: 340px;       /* Loading-State: kompakt, kein riesiger leerer Block */
}
.werk-vertikal[data-state="ready"] .werk-bild-area {
  aspect-ratio: 1 / 1;     /* Ready-State: das Bild bestimmt jetzt quadratisch das Layout */
  min-height: unset;
}
.werk-bild-area .urknall-skeleton {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  color: var(--ink);
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.werk-bild {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.6s ease;
  /* KEIN Rahmen — nur das Bild */
}
.werk-vertikal[data-state="ready"] .urknall-skeleton {
  opacity: 0;
}
.werk-vertikal[data-state="ready"] .werk-bild {
  opacity: 1;
}

/* Werk-Titel (nur werk.php hat diesen) */
.werk-titel {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  text-align: center;
  max-width: 720px;
  letter-spacing: 0.5px;
}

/* Genesis-Story-Text */
.werk-jandl {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink);
  max-width: 680px;
  width: 100%;
  word-wrap: break-word;
  text-align: left;
  min-height: 4em;
}
.werk-jandl .werk-stanza {
  margin: 0 0 1.1em 0;
}
.werk-jandl .werk-stanza:last-child {
  margin-bottom: 0;
}
/* Skelett-Modus · Platzhalter-Text wenn keine Pipeline läuft */
.werk-jandl .werk-stanza-platzhalter {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 1px;
  line-height: 1.7;
  text-align: center;
  border: .5px dashed var(--ink-faint);
  padding: 28px 24px;
  max-width: 600px;
  margin: 0 auto;
}
/* Skelett-Modus · Bild-Platzhalter zeigt nur die Cobalt-Fläche */
.werk-bild-platzhalter {
  background: var(--paper-dark);
  border: .5px solid var(--ink-faint);
}

/* 2-Spalten-Layout für werk.php (Einzelseite) und Galerie-Lightbox */
@media (min-width: 760px) {
  .werk-jandl--columns {
    column-count: 2;
    column-gap: 44px;
    column-fill: balance;
    max-width: 920px;
  }
  .werk-jandl--columns .werk-stanza {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* ============================================================
   Werk-Symbole — 1-spaltige große Symboldarstellung
   Eigene Bühne unter dem Gedicht, deutlich, klar sichtbar.
   ============================================================ */
.werk-symbols {
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 32px;
  padding: 32px 0;
  font-family: var(--glyph-font);
  font-size: 56px;
  line-height: 1;
  color: var(--ink);
  border-top: 1px solid var(--ink-soft);
  border-bottom: 1px solid var(--ink-soft);
}
.werk-symbols:empty { display: none; }
@media (max-width: 700px) {
  .werk-symbols {
    font-size: 40px;
    gap: 22px;
    padding: 24px 0;
  }
}

/* Skeleton-State */
.werk-jandl.skeleton {
  position: relative;
}
.werk-jandl.skeleton .skeleton-line {
  display: block;
  height: 18px;
  background: var(--ink-ghost);
  margin-bottom: 14px;
  border-radius: 1px;
  animation: skeletonPulse 1.4s ease-in-out infinite;
}
.werk-jandl.skeleton .skeleton-line-1 { width: 82%; animation-delay: 0s; }
.werk-jandl.skeleton .skeleton-line-2 { width: 94%; animation-delay: 0.15s; }
.werk-jandl.skeleton .skeleton-line-3 { width: 68%; animation-delay: 0.30s; }
.werk-jandl.skeleton .skeleton-cursor {
  display: inline-block;
  width: 11px;
  height: 22px;
  background: var(--ink);
  vertical-align: middle;
  animation: cursorBlink 1s step-end infinite;
  margin-left: 4px;
}
.werk-jandl:not(.skeleton) .skeleton-line,
.werk-jandl:not(.skeleton) .skeleton-cursor { display: none; }

@keyframes skeletonPulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.75; }
}
@keyframes cursorBlink {
  0%, 50%   { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Meta-Zeile — endlich präsent, nicht klein */
.werk-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px 48px;
  width: 100%;
  max-width: 820px;
  padding: 24px 0;
  border-top: 1px solid var(--ink-soft);
  border-bottom: 1px solid var(--ink-soft);
  align-items: baseline;
}
.werk-meta .meta-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.werk-meta .meta-k {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--ink);
  text-transform: uppercase;
}
.werk-meta .meta-v {
  font-family: var(--mono);
  font-size: 19px;
  letter-spacing: 0.5px;
  color: var(--ink);
}
.werk-meta .meta-glyphs {
  font-family: var(--glyph-font);
  font-size: 34px;
  line-height: 1.1;
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

/* Action-Reihe */
.werk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  width: 100%;
  max-width: 820px;
  margin-top: 8px;
}

/* werk.php Share-Reihe */
.werk-share-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  padding-top: 12px;
}

/* werk.php Main-Wrapper */
.werk-main {
  padding: 48px 0 60px;
  min-height: 60vh;
}
.werk-notfound {
  text-align: center;
  padding: 80px 24px;
  color: var(--ink);
}

/* Share-Popover Desktop-Fallback */
.share-popover {
  position: absolute;
  background: var(--paper-dark);
  border: 1px solid var(--ink-faint);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  z-index: 100;
  margin-top: 4px;
}
.share-popover .share-link {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 1px;
  padding: 10px 14px;
  background: transparent;
  color: var(--ink);
  border: none;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}
.share-popover .share-link:hover {
  background: var(--ink);
  color: var(--ink-dark);
}

/* Mobile */
@media (max-width: 700px) {
  .werk-vertikal { padding: 0 16px; gap: 28px; }
  .werk-titel { font-size: 30px; }
  .werk-jandl { font-size: 17px; line-height: 1.58; }
  .werk-meta {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 18px 0;
  }
  .werk-meta .meta-v { font-size: 17px; }
  .werk-meta .meta-glyphs { font-size: 28px; gap: 14px; }
  .werk-bild-area .urknall-skeleton { width: 220px; height: 220px; }
  .werk-main { padding: 32px 0 48px; }
}

/* ============================================================
   Jandl-Modal (KNALLWERDUNG-Poster) + Info-Modal
   Saubere Overlays mit Backdrop und Close-Button.
   ============================================================ */
.jandl-overlay,
.info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 36, 28, 0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.jandl-close {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1010;
  transition: background .15s ease, color .15s ease;
}
.jandl-close:hover {
  background: var(--ink);
  color: var(--ink-dark);
}
.jandl-close .material-symbols-outlined {
  font-size: 24px;
}

.jandl-poster {
  width: 100%;
  max-width: 1200px;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.jandl-poster img {
  max-width: 100%;
  max-height: 90vh;
  height: auto;
  display: block;
  object-fit: contain;
}

.info-paper {
  position: relative;
  background: var(--paper-dark);
  color: var(--ink);
  padding: 60px 48px 48px;
  max-width: 600px;
  width: 100%;
  border: 1px solid var(--ink-faint);
}
.info-paper .jandl-close {
  position: absolute;
  top: 16px;
  right: 16px;
}
.info-titel {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 24px;
}
.info-paper p {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 16px;
}
.info-tech {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  letter-spacing: 0.5px;
  margin-top: 24px;
}
.info-credit {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  letter-spacing: 1.5px;
  margin-top: 12px;
}

@media (max-width: 700px) {
  .jandl-overlay,
  .info-overlay { padding: 16px; }
  .jandl-close {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
  .info-paper {
    padding: 56px 24px 24px;
  }
  .info-titel { font-size: 22px; }
}

/* Header-Lock während Werk-Generierung — Nav-Links wirken inaktiv */
header.site-header[data-locked="true"] .nav-link {
  cursor: not-allowed;
}

/* CTA-Hint vor dem Speichern in die Galerie — präsent, voller Kontrast */
.werk-cta-hint {
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 0.3px;
  color: var(--ink);
  text-align: center;
  max-width: 700px;
  margin: 16px auto 12px;
  padding: 0 8px;
  line-height: 1.5;
}

/* ============================================================
   Portrait-Privacy-Note — kleiner dezenter Hinweis unter Upload-Options
   Sichtbar bevor User klickt, verschwindet bei Klick auf Option.
   ============================================================ */
.portrait-privacy-note {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.3px;
  color: var(--ink);
  text-align: center;
  max-width: 640px;
  margin: 22px auto 0;
  padding: 0 12px;
}
.portrait-privacy-note[hidden] { display: none; }

@media (max-width: 700px) {
  .portrait-privacy-note { font-size: 10px; padding: 0 8px; }
}

/* ============================================================
   werk.php · Einzelseite · v6.0 minimal
   Titel zentriert · Gedicht im Steg-Layout · Bild gross · Backlink
   Klassen scoped unter .werk-seite — kein Konflikt mit Genesis-Flow .werk-*
   ============================================================ */

.werk-seite {
  max-width: 1100px;
  margin: 56px auto 48px;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.werk-seite-titel {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 400;
  letter-spacing: .5px;
  line-height: 1.15;
  margin: 0 0 29px;
  text-align: center;
  color: var(--ink);
}

.werk-seite-jandl {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 auto 32px;
  width: 100%;
  max-width: 736px;
}

.werk-seite-col {
  margin-bottom: 1.2em;
}
.werk-seite-col:last-child {
  margin-bottom: 0;
}
.werk-seite-stanza {
  margin: 0 0 1.1em 0;
}
.werk-seite-stanza:last-child {
  margin-bottom: 0;
}

/* Steg-Layout ab 760px · zentrierter Mittelsteg
   linke Spalte rechtsbündig · rechte Spalte linksbündig
   Zeilen-Enden zeigen gegen die Mitte · Spalten exakt gleich breit */
@media (min-width: 760px) {
  .werk-seite-jandl {
    display: flex;
    gap: 64px;
    justify-content: center;
    align-items: flex-start;
  }
  .werk-seite-col {
    flex: 1 1 0;
    min-width: 0;
    max-width: 320px;
    margin-bottom: 0;
  }
  .werk-seite-col-left {
    text-align: right;
  }
  .werk-seite-col-right {
    text-align: left;
  }
}

.werk-seite-bild-wrap {
  width: 100%;
  text-align: center;
  margin: 0 0 29px;
}
.werk-seite-bild {
  max-width: 100%;
  max-height: 68vh;
  height: auto;
  display: inline-block;
  border: 1px solid var(--ink-faint);
}

.werk-seite-back {
  display: inline-block;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  margin-top: 4px;
  padding: 6px 12px;
}
.werk-seite-back:hover { color: var(--beige); }

/* ============================================================
   Blätter-Navigation · Pfeile fixed an Bildschirmrand
   Click oder Tastatur ← → · Pfeil ausgeblendet wenn kein prev/next
   ============================================================ */
.werk-seite-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 300;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--ink-faint);
  background: var(--paper-dark);
  transition: background .15s, color .15s, border-color .15s;
  z-index: 100;
  user-select: none;
  padding-bottom: 6px;
}
.werk-seite-nav:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.werk-seite-nav-prev { left: 24px; }
.werk-seite-nav-next { right: 24px; }

.werk-seite-close {
  position: fixed;
  top: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--ink-faint);
  background: var(--paper-dark);
  transition: background .15s, color .15s, border-color .15s;
  z-index: 100;
  user-select: none;
  padding-bottom: 4px;
}
.werk-seite-close:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

@media (max-width: 600px) {
  .werk-seite { padding: 0 16px; margin: 28px auto 32px; }
  .werk-seite-titel { font-size: 21px; margin-bottom: 22px; }
  .werk-seite-jandl { font-size: 14px; margin-bottom: 24px; }
  .werk-seite-nav {
    width: 36px;
    height: 36px;
    font-size: 28px;
    padding-bottom: 4px;
  }
  .werk-seite-nav-prev { left: 10px; }
  .werk-seite-nav-next { right: 10px; }
  .werk-seite-close {
    width: 36px;
    height: 36px;
    font-size: 24px;
    top: 10px;
    left: 10px;
    padding-bottom: 3px;
  }
}

/* ============================================================
   werk.php · Print-Stil · Cmd+P erzeugt sauberes PDF
   Cobalt-Branding bleibt erhalten, Backlink wird unterdrückt,
   Steg-Layout bleibt auch auf schmalen A4-Spalten zweispaltig.
   ============================================================ */
@media print {

  /* Cobalt-Hintergrund für Print erzwingen — Branding-Konsistenz */
  body.werk-page {
    background: var(--paper-dark) !important;
    color: var(--ink) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
    margin: 0;
  }

  /* Ränder und Maximalbreite anpassen für A4-Papier */
  .werk-seite {
    margin: 0;
    padding: 28px 36px 32px;
    max-width: none;
    width: 100%;
  }

  .werk-seite-titel {
    font-size: 22px;
    margin-bottom: 22px;
    page-break-after: avoid;
  }

  /* Steg auch beim Druck zweispaltig (auch wenn A4 schmal)
     linke Spalte rechtsbündig · rechte Spalte linksbündig · Spalten gleich breit */
  .werk-seite-jandl {
    display: flex !important;
    gap: 44px;
    justify-content: center;
    align-items: flex-start;
    max-width: 100%;
    margin-bottom: 22px;
    page-break-inside: avoid;
  }
  .werk-seite-col {
    flex: 1 1 0;
    min-width: 0;
    max-width: 280px;
    margin-bottom: 0;
  }
  .werk-seite-col-left  { text-align: right; }
  .werk-seite-col-right { text-align: left; }

  /* Bild darf auf eigene Seite umbrechen, soll nicht zerschnitten werden */
  .werk-seite-bild-wrap {
    margin-bottom: 0;
    page-break-inside: avoid;
    page-break-before: auto;
  }
  .werk-seite-bild {
    max-width: 100%;
    max-height: 64vh;
    border: 1px solid var(--ink-faint);
  }

  /* Backlink, Nav-Pfeile und Close-Kreuz verschwinden im Druck */
  .werk-seite-back,
  .werk-seite-nav,
  .werk-seite-close {
    display: none !important;
  }

  /* Browser-Standard-Print-Header/Footer Suppression hilft hier nicht
     (browserabhängig) — User stellt das in der Druck-Vorschau aus. */
}

/* ============================================================
   Zurück-Buttons · auf Screen 2, 3, 5 jeweils oben links
   Dezent, nicht prominent — befreit aus Stuck-Zuständen
   ============================================================ */
.schritt-zurueck {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink-faint);
  cursor: pointer;
  padding: 8px 14px;
  margin: 0 0 24px 0;
  transition: background .15s, color .15s, border-color .15s;
  align-self: flex-start;
}
.schritt-zurueck:hover {
  background: var(--tint);
  border-color: var(--ink);
}
.schritt-zurueck .material-symbols-outlined {
  font-size: 18px;
}

/* Auf Screen 2 und 3 ist .screen ein flex-container — Button kommt links oben */
.screen .schritt-zurueck:first-child {
  margin-left: 0;
}

@media (max-width: 600px) {
  .schritt-zurueck {
    font-size: 11px;
    padding: 6px 12px;
    margin-bottom: 18px;
  }
}

/* ============================================================
   Screen 2 · Portrait · drei Stufen Wahl/Webcam/Preview
   ============================================================ */
.portrait-stufe[hidden] { display: none; }
.portrait-stufe {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Webcam-Live-Frame · zentriertes Quadrat-Crop, eckiger Rahmen */
.webcam-frame {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  background: var(--paper-dark);
  border: 1px solid var(--ink-faint);
  overflow: hidden;
}
.webcam-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Spiegelung für Selfie-Modus damit es sich natürlich anfühlt */
  transform: scaleX(-1);
}

/* Preview · zeigt das aufgenommene Bild */
.preview-frame {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  background: var(--paper-dark);
  border: 1px solid var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Steuerleisten für Webcam und Preview · zwei Buttons horizontal */
.webcam-controls,
.preview-controls {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .webcam-frame, .preview-frame { max-width: 100%; }
  .webcam-controls, .preview-controls { gap: 10px; }
}

/* ============================================================
   Save-Modal · Titel-Eingabe vor Galerie-Speicherung
   ============================================================ */
.save-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 20, 0.86);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.save-modal[hidden] { display: none; }

.save-modal-inner {
  background: var(--paper);
  border: 1px solid var(--ink-faint);
  padding: 36px 36px 28px;
  max-width: 480px;
  width: 100%;
  position: relative;
}

.save-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.save-modal-close:hover { color: var(--beige); }

.save-modal h3 {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.save-modal-hint {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  margin: 0 0 22px;
  line-height: 1.5;
  opacity: .8;
}

.save-modal label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}

.save-modal input {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
  background: var(--paper-dark);
  border: 1px solid var(--ink-faint);
  outline: none;
}
.save-modal input:focus {
  border-color: var(--beige);
}

.save-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  justify-content: flex-end;
}

.save-result {
  margin-top: 22px;
  padding-top: 20px;
  border-top: .5px solid var(--ink-faint);
}
.save-result[hidden] { display: none; }
.save-success {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 1px;
  margin: 0 0 12px;
}
.save-open-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.save-open-link:hover { color: var(--beige); }

/* ============================================================
   Werk-Phase-Status · pulsierender Phasentext während Pipeline
   ============================================================ */
.werk-phase-status {
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink);
  opacity: .7;
  white-space: nowrap;
  transition: opacity .4s ease;
  pointer-events: none;
}
.werk-vertikal[data-state="ready"] .werk-phase-status,
.werk-vertikal[data-state="error"] .werk-phase-status {
  opacity: 0;
}

@media (max-width: 600px) {
  .save-modal-inner { padding: 28px 22px 22px; }
  .save-modal h3 { font-size: 16px; }
  .save-modal input { font-size: 16px; }
  .werk-phase-status { font-size: 11px; bottom: -28px; }
}


/* ===============================
   KNALL · VERSION SWITCH BUTTON
   Transparent PNG / white type
   visual zoom inside badge: 80%
================================ */

.knall-version-switch {
  --badge-size: 120px;       /* fix eingefroren, skaliert nicht mit vw */
  --badge-zoom: .8;

  /* an den Titel gehaengt, scrollt mit; min. 25px rechts daneben */
  position: absolute;
  left: calc(100% + 25px);
  top: 50%;
  z-index: 5;

  width: var(--badge-size);
  aspect-ratio: 1 / 1;
  border-radius: 50%;

  display: grid;
  place-items: center;

  background: transparent;
  text-decoration: none;

  opacity: .92;
  transform: translateY(-50%) scale(.9);
  transform-origin: center;

  transition:
    transform .18s ease,
    opacity .18s ease;
}

.knall-version-switch img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;

  transform: scale(var(--badge-zoom));
  transform-origin: center;
  pointer-events: none;
}

.knall-version-switch:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

.knall-version-switch:focus-visible {
  outline: 2px solid #000;
  outline-offset: 5px;
}

/* schmale Viewports: kein Platz rechts -> ueber die rechte Titelkante heben */
@media (max-width: 760px) {
  .knall-version-switch {
    --badge-size: 120px;
    left: auto;
    right: 0;
    top: 0;
    transform: translateY(-115%) scale(.9);
  }
  .knall-version-switch:hover {
    transform: translateY(-115%) scale(1);
  }
}

@media (max-width: 420px) {
  .knall-version-switch {
    --badge-size: 120px;
  }
}
