/* Lokale Fonts (variable, latin) — kein externer Request mehr */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/PlayfairDisplay-variable.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/PlayfairDisplay-italic-variable.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('../fonts/DMSans-variable.woff2') format('woff2');
}

/* MvM Makler — v5: Ein-Bildschirm-Gespräch. Die Site IST der Chat.
   Palette aus referenz-lovable/REFERENZ.md. Keine Bänder, keine Boxen. */

:root {
  --cream: hsl(39 38% 94%);
  --cream-deep: hsl(38 34% 89%);
  --ink: hsl(220 20% 15%);
  --ink-soft: hsl(220 12% 38%);
  --sage: hsl(152 28% 38%);
  --sage-deep: hsl(152 30% 30%);
  --amber: hsl(38 65% 55%);
  --line: hsl(38 24% 79%);
  --font-head: "Playfair Display", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  font-size: 1.0625rem;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2 { font-family: var(--font-head); font-weight: 500; line-height: 1.12; }

a { color: var(--sage-deep); }

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 1.1rem;
}

/* ---------- Bühne: ein Bildschirm ---------- */

.stage {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

/* Hausbezug: Foto diskret und transparent im Hintergrund, unten rechts am
   stärksten, zur Textseite hin ausgeblendet */
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../img/haus-am-wasser.jpg") center 45% / cover no-repeat;
  opacity: 0.38;
  filter: saturate(0.9);
  animation: atmen 14s ease-out both;
}
@keyframes atmen {
  from { transform: scale(1.045); }
  to { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .stage::before { animation: none; }
}

.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 72% 68% at 50% 52%, hsl(39 38% 94% / 0.88) 0%, hsl(39 38% 94% / 0.5) 55%, transparent 100%), linear-gradient(180deg, hsl(39 38% 94% / 0.85) 0%, transparent 22%);
}

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
  flex-shrink: 0;
}

.wordmark { text-decoration: none; color: var(--ink); }
.wordmark-name { display: block; font-family: var(--font-head); font-size: 1.25rem; letter-spacing: 0.01em; }
.wordmark-sub { display: block; font-size: 0.6875rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--sage); }

.head-call {
  font-family: var(--font-head);
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid var(--amber);
  padding-bottom: 0.1rem;
  letter-spacing: 0.02em;
}
.head-call:hover { color: var(--sage-deep); }

.buehne {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 10fr) minmax(0, 10fr);
  gap: clamp(2rem, 5vw, 5rem);
  max-width: 76rem;
  width: 100%;
  margin: 0 auto;
  padding: clamp(1rem, 3vh, 3rem) clamp(1.25rem, 5vw, 4rem) clamp(1.25rem, 3vh, 2.5rem);
}

/* Identität links */

.identitaet { align-self: center; }

html.anim .identitaet > * {
  opacity: 0;
  transform: translateY(12px);
  animation: auftritt 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
html.anim .identitaet > *:nth-child(2) { animation-delay: 0.12s; }
html.anim .identitaet > *:nth-child(3) { animation-delay: 0.26s; }
html.anim .identitaet > *:nth-child(4) { animation-delay: 0.4s; }
@keyframes auftritt {
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html.anim .identitaet > * { opacity: 1; transform: none; animation: none; }
}

.identitaet h1 {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  margin-bottom: 1.3rem;
}

.lead { color: var(--ink-soft); max-width: 32rem; }

.lead-pfeil {
  margin-top: 1.4rem;
  font-family: var(--font-head);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--sage-deep);
}

/* ---------- Chat ---------- */

.chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  justify-content: center;
  align-self: center;
  width: 100%;
  max-height: 100%;
}

.verlauf {
  overflow-y: auto;
  min-height: 0;
  padding: 0.5rem 0.25rem 0.75rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.chat-zeile {
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}
.chat-max { justify-content: flex-start; }
.chat-folge { padding-left: 3.2rem; }
.chat-ich { justify-content: flex-end; }

.chat-avatar {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 3px;
  object-fit: cover;
  object-position: top;
  flex-shrink: 0;
  filter: sepia(0.15) saturate(0.85);
  align-self: flex-start;
}

.bubble {
  font-size: 1.0625rem;
  line-height: 1.55;
  max-width: 27rem;
}

.bubble-max {
  font-family: var(--font-head);
  font-size: 1.2rem;
  line-height: 1.45;
  color: var(--ink);
  padding: 0.15rem 0 0.15rem 1.1rem;
  border-left: 1px solid var(--amber);
}
.bubble-max a { color: var(--sage-deep); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--amber); }
.bubble-max a:hover { color: var(--ink); }

.bubble-ich {
  font-style: italic;
  color: var(--ink-soft);
  text-align: right;
  padding: 0.15rem 1.1rem 0.15rem 0;
  border-right: 1px solid var(--line);
}

/* Tipp-Indikator */
.bubble-tippt { display: inline-flex; gap: 0.35rem; padding: 0.5rem 0 0.5rem 1.1rem; border-left: 1px solid var(--line); }
.bubble-tippt span {
  width: 0.3rem; height: 0.3rem;
  border-radius: 50%;
  background: var(--amber);
  animation: tippt 1.1s infinite ease-in-out;
}
.bubble-tippt span:nth-child(2) { animation-delay: 0.15s; }
.bubble-tippt span:nth-child(3) { animation-delay: 0.3s; }
@keyframes tippt {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* Bubble-Einblendung. Intro + Chips stehen statisch im HTML und sind ohne JS
   sichtbar; nur mit JS (html.anim) starten sie versteckt und blenden ein. */
.chat-zeile { transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.chat-zeile.neu:not(.da),
html.anim .chat-zeile.intro:not(.da) { opacity: 0; transform: translateY(10px); }
html.anim .chips:not(.da) { opacity: 0; }
.chips { transition: opacity 0.4s ease; }
@media (prefers-reduced-motion: reduce) {
  .chat-zeile, html.anim .chat-zeile.intro:not(.da), .chat-zeile.neu:not(.da) { opacity: 1; transform: none; transition: none; }
  .bubble-tippt span { animation: none; }
}

/* Chips */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
  padding: 0.4rem 0 0.9rem;
  flex-shrink: 0;
}

.chip {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  border-radius: 2px;
  padding: 0.65rem 1.05rem;
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}
.chip:hover { border-color: var(--amber); color: var(--ink); }
.chip-primary { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.chip-primary:hover { background: var(--sage-deep); border-color: var(--sage-deep); color: var(--cream); }

/* WhatsApp-Knopf in WhatsApp-Gruen */
#senden-wa { background: #25d366; border-color: #25d366; color: #fff; }
#senden-wa:hover { background: #1ebe5d; border-color: #1ebe5d; color: #fff; }

/* Eingabe */

.eingabe { flex-shrink: 0; }

.eingabe textarea {
  width: 100%;
  font-family: var(--font-head);
  font-size: 1.15rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid hsl(38 24% 70%);
  border-radius: 0;
  padding: 0.7rem 0.1rem;
  resize: none;
  overflow: hidden;
  min-height: 3rem;
  transition: border-color 0.3s ease;
}
.eingabe textarea:focus { outline: none; border-bottom-color: var(--amber); }
.eingabe textarea::placeholder { color: hsl(220 8% 60%); font-style: italic; }

/* Senden */

.senden {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-top: 0.7rem;
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
}
.senden.da { opacity: 1; transform: none; pointer-events: auto; max-height: 12rem; }

.senden-hinweis {
  flex-basis: 100%;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .senden { transition: none; }
}

/* Bühne mobil */

@media (max-width: 860px) {
  .buehne {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 1rem;
  }
  .identitaet { align-self: start; }
  .identitaet h1 { font-size: clamp(1.9rem, 8vw, 2.4rem); margin-bottom: 0.6rem; }
  .lead { font-size: 0.9375rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .lead-pfeil { display: none; }
  .bubble { max-width: 85%; }
}

/* ---------- Stage-Fußzeile ---------- */

.stage-fuss {
  flex-shrink: 0;
  display: flex;
  gap: 1.4rem;
  justify-content: center;
  padding: 0.6rem 1.25rem 1rem;
}
.stage-fuss a {
  color: hsl(220 16% 28%);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}
.stage-fuss a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Lesefassung (fragen.html) ---------- */

.lesen {
  max-width: 68rem;
  margin: 0 auto;
  padding: 1rem clamp(1.25rem, 6vw, 6rem) 0;
}

.lesen-h1 {
  font-family: var(--font-head);
  font-weight: 500;
  line-height: 1.12;
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  margin-bottom: 1.2rem;
  max-width: 26ch;
}

.lesen-intro { color: var(--ink-soft); max-width: 38rem; margin-bottom: 2rem; }

.lesen-block h2.recht-h2 {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.3rem;
  margin: 2.1rem 0 0.6rem;
  max-width: none;
  color: var(--ink);
}
.lesen-text h2.recht-h2:first-child { margin-top: 0; }

.lesen-block {
  border-top: 1px solid var(--line);
  padding: 2.4rem 0 clamp(3rem, 7vw, 5rem);
}

.lesen-block h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); margin-bottom: 1.4rem; max-width: 26ch; }

.lesen-text { max-width: 38rem; }
.lesen-text p { margin-bottom: 1.3rem; color: var(--ink-soft); }

.lesen-signatur {
  font-family: var(--font-head);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--sage-deep) !important;
  margin-top: 1.8rem;
}

.faq-liste { max-width: 46rem; }
.faq-liste details { border-bottom: 1px solid var(--line); }
.faq-liste summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--font-head);
  font-size: 1.2rem;
  padding: 1.1rem 2.2rem 1.1rem 0;
  position: relative;
}
.faq-liste summary::-webkit-details-marker { display: none; }
.faq-liste summary::after {
  content: "+";
  position: absolute;
  right: 0.2rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-body);
  font-size: 1.4rem;
  color: var(--sage);
  transition: transform 0.2s ease;
}
.faq-liste details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-liste details p { padding: 0 0 1.2rem; color: var(--ink-soft); max-width: 40rem; }

.lesen-tel {
  display: inline-block;
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  color: var(--sage-deep);
  text-decoration: none;
  border-bottom: 2px solid var(--amber);
  padding-bottom: 0.15rem;
  margin-bottom: 1rem;
}
.lesen-tel:hover { color: var(--ink); }
.lesen-alt { color: var(--ink-soft); font-size: 0.9875rem; }

/* ---------- Footer ---------- */

.site-foot { border-top: 1px solid var(--line); padding: 2.2rem 0 2.8rem; }
.foot-brand { font-family: var(--font-head); font-size: 1.05rem; }
.foot-region { color: var(--ink-soft); font-size: 0.875rem; max-width: 34rem; margin: 0.4rem 0 1.2rem; }
.foot-nav { display: flex; gap: 1.4rem; }
.foot-nav a { color: var(--ink-soft); font-size: 0.875rem; }

/* ---------- Sonstiges ---------- */

.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;
}

/* ---------- Scroll-Video (Startseite): Stage klebt, Canvas scrubbt ---------- */

.scrollraum { height: 420vh; }
.scrollraum .stage { position: sticky; top: 0; }

/* Standbild bleibt als No-JS-/Lade-Fallback unter der Canvas.
   Sobald das Video malt (html.video-an), wird es ausgeblendet — sonst
   ueberlagern sich zwei fast deckungsgleiche Bilder (Geister-Fenster). */
.scrollraum .stage::before { z-index: -3; transition: opacity 0.6s ease; }
html.video-an .scrollraum .stage::before { opacity: 0; }

#leinwand {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  opacity: 0.38;
  filter: saturate(0.9);
}
