/* Zettely – Design-Tokens (warme Papier-/Pastell-Palette, an Astryx-Token-Namen angelehnt) */
:root {
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px; --space-12: 48px;
  --radius-sm: 6px; --radius-md: 12px; --radius-lg: 20px; --radius-full: 999px;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-hand: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;

  --color-bg: #faf6ef;            /* Papier */
  --color-surface: #ffffff;
  --color-text: #1f1a14;
  --color-text-muted: #5b5146;     /* 7.2:1 auf --color-bg */
  --color-border: #e4dccd;
  --color-accent: #b3401f;         /* Terrakotta, 5.6:1 auf weiß */
  --color-accent-hover: #93331a;
  --color-on-accent: #ffffff;
  --color-focus: #1a5fb4;
  --color-danger: #a4161a;

  --zettel-ink: #1f1a14;
  --zettel-gelb: #fff1a8;
  --zettel-rosa: #ffd6e0;
  --zettel-mint: #c9f2dc;
  --zettel-blau: #cfe6ff;
  --zettel-flieder: #e4d9ff;
  --zettel-pfirsich: #ffdcc2;

  --shadow-zettel: 0 1px 2px rgb(60 40 20 / .12), 0 6px 16px rgb(60 40 20 / .10);
  --ad-height: 100px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--color-bg); color: var(--color-text); font: 16px/1.55 var(--font-body); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); }
a:hover { color: var(--color-accent-hover); }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: var(--space-2); background: var(--color-surface); padding: var(--space-2) var(--space-4); z-index: 100; }
.skip:focus { left: var(--space-2); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 var(--space-4); }
header.site { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) 0; }
.logo { font: 700 1.5rem var(--font-hand); color: var(--color-text); text-decoration: none; }
.logo span { color: var(--color-accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-6);
  border-radius: var(--radius-full); border: 2px solid transparent; font: 600 1rem var(--font-body); cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--color-accent); color: var(--color-on-accent); }
.btn-primary:hover { background: var(--color-accent-hover); color: var(--color-on-accent); }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
.btn-secondary:hover { border-color: var(--color-text-muted); color: var(--color-text); }
.btn-ghost { background: transparent; color: var(--color-text); }
.btn-lg { min-height: 56px; font-size: 1.125rem; padding: 0 var(--space-8); }
.btn[disabled] { opacity: .6; cursor: progress; }
.icon-btn { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; background: transparent; border: 0; border-radius: var(--radius-full); cursor: pointer; color: var(--zettel-ink); font-size: 1rem; }
.icon-btn:hover { background: rgb(0 0 0 / .07); }

/* ── Landingpage */
.hero { padding: var(--space-12) 0 var(--space-8); text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.15; margin: 0 0 var(--space-4); }
.hero p.lead { font-size: 1.2rem; color: var(--color-text-muted); max-width: 640px; margin: 0 auto var(--space-6); }
.hero .note { font-size: .95rem; color: var(--color-text-muted); margin-top: var(--space-3); }
.usp { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; list-style: none; padding: 0; margin: var(--space-6) 0 0; }
.usp li { background: var(--color-surface); border: 1px solid var(--color-border); padding: var(--space-1) var(--space-4); border-radius: var(--radius-full); font-size: .95rem; }
section.block { padding: var(--space-12) 0; }
section.block h2 { font-size: 1.75rem; margin: 0 0 var(--space-6); text-align: center; }
.steps, .cases { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); list-style: none; padding: 0; margin: 0; }
.steps li, .cases li { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-6); }
.steps h3, .cases h3 { margin: 0 0 var(--space-2); font-size: 1.15rem; }
.compare { width: 100%; border-collapse: collapse; background: var(--color-surface); border-radius: var(--radius-md); overflow: hidden; }
.compare th, .compare td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border); text-align: left; }
.table-wrap { overflow-x: auto; }
details.faq { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-4) var(--space-6); margin-bottom: var(--space-3); }
details.faq summary { font-weight: 600; cursor: pointer; min-height: 28px; }
footer.site { padding: var(--space-8) 0; color: var(--color-text-muted); font-size: .95rem; border-top: 1px solid var(--color-border); margin-top: var(--space-8); }
footer.site nav { display: flex; gap: var(--space-4); flex-wrap: wrap; }

/* ── Werbefläche: Höhe reserviert → CLS = 0 */
.ad-slot { min-height: var(--ad-height); margin: var(--space-6) 0; display: grid; place-items: center; contain: layout; }
.ad-ins { display: block; width: 100%; height: var(--ad-height); }
.ad-label { font-size: .75rem; color: var(--color-text-muted); text-align: center; }

/* ── Zettelwand */
.wall-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) 0; }
.wall-head h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.25rem); }
.wall-head .meta { color: var(--color-text-muted); margin: var(--space-1) 0 0; }
.mode-badge { display: inline-block; font-size: .85rem; font-weight: 600; padding: 2px var(--space-3); border-radius: var(--radius-full); background: var(--zettel-mint); color: var(--zettel-ink); }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.board { columns: 280px; column-gap: var(--space-4); padding: var(--space-4) 0 120px; }
.zettel { break-inside: avoid; margin: 0 0 var(--space-4); padding: var(--space-4); border-radius: var(--radius-sm); color: var(--zettel-ink);
  box-shadow: var(--shadow-zettel); transform: rotate(var(--tilt, 0deg)); transition: transform .2s; position: relative; }
.zettel:hover { transform: rotate(0deg) scale(1.01); }
.zettel .text { font: 1.1rem/1.5 var(--font-hand); white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.zettel .author { margin: var(--space-3) 0 0; font-weight: 600; font-size: .95rem; }
.zettel img { border-radius: var(--radius-sm); margin-bottom: var(--space-3); width: 100%; }
.zettel .actions { display: flex; justify-content: flex-end; gap: var(--space-1); margin: var(--space-2) calc(-1 * var(--space-2)) calc(-1 * var(--space-2)) 0; }
.zettel.is-hidden { opacity: .55; outline: 2px dashed var(--color-danger); }
.z-gelb { background: var(--zettel-gelb); } .z-rosa { background: var(--zettel-rosa); } .z-mint { background: var(--zettel-mint); }
.z-blau { background: var(--zettel-blau); } .z-flieder { background: var(--zettel-flieder); } .z-pfirsich { background: var(--zettel-pfirsich); }

.yt { position: relative; aspect-ratio: 16/9; background: #000 center/cover no-repeat; border-radius: var(--radius-sm); margin-bottom: var(--space-3); overflow: hidden; }
.yt button { position: absolute; inset: 0; width: 100%; background: rgb(0 0 0 / .55); color: #fff; border: 0; font: 600 .95rem var(--font-body); padding: var(--space-4); cursor: pointer; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.fab { position: fixed; right: var(--space-6); bottom: calc(var(--ad-height) + var(--space-6)); width: 64px; height: 64px; border-radius: 50%; font-size: 2rem; line-height: 1;
  background: var(--color-accent); color: var(--color-on-accent); border: 0; box-shadow: 0 6px 20px rgb(0 0 0 / .25); cursor: pointer; z-index: 20; }
.fab:hover { background: var(--color-accent-hover); }
.ad-dock { position: fixed; left: 0; right: 0; bottom: 0; height: var(--ad-height); background: var(--color-bg); border-top: 1px solid var(--color-border); display: grid; place-items: center; z-index: 10; }
body.no-ads .fab { bottom: var(--space-6); }

/* ── Empty / Skeleton */
.empty { column-span: all; break-inside: avoid; text-align: center; padding: var(--space-12) var(--space-4); color: var(--color-text-muted); }
.empty h2 { color: var(--color-text); }
.skeleton { break-inside: avoid; height: 140px; margin-bottom: var(--space-4); border-radius: var(--radius-sm); background: linear-gradient(90deg, #efe8dc 25%, #f7f2ea 50%, #efe8dc 75%); background-size: 200% 100%; animation-name: shimmer; animation-duration: 1.2s; animation-iteration-count: infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Dialog */
dialog { border: 0; border-radius: var(--radius-lg); padding: 0; width: min(560px, calc(100vw - 2 * var(--space-4))); max-height: calc(100dvh - 2 * var(--space-4)); color: var(--color-text); background: var(--color-surface); }
dialog::backdrop { background: rgb(31 26 20 / .5); }
dialog form { padding: var(--space-6); display: grid; gap: var(--space-4); }
dialog h2 { margin: 0; font-size: 1.35rem; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; }
@media (max-width: 600px) {
  dialog { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}
label { font-weight: 600; display: block; margin-bottom: var(--space-1); }
.hint { font-weight: 400; color: var(--color-text-muted); font-size: .9rem; }
input[type=text], input[type=email], input[type=url], textarea, select { width: 100%; min-height: 44px; padding: var(--space-2) var(--space-3); font: inherit; color: var(--color-text);
  background: var(--color-surface); border: 1.5px solid #a89c8a; border-radius: var(--radius-sm); }
textarea { min-height: 140px; resize: vertical; font-family: var(--font-hand); font-size: 1.1rem; }
.colors { display: flex; gap: var(--space-2); flex-wrap: wrap; border: 0; padding: 0; margin: 0; }
.colors legend { font-weight: 600; margin-bottom: var(--space-1); padding: 0; }
.colors label { margin: 0; }
.colors input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.colors span { display: block; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--color-border); cursor: pointer; }
.colors input:checked + span { border: 3px solid var(--color-text); box-shadow: 0 0 0 2px var(--color-surface) inset; }
.colors input:focus-visible + span { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.radios { border: 0; padding: 0; margin: 0; }
.radios legend { font-weight: 600; margin-bottom: var(--space-1); padding: 0; }
.radios label { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; font-weight: 400; margin: 0; }
.radios input { width: 20px; height: 20px; }
.preview-img { max-height: 180px; width: auto; border-radius: var(--radius-sm); }
.row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.err { color: var(--color-danger); font-weight: 600; }

/* ── Toast */
#toasts { position: fixed; left: 50%; top: var(--space-4); transform: translateX(-50%); z-index: 1000; display: grid; gap: var(--space-2); width: min(480px, calc(100vw - 32px)); }
.toast { background: var(--color-text); color: #fff; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); box-shadow: 0 6px 20px rgb(0 0 0 / .2); }
.toast button { margin-left: var(--space-3); background: transparent; color: #fff; border: 1px solid #fff; border-radius: var(--radius-full); padding: 2px var(--space-3); cursor: pointer; }

/* ── Share-Box */
.share { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-4); margin: var(--space-2) 0 var(--space-4); display: grid; gap: var(--space-3); }
.share .row input { flex: 1; min-width: 200px; }

/* ── Geschenk-Modus */
.gift-hero { text-align: center; padding: var(--space-12) var(--space-4) var(--space-6); }
.gift-hero h1 { font: 700 clamp(2rem, 6vw, 3.5rem)/1.15 var(--font-hand); margin: 0; }
.gift-hero p { color: var(--color-text-muted); font-size: 1.15rem; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .zettel { transform: none !important; }
}

/* ── Druck / PDF-Export (Lesemodus) */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  .no-print, .fab, .ad-dock, .ad-slot, .zettel .actions, #confetti, #toasts { display: none !important; }
  .board { columns: 2; padding: 0; }
  .zettel { transform: none !important; box-shadow: none; border: 1px solid #ccc; break-inside: avoid; page-break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .yt { aspect-ratio: auto; background: none !important; }
  .yt button { display: none; }
  .yt .print-link { display: block !important; position: static; color: var(--zettel-ink); }
}
.print-link { display: none; }
