/* ==========================================================================
   Anitas Tage – Gestaltung
   Leitmotiv: ein Buch, das nur für Anita geschrieben wird.
   Briefpapier, Tinte, Wachssiegel, feine Goldlinien. Jeder Tag ist eine Buchseite.
   Die Farbwerte (--paper, --accent …) setzt das Skript je nach Tag und Tageszeit.
   ========================================================================== */

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-latin-wght-italic.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/caveat-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  /* Startwerte (Winter). Werden per Skript überschrieben. */
  --paper: #f6f1e7;
  --card: #fbf9f4;
  --ink: #2b2a26;
  --muted: #6a665c;
  --line: #d6d1c8;
  --accent: #2f4a3a;
  --accent2: #7a2632;
  --seal: #7e2330;
  --gold: #b08d57;

  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --ribbons-h: 4.4rem;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.45;
  transition: background-color .8s var(--ease), color .8s var(--ease);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Feine Papierstruktur */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .4  0 0 0 0 .3  0 0 0 .14 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23p)'/%3E%3C/svg%3E");
}
.night body::before { mix-blend-mode: screen; opacity: .1; }

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 500; text-wrap: balance; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

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

/* ---------- Sternenhimmel im Nachtmodus ---------- */
#sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s var(--ease); }
.night #sky { opacity: 1; }
#sky svg { width: 100%; height: 100%; display: block; }
#sky circle { fill: var(--gold); }

/* ---------- Buchseite ---------- */
#view {
  position: relative;
  z-index: 1;
  max-width: 34rem;
  margin: 0 auto;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.25rem calc(var(--ribbons-h) + 2.5rem + env(safe-area-inset-bottom));
}

.fade-in { animation: ink .8s var(--ease) both; }

/* Tinte „fließt“: Die Abschnitte der Seite erscheinen nacheinander, erst weich, dann scharf. */
.sheet > * { animation: ink .9s var(--ease) both; animation-delay: calc(var(--i, 0) * 110ms); }
/* „translate“ statt „transform“, damit schräg geklebte Zettel ihre Drehung behalten. */
@keyframes ink {
  from { opacity: 0; filter: blur(5px); translate: 0 6px; }
  60% { filter: blur(0); }
  to { opacity: 1; filter: blur(0); translate: 0 0; }
}

/* Umblättern */
#view.turn-back { animation: turn-back .28s ease-in both; }
#view.turn-forward { animation: turn-forward .28s ease-in both; }
@keyframes turn-back { to { opacity: 0; transform: translateX(22%) rotate(1.5deg); } }
@keyframes turn-forward { to { opacity: 0; transform: translateX(-22%) rotate(-1.5deg); } }

/* ---------- Kleintext ---------- */
.eyebrow {
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.italic { font-style: italic; }

.dev-banner {
  font-family: var(--sans); font-size: .72rem; color: #4a3b00;
  background: #fff3c4; border: 1px solid #e0c25a; padding: .35rem .6rem; margin-bottom: 1rem;
}
.dev-note { margin-top: .6rem; font-family: var(--sans); font-size: .7rem; color: #4a3b00; background: #fff3c4; border: 1px solid #e0c25a; padding: .3rem .5rem; display: inline-block; }

.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center;
  color: var(--accent); border-radius: 50%;
  transition: background-color .2s;
}
.icon-btn:hover { background-color: color-mix(in srgb, var(--accent) 8%, transparent); }
.icon-btn:disabled { opacity: .22; cursor: default; }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

.btn {
  font-family: var(--sans); font-size: .76rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent);
  padding: .7rem 1.1rem; min-height: 44px; white-space: nowrap;
  transition: background-color .2s, color .2s;
}
.btn:hover { background-color: var(--accent); color: var(--paper); }
.btn-quiet { border-color: transparent; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: .3em; text-decoration-thickness: 1px; padding-inline: .4rem; }
.btn-quiet:hover { background: none; color: var(--accent); text-decoration-thickness: 2px; }

/* ---------- Kopf der Seite ---------- */
.day-head { text-align: center; position: relative; padding-top: .5rem; }
.day-head .chapter { display: inline-flex; align-items: center; gap: .55rem; }
.moon { width: 15px; height: 15px; flex: none; }
.moon .disc { fill: none; stroke: var(--gold); stroke-width: 1; }
.moon .lit { fill: var(--gold); }

.day-head h1 { font-size: clamp(2.3rem, 10.5vw, 3.1rem); line-height: 1.05; margin-top: 1rem; font-weight: 400; letter-spacing: -.005em; }
.day-head h1 .weekday { display: block; font-size: .48em; font-style: italic; color: var(--accent2); margin-bottom: .4rem; letter-spacing: .01em; }
.day-head .together { margin-top: .75rem; font-size: 1.05rem; color: var(--muted); font-style: italic; }
.day-head .greeting { margin-top: 1.2rem; font-size: 1.5rem; font-style: italic; color: var(--accent); text-wrap: balance; }

.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.tags li {
  font-family: var(--sans); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); color: var(--accent2);
  padding: .25rem .6rem;
}
.special-note { margin-top: .7rem; font-size: 1rem; font-style: italic; color: var(--muted); text-wrap: pretty; }

/* Zierlinie mit Fleuron oder Saison-Ornament */
.divider { display: flex; align-items: center; gap: .8rem; margin: 2rem 0; color: var(--gold); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to right, transparent, var(--gold)); opacity: .7; }
.divider::after { background: linear-gradient(to left, transparent, var(--gold)); }
.divider svg { height: 22px; width: auto; flex: none; fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.divider svg .solid { fill: currentColor; stroke: none; }

/* ---------- Hinweis „Blätter warten“ ---------- */
.waiting {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold);
  padding: .8rem .2rem; margin-bottom: 1.5rem; font-size: 1.05rem; font-style: italic;
}

/* ---------- Strauß der Woche ---------- */
.bouquet { text-align: center; }
.bouquet-frame {
  position: relative;
  border: 1px solid var(--gold);
  outline: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); outline-offset: 5px;
  margin: 5px 5px 1.5rem; padding: .5rem .5rem 0;
  background: var(--card);
}
.bq { display: block; width: 100%; max-width: 21rem; height: auto; margin: 0 auto; }
.flower-name { font-size: 2.1rem; line-height: 1.1; font-weight: 400; margin-top: .4rem; }
.flower-meaning { font-style: italic; font-size: 1.25rem; color: var(--accent); margin-top: .2rem; text-wrap: balance; }
.botanical { font-style: italic; color: var(--muted); font-size: 1rem; }
.bouquet .status { margin-top: .7rem; font-family: var(--sans); font-size: .72rem; letter-spacing: .08em; color: var(--muted); }
.ribbon-new {
  position: absolute; top: .7rem; left: -1px; z-index: 1;
  font-family: var(--sans); font-size: .6rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  background: var(--accent2); color: var(--paper); padding: .3rem .7rem .3rem .6rem;
}

/* Der Strauß entsteht: Papier erscheint, Stiele zeichnen sich, dann blenden die Blüten ein. */
.bq .bq-wrap { animation: bq-fade .7s .5s var(--ease) both; }
.bq .ln { stroke-dasharray: 1; stroke-dashoffset: 1; animation: bq-draw 1.3s .8s var(--ease) forwards; }
.bq .bq-bloom { animation: bq-fade 1.1s 1.7s var(--ease) both; }
@keyframes bq-draw { to { stroke-dashoffset: 0; } }
@keyframes bq-fade { from { opacity: 0; } to { opacity: 1; } }

/* Am Wochenende fallen einzelne Blütenblätter langsam herunter. */
.bq .fall { animation: petal-fall 4.5s 2.6s cubic-bezier(.3, .1, .5, 1) both; }
.bq .bq-fallen > g:nth-child(2n) .fall { animation-delay: 3.6s; animation-duration: 5.2s; }
.bq .bq-fallen > g:nth-child(3n) .fall { animation-delay: 4.8s; animation-duration: 4s; }
.bq .bq-fallen > g:nth-child(5n) .fall { animation-delay: 6s; }
@keyframes petal-fall {
  0% { transform: translate(-14px, -190px) rotate(-70deg); opacity: 0; }
  12% { opacity: 1; }
  35% { transform: translate(10px, -120px) rotate(30deg); }
  65% { transform: translate(-8px, -50px) rotate(-25deg); }
  100% { transform: none; opacity: 1; }
}

/* ---------- Notiz von Richard (Handschrift) ---------- */
.note {
  position: relative;
  margin: 2.2rem auto 0; max-width: 24rem; padding: 1.5rem 1.3rem 1.1rem;
  background: var(--card);
  transform: rotate(-1.2deg);
  font-family: var(--hand); font-size: 1.7rem; line-height: 1.25; color: var(--accent);
  box-shadow: 0 1px 0 var(--line), 0 12px 24px -18px rgba(0, 0, 0, .4);
}
/* Klebestreifen */
.note::before, .taped::before {
  content: ""; position: absolute; top: -.55rem; left: 50%; width: 5.2rem; height: 1.25rem;
  transform: translateX(-50%) rotate(-2.5deg);
  background: color-mix(in srgb, var(--gold) 34%, transparent);
  border-left: 1px dashed color-mix(in srgb, var(--gold) 60%, transparent);
  border-right: 1px dashed color-mix(in srgb, var(--gold) 60%, transparent);
}
.note .eyebrow { display: block; margin-bottom: .3rem; }

/* ---------- Kartenstapel ---------- */
.deck { margin: 0 -1.25rem; }
.deck-track {
  display: flex; gap: .9rem;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: .5rem 1.75rem 1.2rem;
  scrollbar-width: none;
}
.deck-track::-webkit-scrollbar { display: none; }
.deck-track:focus-visible { outline-offset: -4px; }

.card {
  flex: 0 0 100%;
  scroll-snap-align: center; scroll-snap-stop: always;
  min-height: 16rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 2.5rem 1.6rem 1.9rem;
  background: var(--card);
  position: relative;
  box-shadow: 0 0 0 1px var(--line), 0 14px 28px -22px rgba(0, 0, 0, .45);
  transition: background-color .8s var(--ease);
}
/* Goldener Innenrahmen */
.card::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--gold); opacity: .75; pointer-events: none; }
.card .eyebrow { position: absolute; top: 1.25rem; left: 0; right: 0; color: var(--accent2); }
.card .text { font-size: 1.5rem; line-height: 1.3; text-wrap: balance; max-width: 22ch; }
.card.long .text, .card .text.small { font-size: 1.22rem; max-width: 27ch; }
/* Initiale beim lieben Spruch */
.card.sweet .text::first-letter { font-size: 2.3em; line-height: .8; color: var(--accent2); font-weight: 500; padding-right: .02em; }
.card.quote .text { font-style: italic; }
.card .source { margin-top: 1rem; font-size: 1rem; color: var(--muted); }
.card .source b { font-weight: 600; color: var(--ink); display: block; font-variant: small-caps; letter-spacing: .06em; }
.card .punch { margin-top: 1rem; font-size: 1.5rem; font-style: italic; color: var(--accent); text-wrap: balance; }
.card .teaser { margin-top: .7rem; font-size: 1.05rem; color: var(--muted); font-style: italic; max-width: 24ch; text-wrap: balance; }
.card .btn { margin-top: 1.1rem; }

.deck-ctrl { display: flex; align-items: center; justify-content: center; gap: .6rem; }
.dots { display: flex; gap: .45rem; padding: 0 .4rem; }
.dots span { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--gold); transition: background-color .3s; }
.dots span.on { background: var(--gold); }

/* ---------- Frage des Tages ---------- */
.section-title { text-align: center; margin-bottom: 1rem; }
.question { text-align: center; margin-top: 2.2rem; padding: 0 .5rem; }
.question .text { font-size: 1.7rem; line-height: 1.22; font-style: italic; text-wrap: balance; }

.question-body { margin-top: 1.3rem; }
.answer-form { display: flex; flex-direction: column; align-items: stretch; gap: .7rem; max-width: 26rem; margin: 0 auto; }
.field {
  width: 100%; font: inherit; font-size: 1.2rem; line-height: 1.4; color: var(--ink);
  background: var(--card); border: 0; border-bottom: 1px solid var(--gold); border-radius: 0;
  padding: .7rem .8rem; resize: vertical; min-height: 44px;
  box-shadow: 0 0 0 1px var(--line);
}
.field::placeholder { color: var(--muted); font-style: italic; opacity: 1; }
.field:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
select.field { appearance: none; -webkit-appearance: none; text-align: center; text-align-last: center; }
.field-group { display: flex; flex-direction: column; gap: .7rem; }
.form-actions { display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap; }
.form-status { min-height: 1.2em; font-family: var(--sans); font-size: .78rem; color: var(--accent2); }
.btn-solid { background: var(--accent); color: var(--paper); }
.btn-solid:hover { background: var(--accent2); border-color: var(--accent2); }
.btn:disabled { opacity: .5; cursor: default; }

.swatches { display: grid; grid-template-columns: repeat(2, 1fr); gap: .45rem; }
.swatch {
  display: flex; align-items: center; gap: .55rem; min-height: 44px; padding: .35rem .6rem;
  font-size: 1.05rem; text-align: left; background: var(--card); box-shadow: 0 0 0 1px var(--line);
}
.swatch .dot { width: 1.4rem; height: 1.4rem; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px var(--line); }
.swatch .dot.empty { background: none; border: 1px dashed var(--muted); box-shadow: none; }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--accent); }

.my-answer {
  margin: 0 auto; max-width: 26rem; padding: 0 .5rem;
  font-size: 1.35rem; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere;
}
.my-answer::before { content: "„"; color: var(--gold); }
.my-answer::after { content: "“"; color: var(--gold); }
.saved { margin-top: .6rem; font-family: var(--sans); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.saved-note, .guess { margin-top: .5rem; font-style: italic; color: var(--muted); font-size: 1.05rem; }
.reaction { margin: 1rem auto 0; max-width: 24rem; font-family: var(--hand); font-size: 1.6rem; line-height: 1.2; color: var(--accent2); transform: rotate(-1.5deg); }
.reaction .heart { width: 1.2rem; height: 1.2rem; vertical-align: -.15rem; margin-right: .3rem; }
.heart { fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }
.heart.on { fill: var(--accent2); stroke: var(--accent2); }
.heart-btn { color: var(--accent2); }
.question .form-actions { margin-top: .8rem; }
.ask-carl { text-align: center; margin-top: 1.2rem; }
.ask-carl .answer-form { margin-top: .6rem; }

/* ---------- Aufgaben: Zettel mit Klebestreifen ---------- */
.tasks { text-align: center; }
.task-intro { font-style: italic; color: var(--muted); margin-bottom: 1rem; }
.task-options { display: flex; flex-direction: column; gap: .7rem; max-width: 26rem; margin: 0 auto .6rem; }
.task-option {
  display: block; width: 100%; text-align: center; padding: 1rem 1rem 1.1rem; min-height: 44px;
  background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 10px 20px -18px rgba(0, 0, 0, .45);
  border-bottom: 1px solid var(--gold);
  transition: box-shadow .2s, translate .2s;
}
.task-option:hover { box-shadow: 0 0 0 1px var(--accent), 0 12px 22px -16px rgba(0, 0, 0, .5); translate: 0 -1px; }
.task-option .eyebrow { display: block; margin-bottom: .35rem; color: var(--accent2); }
.task-title { display: block; font-size: 1.4rem; line-height: 1.2; text-wrap: balance; }
.task-note {
  position: relative; max-width: 22rem; margin: 1.6rem auto 1.4rem; padding: 1.6rem 1.2rem 1.2rem;
  background: var(--card); rotate: -1.4deg;
  box-shadow: 0 1px 0 var(--line), 0 12px 24px -18px rgba(0, 0, 0, .45);
}
.task-note.is-small { rotate: 1.1deg; max-width: 19rem; padding: 1.3rem 1rem 1rem; }
.task-note .eyebrow { margin-bottom: .4rem; color: var(--accent2); }
.task-note .task-title { font-size: 1.55rem; }
.task-note .form-actions, .task-note .answer-form { margin-top: .9rem; }
.task-note.is-small .task-title { font-size: 1.25rem; }
.task-note.is-done .task-title { text-decoration: line-through; text-decoration-color: var(--accent2); text-decoration-thickness: 1px; }
.task-memory { font-family: var(--hand); font-size: 1.45rem; line-height: 1.2; color: var(--accent); margin-top: .5rem; }
.task-list { list-style: none; padding: 0; margin: 0 0 1rem; font-style: italic; }
.swap { max-width: 24rem; margin: 0 auto 1rem; display: flex; flex-direction: column; align-items: center; gap: .6rem; color: var(--muted); }
.task-stats { font-family: var(--sans); font-size: .72rem; letter-spacing: .08em; color: var(--muted); margin: .8rem 0; }
.task-extras { display: flex; flex-direction: column; align-items: center; gap: .3rem; margin-top: .8rem; }
.check { display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; font-style: italic; font-size: 1.05rem; color: var(--muted); cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }

/* ---------- Momente ---------- */
.center { text-align: center; }
.chapter-title { text-align: center; font-size: 1.7rem; font-weight: 400; font-style: italic; color: var(--accent); margin-bottom: 1.2rem; }
.diary { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.8rem; }
.diary-entry { text-align: center; }
.diary-question { font-style: italic; color: var(--muted); font-size: 1.1rem; margin: .3rem 0 .5rem; text-wrap: balance; }

/* ---------- Fuß der Seite: Countdown, Teaser, Seitenzahl ---------- */
.countdown { text-align: center; }
.countdown .num { display: block; font-size: 3rem; line-height: 1; font-weight: 400; color: var(--accent); font-variant-numeric: lining-nums; }
.countdown .label { display: block; margin-top: .35rem; font-style: italic; color: var(--muted); }

.tomorrow { text-align: center; margin-top: 2rem; font-style: italic; color: var(--muted); font-size: 1.1rem; text-wrap: balance; }

.page-foot { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-top: 2.2rem; }
.page-num { min-width: 6.5rem; text-align: center; font-style: italic; font-size: 1.15rem; color: var(--muted); font-variant-numeric: oldstyle-nums; }
.page-num::before, .page-num::after { content: "·"; color: var(--gold); margin: 0 .55em; }
.back-today { text-align: center; margin-top: .6rem; }

/* ---------- Umschlag ---------- */
.envelope-stage { min-height: calc(100dvh - var(--ribbons-h) - 7rem); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1.6rem; }
.envelope-stage .for { font-size: 2.1rem; line-height: 1.1; font-weight: 400; }
.envelope-stage .for small { display: block; font-size: .5em; font-style: italic; color: var(--accent2); margin-bottom: .35rem; }
.envelope { display: block; width: min(100%, 21rem); border-radius: 4px; }
.envelope svg { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 16px 18px rgba(0, 0, 0, .16)); }
.envelope .body { fill: var(--card); stroke: var(--line); stroke-width: 1; }
.envelope .lining { fill: none; stroke: var(--gold); stroke-width: .8; opacity: .8; }
.envelope .fold { fill: none; stroke: var(--line); stroke-width: 1; }
.envelope .flap { fill: var(--card); stroke: var(--line); stroke-width: 1; transform-box: fill-box; transform-origin: 50% 0%; }
.envelope .seal-half { transform-box: fill-box; transform-origin: 50% 50%; }
.envelope .wax { fill: var(--seal); }
.envelope .wax-ring { fill: none; stroke: rgba(255, 255, 255, .3); stroke-width: 1; }
.envelope .seal-num { fill: rgba(255, 255, 255, .93); font-family: var(--serif); font-size: 24px; font-weight: 500; text-anchor: middle; dominant-baseline: central; font-variant-numeric: lining-nums; }
.envelope .seal-mono { fill: rgba(255, 255, 255, .93); font-family: var(--serif); font-style: italic; font-size: 34px; font-weight: 500; text-anchor: middle; dominant-baseline: central; }
.envelope:not(.static):hover .seal { transform: scale(1.04); }
.envelope .seal { transform-box: fill-box; transform-origin: 50% 50%; transition: transform .3s var(--ease); }
.envelope-stage .hint { font-style: italic; color: var(--muted); }

.envelope.opening .seal-left { animation: seal-left .7s var(--ease) forwards; }
.envelope.opening .seal-right { animation: seal-right .7s var(--ease) forwards; }
.envelope.opening .flap { animation: flap-open .7s .35s var(--ease) forwards; }
.envelope-stage.leaving .for, .envelope-stage.leaving .hint, .envelope-stage.leaving .eyebrow { transition: opacity .4s; opacity: 0; }
.envelope-stage.leaving { animation: stage-leave .5s .95s var(--ease) forwards; }
@keyframes seal-left { to { transform: translate(-16px, 10px) rotate(-22deg); opacity: 0; } }
@keyframes seal-right { to { transform: translate(16px, 12px) rotate(24deg); opacity: 0; } }
@keyframes flap-open { 0% { transform: scaleY(1); } 100% { transform: scaleY(-.5); } }
@keyframes stage-leave { to { opacity: 0; transform: translateY(14px); } }

/* ---------- Einfache Seiten (Start, Platzhalter, Fehler) ---------- */
.plain { min-height: calc(100dvh - var(--ribbons-h) - 7rem); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1.1rem; }
.plain h1 { font-size: 2.5rem; font-weight: 400; }
.plain .big-num { font-size: 5.5rem; line-height: 1; color: var(--accent2); font-weight: 400; }
.plain p { max-width: 26ch; text-wrap: balance; }

.page-head { text-align: center; margin: 1rem 0 2rem; }
.page-head h1 { font-size: 2.7rem; font-weight: 400; line-height: 1.1; margin: .5rem 0 .3rem; }

/* ---------- Herbarium: gepresste Blumen wie in einem Buch ---------- */
.specimens { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.6rem .9rem; }
.specimen-card {
  position: relative; text-align: center;
  background: var(--card);
  padding: 1.1rem .7rem 1rem;
  box-shadow: 0 0 0 1px var(--line), 0 10px 20px -18px rgba(0, 0, 0, .45);
}
.specimen-card:nth-child(odd) { transform: rotate(-.6deg); }
.specimen-card:nth-child(even) { transform: rotate(.5deg); }
.specimen-card.taped::before { width: 3.6rem; height: 1rem; }
.specimen { display: block; width: 100%; max-width: 8.5rem; height: auto; margin: 0 auto .4rem; }
/* gepresst: etwas flacher und blasser als frisch */
.pressed .specimen { filter: saturate(.72) sepia(.14) contrast(.96); }
.specimen-card .flower-name { font-size: 1.45rem; }
.specimen-card .flower-meaning { font-size: 1.05rem; }
.specimen-card .botanical { font-size: .9rem; }
.specimen-card .inked { font-family: var(--hand); font-size: 1.15rem; color: var(--accent2); margin-top: .35rem; line-height: 1.1; }
.specimen-card .btn { margin-top: .2rem; position: relative; font-size: .66rem; }
.specimen-card .fact { font-size: 1rem; line-height: 1.35; margin-top: .3rem; text-align: left; padding: 0 .3rem; text-wrap: pretty; }

/* ---------- Richards Briefe ---------- */
.letter {
  position: relative; max-width: 26rem; margin: 0 auto; padding: 1.8rem 1.5rem 1.5rem; text-align: left;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line), 0 16px 30px -22px rgba(0, 0, 0, .5);
  font-size: 1.3rem; line-height: 1.5;
}
.letter::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--gold); opacity: .7; pointer-events: none; }
.letter p + p { margin-top: .9rem; }
.letter-title { font-style: italic; font-size: 1.5rem; color: var(--accent2); }
.letter-closing { font-style: italic; }
.letter-signature { font-family: var(--hand); font-size: 2rem; line-height: 1; color: var(--accent); text-align: right; margin-top: 1.2rem !important; rotate: -2deg; }
.letter-tip { max-width: 24rem; margin: 1.3rem auto 0; text-align: center; font-family: var(--sans); font-size: .78rem; line-height: 1.5; color: var(--muted); }
.reveal { text-align: center; margin-top: 2.6rem; }
.reveal-title { font-size: clamp(2.8rem, 13vw, 3.8rem); line-height: 1.05; font-weight: 400; font-style: italic; color: var(--accent2); margin-top: .5rem; }
.reveal-line { margin-top: .7rem; font-size: 1.3rem; font-style: italic; color: var(--accent); text-wrap: balance; }

/* ---------- Die 24 Türchen ---------- */
.doors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; }
.door {
  position: relative; width: 100%; aspect-ratio: 1; display: grid; place-items: center;
  background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 8px 16px -14px rgba(0, 0, 0, .45);
  transition: translate .2s, box-shadow .2s;
}
.door::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--gold); opacity: .6; pointer-events: none; }
.door-num { font-size: 1.9rem; font-style: italic; font-variant-numeric: lining-nums; color: var(--accent2); }
.door.is-locked { background: none; box-shadow: 0 0 0 1px var(--line); cursor: default; }
.door.is-locked::before { border-style: dashed; opacity: .45; }
.door.is-locked .door-num { color: var(--muted); opacity: .75; }
.door.is-open { background: var(--accent); }
.door.is-open .door-num { color: var(--paper); }
.door.is-open::before { border-color: var(--paper); opacity: .35; }
.door.is-ready:hover, .door.is-open:hover { translate: 0 -2px; }
.door.is-today { box-shadow: 0 0 0 2px var(--gold), 0 10px 18px -12px rgba(0, 0, 0, .5); }

/* ---------- Lesebändchen (Navigation) ---------- */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; justify-content: center; align-items: flex-end; gap: .55rem;
  height: calc(var(--ribbons-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  pointer-events: none;
  background: linear-gradient(to top, var(--paper) 35%, transparent);
}
#tabs[hidden] { display: none; }
#tabs button {
  pointer-events: auto;
  width: 4.1rem; height: 3.1rem;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .15rem;
  padding-top: .45rem;
  font-family: var(--sans); font-size: .54rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--paper);
  background: var(--accent);
  /* Schwalbenschwanz-Ende wie bei einem Lesebändchen */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - .6rem), 0 100%);
  transition: height .35s var(--ease), background-color .5s var(--ease);
}
#tabs button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
#tabs button[aria-current="page"] { height: 4.1rem; background: var(--accent2); }
#tabs button:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--gold); }

/* ---------- Weniger Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .bq .ln { stroke-dashoffset: 0; animation: none; }
  .bq .bq-wrap, .bq .bq-bloom, .bq .fall { animation: none; }
}

/* ---------- Größere Bildschirme ---------- */
@media (min-width: 40rem) {
  #view { padding-top: 2.5rem; }
  .deck { margin: 0; }
  .deck-track { padding-inline: .25rem; }
  .specimens { grid-template-columns: repeat(3, 1fr); }
}
