/* ============ Schriften (selbst gehostet, OFL) ============ */
@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('../fonts/caveat.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Homemade Apple'; src: url('../fonts/homemade-apple.woff2') format('woff2'); font-weight: 400; font-display: swap; }

/* ============ Tokens ============ */
:root {
  --wine-900: #3A0B17;
  --wine-800: #4E1020;
  --wine-700: #6E1A2D;
  --wine-600: #8A2438;
  --paper: #F5ECDD;
  --paper-2: #EBDCC3;
  --paper-3: #DFCBAA;
  --ink: #2B1B18;
  --ink-2: #5C4A42;
  --pine: #2E4A3B;
  --pine-2: #3E5F4C;
  --gold: #C8A15A;
  --gold-2: #D9B978;
  --blush: #E9B9AE;

  --serif: 'Fraunces', 'Iowan Old Style', 'Palatino', Georgia, serif;
  --hand: 'Caveat', 'Bradley Hand', cursive;
  --sign: 'Homemade Apple', 'Caveat', cursive;

  --cut: var(--wine-800);
  --scarf: var(--pine);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-swing: cubic-bezier(.5, 0, .2, 1);

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --fibers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .09' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .25 0 0 0 0 .16 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
}

/* ============ Basis ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--wine-900); }
html, body { margin: 0; overscroll-behavior-y: none; }
body {
  min-height: 100svh;
  background: var(--wine-800) var(--grain);
  color: var(--paper);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-variation-settings: 'SOFT' 50, 'WONK' 0;
  font-size: 17px;
  line-height: 1.5;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
img, svg { display: block; max-width: 100%; }
.art { overflow: visible; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px dashed var(--gold-2); outline-offset: 3px; }

/* ============ Papierbogen (Türchen-Inhalt) ============ */
.paper {
  --cut: var(--paper);
  background-color: var(--paper);
  background-image: var(--fibers), var(--grain);
  color: var(--ink);
}
.paper ::selection { background: var(--blush); }

/* ============ Knöpfe: wie gestempelt, nicht wie Pillen ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 46px; padding: .55em 1.1em;
  font-family: var(--serif); font-weight: 560; font-size: 16px; letter-spacing: .02em; text-decoration: none;
  color: var(--wine-700);
  border: 1.5px solid currentColor; border-radius: 3px 5px 4px 3px;
  background: transparent;
  transition: transform .12s var(--ease-out), background-color .2s;
}
.btn:active { transform: translateY(1px) scale(.98); background: color-mix(in srgb, var(--wine-700) 8%, transparent); }
.btn--solid { background: var(--wine-700); color: var(--paper); border-color: var(--wine-700); }
.btn--solid:active { background: var(--wine-800); }
.btn--quiet { border-color: transparent; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; min-height: 40px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ============ Feier-Ebene ============ */
.celebrate { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.celebrate span {
  position: absolute; top: -24px; width: 14px; height: 14px;
  animation: fall var(--d) var(--delay) linear forwards;
}
.celebrate__flake { background: var(--paper); clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); opacity: .9; }
.celebrate__star { background: var(--gold-2); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
@keyframes fall {
  to { transform: translate(var(--x), 105vh) rotate(var(--r)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .15s !important; }
}
