/* Geisterarchiv – Bibliothek. Dieselbe Welt wie der Wirkraum: Krypta im Hintergrund, Pergament, Kerzenlicht. */
:root {
  --nacht: #0a0604;
  --tinte: #2b1a0e;
  --rubrik: #9a2c1b;
  --gold: #c9a352;
  --gold-hell: #ecd28f;
  --ui: #ead9b3;
  --ui-leise: rgba(234, 217, 179, .66);
}
* { box-sizing: border-box; }
html { background: var(--nacht); }
body {
  margin: 0; min-height: 100vh; color: var(--ui);
  font-family: "Alegreya", Georgia, serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* Krypta, unscharf und dunkel, mit warmem Licht von unten */
.hintergrund { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--nacht); }
.hintergrund::before {
  content: ""; position: absolute; inset: -30px;
  background: url("bild/szene-quer.webp") center 70% / cover no-repeat;
  filter: blur(7px) brightness(.42) saturate(.9);
}
.hintergrund::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(255, 150, 60, .1), rgba(0, 0, 0, 0) 70%),
    radial-gradient(ellipse 120% 90% at 50% 40%, rgba(10, 6, 4, 0) 30%, rgba(10, 6, 4, .85) 100%);
}
@media (max-aspect-ratio: 9/10) {
  .hintergrund::before { background-image: url("bild/szene-hoch.webp"); background-position: center 80%; }
}

/* ---------- Kopf ---------- */
.kopf { max-width: 760px; margin: 0 auto; padding: 56px 16px 18px; text-align: center; }
.marke {
  margin: 0; font-family: "Fraktur", serif; font-size: clamp(52px, 12vw, 104px); line-height: 1;
  background: linear-gradient(180deg, #f3dc9e 0%, #c9a352 55%, #8e6a2c 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 26px rgba(255, 170, 70, .22));
}
.unterzeile {
  margin: .45em 0 0; font-family: "Cormorant", serif; font-style: italic; font-weight: 500;
  font-size: clamp(19px, 4.4vw, 25px); color: var(--ui-leise);
}
.einleitung { margin: 1.4em auto 0; max-width: 36em; font-size: clamp(16px, 2.2vw, 18px); line-height: 1.55; color: rgba(234, 217, 179, .82); }

/* ---------- Regal ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 0 16px 40px; }
.regal-kopf, .grimoire-kopf { text-align: center; margin: 42px 0 22px; }
.regal-kopf h1, .grimoire-kopf h2 {
  margin: 0; font-family: "Alegreya", serif; font-weight: 500; font-variant: small-caps;
  letter-spacing: .14em; font-size: clamp(22px, 3.4vw, 28px); color: var(--gold-hell);
}
.regal-kopf h1::before, .regal-kopf h1::after, .grimoire-kopf h2::before, .grimoire-kopf h2::after {
  content: ""; display: inline-block; width: clamp(28px, 8vw, 70px); height: 1px; vertical-align: middle; margin: 0 .7em;
  background: linear-gradient(90deg, rgba(201, 163, 82, 0), rgba(201, 163, 82, .7));
}
.regal-kopf h1::after, .grimoire-kopf h2::after { background: linear-gradient(90deg, rgba(201, 163, 82, .7), rgba(201, 163, 82, 0)); }
.regal-kopf p, .grimoire-kopf p { margin: .4em 0 0; font-style: italic; color: var(--ui-leise); font-size: 16px; }

.karten {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 22px 20px;
}
.karte-eintrag { animation: auftauchen .9s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 55ms); }
@keyframes auftauchen { from { opacity: 0; transform: translateY(12px); } }

/* Pergamentzettel */
.karte {
  position: relative; display: flex; flex-direction: column; height: 100%;
  padding: 26px 26px 22px; text-decoration: none; color: var(--tinte);
  background: url("bild/pergament.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .55)) sepia(.12) brightness(.9);
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), filter .45s;
}
a.karte:hover, a.karte:focus-visible {
  outline: none; transform: translateY(-4px) rotate(-.4deg);
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, .6)) drop-shadow(0 0 22px rgba(255, 170, 70, .25)) sepia(.08) brightness(.98);
}
.kategorie {
  margin: 0; font-weight: 500; font-variant: small-caps; letter-spacing: .1em; font-size: 14px; color: var(--rubrik);
}
.titel { margin: .12em 0 .1em; font-family: "Fraktur", serif; font-weight: 400; font-size: 36px; line-height: 1.05; }
.kurz { margin: 0; font-style: italic; font-size: 16.5px; line-height: 1.35; color: rgba(43, 26, 14, .82); }
.formel {
  margin: .9em 0 0; padding-top: .7em; border-top: 1px solid rgba(154, 44, 27, .25);
  font-size: 15.5px; line-height: 1.35; color: var(--rubrik);
}
.quelle { margin: .7em 0 0; font-size: 13px; color: rgba(43, 26, 14, .6); }
.wirken {
  align-self: flex-start; margin-top: auto; padding-top: 14px;
  font-weight: 600; font-variant: small-caps; letter-spacing: .14em; font-size: 15px; color: var(--rubrik);
}
.wirken::after { content: " →"; transition: margin .3s; }
a.karte:hover .wirken::after { margin-left: 4px; }

/* ---------- Grimoire: dunkles, versiegeltes Regal ---------- */
.grimoire {
  margin-top: 56px; padding: 6px clamp(16px, 3vw, 34px) 34px;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(201, 163, 82, .1), rgba(0, 0, 0, 0) 70%),
    linear-gradient(180deg, rgba(36, 20, 10, .9), rgba(16, 9, 5, .92));
  border: 1px solid rgba(201, 163, 82, .22);
  box-shadow: inset 0 0 0 5px rgba(16, 9, 5, .9), inset 0 0 0 6px rgba(201, 163, 82, .14), 0 20px 40px rgba(0, 0, 0, .5);
}
.grimoire-kopf h2 { font-family: "Fraktur", serif; font-variant: normal; letter-spacing: .01em; font-size: clamp(34px, 5.5vw, 48px); color: var(--gold); }
.karte.zu {
  color: var(--ui); background: linear-gradient(160deg, #2a1810, #170d07);
  border: 1px solid rgba(201, 163, 82, .25); filter: none;
  box-shadow: inset 0 0 0 4px #170d07, inset 0 0 0 5px rgba(201, 163, 82, .12);
}
.karte.zu .kategorie { color: var(--gold); }
.karte.zu .kurz { color: var(--ui-leise); }
.karte.zu .titel { color: var(--gold-hell); font-size: 30px; }
.preis { margin: auto 0 0; padding-top: 16px; font-variant: small-caps; letter-spacing: .12em; font-size: 14px; color: var(--gold); }
.siegel {
  position: absolute; right: 18px; bottom: 16px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-family: "Fraktur", serif; font-size: 24px; color: #5a0d07;
  background: radial-gradient(circle at 38% 34%, #c8402c, #8e1a10 55%, #4f0b06);
  box-shadow: 0 3px 6px rgba(0, 0, 0, .5), inset 0 0 0 4px rgba(79, 11, 6, .35);
}

/* ---------- Fuß ---------- */
.fuss { max-width: 760px; margin: 0 auto; padding: 10px 16px 40px; text-align: center; font-size: 14px; color: var(--ui-leise); }
.fuss a { color: var(--ui-leise); }

@media (prefers-reduced-motion: reduce) { .karte-eintrag { animation: none; } .karte { transition: none; } }
@media (max-width: 600px) {
  .kopf { padding-top: 40px; }
  .karte { padding: 22px 22px 18px; }
  .titel { font-size: 32px; }
}

/* ---------- Textseiten (Impressum, Datenschutz, 404) ---------- */
.textseite { max-width: 760px; margin: 0 auto; padding: 0 16px 30px; }
.textseite .zurueck { display: inline-block; margin: 0 0 14px; color: var(--ui-leise); text-decoration: none; font-style: italic; }
.textseite .zurueck:hover { color: var(--gold-hell); }
.text {
  padding: clamp(24px, 5vw, 48px) clamp(20px, 5vw, 52px);
  background: linear-gradient(180deg, #ecdcb5, #e2cc9a);
  color: var(--tinte);
  border-radius: 3px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .6), inset 0 0 60px rgba(120, 80, 30, .18);
  line-height: 1.55; font-size: 17px;
}
.text h1 { margin: 0 0 .4em; font-family: "Fraktur", serif; font-weight: 400; font-size: clamp(40px, 8vw, 56px); line-height: 1.05; }
.text h2 { margin: 1.6em 0 .4em; font-weight: 600; font-variant: small-caps; letter-spacing: .06em; font-size: 20px; color: var(--rubrik); }
.text p { margin: .6em 0; }
.text a { color: var(--rubrik); }
.text .lead { font-size: 18.5px; font-style: italic; }
.text .stand { margin-top: 2em; font-size: 14px; color: rgba(43, 26, 14, .65); }
.text .noch-nicht {
  display: inline-block; margin: 0 0 .3em; padding: 2px 9px; border: 1px solid rgba(154, 44, 27, .45); border-radius: 2px;
  font-size: 13.5px; font-variant: small-caps; letter-spacing: .06em; color: var(--rubrik);
}
.kopf.klein { padding: 34px 16px 12px; }
.kopf.klein .marke { font-size: clamp(44px, 9vw, 64px); text-decoration: none; display: inline-block; }

/* Logo: Signet über der großen Wortmarke (Bibliothek) und neben der Wortmarke (Textseiten) */
.signet-gross { display: block; margin: 0 auto 10px; width: clamp(92px, 20vw, 130px); height: auto; filter: drop-shadow(0 0 22px rgba(255, 170, 70, .35)); animation: auftauchen 1.2s ease both; }
.marke-zeile { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.marke-zeile .signet { width: clamp(42px, 8vw, 54px); height: auto; filter: drop-shadow(0 0 12px rgba(255, 170, 70, .3)); }

/* Einstellungen-Knopf oben rechts in der Bibliothek */
.einst-oben { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 14px; z-index: 20; }

/* ---------- Seite „Wie Wirken funktioniert“ ---------- */
.text .merksatz {
  margin: 1.4em 0 .4em; padding: .9em 1em; text-align: center;
  font-family: "Cormorant", serif; font-style: italic; font-weight: 600; font-size: clamp(21px, 4.6vw, 27px); line-height: 1.3;
  color: var(--rubrik); border-top: 1px solid rgba(154, 44, 27, .3); border-bottom: 1px solid rgba(154, 44, 27, .3);
}
.text .schritte { margin: .6em 0; padding-left: 1.4em; }
.text .schritte li { margin: .5em 0; padding-left: .2em; }
.text .schritte li::marker { font-family: "Fraktur", serif; color: var(--rubrik); font-size: 1.15em; }
.text .weiter { margin-top: 2em; text-align: center; }
.text .weiter-knopf {
  display: inline-block; padding: 10px 22px; text-decoration: none;
  font-family: "Cormorant", serif; font-weight: 600; font-size: 19px; color: #fff4e0; background: var(--rubrik); border: 1px solid var(--rubrik);
}
.text .weiter-knopf:hover { background: #7e2214; }
.einleitung a { color: var(--gold-hell); }
