/* ─────────────────────────────────────────────────────────────────────────
 * WUNSCHWERKER — gemeinsame Basis für alle Seiten
 * Tokens · Reset · Typo · Header · Badge · Buttons · Fokus · Footer
 * Seitenspezifisches bleibt im <style>-Block der jeweiligen Seite.
 ──────────────────────────────────────────────────────────────────────── */
:root {
  /* Papier & Karton — die Wunschkarte als Material */
  --paper: #ffffff;                 /* Grund: weißes Papier */
  --carton: #efede8;                /* Karton: Flächen, Badges */

  /* Tinte */
  --ink: #16140f;                   /* Schrift, Headlines, dunkle Fläche */
  --muted: #87847d;                 /* Platzhalter */

  /* Kante */
  --border: rgba(22, 20, 15, 0.12);

  /* Wunschgold — der einzige Akzent: Aktion, Wunsch, Markierung */
  --wish: #f7c43c;
  --wish-ink: var(--ink);           /* Tinte auf Gold */
  --wish-light: #ffd970;            /* Hover: heller, nicht dunkler */
  --wish-deep: color-mix(in oklab, var(--wish), black 10%);

  /* Bedeutung */
  --fulfilled: #146c3c;             /* Stempelgrün: übernommen / erfüllt */
  --danger: #c8322f;

  /* Typography */
  /* Fraunces: weiche, warme Serife für Überschriften – Papier, Karte, Zeitung.
     Figtree: freundliche, klare Grotesk für Text und UI. */
  --font-body: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: Fraunces, Georgia, "Times New Roman", serif;
  --font-label: var(--font-body);

  /* Type scale */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 18px;
  --text-lg: 22px;
  --text-xl: 26px;
  --text-2xl: 40px;
  --text-3xl: 64px;
  --text-4xl: 96px;

  --leading-body: 1.44;
  --leading-tight: 1.02;
  --tracking-label: 0.01em;
  --tracking-display: -0.028em;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;

  --section-y-desktop: 80px;
  --section-y-tablet: 48px;
  --section-y-phone: 32px;

  /* Radius */
  --radius-sm: 16px;
  --radius-md: 24px;   /* Karten in Flächen: deutlich kleiner als --radius-lg */
  --radius-lg: 40px;
  --radius-pill: 9999px;

  /* Elevation — ring-only */
  --elev-ring: 0 0 0 1px var(--border);

  /* Fokus: Doppelring, sichtbar auf Weiß, Grün und Schwarz */
  --focus-ring: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink);

  /* Motion */
  --motion-press: 160ms;
  --motion-fast: 150ms;
  --motion-base: 200ms;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  /* Layout */
  --container-max: 1280px;
  --container-gutter-desktop: 24px;
  --container-gutter-tablet: 16px;
  --container-gutter-phone: 12px;

  /* Abgeleitete Töne (color-mix, keine neue Palette) */
  --ink-soft: color-mix(in oklab, var(--ink) 76%, var(--paper));
  --ink-faint: color-mix(in oklab, var(--ink) 38%, var(--paper));
  --on-dark: color-mix(in oklab, var(--paper) 74%, transparent);
  --on-dark-line: color-mix(in oklab, var(--paper) 24%, transparent);
  --danger-on-dark: color-mix(in oklab, var(--danger) 55%, var(--paper));
  --fulfilled-on-dark: color-mix(in oklab, var(--fulfilled) 40%, var(--paper));
}

/* ─── reset & base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-body);
  font-feature-settings: "calt" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
[hidden] { display: none !important; }
::selection { background: var(--wish); color: var(--wish-ink); }

/* ─── layout primitives ─────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-gutter-phone);
}
@media (min-width: 720px)  { .container { padding-inline: var(--container-gutter-tablet); } }
@media (min-width: 1024px) { .container { padding-inline: var(--container-gutter-desktop); } }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }

/* ─── type ──────────────────────────────────────────────────────── */
.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 50, "WONK" 0;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  margin: 0;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-label);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  color: var(--ink-soft);
  margin: 0 0 var(--space-4);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--wish);
}
.lead {
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0;
}
.meta {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--ink-soft);
}

/* Textmarker statt Kasten: der Strich liegt unter der x-Höhe wie von Hand gezogen */
mark {
  background: linear-gradient(transparent 56%, var(--wish) 56%, var(--wish) 90%, transparent 90%);
  color: inherit;
  padding: 0 0.08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ─── header ────────────────────────────────────────────────────── */
.topnav { padding-block: var(--space-5); }
.brand { display: inline-flex; align-items: center; text-decoration: none; border-radius: 4px; }
.brand-logo { height: clamp(36px, 4.6vw, 50px); width: auto; }
/* Statuslabel, bewusst ohne Rahmen: soll nicht wie ein Button wirken */
.tag {
  font-family: var(--font-label);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-soft);
}

/* ─── badge ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--carton);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 500;
  margin: 0 0 var(--space-6);
}
.badge-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--fulfilled);
  flex: none;
}
.badge-dot--danger { background: var(--danger); }
@media (prefers-reduced-motion: no-preference) {
  .badge-dot { animation: pulse 2.6s ease-in-out infinite; }
  @keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.45; transform: scale(0.8); }
  }
}

/* ─── buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 52px;
  padding: 12px 30px;
  border: 0;
  border-radius: var(--radius-pill);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 200ms var(--ease-out),
    background-color 200ms var(--ease-out);
}
.btn-primary { background: var(--wish); color: var(--wish-ink); }
/* Hover nur bei echter Maus — auf Touch bliebe er nach dem Tippen hängen.
   Hover: Fläche einen Schritt Richtung Tinte, 1px hoch. Druck: 1px unter Ruhe, leicht kleiner. */
@media (hover: hover) and (pointer: fine) {
  .btn-primary:not(:disabled):hover {
    background: var(--wish-deep);
    transform: translateY(-1px);
    transition-duration: 140ms;
  }
}
.btn-primary:not(:disabled):active {
  background: var(--wish-deep);
  transform: translateY(1px) scale(0.985);
  transition-duration: 90ms;
}
.btn:disabled { cursor: progress; }

.btn-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid color-mix(in oklab, var(--wish-ink) 25%, transparent);
  border-top-color: var(--wish-ink);
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
@keyframes btn-breathe { from { opacity: 1; } to { opacity: 0.35; } }

/* ─── fokus ─────────────────────────────────────────────────────── */
:where(a, button, .btn):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
:where(p, li, address) a:focus-visible { border-radius: 4px; }

/* Kleine Textlinks: Klickfläche auf ≥ 40 px erweitern, ohne das Layout zu verschieben */
.hit { position: relative; }
.hit::after {
  content: "";
  position: absolute;
  inset: -14px -6px;
}

/* ─── footer-zeile (Unterseiten) ────────────────────────────────── */
.page-meta {
  margin: 0;
  padding: var(--space-5) var(--container-gutter-phone) var(--space-6);
  border-top: 1px solid var(--border);
  font-family: var(--font-label);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--ink-soft);
}

/* ─── Textlinks: feine Haarlinie in Ruhe, die Tintenlinie zieht sich von links ein ── */
.page-meta a,
.link {
  color: inherit;
  text-decoration: none;
  background:
    linear-gradient(currentColor, currentColor) 100% 100% / 0 1px no-repeat,
    linear-gradient(var(--link-hair, var(--border)), var(--link-hair, var(--border))) 0 100% / 100% 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size 200ms var(--ease-out), color 200ms var(--ease-out);
}
.page-meta a:hover,
.link:hover {
  color: var(--ink);
  background-size: 100% 1px, 100% 1px;
  background-position: 0 100%, 0 100%;
  transition-duration: 140ms;
}

/* ─── einstieg (Hero / Statusseiten) ────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .stagger > :not(.no-rise) { animation: rise 400ms var(--ease-out) both; }
  .stagger > :nth-child(2) { animation-delay: 0ms; }
  .stagger > :nth-child(3) { animation-delay: 50ms; }
  .stagger > :nth-child(4) { animation-delay: 100ms; }
  .stagger > :nth-child(5) { animation-delay: 150ms; }
  .stagger > :nth-child(6) { animation-delay: 200ms; }
  .stagger > :nth-child(7) { animation-delay: 250ms; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
  }
}

/* ─── reduzierte Bewegung: weniger, nicht null ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
  /* Ladezustand ist Information, keine Deko: pulsieren statt drehen */
  .btn-spinner { animation: btn-breathe 0.9s ease-in-out infinite alternate !important; }
}
