/* Layout: die Karte selbst als Einstieg (2:3), darunter bzw. daneben ein ruhiges
   rosa Papier mit dem Segen. Eine Welt im Kartendesign, bewusst ohne Dunkelmodus. */
@font-face { font-family: "Bodoni Moda"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(fonts/bodoni-moda.woff2) format("woff2"); }
@font-face { font-family: "Bodoni Moda"; font-style: italic; font-weight: 400 500; font-display: swap; src: url(fonts/bodoni-moda-italic.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(fonts/newsreader.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/newsreader-italic.woff2) format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-style: normal; font-weight: 800; font-display: block; src: url(fonts/big-shoulders-800.woff) format("woff"); }

:root {
  --orange: #f6a21e;
  --red: #ec2a3f;
  --pink: #f8d2cb;
  --paper: #fdeee9;
  --ink: #3a1410;
  --ink-soft: #7a3a30;
  --line: rgba(122, 58, 48, 0.22);
  --gold-0: #2a1c06;
  --gold-1: #6e4b12;
  --gold-2: #c8973a;
  --gold-3: #fff0bf;

  --f-display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --f-letters: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --f-body: "Newsreader", Georgia, "Times New Roman", serif;
  --f-sans: "Avenir Next", Avenir, Futura, "Century Gothic", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  /* Design der Segensseite; html[data-design] in design.css überschreibt. */
  --page: var(--orange);
  --on-page: var(--ink);
  --accent: var(--red);
  --badge: var(--orange);
  --badge-ink: var(--ink);
  --mark: rgba(246, 162, 30, 0.55);
  --card-bg: var(--pink);
  --band:
    radial-gradient(circle at 18% 120%, var(--red) 0 34px, transparent 35px),
    radial-gradient(circle at 78% -30%, var(--red) 0 46px, transparent 47px),
    radial-gradient(circle at 96% 110%, var(--red) 0 22px, transparent 23px),
    repeating-linear-gradient(100deg, transparent 0 9px, rgba(236, 42, 63, 0.35) 9px 10px),
    var(--pink);
  --sealed: repeating-linear-gradient(115deg, var(--red) 0 12px, var(--pink) 12px 15px, var(--red) 15px 26px, #f7b34a 26px 36px);

  color-scheme: light;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--page); }
body {
  margin: 0;
  background: var(--page);
  color: var(--on-page);
  font-family: var(--f-body);
  font-size: 1.125rem;
  line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 28px 56px;
  overflow-x: hidden;
}
[hidden] { display: none !important; }

.layout {
  display: grid;
  gap: 36px;
  justify-items: center;
  max-width: 68rem;
  margin-inline: auto;
}

/* ---------- Karte ---------- */
.card-wrap { width: min(100%, 26rem); perspective: 1100px; }
.card {
  position: relative;
  aspect-ratio: 2 / 3;
  max-width: 100%;
  container-type: inline-size;
  overflow: hidden;
  border-radius: 6px;
  background: var(--card-bg);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 22px 40px -18px rgba(90, 20, 0, 0.55),
    0 4px 10px rgba(90, 20, 0, 0.18);
  transform: rotate(-1.2deg) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  cursor: pointer;
  outline: none;
}
.card:focus-visible { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); }
.card canvas {
  position: absolute;
  inset: -4%;
  width: 108%;
  height: 108%;
  transform: translate(var(--px2, 0), var(--py2, 0));
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.letters {
  position: absolute;
  inset: -6% -14%;
  display: grid;
  align-content: space-between;
  font-family: var(--f-letters);
  font-weight: 800;
  font-size: 58cqw;
  line-height: 0.74;
  letter-spacing: -0.035em;
  color: var(--orange);
  white-space: nowrap;
  transform: translate(var(--px, 0), calc(var(--py, 0px) + var(--sy, 0px)));
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  user-select: none;
  pointer-events: none;
}
.letters span:nth-child(2) { margin-left: -0.32em; }
.letters span:nth-child(3) { margin-left: -0.12em; }

.verse {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  margin: 0;
  display: grid;
  justify-items: center;
  font-family: var(--f-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: var(--verse-size, 15.5cqw);
  line-height: 0.8;
  letter-spacing: -0.045em;
  text-align: center;
  filter: drop-shadow(0 1px 0 rgba(255, 226, 160, 0.55)) drop-shadow(0 2px 3px rgba(60, 20, 0, 0.25));
}
.verse span,
.verse .kicker,
.note {
  display: block;
  background-image: linear-gradient(105deg,
    var(--gold-0) 0%, var(--gold-1) 34%, var(--gold-2) 44%,
    var(--gold-3) 50%, var(--gold-2) 56%, var(--gold-1) 66%, var(--gold-0) 100%);
  background-size: 320% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: line-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both, shine 7s ease-in-out 2.2s infinite;
  animation-delay: calc(0.9s + var(--i, 0) * 0.1s), calc(2.2s + var(--i, 0) * 0.1s);
}
@keyframes line-in { from { opacity: 0; transform: translateY(0.18em); } to { opacity: 1; transform: none; } }
@keyframes shine { 0%, 55% { background-position: 100% 0; } 85%, 100% { background-position: 0% 0; } }
.card.flash .verse span { animation: shine-once 1.1s ease-in-out both; }
@keyframes shine-once { from { background-position: 100% 0; } to { background-position: 0% 0; } }

.card.moving,
.card.moving canvas,
.card.moving .letters { transition-duration: 0.18s; }
.motion-hint {
  display: block;
  margin: 14px auto 0;
  font: inherit;
  font-size: 0.82rem;
  color: var(--on-page);
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}
.motion-hint:focus-visible { outline: 2px solid var(--on-page); outline-offset: 2px; }
.hint {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
}
.hint a { color: inherit; text-decoration: none; display: inline-flex; gap: 0.5em; align-items: center; }
.hint a:focus-visible { outline: 2px solid var(--on-page); outline-offset: 4px; }
.hint svg { animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* ---------- Papier ---------- */
.letter {
  position: relative;
  width: min(100%, 38rem);
  min-width: 0;
  background: var(--paper);
  border-radius: 4px;
  padding: clamp(28px, 7vw, 56px) clamp(22px, 6vw, 52px) clamp(32px, 7vw, 56px);
  box-shadow: 0 18px 40px -22px rgba(90, 20, 0, 0.5);
  display: grid;
  gap: 1.15em;
}
.letter::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 10px;
  border-radius: 4px 4px 0 0;
  background: repeating-linear-gradient(115deg, var(--red) 0 14px, var(--pink) 14px 18px, var(--red) 18px 30px, var(--orange) 30px 40px);
}
.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 500;
}
.greeting {
  margin: 0;
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2rem, 8vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
  white-space: pre-line;
}
.letter p { margin: 0; }
h2 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
blockquote {
  margin: 0.4em 0;
  padding: 1.1em 0 1.1em 1.1em;
  border-left: 3px solid var(--accent);
  font-size: 1.2rem;
  line-height: 1.55;
  font-style: italic;
}
blockquote cite {
  display: block;
  margin-top: 0.7em;
  font-style: normal;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.key {
  font-style: normal;
  font-family: var(--f-display);
  font-weight: 600;
  background: linear-gradient(transparent 62%, var(--mark) 62%) no-repeat 0 0 / 0% 100%;
  transition: background-size 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s;
  padding-inline: 0.05em;
}
.in .key { background-size: 100% 100%; }

.ornament { display: flex; justify-content: center; padding-block: 0.4em; }
.ornament svg { width: 70px; height: 34px; }
.ornament path { fill: none; stroke: var(--red); stroke-width: 1.2; stroke-linecap: round; }

.reveal { transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .reveal:not(.in) { opacity: 0.35; transform: translateY(14px); }

footer {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
}

@media (min-width: 900px) {
  body { padding-block: 64px 72px; }
  .layout.split { grid-template-columns: minmax(0, 26rem) minmax(0, 38rem); align-items: start; gap: 56px; justify-content: center; }
  .split .card-wrap { position: sticky; top: calc(48px + env(safe-area-inset-top, 0px)); }
  .split .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal:not(.in) { opacity: 1; transform: none; }
  .key { background-size: 100% 100%; }
  .verse span { background-position: 50% 0; }
}
