/* Gertis Maschenzoo – von Hand geschrieben, wird nicht generiert.
   Idee: das Eingangsschild eines Zoos in Wiesengrün, unten mit gehäkeltem
   Muschelrand. Dicke, runde Titelschrift (wie ausgestopft), sehr lesbarer Fließtext. */

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Bagel Fat One";
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/bagel-fat-one-latin-400-normal.woff2") format("woff2");
}

:root {
  --wiese: #1F4D3A;        /* Schild, Knöpfe */
  --wiese-tief: #163A2B;
  --garn: #F6C445;         /* Garn-Gelb: Titel, Blätterknöpfe */
  --himbeer: #B92D55;      /* nur der Aufkleber */
  --grund: #F2F6EF;
  --text: #17231C;
  --leise: #47564D;
  --flaeche: #FFFFFF;
  --rand: #CCD8CB;
  --buehne: #E3EAE0;
  --verweis: #1F4D3A;
  --punkt: #9AA89D;
  --punkt-aktiv: #1F4D3A;
  --anzeige: "Bagel Fat One", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --muschel: 15px;
  --gewebe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='16'%3E%3Cpath d='M5 3 L11 12 L17 3' fill='none' stroke='%23E1E9DC' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --schatten: 0 2px 0 rgba(23, 35, 28, 0.06), 0 10px 24px -8px rgba(23, 35, 28, 0.28);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0F1814;
    --text: #EDF3EA;
    --leise: #B4C2B7;
    --flaeche: #1A2720;
    --rand: #33453A;
    --buehne: #080D0A;
    --verweis: #F6C445;
    --punkt: #56675B;
    --punkt-aktiv: #F6C445;
    --gewebe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='16'%3E%3Cpath d='M5 3 L11 12 L17 3' fill='none' stroke='%23172520' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --schatten: 0 10px 24px -8px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--gewebe) var(--grund);
  color: var(--text);
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 19px;
  line-height: 1.5;
}

a { color: var(--verweis); }

:focus-visible {
  outline: 4px solid var(--garn);
  outline-offset: 3px;
  border-radius: 8px;
  box-shadow: 0 0 0 7px var(--text);
}

img { max-width: 100%; height: auto; display: block; }

main, .kopf-innen, .fuss {
  max-width: 960px;
  margin-inline: auto;
}

/* Das Schild */

.kopf {
  position: relative;
  background: var(--wiese);
  color: #FFFFFF;
  margin-bottom: var(--muschel);
}
/* Muschelrand: eine Reihe Halbkreise, wie die Abschlusskante einer Häkeldecke */
.kopf::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: var(--muschel);
  background: radial-gradient(circle at 15px 0, var(--wiese) 14.5px, transparent 15px) repeat-x;
  background-size: 30px var(--muschel);
}

.kopf-innen {
  padding: 22px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.schild { display: flex; flex-direction: column; gap: 8px; }

/* Eine Zeile Titel, so breit wie das Schild: das ist die Wirkung, nicht die Höhe */
.kopf h1 {
  margin: 0;
  font-family: var(--anzeige);
  font-weight: 400;
  font-size: clamp(30px, 8.4vw, 76px);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--garn);
}

.bestand { margin: 0; font-size: 19px; line-height: 1.35; }

@media (min-width: 900px) {
  .kopf-start .kopf-innen {
    padding: 30px 24px 26px;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
  }
  .kopf-start h1 { font-size: clamp(48px, 5.6vw, 60px); white-space: nowrap; }
  .kopf-start .suche { flex: 0 1 320px; min-width: 260px; }
}

.kopf-klein .kopf-innen { padding: 14px 16px 12px; }
.titel-klein { margin: 0; font-family: var(--anzeige); font-size: 30px; line-height: 1.1; }
.titel-klein a { color: var(--garn); text-decoration: none; display: inline-flex; align-items: center; min-height: 56px; }

.zurueck {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 22px 0 14px;
  border-radius: 99px;
  background: var(--garn);
  color: #17231C;
  font-weight: 700;
  font-size: 19px;
  text-decoration: none;
}
.zurueck svg { width: 26px; height: 26px; }

svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Abschnitte */

.abschnitt {
  padding: 30px 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ueberschrift {
  margin: 14px 0 0;
  font-family: var(--anzeige);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.1;
}

.leer { font-size: 22px; margin: 24px 0; }

/* Der Neuzugang */

.neuzugang {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
}
.neuzugang-bild { position: relative; display: block; margin-bottom: 16px; }
.neuzugang-bild img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 28px;
  background: var(--buehne);
}
.sticker {
  position: absolute;
  left: -8px;
  top: 18px;
  transform: rotate(-5deg);
  background: var(--himbeer);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 19px;
  line-height: 1;
  padding: 12px 18px;
  border-radius: 99px;
  border: 3px solid var(--grund);
}
.neuzugang-name {
  font-family: var(--anzeige);
  font-size: clamp(38px, 10.5vw, 64px);
  line-height: 1;
  overflow-wrap: anywhere;
}
.neuzugang-datum { font-size: 19px; color: var(--leise); margin-top: 8px; }
.neuzugang:hover .neuzugang-name, .kachel:hover .kachel-name, .nachbar:hover .nachbar-name {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

/* Raster */

.raster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 16px;
}
@media (min-width: 640px) { .raster { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 22px; } }
@media (min-width: 900px) { .raster { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.kachel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: var(--text);
}
.kachel img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 22px;
  background: var(--buehne);
  margin-bottom: 8px;
}
.kachel-name { font-weight: 700; font-size: 20px; line-height: 1.2; overflow-wrap: anywhere; }
.kachel-datum { font-size: 17px; color: var(--leise); }

/* Knöpfe */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
  padding: 8px 24px;
  border-radius: 99px;
  font-family: inherit;
  font-weight: 700;
  font-size: 20px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.knopf-voll { background: var(--wiese); color: #FFFFFF; border: 2px solid var(--wiese); }
.knopf-voll:hover { background: var(--wiese-tief); }
.knopf-rand { background: transparent; color: var(--text); border: 2px solid var(--text); }
@media (prefers-color-scheme: dark) {
  .knopf-voll { background: var(--garn); border-color: var(--garn); color: #17231C; }
  .knopf-voll:hover { background: #FFD76A; }
}

.mehr {
  padding: 34px 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
  margin-inline: auto;
}

/* Einzelansicht */

.fotos { padding-top: 6px; }
.buehne { position: relative; background: var(--buehne); }
.foto { margin: 0; }
.foto img {
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  margin-inline: auto;
}
.foto-link { display: block; cursor: zoom-in; }
/* ohne JS stehen alle Fotos untereinander */
.foto + .foto { border-top: 6px solid var(--grund); }

/* mit JS: eine Reihe zum Wischen, jedes Foto rastet ein */
.js .mehrere .reihe {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.js .mehrere .reihe::-webkit-scrollbar { display: none; }
.js .mehrere .foto { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; border-top: 0; }
.js .mehrere .foto img { width: 100%; height: min(70vh, 640px); object-fit: contain; }

.blaettern {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #17231C;
  background: var(--garn);
  color: #17231C;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.blaettern[hidden] { display: none; }
.blaettern:disabled { opacity: 0.3; cursor: default; }
.blaettern svg { width: 30px; height: 30px; }
.blaettern-zurueck { left: 10px; }
.blaettern-vor { right: 10px; }

.fotoleiste {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px 18px;
  padding: 16px 24px 0;
}
.fotoleiste:not(:has(> :not([hidden]))) { display: none; }
.punkte { display: none; gap: 10px; }
.js .punkte { display: inline-flex; }
.punkt { width: 14px; height: 14px; border-radius: 50%; background: var(--punkt); }
.punkt.aktiv { background: var(--punkt-aktiv); }
.zaehler { font-size: 18px; color: var(--leise); }

.knopf svg { width: 26px; height: 26px; flex: none; }
.knopf { gap: 10px; }
.vergroessern { width: auto; min-height: 56px; font-size: 19px; padding: 6px 22px 6px 18px; }

.steckbrief { padding: 26px 24px 8px; display: flex; flex-direction: column; gap: 10px; }
.steckbrief h1 {
  margin: 0;
  font-family: var(--anzeige);
  font-weight: 400;
  font-size: clamp(44px, 12.5vw, 84px);
  line-height: 0.95;
  overflow-wrap: anywhere;
}
.eingezogen { margin: 0; font-size: 20px; color: var(--leise); }
.geschichte { max-width: 34em; margin-top: 8px; }
.geschichte p { margin: 0 0 0.8em; font-size: 21px; line-height: 1.5; }
.geschichte p:last-child { margin-bottom: 0; }
.teilen { margin-top: 14px; max-width: 340px; }

/* Vergrößert: ganzer Bildschirm, Schließen unten in Daumennähe */
.lupe {
  margin: 0;
  padding: 0;
  border: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  background: #080D0A;
  color: #FFFFFF;
}
.lupe[open] { display: flex; flex-direction: column; }
.lupe::backdrop { background: #080D0A; }
.lupe-flaeche { position: relative; flex: 1; min-height: 0; overflow: auto; }
.lupe-flaeche img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  cursor: zoom-in;
}
.lupe.gross .lupe-flaeche img { position: static; max-width: none; max-height: none; height: auto; cursor: zoom-out; }
.lupe-leiste {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--wiese);
}
.lupe-hinweis { margin: 0; font-size: 18px; line-height: 1.3; }
.lupe-zu { width: auto; flex: none; min-width: 140px; background: var(--garn); border-color: var(--garn); color: #17231C; }
.lupe-zu:hover { background: #FFD76A; }

.nachbarn {
  padding: 36px 24px 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 640px;
}
.nachbar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: var(--text);
}
.nachbar img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 8px;
  background: var(--buehne);
}
.nachbar-aelter { text-align: right; align-items: flex-end; }
.nachbar-richtung {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 18px;
  color: var(--leise);
}
.nachbar-richtung svg { width: 20px; height: 20px; }
.nachbar-name { font-weight: 700; font-size: 20px; line-height: 1.2; overflow-wrap: anywhere; }

/* Fuß: eine Reihe fester Maschen */

.fuss {
  padding: 40px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
  color: var(--leise);
  font-size: 18px;
}
.maschen { width: 120px; height: 14px; color: var(--verweis); }
.maschen path { stroke-width: 2; }
.fuss p { margin: 0; }

/* Suche (nur mit JS sichtbar), sitzt im Schild */

[hidden] { display: none !important; }

.nur-vorlesen {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.suche { display: none; }
.js .suche { display: block; }
.suche-feld { position: relative; display: block; }
.suche-feld svg {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  color: #47564D;
  pointer-events: none;
}
.suche input {
  width: 100%;
  min-height: 60px;
  padding: 8px 20px 8px 56px;
  border-radius: 99px;
  border: 3px solid var(--wiese-tief);
  background: #FFFFFF;
  color: #17231C;
  font: inherit;
  font-size: 20px;
  -webkit-appearance: none;
  appearance: none;
}
.suche input::placeholder { color: #47564D; opacity: 1; }

.suche-kopf {
  padding: 0 24px;
  max-width: 568px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.suche-status { margin: 28px 0 0; font-size: 20px; font-weight: 700; }
.suche-status:empty { display: none; }

.steckbrief .nachweis { margin: 6px 0 0; font-size: 17px; color: var(--leise); }
.nachweis a { color: var(--leise); }

/* ------------------------------------------------------------------
   Mehr Leben: Garnfarben, Wimpelkette, schiefe Fotos, Gehegeschild
   ------------------------------------------------------------------ */

/* Garnfarben fürs Namensschild. Text jeweils mit mindestens 4.5:1 Kontrast. */
.farbe-0 { --garnfarbe: #F6C445; --garntext: #17231C; }  /* Sonnengelb */
.farbe-1 { --garnfarbe: #B92D55; --garntext: #FFFFFF; }  /* Himbeer */
.farbe-2 { --garnfarbe: #2F6FA0; --garntext: #FFFFFF; }  /* Himmelblau */
.farbe-3 { --garnfarbe: #E58A3C; --garntext: #17231C; }  /* Mohn */
.farbe-4 { --garnfarbe: #6B4C9A; --garntext: #FFFFFF; }  /* Flieder */
.farbe-5 { --garnfarbe: #A8D5B0; --garntext: #17231C; }  /* Salbei */

/* Wimpelkette oben am Schild: es ist ja ein Geburtstag */
.wimpel {
  height: 34px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='34'%3E%3Cpath d='M0 4 Q40 12 80 4 Q120 12 160 4' fill='none' stroke='%23FFFFFF' stroke-opacity='.55' stroke-width='1.5'/%3E%3Cpath d='M8 6.5 L32 8 L20 30 Z' fill='%23F6C445'/%3E%3Cpath d='M48 8 L72 6.5 L60 30 Z' fill='%23E2577F'/%3E%3Cpath d='M88 6.5 L112 8 L100 30 Z' fill='%236FB0E0'/%3E%3Cpath d='M128 8 L152 6.5 L140 30 Z' fill='%23E58A3C'/%3E%3C/svg%3E") repeat-x;
  background-position: center top;
}
.kopf-start .kopf-innen { padding-top: 10px; }

/* Überschrift mit einer Reihe Maschen darunter */
.ueberschrift + .maschen-unter { width: 160px; height: 14px; margin-top: -10px; color: var(--garn); }
.ueberschrift + .maschen-unter path { stroke-width: 3; }
@media (prefers-color-scheme: light) {
  .ueberschrift + .maschen-unter { color: #D9A520; }
}

/* Kacheln: Fotos wie aufgepinnt, jedes ein bisschen schief */
.raster { gap: 34px 18px; padding-top: 4px; }
@media (min-width: 640px) { .raster { gap: 42px 26px; } }

.kachel { --dreh: -1.6deg; gap: 0; align-items: center; text-align: center; }
.kachel:nth-child(4n+2) { --dreh: 1.4deg; }
.kachel:nth-child(4n+3) { --dreh: -0.6deg; }
.kachel:nth-child(4n+4) { --dreh: 2deg; }
.kachel img {
  border-radius: 18px;
  border: 7px solid var(--flaeche);
  box-shadow: var(--schatten);
  margin-bottom: 0;
  rotate: var(--dreh);
}
.kachel-name {
  position: relative;
  z-index: 1;
  margin-top: -20px;
  max-width: 94%;
  padding: 7px 16px 8px;
  border-radius: 14px;
  background: var(--garnfarbe, var(--wiese));
  color: var(--garntext, #FFFFFF);
  box-shadow: 0 3px 0 rgba(23, 35, 28, 0.18);
  rotate: calc(var(--dreh) * -1.4);
}
.kachel-datum { margin-top: 8px; }
.kachel:hover .kachel-name { text-decoration: none; }

/* Wackeln beim Drüberfahren, kurzes Drücken beim Antippen */
@media (prefers-reduced-motion: no-preference) {
  .kachel img, .kachel-name { transition: rotate 0.2s ease, scale 0.2s ease; }
  .kachel:hover img { animation: wackeln 0.5s ease-in-out; }
  .kachel:hover .kachel-name { scale: 1.06; }
  .kachel:active img { scale: 0.97; }
  .neuzugang-bild img { transition: rotate 0.3s ease; }
  .neuzugang:hover .neuzugang-bild img { rotate: 0deg; }
}
@keyframes wackeln {
  0%, 100% { rotate: var(--dreh); }
  25% { rotate: calc(var(--dreh) - 3deg); }
  60% { rotate: calc(var(--dreh) + 2.5deg); }
}

/* Der Neuzugang: großes Foto mit Rahmen, Name auf einem Schild */
.neuzugang { align-items: flex-start; }
.neuzugang-bild { width: 100%; margin-bottom: 0; }
.neuzugang-bild img {
  border-radius: 24px;
  border: 10px solid var(--flaeche);
  box-shadow: var(--schatten);
  rotate: -0.8deg;
}
.sticker { left: -6px; top: 22px; font-size: 20px; padding: 13px 20px; z-index: 1; }
.neuzugang-name {
  position: relative;
  margin: -34px 0 0 18px;
  padding: 10px 22px 14px;
  border-radius: 20px;
  background: var(--garnfarbe, var(--wiese));
  color: var(--garntext, #FFFFFF);
  box-shadow: 0 4px 0 rgba(23, 35, 28, 0.2);
  rotate: 1.2deg;
  max-width: calc(100% - 18px);
}
.neuzugang-datum { margin-top: 14px; }
.neuzugang:hover .neuzugang-name { text-decoration: none; }

/* Einzelseite: Name auf einer Karteikarte aus dem Bibliothekskatalog.
   Rote Kopflinie, blaue Zeilen, Schreibmaschinenschrift, Datum als Stempel,
   unten das Loch für die Katalogstange, oben ein Reiter in der Garnfarbe. */
.steckbrief { gap: 14px; }
.tafel {
  --karte: #FBF7EA;
  --tinte: #26241F;
  --kopflinie: #D2504A;
  --zeile: #A9C1DB;
  --linie: 34px;
  --kopf: 58px;
  position: relative;
  align-self: flex-start;
  width: min(100%, 580px);
  margin-top: 12px;
  padding: 0 30px 46px;
  border-radius: 3px;
  background:
    linear-gradient(var(--kopflinie), var(--kopflinie)) 0 calc(var(--kopf) - 3px) / 100% 2px no-repeat,
    linear-gradient(var(--kopflinie), var(--kopflinie)) 0 calc(var(--kopf) + 1px) / 100% 1px no-repeat,
    linear-gradient(var(--karte), var(--karte)) 0 0 / 100% var(--kopf) no-repeat,
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--linie) - 1px), var(--zeile) calc(var(--linie) - 1px) var(--linie)) 0 var(--kopf) / 100% 100% no-repeat,
    var(--karte);
  color: var(--tinte);
  font-family: "American Typewriter", "Courier Prime", "Courier New", Courier, monospace;
  box-shadow: 0 1px 0 rgba(0,0,0,.08), inset 0 0 0 1px rgba(80,60,20,.08), var(--schatten);
  rotate: -0.8deg;
}
/* Zwei Streifen Klebeband in der Garnfarbe, halb durchsichtig, über die oberen Ecken */
.tafel::before,
.tafel-nr::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 92px;
  height: 30px;
  background:
    linear-gradient(to bottom, rgba(255,255,255,.35), rgba(255,255,255,0) 45%, rgba(255,255,255,.18)),
    color-mix(in srgb, var(--garnfarbe, var(--garn)) 55%, transparent);
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  /* gerissene Enden */
  clip-path: polygon(
    0 8%, 4% 0, 8% 10%, 96% 0, 100% 12%, 97% 30%, 100% 50%, 96% 70%, 100% 88%, 95% 100%,
    90% 92%, 6% 100%, 2% 86%, 4% 66%, 0 48%, 3% 28%);
  pointer-events: none;
  z-index: 1;
}
.tafel::before { left: -18px; rotate: -32deg; }
.tafel-nr::after { right: -18px; rotate: 30deg; }
/* Loch für die Katalogstange */
.tafel::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: var(--grund);
  box-shadow: inset 0 2px 3px rgba(0,0,0,.35);
}
.tafel-nr {
  display: flex;
  align-items: center;
  height: var(--kopf);
  margin: 0;
  padding-left: 26px;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.steckbrief .tafel h1 {
  margin: calc(var(--linie) * 0.5) 0 0;
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(34px, 9vw, 52px);
  line-height: calc(var(--linie) * 2);
  letter-spacing: -0.01em;
  color: var(--tinte);
}
.tafel .eingezogen {
  display: inline-block;
  margin-top: 18px;
  padding: 4px 12px 3px;
  border: 2.5px solid currentColor;
  border-radius: 6px;
  color: #6B3FA0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  max-width: 100%;
  line-height: 1.35;
  text-wrap: balance;
  rotate: -3deg;
  opacity: .85;
}
@media (prefers-color-scheme: dark) {
  .tafel { --karte: #ECE5D2; --zeile: #9DB2C9; }
}
.steckbrief .geschichte { margin-top: 18px; }

/* Nachbarn passend zu den Kacheln */
.nachbar img { border: 6px solid var(--flaeche); box-shadow: var(--schatten); }
.nachbar-neuer img { rotate: -1.2deg; }
.nachbar-aelter img { rotate: 1.2deg; }

/* Fuß: die Maschenreihe in Garnfarben */
.fuss .maschen { width: 200px; height: 18px; color: var(--himbeer); }
.fuss .maschen path { stroke-width: 2.6; }
@media (prefers-color-scheme: dark) { .fuss .maschen { color: var(--garn); } }

/* Impressum & Datenschutz */
.fuss .fuss-klein { font-size: 17px; }
.fuss-klein a { color: var(--leise); }

.recht { padding: 30px 24px 8px; }
.recht h1 {
  margin: 0 0 6px;
  font-family: var(--anzeige);
  font-weight: 400;
  font-size: clamp(36px, 9vw, 52px);
  line-height: 1.05;
}
.recht h1 + p, .recht h1 + h2 { margin-top: 0; }
.recht h1:not(:first-child) { margin-top: 48px; }
.recht h2 { margin: 30px 0 6px; font-size: 22px; line-height: 1.3; }
.recht p { margin: 0 0 14px; font-size: 19px; line-height: 1.55; max-width: 36em; }
.recht-grundlage { color: var(--leise); font-size: 17px !important; }
.platzhalter { background: var(--garn); color: #17231C; padding: 0 4px; border-radius: 4px; }

/* Der Knäuelbär im Schild */
/* Schmal: der Bär sitzt oben auf dem Schild, der Titel behält seine volle Größe.
   Ab 640px steht er links daneben. */
.marke { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.marke .schild { min-width: 0; }
.logo { display: block; flex: none; width: 76px; height: auto; }
@media (min-width: 640px) {
  .marke { flex-direction: row; align-items: center; gap: 20px; }
  .logo { width: 104px; }
  .kopf-start h1 { font-size: clamp(36px, 6.2vw, 64px); }
}
@media (min-width: 900px) {
  .kopf-start h1 { font-size: clamp(44px, 4.8vw, 52px); }
}
.titel-klein .logo { width: 48px; margin-right: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .marke:hover .logo, .titel-klein a:hover .logo { animation: wackeln-logo 0.6s ease-in-out; }
}
@keyframes wackeln-logo {
  0%, 100% { rotate: 0deg; }
  25% { rotate: -7deg; }
  60% { rotate: 5deg; }
}

/* Herzen: ein aufgenähter Häkelflicken in Himbeer, die Zahl darin. Auf der Bewohner-Seite
   ist der Flicken selbst der Knopf; nach dem Schenken wird er garngelb. In der Übersicht
   sitzt er klein oben rechts am Foto. */
.herz-flicken {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 3px 0 rgba(23, 35, 28, 0.22));
}
.herz-flicken svg { display: block; width: 100%; height: 100%; }
.herz-flicken .flicken { fill: var(--himbeer); stroke: none; }
.herz-flicken .naht { fill: none; stroke: #FFFFFF; stroke-width: 2.2; stroke-dasharray: 3.2 3.4; stroke-linecap: round; }
.herz-nummer {
  position: absolute;
  inset: 0 0 9%;
  display: grid;
  place-items: center;
  font-family: var(--anzeige);
  font-size: 32px;
  line-height: 1;
  color: #FFFFFF;
}
.dreistellig .herz-nummer { font-size: 22px; }

/* Herz und Teilen nebeneinander; der Teilen-Knopf nimmt den Rest der Zeile */
.aktionen { display: flex; align-items: center; gap: 22px; margin-top: 18px; max-width: 460px; }
.aktionen:not(:has(> :not([hidden]))) { display: none; }
.aktionen .teilen { flex: 1 1 auto; width: auto; margin-top: 0; max-width: 340px; }
.herz { flex: none; padding-left: 4px; }
.herz-knopf {
  display: block;
  width: 92px;
  height: 84px;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: none;
  cursor: pointer;
  rotate: -8deg;
}
.herz-knopf[aria-pressed="true"] { cursor: default; }
.herz-knopf[aria-pressed="true"] .flicken { fill: var(--garn); }
.herz-knopf[aria-pressed="true"] .naht { stroke: #17231C; }
.herz-knopf[aria-pressed="true"] .herz-nummer { color: #17231C; }
.herz-knopf:disabled { cursor: progress; }

.kachel { position: relative; }
.herz-plakette {
  position: absolute;
  z-index: 2;
  top: -12px;
  right: -8px;
  width: 52px;
  height: 47px;
  rotate: 10deg;
}
.herz-plakette .herz-nummer { font-size: 20px; }
.herz-plakette.dreistellig .herz-nummer { font-size: 15px; }
.neuzugang-bild .herz-plakette { top: -14px; right: -10px; width: 78px; height: 71px; }
.neuzugang-bild .herz-plakette .herz-nummer { font-size: 29px; }

@media (prefers-reduced-motion: no-preference) {
  .herz-knopf { transition: rotate 0.2s ease; }
  .herz-knopf:not([aria-pressed="true"]):hover { rotate: 4deg; }
  .herz-knopf[aria-pressed="true"] .herz-flicken { animation: herzschlag 0.5s ease-out; }
}
@keyframes herzschlag { 0% { scale: 1; } 35% { scale: 1.3; } 100% { scale: 1; } }
