/*
  Die Werkschau-Seiten: N8.AI, Underworld Ledger, Health Eat.
  Setzt tokens.css voraus.
*/

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--papier);
    color: var(--tinte);
    font-family: var(--text);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
  }

.bahn {
    width: min(1180px, 100% - 2.5rem);
    margin-inline: auto;
  }

h1, h2, h3, .display {
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: .012em;
    text-wrap: balance;
    margin: 0;
  }

.etikett {
    font-family: var(--mono);
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--tinte-3);
  }

/* ---------- Kopf ---------- */

  .kopf {
    padding: clamp(3rem, 9vw, 6.5rem) 0 2.5rem;
    border-bottom: 1px solid var(--linie);
  }

.marke {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: clamp(2rem, 6vw, 3.5rem);
  }

.marke-punkte {
    display: flex;
    gap: 3px;
    align-items: flex-end;
  }

.marke-punkte i {
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--tinte);
  }

.marke-punkte i:nth-child(2) { width: 13px; height: 13px; }

.marke-name {
    font-family: var(--text);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .01em;
  }

h1 {
    font-size: clamp(3.6rem, 12vw, 8.5rem);
    line-height: .86;
    margin-bottom: 1.4rem;
  }

.kopf-satz {
    font-size: clamp(1.1rem, 2.2vw, 1.4rem);
    line-height: 1.5;
    color: var(--tinte-2);
    max-width: 46ch;
    margin: 0 0 2.8rem;
  }

.zahlenband {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem 2rem;
    border-top: 1px solid var(--linie);
    padding-top: 1.6rem;
  }

.zahl b {
    display: block;
    font-family: var(--display);
    font-size: 2.5rem;
    line-height: 1;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
  }

.zahl span {
    display: block;
    font-family: var(--mono);
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--tinte-3);
    margin-top: .5rem;
    line-height: 1.5;
  }

/* ---------- Abschnitte ---------- */

  section {
    padding: clamp(3.5rem, 8vw, 6rem) 0;
    border-bottom: 1px solid var(--linie);
  }

.abschnittskopf {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.8rem;
    flex-wrap: wrap;
  }

h2 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: .95;
  }

.fassungsmarke {
    font-family: var(--mono);
    font-size: .74rem;
    letter-spacing: .08em;
    padding: .28rem .6rem;
    border-radius: 999px;
    border: 1px solid currentColor;
    white-space: nowrap;
  }

.marke-alt { color: var(--alt-satt); }

.marke-neu { color: var(--signal-satt); }

p { margin: 0 0 1.1rem; }

p:last-child { margin-bottom: 0; }

a { color: inherit; }

.fliess { max-width: 68ch; }

strong { font-weight: 700; }

/* ---------- Listen ---------- */

  .bereiche {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1px;
    background: var(--linie);
    border: 1px solid var(--linie);
  }

.bereiche li {
    background: var(--papier);
    padding: 1rem 1.1rem;
  }

.bereiche b {
    display: block;
    font-family: var(--display);
    font-size: 1.28rem;
    font-weight: 400;
    letter-spacing: .02em;
    margin-bottom: .15rem;
  }

.bereiche span {
    font-size: .88rem;
    color: var(--tinte-2);
    line-height: 1.45;
  }

/* ---------- Bilder ---------- */

  .galerie {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.6rem;
    margin-top: 2.6rem;
  }

.galerie.breit { grid-template-columns: 1fr; }

figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .7rem;
  }

.rahmen {
    border: 1px solid var(--linie-stark);
    border-radius: 10px;
    overflow: hidden;
    background: var(--papier-2);
    box-shadow: var(--schatten);
    cursor: zoom-in;
    display: block;
    padding: 0;
    width: 100%;
    line-height: 0;
  }

.rahmen:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 3px;
  }

.rahmen img {
    width: 100%;
    height: auto;
    display: block;
  }

figcaption {
    font-size: .9rem;
    color: var(--tinte-2);
    line-height: 1.5;
  }

figcaption b {
    color: var(--tinte);
    font-weight: 700;
  }

/* ---------- Stapel-Karte ---------- */

  .stapel {
    margin-top: 2.6rem;
    border: 1px solid var(--linie);
    border-radius: 12px;
    background: var(--papier-2);
    padding: 1.6rem 1.8rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.6rem 2.4rem;
  }

.stapel-teil h4 {
    margin: 0 0 .7rem;
    font-family: var(--mono);
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--tinte-3);
    font-weight: 500;
  }

.stapel-teil ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .35rem;
  }

.stapel-teil li {
    font-family: var(--mono);
    font-size: .82rem;
    line-height: 1.45;
  }

.stapel-teil li em {
    font-style: normal;
    color: var(--tinte-3);
  }

/* ---------- Gegenüberstellung ---------- */

  .steuerung {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem 2rem;
    align-items: center;
    margin: 2.2rem 0 1.6rem;
  }

.schalter {
    display: inline-flex;
    border: 1px solid var(--linie-stark);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
    background: var(--papier-2);
  }

.schalter button {
    font-family: var(--mono);
    font-size: .78rem;
    letter-spacing: .04em;
    border: 0;
    background: transparent;
    color: var(--tinte-2);
    padding: .45rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
  }

.schalter button:hover { color: var(--tinte); }

.schalter button[aria-pressed="true"],
  .schalter button[aria-selected="true"] {
    background: var(--tinte);
    color: var(--papier);
  }

.schalter.fassungen button[aria-pressed="true"][data-fassung="alt"] {
    background: var(--alt);
    color: #fff;
  }

.schalter.fassungen button[aria-pressed="true"][data-fassung="neu"] {
    background: var(--signal);
    color: #1a0800;
  }

.schalter button:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 2px;
  }

.buehne {
    position: relative;
    border: 1px solid var(--linie-stark);
    border-radius: 12px;
    overflow: hidden;
    background: var(--papier-2);
    box-shadow: var(--schatten);
    aspect-ratio: 1600 / 935;
    cursor: pointer;
  }

.buehne figure {
    position: absolute;
    inset: 0;
    display: block;
    margin: 0;
    opacity: 0;
    transition: opacity .28s ease;
  }

.buehne figure.sichtbar { opacity: 1; }

.buehne img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    display: block;
  }

/* Am Bildschirm trägt der Text unter der Bühne die Erklärung; im Druck
     bekommt jedes Bild seine eigene zurück. */
  .buehne figcaption { display: none; }

.buehnen-fuss {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: .9rem;
    font-size: .9rem;
    color: var(--tinte-2);
    flex-wrap: wrap;
  }

.buehnen-fuss .was { max-width: 62ch; }

/* ---------- Arbeitsweise ---------- */

  .schritte {
    list-style: none;
    counter-reset: schritt;
    padding: 0;
    margin: 2.2rem 0 0;
    display: grid;
    gap: 1px;
    background: var(--linie);
    border-block: 1px solid var(--linie);
  }

.schritte li {
    background: var(--papier);
    padding: 1.3rem 0;
    display: grid;
    grid-template-columns: 3.2rem 1fr;
    gap: 1.2rem;
    align-items: start;
  }

.schritte li::before {
    counter-increment: schritt;
    content: counter(schritt, decimal-leading-zero);
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--signal-satt);
    padding-top: .25rem;
  }

.schritte b {
    font-family: var(--display);
    font-weight: 400;
    font-size: 1.35rem;
    letter-spacing: .02em;
    display: block;
    margin-bottom: .2rem;
  }

.schritte span {
    color: var(--tinte-2);
    font-size: .95rem;
  }

/* ---------- Tabelle ---------- */

  .tabellenhuelle {
    overflow-x: auto;
    margin-top: 2.4rem;
    border: 1px solid var(--linie);
    border-radius: 12px;
  }

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 640px;
    font-size: .92rem;
  }

th, td {
    text-align: left;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--linie);
    vertical-align: top;
  }

thead th {
    font-family: var(--mono);
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--tinte-3);
    font-weight: 500;
    background: var(--papier-2);
  }

tbody tr:last-child td { border-bottom: 0; }

td.frage {
    font-weight: 700;
    width: 22%;
  }

td code, .fliess code {
    font-family: var(--mono);
    font-size: .86em;
    background: var(--papier-2);
    border: 1px solid var(--linie);
    border-radius: 4px;
    padding: .05em .35em;
  }

/* ---------- Lupe ---------- */

  .lupe {
    position: fixed;
    inset: 0;
    background: rgba(10, 9, 12, .88);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 50;
    cursor: zoom-out;
  }

.lupe.offen { display: flex; }

.lupe img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  }

.lupe-hinweis {
    position: absolute;
    bottom: 1.2rem;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--mono);
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .55);
  }

/* ---------- Fuß ---------- */

  footer {
    padding: 3rem 0 4rem;
    color: var(--tinte-3);
    font-size: .9rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
  }

@media (prefers-reduced-motion: reduce) {
* { transition: none !important; }
}

@media (max-width: 640px) {
body { font-size: 16px; }
.schritte li { grid-template-columns: 2.4rem 1fr; gap: .8rem; }
}

/* ---------- Druck ----------
     Auf Papier gibt es keinen Umschalter. Die Gegenüberstellung klappt deshalb
     zur vollständigen Bilderfolge auf, jedes Bild mit eigener Bildunterschrift.
     Und: Gedruckt wird immer auf hellem Grund, auch wenn der Bildschirm gerade
     dunkel steht. */
  @media print {
    :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
      --papier: #ffffff;
      --papier-2: #f7f5f1;
      --tinte: #17161a;
      --tinte-2: #45423c;
      --tinte-3: #6c685f;
      --linie: #d8d3c8;
      --linie-stark: #bfb9ac;
      --signal: #ff5c2b;
      --signal-satt: #c93a10;
      --alt: #e8456a;
      --alt-satt: #bb2547;
      --schatten: none;
    }

    body {
      font-size: 10.5pt;
      background: #fff;
      -webkit-print-color-adjust: exact;
      print-color-adjust: exact;
    }

    .bahn { width: 100%; }

    @page { margin: 14mm 12mm; }

    /* Was nur am Bildschirm einen Sinn hat */
    .steuerung,
    .lupe,
    .buehnen-fuss .etikett { display: none !important; }

    .kopf { padding-top: 0; }
    h1 { font-size: 46pt; }
    h2 { font-size: 22pt; }
    .kopf-satz { font-size: 12pt; }
    section { padding: 1.6rem 0; }

    /* Die Bühne wird zur Liste */
    .buehne {
      position: static;
      aspect-ratio: auto;
      border: 0;
      background: transparent;
      display: grid;
      gap: 1.4rem;
      cursor: default;
    }

    .buehne figure {
      position: static;
      opacity: 1;
      display: flex;
      flex-direction: column;
      gap: .5rem;
      break-inside: avoid;
    }

    .buehne img {
      height: auto;
      border: 1px solid var(--linie-stark);
      border-radius: 8px;
    }

    .buehne figcaption {
      display: block;
      font-size: 9pt;
      color: var(--tinte-2);
    }

    #buehnen-text { display: none; }

    /* Umbrüche */
    figure, .stapel, .zahl, .schritte li, tr { break-inside: avoid; }
    h2, .abschnittskopf { break-after: avoid; }
    .galerie { gap: 1.2rem; }
    .rahmen { box-shadow: none; cursor: default; }
    a { text-decoration: none; }
  }

/* LEISTE:ANFANG — erzeugt von werkzeug/leiste-einbauen.py */
  .leiste {
    position: fixed;
    top: clamp(.7rem, 2vw, 1.4rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: clamp(.6rem, 2vw, 1.6rem);
    padding: .4rem .4rem .4rem 1.1rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--papier-2) 92%, transparent);
    border: 1px solid var(--linie);
    box-shadow: var(--schatten);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    max-width: calc(100% - 1.6rem);
  }

  /* Nicht .marke: Diesen Namen vergeben die Werkschauen selbst an den Kicker
     über ihrer Überschrift. */
  .leiste-marke {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-family: var(--text);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -.01em;
    color: var(--tinte);
    text-decoration: none;
    white-space: nowrap;
  }

  .marke-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: block;
    flex: none;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--tinte) 14%, transparent);
  }

  .leiste nav { display: flex; align-items: center; gap: clamp(.5rem, 1.6vw, 1.4rem); }

  .leiste nav a {
    color: var(--tinte-2);
    text-decoration: none;
    font-family: var(--text);
    font-size: .93rem;
    font-weight: 600;
    white-space: nowrap;
    padding: .35rem .2rem;
    border-bottom: 2px solid transparent;
    transition: color .18s ease, border-color .18s ease;
  }

  .leiste nav a:hover,
  .leiste nav a[aria-current="page"] {
    color: var(--tinte);
    border-bottom-color: var(--signal);
  }

  .leiste .leiste-knopf {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .62rem 1.25rem;
    border-radius: 999px;
    background: var(--tinte);
    color: var(--papier-2);
    text-decoration: none;
    font-family: var(--text);
    font-weight: 700;
    font-size: .93rem;
    white-space: nowrap;
    transition: background .18s ease, color .18s ease;
  }

  .leiste .leiste-knopf:hover { background: var(--signal-satt); color: var(--papier-2); }

  .hamburger {
    display: none;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: none;
  }

  .hamburger:hover { background: color-mix(in srgb, var(--tinte) 8%, transparent); }

  .hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--tinte);
    transition: transform .22s ease, opacity .16s ease;
  }

  .hamburger span + span { margin-top: 4px; }

  .hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  /* Der Seitenkopf rückt unter der Leiste weg. */
  .bahn > .kopf { padding-top: clamp(5.5rem, 11vw, 8rem); }

  /* Manche Werkschau setzt ein Leuchten mit negativem Rand hinter die
     Überschrift; ohne clip erzeugt das einen waagerechten Rollbalken über die
     ganze Seite. clip statt hidden, damit die feststehende Leiste ihren Bezug
     behält. */
  body { overflow-x: clip; }

  @media (max-width: 720px) {
    .leiste {
      width: calc(100% - 1.6rem);
      gap: .5rem;
      padding: .35rem .35rem .35rem .8rem;
    }

    .leiste-marke { margin-right: auto; }
    .hamburger { display: flex; }
    .leiste .leiste-knopf { padding: .5rem .9rem; font-size: .82rem; }

    /* Schmal wird die Reihe nicht gekürzt, sondern vollständig in ein Blatt
       verlegt — sonst fällt das letzte Projekt lautlos weg. */
    .leiste nav {
      position: absolute;
      top: calc(100% + .5rem);
      left: 0;
      right: 0;
      flex-direction: column;
      align-items: stretch;
      gap: .15rem;
      padding: .5rem;
      border-radius: 22px;
      background: var(--papier-2);
      border: 1px solid var(--linie);
      box-shadow: var(--schatten);
      display: none;
      opacity: 0;
      transform: translateY(-6px);
      transition: opacity .18s ease, transform .18s ease;
    }

    .leiste nav.offen { display: flex; opacity: 1; transform: translateY(0); }

    .leiste nav a {
      padding: .85rem 1rem;
      border-radius: 14px;
      border-bottom: 0;
      font-size: 1rem;
    }

    .leiste nav a:hover,
    .leiste nav a:focus-visible,
    .leiste nav a[aria-current="page"] {
      background: color-mix(in srgb, var(--tinte) 7%, transparent);
      border-bottom-color: transparent;
      color: var(--tinte);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .leiste nav, .hamburger span { transition: none; }
  }

  @media print { .leiste { display: none !important; } .bahn > .kopf { padding-top: 0; } }
  /* LEISTE:ENDE */

/* ---------- Zusaetze der App-Seiten ---------- */

  .galerie.handy { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 2rem 1.5rem; }

.galerie.handy .rahmen { border-radius: 22px; }

.galerie.handy figcaption b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.15rem; letter-spacing: .02em; margin-bottom: .1rem; }

.karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; margin-top: 2.4rem; }

.karte { border: 1px solid var(--linie); border-radius: 12px; background: var(--papier-2); padding: 1.3rem 1.4rem; }

.karte .etikett { display: block; margin-bottom: .7rem; }

.karte h3 { font-family: var(--display); font-weight: 400; font-size: 1.3rem; letter-spacing: .02em; margin: 0 0 .35rem; }

.karte p { font-size: .92rem; color: var(--tinte-2); margin: 0; }

.schaubild { margin-top: 2.4rem; overflow-x: auto; }

.schaubild svg { display: block; min-width: 640px; width: 100%; height: auto; }

