:root {
  --paper: #fafafa;
  --linen: #f3f1ec;
  --surface: #ffffff;
  --ink: #111110;
  --ink-soft: #4a4741;
  --ink-faint: #57534b;
  --line: #e3dfd6;
  --line-strong: #c9c3b6;
  --accent: #165b52;
  --forest: #124841;
  --baskerville: 'Libre Baskerville', Baskerville, 'Times New Roman', serif;
  --ease-settle: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--baskerville);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
}

.tabular { font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent);
}

.wrap {
  width: min(920px, calc(100% - 32px));
  margin-inline: auto;
}
.wrap-narrow {
  width: min(680px, calc(100% - 32px));
  margin-inline: auto;
}

/* Nahezu unsichtbare Kopfleiste: 100 % Baskerville */
.ive-header {
  padding: 20px 0 0;
  position: relative;
  z-index: 30;
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.header-bar.with-back {
  justify-content: space-between;
}

.circle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-faint);
  font-family: var(--baskerville);
  font-style: italic;
  font-size: 0.875rem;
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s var(--ease-settle), box-shadow 0.18s var(--ease-settle);
}
.circle-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}
.circle-btn:active {
  transform: scale(0.97);
}

.sound-btn.is-playing {
  border-color: var(--accent);
  color: var(--accent);
}

/* Stilles Jony-Ive-Briefsiegel bei Browser-Autoplay-Sperre (löst sich in 0.35s zum synchronen Einflug + Koel-Ruf auf) */
.entrance-curtain {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--paper);
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.36s var(--ease-settle);
}
.entrance-curtain.is-leaving {
  opacity: 0;
  pointer-events: none;
}
.entrance-card {
  text-align: center;
  padding: 24px;
}
.entrance-seal {
  display: block;
  margin: 0 auto 20px;
}
.entrance-name {
  font-family: var(--baskerville);
  font-weight: 400;
  font-size: clamp(2rem, 5.4vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 0 0 28px;
}

/* Vektor-Flugbühne des Asiatischen Koels über dem gesamten Papierbogen */
.koel-stage-wrap {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 25;
}
.koel-flight-svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Haupt-Leinwand: 85 % stiller Baumwollpapier-Raum */
.contact-canvas {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0 56px;
}
.canvas-stack {
  width: 100%;
  text-align: center;
}

/* Taktile Steinway-Wortmarke: waagerechtes Streichen spielt die Tasten-Welle, senkrechtes Wischen scrollt ruhig */
.wordmark-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  padding: 40px 16px 12px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.monument-name {
  font-family: var(--baskerville);
  font-weight: 400;
  font-size: clamp(2.25rem, 6.4vw, 5.15rem);
  line-height: 1.08;
  letter-spacing: -0.018em;
  margin: 0 0 28px;
  color: var(--ink);
  cursor: default;
}
.ive-char {
  display: inline-block;
  will-change: transform;
}
.ive-space {
  display: inline-block;
  width: 0.28em;
}

/* Ruhige Einladung in Baskerville Italic */
.invite-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  font-family: var(--baskerville);
  font-style: italic;
  font-size: 1.0625rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.18s var(--ease-settle), box-shadow 0.18s var(--ease-settle);
}
.invite-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.invite-btn:active {
  transform: scale(0.97);
}

/* Dezenter Schalter für Rechts-Unterseiten */
.steinway-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  font-family: var(--baskerville);
  font-style: italic;
  font-size: 0.9375rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.18s var(--ease-settle), box-shadow 0.18s var(--ease-settle);
}
.steinway-btn:hover {
  border-color: var(--accent);
  background: var(--linen);
}
.steinway-btn:active {
  transform: scale(0.97);
}

/* Bütten-Briefblatt */
.unfolded-letter {
  max-width: 520px;
  width: 100%;
  margin: 8px auto 0;
  padding: 28px 32px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 18px 44px rgba(20, 20, 19, 0.04);
}
@media (max-width: 600px) {
  .unfolded-letter { padding: 20px 16px; }
}

.line-field,
.line-textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-family: var(--baskerville);
  font-size: 1rem;
  padding: 12px 4px;
  border-radius: 0;
}
.line-field { min-height: 48px; margin-bottom: 16px; }
.line-textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
  margin-bottom: 16px;
}
.line-field::placeholder,
.line-textarea::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}
.line-field:focus,
.line-textarea:focus {
  border-bottom-color: var(--accent);
}

.summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--ink-faint);
  margin-bottom: 16px;
}

.letter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.letter-subactions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.btn-ink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--baskerville);
  font-size: 0.9375rem;
  text-decoration: none;
  border: 1px solid var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.18s var(--ease-settle), box-shadow 0.18s var(--ease-settle);
}
.btn-ink span {
  color: var(--paper);
}
.btn-ink:hover {
  background: var(--forest);
  border-color: var(--forest);
  box-shadow: 0 6px 18px rgba(18, 72, 65, 0.18);
}
.btn-ink:active {
  transform: scale(0.97);
}

.quiet-link-btn {
  font-family: var(--baskerville);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  padding: 8px 8px;
  min-height: 44px;
  cursor: pointer;
  touch-action: manipulation;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.quiet-link-btn:hover { color: var(--accent); }
.quiet-address {
  font-family: var(--baskerville);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--ink-faint);
  user-select: all;
}

/* Impressum & Datenschutz */
.section-calm { padding: 56px 0 72px; }
.kicker {
  display: inline-block;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--accent);
  margin-bottom: 12px;
}
.serif-h2 {
  font-family: var(--baskerville);
  font-weight: 400;
  font-size: clamp(1.75rem, 2.8vw, 2.35rem);
  margin: 0 0 24px;
}
.paper-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
}

.ive-footer {
  padding: 16px 0 24px;
  font-size: 0.875rem;
  color: var(--ink-faint);
}
.footer-flex {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  align-items: center;
}
.footer-flex a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 4px;
  font-family: var(--baskerville);
  font-style: italic;
  font-size: 0.875rem;
  color: var(--ink-faint);
  text-decoration: none;
}
.footer-flex a:hover { color: var(--ink); }

/* DIN-A4 Druck-Karte ("Die Rückseite der Schublade" bei Cmd+P) */
#pfauch-print-card { display: none; }

@media (prefers-reduced-motion: reduce) {
  .ive-char, .steinway-btn, .invite-btn, .circle-btn, .btn-ink {
    transition: none !important;
    transform: none !important;
  }
}

@media print {
  @page { size: A4 portrait; margin: 20mm 20mm; }
  html, body { background: #ffffff !important; color: #111110 !important; font-size: 11pt !important; line-height: 1.5 !important; }
  tr, .paper-box, .paper-box > div { break-inside: avoid; page-break-inside: avoid; }
  .ive-header, .koel-stage-wrap, .koel-flight-svg, .entrance-curtain, .contact-canvas .canvas-stack, .ive-footer, .steinway-btn { display: none !important; }
  .contact-canvas, .section-calm { display: block !important; padding: 0 !important; }
  .section-calm .wrap-narrow { width: 100% !important; }
  .section-calm .paper-box { border: 0 !important; padding: 0 !important; box-shadow: none !important; }
  .contact-canvas #pfauch-print-card {
    display: block !important;
    font-family: var(--baskerville);
    text-align: center;
    padding-top: 52mm;
    break-inside: avoid;
  }
}
