/* Niemandspost – das Buch. Schriften selbst gehostet (SIL OFL), keine fremden Quellen. */
@font-face { font-family: "Cinzel"; src: url("fonts/cinzel-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("fonts/cinzel-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Cinzel Decorative"; src: url("fonts/cinzel-decorative-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("fonts/im-fell-english-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("fonts/im-fell-english-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("fonts/caveat-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Dancing Script"; src: url("fonts/dancing-script-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; size-adjust: 112%; }

:root {
  --desk-1: #17110c;
  --desk-2: #2a1d13;
  --leather-1: #4a1e17;
  --leather-2: #2c0f0b;
  --leather-3: #1c0806;
  --gold: #c9a45c;
  --gold-hi: #ecd498;
  --gold-lo: #8a6a2e;
  --paper: #efe2c4;
  --paper-2: #e3d0a8;
  --paper-edge: #c9ae7c;
  --ink: #2b1d12;
  --ink-soft: #5b4630;
  --rubric: #8c2a1c;
  --letter: #f4ead2;
  --letter-ink: #2a2140;
  --serif: "EB Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  --display: "Cinzel", "Trajan Pro", Palatino, Georgia, serif;
  --hand: "IM Fell English", "EB Garamond", Palatino, Georgia, serif;

  /* Seitengröße: Doppelseite bei breiten Fenstern, sonst eine Seite */
  /* Seite so groß, wie Bedienleiste und Fußzeile es zulassen; Schrift wächst nur langsam mit (ein großes Buch hat
     mehr Zeichen je Zeile, nicht größere Buchstaben): Ziel 60–70 Zeichen, um 28 Zeilen */
  /* Untergrenze 360 × 480 px: in sehr flachen Fenstern scrollt die Seite, statt in Hunderte Seiten zu zerfallen */
  --page-w: max(360px, min(calc((100vw - 48px) / 2), calc((100svh - 122px) / 1.3333)));
  --page-h: calc(var(--page-w) * 1.3333);
  --fs: clamp(14px, calc(var(--page-w) * 0.0295), 18.5px);
}
@media (max-width: 820px) {
  :root {
    --page-w: calc(100vw - 24px);
    --page-h: max(480px, min(calc(100svh - 120px), calc(var(--page-w) * 1.75)));
    --fs: clamp(16px, 4.3vw, 19px);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255, 196, 120, 0.10), transparent 60%),
    repeating-linear-gradient(92deg, rgba(0,0,0,0.12) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, var(--desk-2), var(--desk-1));
  background-color: var(--desk-1);
  color: var(--paper);
  font-family: var(--serif);
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  overflow-x: hidden;
}

.desk {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 12px 4px;
}

/* ---------- Buch ---------- */
.book {
  position: relative;
  width: calc(var(--page-w) * 2);
  height: var(--page-h);
  perspective: 2600px;
  transition: transform 1.1s cubic-bezier(.6,.05,.3,1);
}
@media (max-width: 820px) { .book { width: var(--page-w); } }
/* Geschlossen liegt nur die rechte Hälfte (der Buchblock unter dem Deckel) in der Mitte;
   beim Aufschlagen gleitet das Buch nach rechts, während der Deckel nach links klappt. */
@media (min-width: 821px) { .book[data-state="closed"] { transform: translateX(calc(var(--page-w) * -0.5)); } }

/* Buchdeckel hinter den Seiten (sichtbar als Rand) */
.spread {
  position: absolute;
  inset: 0;
  display: flex;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--leather-2), var(--leather-1) 48%, var(--leather-3) 50%, var(--leather-1) 52%, var(--leather-2));
  padding: 10px 12px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6), 0 6px 14px rgba(0,0,0,0.5), inset 0 0 0 2px rgba(201,164,92,0.25);
  margin: -10px -12px;
  width: calc(100% + 24px);
  height: calc(100% + 20px);
}
.book[data-state="closed"] .spread { visibility: hidden; }
@media (max-width: 820px) {
  .spread { background: linear-gradient(90deg, var(--leather-3), var(--leather-1) 6%, var(--leather-2)); padding: 8px 8px 8px 12px; margin: -8px -8px -8px -12px; width: calc(100% + 20px); height: calc(100% + 16px); }
}

.page {
  position: relative;
  flex: 1;
  height: 100%;
  overflow: hidden;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 0 0.12 0 0 0 0.10 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% 45%, var(--paper) 55%, var(--paper-2) 100%);
}
.page.left {
  border-radius: 4px 0 0 4px;
  /* Falz: jede Seite trägt ihre Hälfte selbst – so bewegt sie sich beim Umblättern mit dem Blatt */
  box-shadow: inset -1px 0 0 rgba(60, 35, 10, 0.35), inset -26px 0 30px -18px rgba(70, 40, 10, 0.45), inset 3px 0 0 var(--paper-edge);
}
.page.right {
  border-radius: 0 4px 4px 0;
  box-shadow: inset 1px 0 0 rgba(60, 35, 10, 0.35), inset 26px 0 30px -18px rgba(70, 40, 10, 0.45), inset -3px 0 0 var(--paper-edge);
}
.gutter { display: none; } /* die Falz zeichnen die Seiten selbst (siehe .page.left/.right) */
@media (max-width: 820px) {
  .page.left { display: none; }
  .page.right { border-radius: 2px 4px 4px 2px; box-shadow: inset 18px 0 22px -16px rgba(70, 40, 10, 0.45), inset -3px 0 0 var(--paper-edge); }
  .gutter { display: none; }
}

/* Inhalt einer Seite */
.pc {
  position: absolute;
  inset: 0;
  padding: calc(var(--page-h) * 0.065) calc(var(--page-w) * 0.085) calc(var(--page-h) * 0.075);
  font-size: var(--fs);
  line-height: 1.45;
  hyphens: auto;
  -webkit-hyphens: auto;
  text-align: justify;
  text-rendering: optimizeLegibility;
  font-feature-settings: "liga", "onum";
}
.pc .body { height: 100%; overflow: hidden; }
.pc p { margin: 0; text-indent: 1.4em; }
.pc p.first, .pc p.cont { text-indent: 0; }
.pc p + p { margin-top: 0.15em; }

.running {
  position: absolute;
  top: calc(var(--page-h) * 0.03);
  left: 0; right: 0;
  text-align: center;
  font-family: var(--display);
  font-size: calc(var(--fs) * 0.62);
  letter-spacing: 0.22em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.folio {
  position: absolute;
  bottom: calc(var(--page-h) * 0.03);
  left: 0; right: 0;
  text-align: center;
  font-family: var(--display);
  font-size: calc(var(--fs) * 0.7);
  color: var(--ink-soft);
}
.folio::before, .folio::after { content: "❦"; margin: 0 0.6em; color: var(--rubric); opacity: 0.6; font-size: 0.85em; }
.folio:empty::before, .folio:empty::after { content: none; }

/* Kapitelkopf */
.chapter-head { text-align: center; margin: 0.4em 0 1.1em; text-indent: 0; }
.chapter-head .runde {
  display: block;
  font-family: var(--display);
  font-size: 0.72em;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--rubric);
}
.chapter-head h2 {
  margin: 0.25em 0 0.15em;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.45em;
  line-height: 1.2;
  text-align: center;
  hyphens: manual;
}
.chapter-head .date { display: block; font-style: italic; color: var(--ink-soft); font-size: 0.85em; }
.chapter-head .rule {
  display: block;
  margin: 0.6em auto 0;
  width: 60%;
  height: 10px;
  background:
    radial-gradient(circle at 50% 50%, var(--rubric) 0 3px, transparent 3.5px),
    linear-gradient(90deg, transparent, var(--gold-lo) 20%, var(--gold-lo) 44%, transparent 44% 56%, var(--gold-lo) 56%, var(--gold-lo) 80%, transparent) center / 100% 1px no-repeat;
}

/* Initiale */
.pc p.drop::first-letter {
  float: left;
  font-family: "Cinzel Decorative", var(--display);
  font-weight: 700;
  font-size: 3.35em;
  line-height: 0.82;
  padding: 0.06em 0.09em 0 0;
  color: var(--rubric);
  text-shadow: 1px 1px 0 rgba(201, 164, 92, 0.55);
}

/* Raumseite mit Skizze: Text oben, Skizze unten (feste Höhe, damit der Umbruch nicht vom Laden abhängt) */
.page.mit-bild .body { display: flex; flex-direction: column; }
.page.mit-bild .raum-text { flex: 0 0 auto; }
.skizze { flex: 0 0 auto; height: 46%; margin: auto 0 0; padding-top: 0.6em; position: relative; display: flex;
          justify-content: center; filter: drop-shadow(2px 3px 2.5px rgba(60, 35, 10, 0.32)); }
.zettel {
  height: 100%;
  padding: 5% 6%;
  background: #e6d5ad radial-gradient(ellipse at 40% 35%, #ead9b3, #dcc79c);
  transform: rotate(-1.6deg);
  clip-path: polygon(1% 2%, 9% 0, 18% 1.5%, 30% 0.3%, 41% 1.8%, 55% 0, 68% 1.2%, 80% 0.2%, 92% 1.6%, 99% 0.4%,
    98.5% 12%, 100% 26%, 98.8% 40%, 99.6% 55%, 98.4% 70%, 100% 84%, 98.9% 99%, 88% 98%, 75% 100%, 61% 98.6%,
    47% 99.8%, 33% 98.2%, 20% 100%, 8% 98.4%, 0.6% 99.5%, 1.4% 86%, 0 72%, 1.2% 58%, 0.2% 44%, 1.5% 30%, 0 16%);
}
.zettel img { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; mix-blend-mode: multiply;
              filter: sepia(0.35) contrast(1.05); }
/* Nadel: Kopf und ein Stück Schaft, oben am Zettel */
.nadel { position: absolute; top: calc(0.6em + 2%); left: 50%; width: 9px; height: 9px; margin-left: -4px; border-radius: 50%;
         background: radial-gradient(circle at 35% 35%, #b9b2a6, #5b544b 60%, #2f2a25); box-shadow: 1px 2px 2px rgba(40, 25, 10, 0.45); }
.nadel::after { content: ""; position: absolute; left: 4px; top: 7px; width: 1.5px; height: 10px; background: linear-gradient(#6b645a, #9d968b);
                transform: rotate(18deg); transform-origin: top; opacity: 0.8; }
/* Wiederholte linke Seite: nie pixelgleich – anderes Licht, anderer Anschnitt */
.page.left.v1 { background-position: 37px 23px, 0 0; }
.page.left.v1 .pc { transform: translate(0.6px, -0.8px); }
.page.left.v1 .zettel { transform: rotate(-1.1deg) translate(2px, 1px); }
.page.left.v2 { background-position: 91px 140px, 0 0; filter: brightness(0.985); }
.page.left.v2 .pc { transform: translate(-0.7px, 0.5px); }
.page.left.v2 .zettel { transform: rotate(-2.1deg) translate(-1px, 2px); }
.page.left.v3 { background-position: 155px 64px, 0 0; filter: brightness(1.012) saturate(0.97); }
.page.left.v3 .pc { transform: translate(0.4px, 0.9px); }
.page.left.v3 .zettel { transform: rotate(-0.8deg) translate(1px, -1px); }

/* Der Raum: nüchtern, zweite Person */
.raum p { color: var(--ink); }

/* Der Brief: eingelegtes Blatt in anderer Hand */
.page.brief .pc { padding-left: calc(var(--page-w) * 0.075); padding-right: calc(var(--page-w) * 0.075); }
.page.brief .body {
  background: radial-gradient(ellipse at 30% 20%, #faf3e0, var(--letter) 60%, #ebdcb8 100%);
  padding: 1.1em 1.25em;
  box-shadow: 0 2px 0 rgba(0,0,0,0.05), 2px 6px 14px rgba(60, 35, 10, 0.28);
  transform: rotate(-0.6deg);
  border: 1px solid rgba(140, 110, 60, 0.35);
}
.page.brief.cont .body { transform: rotate(0.4deg); }
.brief-text {
  font-family: var(--hand);
  color: var(--letter-ink);
  font-size: 1.04em;
  line-height: 1.55;
  text-align: left;
  hyphens: manual;
}
.brief-text p { text-indent: 0; }
.brief-text p + p { margin-top: 0.7em; }
.brief-text p.salut { font-style: italic; }
/* Zwei Hände, gleiche Tinte, gleiche Größe: A schreibt aufrecht (IM Fell), Gerwin in Schreibschrift */
.brief-text p.hand-gerwin { font-family: "Dancing Script", var(--hand); font-style: normal; letter-spacing: 0.01em; }
.brief-text p.hand-gerwin.salut { font-style: normal; }
.brief-text p.teil:not(:first-child) { margin-top: 1.25em; } /* jeder Teil beginnt so, ohne Überschrift */
.brief-mark {
  display: block;
  text-align: right;
  font-family: var(--display);
  font-size: 0.62em;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--rubric);
  opacity: 0.75;
  margin-bottom: 0.6em;
}

/* Innenseite des vorderen Deckels: ein eingeklebtes Blatt mit einer Bleistiftskizze der Stadt. */
.page.endpaper {
  background-color: #eadcbc;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 0 0.12 0 0 0 0.10 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% 50%, #efe3c6 40%, #dcc89f 100%);
}
.karte { position: absolute; inset: 0; }
.karte .plan { position: absolute; inset: 5% 7%; width: 86%; height: 90%; overflow: visible; }
.karte .ortname { font-family: "Caveat", var(--hand); fill: #3d3024; }
.karte .ortname.weg { fill-opacity: 0.8; }

/* Vorsatzblatt und leere Seiten */
.vorsatz { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; text-indent: 0; }
.vorsatz .t { font-family: var(--display); font-weight: 700; font-size: 1.9em; letter-spacing: 0.08em; color: var(--ink); }
.vorsatz .s { font-style: italic; color: var(--ink-soft); margin-top: 0.6em; }
.vorsatz .orn { color: var(--rubric); font-size: 1.6em; margin: 0.8em 0; opacity: 0.75; }
.leer { display: flex; align-items: center; justify-content: center; height: 100%; font-style: italic; color: var(--ink-soft); text-align: center; text-indent: 0; }

/* ---------- Einband ---------- */
/* Der Deckel hat zwei Seiten: außen Leder, innen die Karte. Er dreht sich um den Buchrücken und liegt am Ende
   genau dort, wo die linke Seite der Doppelseite ist – dann wird er gegen die Doppelseite getauscht. */
.cover {
  position: absolute;
  top: -10px; left: 50%;
  width: calc(var(--page-w) + 12px);
  height: calc(var(--page-h) + 20px);
  z-index: 5;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: var(--gold);
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 1.1s cubic-bezier(.6,.05,.3,1);
}
@media (max-width: 820px) {
  .cover { top: -8px; left: -12px; width: calc(var(--page-w) + 20px); height: calc(var(--page-h) + 16px); }
}
.cover-face {
  position: absolute;
  inset: 0;
  display: block;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.cover-face.front {
  border-radius: 4px 10px 10px 4px;
  background:
    radial-gradient(ellipse at 40% 30%, rgba(255, 255, 255, 0.06), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='l'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23l)'/%3E%3C/svg%3E"),
    linear-gradient(90deg, var(--leather-3) 0, var(--leather-2) 4%, var(--leather-1) 30%, var(--leather-2) 100%);
  box-shadow: 0 30px 60px rgba(0,0,0,0.6), 0 6px 14px rgba(0,0,0,0.5), inset 6px 0 10px rgba(0,0,0,0.45);
}
.cover-face.back {
  transform: rotateY(180deg);
  border-radius: 6px 0 0 6px;
  background: linear-gradient(90deg, var(--leather-2), var(--leather-1) 96%, var(--leather-3));
  box-shadow: inset 0 0 0 2px rgba(201,164,92,0.25);
}
.cover-face.back .page { position: absolute; top: 10px; bottom: 10px; left: 12px; right: 0; height: auto; }
.cover:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 6px; }
.cover-frame {
  position: absolute;
  inset: 6%;
  border: 2px solid var(--gold-lo);
  outline: 1px solid rgba(201, 164, 92, 0.35);
  outline-offset: 6px;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4%;
  padding: 8%;
  background:
    radial-gradient(circle at 0 0, transparent 14px, transparent 15px),
    linear-gradient(var(--gold-lo), var(--gold-lo)) top 10px left 10px / 26px 1px no-repeat,
    linear-gradient(var(--gold-lo), var(--gold-lo)) top 10px left 10px / 1px 26px no-repeat,
    linear-gradient(var(--gold-lo), var(--gold-lo)) top 10px right 10px / 26px 1px no-repeat,
    linear-gradient(var(--gold-lo), var(--gold-lo)) top 10px right 10px / 1px 26px no-repeat,
    linear-gradient(var(--gold-lo), var(--gold-lo)) bottom 10px left 10px / 26px 1px no-repeat,
    linear-gradient(var(--gold-lo), var(--gold-lo)) bottom 10px left 10px / 1px 26px no-repeat,
    linear-gradient(var(--gold-lo), var(--gold-lo)) bottom 10px right 10px / 26px 1px no-repeat,
    linear-gradient(var(--gold-lo), var(--gold-lo)) bottom 10px right 10px / 1px 26px no-repeat;
}
.sigil { width: 42%; fill: none; stroke: var(--gold); stroke-width: 1.6; filter: drop-shadow(0 1px 0 rgba(0,0,0,0.6)); }
.sigil .seal { fill: var(--rubric); stroke: var(--gold-hi); }
.cover-title {
  font-family: "Cinzel Decorative", var(--display);
  font-weight: 700;
  font-size: calc(var(--page-w) * 0.084);
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.7));
  line-height: 1.1;
}
.cover-sub { font-family: var(--display); font-size: calc(var(--page-w) * 0.036); letter-spacing: 0.25em; text-transform: uppercase; color: var(--gold); opacity: 0.85; }
.cover-hint { margin-top: 6%; font-family: var(--serif); font-style: italic; font-size: calc(var(--page-w) * 0.04); color: var(--gold-hi); opacity: 0.7; transition: opacity 0.3s; }
.cover:hover .cover-hint { opacity: 1; }

/* Ohne Text: Beim Überfahren hebt sich der Einband an der rechten Kante kaum merklich – er lässt sich öffnen */
@media (hover: hover) {
  .book[data-state="closed"] .cover { transition: transform 0.45s ease; }
  .book[data-state="closed"] .cover:hover { transform: rotateY(-3deg); }
  .book[data-state="closed"] .cover:hover .cover-face.front { box-shadow: 8px 34px 70px rgba(0,0,0,0.65), 0 6px 14px rgba(0,0,0,0.5), inset 6px 0 10px rgba(0,0,0,0.45); }
}
.cover-face.front { transition: box-shadow 0.45s ease; }
.book[data-state="opening"] .cover { transform: rotateY(-180deg); pointer-events: none; transition: transform 1.1s cubic-bezier(.6,.05,.3,1); }
.book[data-state="open"] .cover { display: none; }
/* Zuklappen: der Deckel legt sich zurück auf den Buchblock, das Buch gleitet wieder in die Mitte */
.book[data-state="closing"] .cover { transform: none; pointer-events: none; transition: transform 1.1s cubic-bezier(.6,.05,.3,1); }
@media (min-width: 821px) {
  .book[data-state="closing"] { transform: translateX(calc(var(--page-w) * -0.5)); }
  .book[data-state="closing"] .spread { clip-path: inset(0 0 0 50%); }
}
/* Während der Deckel klappt, gibt es links noch nichts – die linke Hälfte bringt der Deckel selbst mit */
@media (min-width: 821px) { .book[data-state="opening"] .spread { clip-path: inset(0 0 0 50%); } }

/* ---------- Lesebändchen ---------- */
/* Zwei gewebte Bändchen, die oben aus dem Buch hängen: links (Windrose) zur Karte, rechts zum neuesten Kapitel. */
.band {
  position: absolute;
  top: -16px;
  z-index: 5;
  width: 22px;
  height: 92px;
  padding: 0;
  border: 0;
  cursor: pointer;
  display: none;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.12) 0 1px, transparent 1px 2px),
    linear-gradient(90deg, #5e1410, #8c2a1c 40%, #7a2016 70%, #5a130f);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%);
  filter: drop-shadow(1px 2px 1.5px rgba(30, 15, 5, 0.45));
  transition: height 0.25s ease, transform 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.band.links { left: 7%; }
.band.rechts { right: 2.5%; background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.12) 0 1px, transparent 1px 2px),
    linear-gradient(90deg, #1f3a2c, #2f5642 40%, #284a39 70%, #1c3427); }
.band:hover { height: 100px; }
.band svg { position: absolute; left: 3px; top: 52px; width: 16px; height: 16px; fill: none; stroke: #d8b56a; stroke-width: 1.1; opacity: 0.9; }
.book[data-state="open"]:not(.turning) .band.on { display: block; }
@media (max-width: 820px) {
  .band { width: 18px; height: 70px; top: -12px; }
  .band:hover { height: 76px; }
  .band svg { left: 2px; top: 36px; width: 14px; height: 14px; }
  .band.links { left: 7%; }
  .band.rechts { right: 7%; }
}
@media (prefers-reduced-motion: reduce) { .band { transition: none; } }

/* ---------- Umblättern ---------- */
/* Eselsohr: fährt die Maus über eine untere Außenecke, knickt sie um – Klick blättert. Auf Touch-Geräten bleibt ein
   kleiner Knick stehen. Nicht am Einband, nicht dort, wo es nicht weitergeht. */
.corner {
  position: absolute;
  bottom: 10px;
  width: 110px;
  height: 110px;
  z-index: 3;
  display: none;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.corner.next { right: 12px; }
.corner.prev { left: 12px; }
.book[data-state="open"]:not(.turning) .corner.on { display: block; }
.curl {
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  transition: width 0.28s cubic-bezier(.3,.7,.4,1), height 0.28s cubic-bezier(.3,.7,.4,1);
}
.corner.next .curl { right: 0; }
.corner.prev .curl { left: 0; }
.corner:hover .curl { width: 58px; height: 58px; }
.corner:active .curl { width: 74px; height: 74px; }
@media (hover: none) { .corner .curl, .corner:hover .curl { width: 20px; height: 20px; } }
.curl::before, .curl::after { content: ""; position: absolute; inset: 0; }
/* ::before = was unter der umgeknickten Ecke sichtbar wird, ::after = die Rückseite des Blatts */
.corner.next .curl::before { background: linear-gradient(to bottom right, transparent 50%, #c4ab7c 50%, #b39868); border-bottom-right-radius: 4px; }
.corner.next .curl::after {
  background: linear-gradient(to bottom right, #d6c196 0%, #f3e8cb 44%, #e6d4ad 49.5%, transparent 50%);
  filter: drop-shadow(-3px -3px 4px rgba(60, 35, 10, 0.32));
}
.corner.prev .curl::before { background: linear-gradient(to bottom left, transparent 50%, #c4ab7c 50%, #b39868); border-bottom-left-radius: 4px; }
.corner.prev .curl::after {
  background: linear-gradient(to bottom left, #d6c196 0%, #f3e8cb 44%, #e6d4ad 49.5%, transparent 50%);
  filter: drop-shadow(3px -3px 4px rgba(60, 35, 10, 0.32));
}
@media (max-width: 820px) {
  .corner { bottom: 8px; width: 80px; height: 80px; }
  .corner.next { right: 8px; }
}
@media (prefers-reduced-motion: reduce) { .curl { transition: none; } }

.leaf {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
  z-index: 4;
  pointer-events: none;
}
@media (max-width: 820px) { .leaf { left: 0; width: 100%; } }
/* Streifen eines gewölbten Blatts; jeder hängt am rechten Rand des vorigen (Breite/Lage setzt buch.js) */
.leaf .strip { position: absolute; top: 0; height: 100%; transform-origin: left center; transform-style: preserve-3d; }
.leaf .face { position: absolute; top: 0; bottom: 0; left: -0.5px; right: -0.5px; overflow: hidden;
              backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.leaf .face.back { transform: rotateY(180deg); }
.leaf .face > .page { position: absolute; top: 0; height: 100%; } /* behält den Schatten am Bundsteg */
.leaf .fshade { position: absolute; inset: 0; pointer-events: none; }
/* Schatten, den das Blatt auf die liegenden Seiten wirft */
.wurf { position: absolute; inset: 0; z-index: 3; pointer-events: none; }

/* Vorschau der Test-Chronik: Stempel am Buch */
.book.preview::after {
  content: "Vorschau";
  position: absolute;
  top: -14px; right: -8px;
  z-index: 6;
  padding: 4px 12px;
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #f6e7c8;
  background: var(--rubric);
  border: 1px solid var(--gold);
  transform: rotate(4deg);
  box-shadow: 0 3px 8px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* ---------- Bedienung ---------- */
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  color: var(--gold);
  user-select: none;
  min-height: 44px;
}
.book[data-state="closed"] ~ .controls { visibility: hidden; }
.controls { transition: opacity 0.4s; }
.book[data-state="opening"] ~ .controls { opacity: 0; }
.ctl {
  appearance: none;
  border: 1px solid rgba(201, 164, 92, 0.4);
  background: rgba(0, 0, 0, 0.25);
  color: var(--gold);
  font: inherit;
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.ctl.big { width: 44px; height: 44px; font-size: 28px; padding-bottom: 4px; }
.ctl:hover:not(:disabled) { background: rgba(201, 164, 92, 0.15); color: var(--gold-hi); }
.ctl:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.ctl:disabled { opacity: 0.3; cursor: default; }
.ctl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.2; display: block; margin: auto; }
.where { min-width: 11em; text-align: center; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; }

.foot {
  text-align: center;
  padding: 4px 16px 10px;
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(201, 164, 92, 0.55);
}
.foot a { color: inherit; text-decoration: none; }
.foot a:hover, .foot a:focus-visible { color: var(--gold-hi); }
.foot span { margin: 0 0.8em; }

/* Messseite: gleiche Maße wie eine echte Seite, aber unsichtbar */
.measure { position: absolute; left: -9999px; top: 0; width: var(--page-w); height: var(--page-h); visibility: hidden; }

.noscript { color: var(--paper); font-style: italic; }

@media (prefers-reduced-motion: reduce) {
  .cover, .leaf, .book { transition: none !important; }
}
