/* memoiren-ki.de — seniorenfreundlich, Rauschwerk-nah */

:root {
  --paper: #ffffff;
  --paper-soft: #f6f4f1;
  --ink: #201e1d;
  --muted: #6b6866;
  --line: #d8d4cf;
  --signal: #ec3013;
  --ok: #2a5a3c;
  --radius: 2px;
  --max: 40rem;
  --wide: 58rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #faf8f5 0%, var(--paper) 28%, #f3f0eb 100%);
  color: var(--ink);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 1.25rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

img, svg { max-width: 100%; height: auto; display: block; }

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--signal); }

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-family: Archivo, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.75rem;
  font-weight: 700;
}
h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1rem; color: var(--muted); }
p.lead { color: var(--ink); font-size: 1.35rem; }

.wrap {
  width: min(100% - 2rem, var(--wide));
  margin-inline: auto;
}
.wrap.narrow { width: min(100% - 2rem, var(--max)); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--ink);
  backdrop-filter: blur(8px);
}
.site-header .inner {
  width: min(100% - 2rem, var(--wide));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}
.brand {
  font-family: Archivo, sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--ink);
}
.brand span { color: var(--signal); }
.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 1.05rem;
}
.header-nav a { text-decoration: none; }
.header-nav a:hover { text-decoration: underline; }

.hero {
  padding: clamp(2.5rem, 8vw, 5rem) 0 3rem;
}
.hero .kicker {
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.hero-rule {
  width: 7.5rem;
  height: 2px;
  background: var(--signal);
  margin: 1.25rem 0 1.75rem;
  border: 0;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0.75rem 1.4rem;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  font-size: 1.15rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn.secondary {
  background: transparent;
  color: var(--ink);
}
.btn.secondary:hover {
  background: var(--ink);
  color: #fff;
}
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn.mic[aria-pressed="true"] {
  background: var(--signal);
  border-color: var(--signal);
  color: #fff;
}

.section {
  padding: 3rem 0;
}
.section.alt {
  background: var(--paper-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.price-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 800px) {
  .price-grid { grid-template-columns: repeat(3, 1fr); }
}
.price-card {
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 1.5rem 1.35rem;
}
.price-card.featured {
  border-width: 2px;
  border-color: var(--signal);
}
.price-card .amount {
  font-family: Archivo, sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0.5rem 0 1rem;
}
.price-card ul {
  margin: 0 0 1.25rem;
  padding-left: 1.1rem;
  color: var(--muted);
}
.price-card li { margin-bottom: 0.4rem; }

.steps {
  display: grid;
  gap: 1rem;
}
@media (min-width: 700px) {
  .steps { grid-template-columns: repeat(4, 1fr); }
}
.step {
  border-top: 2px solid var(--signal);
  padding-top: 0.85rem;
}
.step .n {
  font-family: Archivo, sans-serif;
  color: var(--signal);
  font-weight: 800;
  font-size: 1.1rem;
}

.chat-shell {
  display: grid;
  gap: 1rem;
  min-height: 70vh;
}
.progress {
  font-size: 1.05rem;
  color: var(--muted);
}
.progress-bar {
  height: 8px;
  background: var(--line);
  margin-top: 0.4rem;
  overflow: hidden;
}
.progress-bar > span {
  display: block;
  height: 100%;
  background: var(--signal);
  width: 0%;
  transition: width 0.35s var(--ease);
}
.chat-log {
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 1.25rem;
  min-height: 18rem;
  max-height: 48vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.bubble {
  max-width: 92%;
  padding: 0.9rem 1.05rem;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  color: var(--ink);
  white-space: pre-wrap;
}
.bubble.bot { align-self: flex-start; }
.bubble.user {
  align-self: flex-end;
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.bubble.report {
  max-width: 100%;
  background: #fff;
  border-color: var(--ink);
  font-size: 1.1rem;
}
.composer {
  display: grid;
  gap: 0.75rem;
}
.composer textarea {
  width: 100%;
  min-height: 7rem;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1.5;
  padding: 1rem;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  resize: vertical;
}
.composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.code-box {
  border: 1px dashed var(--ink);
  padding: 1rem 1.1rem;
  background: #fff;
  font-size: 1.15rem;
}
.code-box strong {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
}

.book-layout {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 960px) {
  .book-layout {
    grid-template-columns: 1.4fr 0.9fr;
    align-items: start;
  }
}
.manuscript {
  border: 1px solid var(--ink);
  background: #fff;
  padding: 1.5rem 1.35rem;
  min-height: 60vh;
  max-height: 75vh;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--ink);
}
.side-chat .chat-log { max-height: 40vh; min-height: 12rem; }

.site-footer {
  border-top: 1px solid var(--ink);
  padding: 2rem 0 2.5rem;
  margin-top: 2rem;
  font-size: 1.05rem;
}
.site-footer .inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
}
.muted { color: var(--muted); }
.err {
  color: #8b1e1e;
  border: 1px solid #8b1e1e;
  background: #fff5f5;
  padding: 0.85rem 1rem;
}
.ok {
  color: var(--ok);
  border: 1px solid var(--ok);
  background: #f3faf5;
  padding: 0.85rem 1rem;
}
.hidden { display: none !important; }

/* —— Gamification: Lebensreise —— */
.level-line {
  font-family: Archivo, sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  margin: 0.35rem 0 0.75rem;
}
.life-journey {
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 1rem 1rem 1.1rem;
}
.journey-label {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.journey-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1fr 1fr;
}
@media (min-width: 640px) {
  .journey-track { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .journey-track { grid-template-columns: repeat(4, 1fr); }
}
.journey-stop {
  border: 1px solid var(--line);
  background: var(--paper-soft);
  padding: 0.65rem 0.7rem;
  min-height: 4.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}
.journey-stop.is-active {
  border-color: var(--ink);
  background: #fff;
}
.journey-stop.is-done {
  border-color: var(--ok);
  background: #f3faf5;
}
.journey-stop.is-done .journey-num { color: var(--ok); }
.journey-num {
  font-family: Archivo, sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--muted);
}
.journey-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.25;
}
.journey-meta {
  font-size: 0.9rem;
  color: var(--muted);
}
.badge-shelf { margin-top: 0.25rem; }
.badge-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.badge-chip {
  border: 1px solid var(--ink);
  background: #fff;
  padding: 0.35rem 0.7rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.bubble.praise {
  border-style: dashed;
  background: #fff;
  font-style: italic;
}
.bubble.milestone {
  border-color: var(--signal);
  border-width: 2px;
  background: #fff;
  font-weight: 600;
  max-width: 100%;
}
.generate-box .generate-hero {
  font-family: Archivo, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
}

.game-toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}
.game-toast {
  border: 2px solid var(--ink);
  background: #fff;
  padding: 0.9rem 1rem;
  box-shadow: 0 8px 24px rgba(32, 30, 29, 0.08);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.game-toast.is-in {
  opacity: 1;
  transform: translateY(0);
}
.game-toast.is-out {
  opacity: 0;
  transform: translateY(8px);
}
.game-toast-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
}
.game-toast-title {
  margin: 0 0 0.25rem;
  font-family: Archivo, sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--ink);
}
.game-toast-text {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.game-burst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 70;
  overflow: hidden;
}
.game-burst span {
  position: absolute;
  top: 45%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: var(--signal);
  opacity: 0.85;
  animation: mk-burst 1.2s var(--ease) forwards;
  animation-delay: var(--delay);
  transform: translate(-50%, -50%);
}
.game-burst span:nth-child(odd) { background: var(--ink); width: 7px; height: 7px; }
.game-burst span:nth-child(3n) { background: #c4a574; }

@keyframes mk-burst {
  0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.6); }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% - 35vh)) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-burst { display: none; }
  .game-toast { transition: none; }
  .journey-stop { transition: none; }
}

@media print {
  .site-header, .site-footer, .composer, .side-chat, .cta-row, .no-print,
  .game-toasts, .life-journey, .badge-shelf { display: none !important; }
  .manuscript {
    max-height: none;
    border: 0;
    padding: 0;
  }
  body { background: #fff; font-size: 12pt; }
}
