:root {
  --bg: #f5f2ec;
  --surface: #ffffff;
  --surface-2: #ece7de;
  --ink: #1c1a17;
  --ink-soft: #5d5850;
  --line: #d9d2c5;
  --accent: #8a6a3d;
  --accent-ink: #ffffff;
  --film-ink: #ffffff;
  --radius: 14px;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14130f; --surface: #1d1b17; --surface-2: #26231e; --ink: #f1ece3; --ink-soft: #a9a196;
    --line: #36322b; --accent: #c9a46a; --accent-ink: #14130f; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14130f; --surface: #1d1b17; --surface-2: #26231e; --ink: #f1ece3; --ink-soft: #a9a196;
  --line: #36322b; --accent: #c9a46a; --accent-ink: #14130f; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--sans); overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: .01em; line-height: 1.1; margin: 0; }
.kicker { font: 600 11px/1.4 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: .5em; border: 1px solid currentColor; border-radius: 999px; padding: .7em 1.3em; font: 500 14px/1 var(--sans); text-decoration: none; cursor: pointer; background: transparent; color: inherit; transition: background .2s, color .2s; }
.btn-solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-solid:hover { filter: brightness(1.08); }
.btn:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Header ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px var(--gutter); color: var(--film-ink); transition: background .3s, color .3s, box-shadow .3s; }
.topbar.solid { background: color-mix(in srgb, var(--bg) 92%, transparent); color: var(--ink); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; font: 500 13px var(--serif); flex: none; }
.brand-logo { height: 34px; width: auto; max-width: 140px; object-fit: contain; flex: none; }
.brand-name { font: 500 18px/1.1 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { display: block; font: 500 10px/1.2 var(--sans); letter-spacing: .2em; text-transform: uppercase; opacity: .75; }
.topnav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.topnav a { text-decoration: none; opacity: .85; }
.topnav a:hover { opacity: 1; }
@media (max-width: 900px) { .topnav a:not(.btn) { display: none; } .topnav .btn { padding: .6em 1em; font-size: 13px; } }
@media (max-width: 600px) { .topnav { display: none; } .brand-name { font-size: 16px; } }

/* ---------- Film ---------- */
.film { position: relative; background: #0d0c0a; }
.film-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.film-vids, .film-vids video, .film-still { position: absolute; inset: 0; width: 100%; height: 100%; }
.film-vids video, .film-still { object-fit: cover; }
.film-vids video { opacity: 0; }
.film-still { z-index: 1; will-change: opacity; }
.film-scrim { position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 50%, rgba(0,0,0,.62) 100%); }
.film-progress { position: absolute; z-index: 4; left: 0; top: 0; height: 2px; background: var(--film-ink); width: 0; opacity: .85; }

.chapter { position: absolute; z-index: 3; left: var(--gutter); right: var(--gutter); bottom: clamp(28px, 8vh, 90px); max-width: 620px; color: var(--film-ink); opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .6s ease; pointer-events: none; }
.chapter.on { opacity: 1; transform: none; }
.chapter .kicker { color: #e8d3ad; }
.chapter h2 { font-size: clamp(40px, 6.5vw, 84px); margin: .2em 0 .25em; }
.chapter p { font-size: clamp(15px, 1.4vw, 18px); margin: 0; max-width: 46ch; opacity: .92; text-shadow: 0 1px 12px rgba(0,0,0,.35); }

.hero { max-width: 900px; }
.hero h1 { font-size: clamp(48px, 9vw, 120px); margin: .12em 0 .1em; }
.hero .sub { font: 400 clamp(17px, 2vw, 24px)/1.3 var(--serif); font-style: italic; opacity: .95; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px 34px; margin-top: 26px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font: 500 26px/1.1 var(--serif); }
.hero-stats span { font: 500 11px/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; opacity: .8; }
.scroll-hint { position: absolute; z-index: 3; left: 50%; bottom: 18px; transform: translateX(-50%); color: var(--film-ink); font: 500 11px var(--sans); letter-spacing: .22em; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: opacity .4s; }
.scroll-hint i { width: 1px; height: 34px; background: linear-gradient(var(--film-ink), transparent); animation: hint 1.8s ease-in-out infinite; }
@keyframes hint { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@media (max-width: 700px) { .scroll-hint { display: none; } }

.film-nav { position: absolute; z-index: 4; right: var(--gutter); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 12px; }
.film-nav button { all: unset; cursor: pointer; display: flex; align-items: center; justify-content: flex-end; gap: 10px; color: var(--film-ink); font: 500 12px var(--sans); letter-spacing: .08em; }
.film-nav button span { opacity: 0; transform: translateX(6px); transition: .25s; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.film-nav button i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--film-ink); transition: .25s; flex: none; }
.film-nav button.on i { background: var(--film-ink); transform: scale(1.3); }
.film-nav button:hover span, .film-nav button.on span { opacity: 1; transform: none; }
@media (max-width: 700px) { .film-nav { gap: 9px; } .film-nav button span { display: none; } }

.loader { position: absolute; z-index: 4; right: var(--gutter); bottom: 18px; color: var(--film-ink); font: 500 11px var(--sans); letter-spacing: .14em; opacity: .7; transition: opacity .6s; }

/* ---------- Exposé ---------- */
.section { padding: clamp(64px, 10vw, 130px) var(--gutter); }
.wrap { max-width: 1180px; margin: 0 auto; }
.section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { font-size: clamp(34px, 4.6vw, 58px); }

.keyfacts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.keyfacts div { padding: 26px 20px; border-left: 1px solid var(--line); }
.keyfacts div:first-child { border-left: 0; padding-left: 0; }
.keyfacts b { display: block; font: 500 clamp(28px, 3.2vw, 42px)/1.1 var(--serif); }
.keyfacts span { font-size: 13px; color: var(--ink-soft); }
@media (max-width: 760px) { .keyfacts { grid-template-columns: 1fr 1fr; } .keyfacts div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); } .keyfacts div:nth-child(-n+2) { border-top: 0; } }

.cols { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 90px); align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.desc h3 { font-size: 28px; margin: 0 0 10px; }
.desc p { margin: 0 0 30px; color: var(--ink-soft); font-size: 17px; }
.facts { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.facts td { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.facts tr:last-child td { border-bottom: 0; }
.facts td:first-child { color: var(--ink-soft); }
.facts td:last-child { text-align: right; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.chips span { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 14px; }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.gallery button { all: unset; cursor: zoom-in; border-radius: 10px; overflow: hidden; aspect-ratio: 4/3; background: var(--surface-2); }
.gallery button:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.gallery button:hover img { transform: scale(1.04); }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr 1fr; } }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10,9,8,.94); display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 6px; }
.lightbox button { all: unset; cursor: pointer; position: absolute; color: #fff; font-size: 30px; padding: 16px; line-height: 1; }
.lb-close { top: 8px; right: 12px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lb-cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #ddd; font-size: 14px; }

.plan { background: var(--surface); border-radius: var(--radius); padding: clamp(18px, 3vw, 36px); }
.plan-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.plan-tabs button { all: unset; cursor: pointer; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; }
.plan-tabs button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.plan svg { width: 100%; height: auto; max-height: 560px; display: block; }
.plan rect { fill: var(--surface-2); stroke: var(--ink); stroke-width: .5; transition: fill .2s; }
.plan .outdoor rect { fill: transparent; stroke-dasharray: 1.5 1.5; }
.plan .room.link { cursor: pointer; }
.plan .room.link:hover rect { fill: color-mix(in srgb, var(--accent) 35%, var(--surface-2)); }
.plan text { fill: var(--ink); font: 500 3.1px var(--sans); text-anchor: middle; pointer-events: none; }
.plan text.area { fill: var(--ink-soft); font-size: 2.5px; font-weight: 400; }
.plan .play { fill: var(--accent); font-size: 2.4px; }
.plan-note { color: var(--ink-soft); font-size: 13px; margin-top: 12px; }

.map { border: 0; width: 100%; aspect-ratio: 4/3; border-radius: var(--radius); background: var(--surface-2); }
.dist { list-style: none; padding: 0; margin: 0; }
.dist li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.dist li span:last-child { font-weight: 500; white-space: nowrap; }

.energy { background: var(--surface); border-radius: var(--radius); padding: clamp(18px, 3vw, 32px); }
.escale { position: relative; display: grid; grid-template-columns: repeat(9, 1fr); height: 30px; margin: 34px 0 10px; font: 600 12px/30px var(--sans); text-align: center; color: #fff; }
.escale span:nth-child(1) { background: #1a9641; border-radius: 6px 0 0 6px; } .escale span:nth-child(2) { background: #52b151; } .escale span:nth-child(3) { background: #8acb4d; }
.escale span:nth-child(4) { background: #c4e24b; color: #222; } .escale span:nth-child(5) { background: #fee94c; color: #222; } .escale span:nth-child(6) { background: #fdc04a; color: #222; }
.escale span:nth-child(7) { background: #f88d3d; } .escale span:nth-child(8) { background: #ec5a32; } .escale span:nth-child(9) { background: #d7191c; border-radius: 0 6px 6px 0; }
.emarker { position: absolute; top: -26px; transform: translateX(-50%); font: 600 12px var(--sans); color: var(--ink); white-space: nowrap; }
.emarker::after { content: ""; display: block; margin: 2px auto 0; width: 0; height: 0; border: 6px solid transparent; border-top-color: var(--ink); }
.egrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; font-size: 14px; margin-top: 18px; }
.egrid span { color: var(--ink-soft); }

.calc { background: var(--surface); border-radius: var(--radius); padding: clamp(18px, 3vw, 32px); }
.calc label { display: block; font-size: 14px; color: var(--ink-soft); margin: 14px 0 6px; }
.calc label b { float: right; color: var(--ink); font-weight: 500; }
.calc input[type=range] { width: 100%; accent-color: var(--accent); }
.calc-out { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.calc-out b { font: 500 40px/1.1 var(--serif); display: block; }
.calc-out small { color: var(--ink-soft); }

.contact { background: var(--ink); color: var(--bg); }
.contact .kicker { color: var(--accent); }
.agent { display: flex; gap: 18px; align-items: center; margin: 26px 0; }
.agent-photo { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 500 26px var(--serif); flex: none; }
.agent small { display: block; opacity: .7; }
.agent-links a { display: block; text-decoration: none; opacity: .9; }
form.req { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
form.req .full { grid-column: 1 / -1; }
form.req input, form.req textarea, form.req select { width: 100%; padding: 14px 16px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--bg) 25%, transparent); background: color-mix(in srgb, var(--bg) 6%, transparent); color: var(--bg); font: inherit; }
form.req input::placeholder, form.req textarea::placeholder { color: color-mix(in srgb, var(--bg) 55%, transparent); }
form.req label.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; opacity: .8; }
form.req label.chk input { width: auto; margin-top: 3px; }
@media (max-width: 600px) { form.req { grid-template-columns: 1fr; } }

.foot { padding: 30px var(--gutter); font-size: 12px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
.foot a { text-decoration: none; }

.cta-float { position: fixed; z-index: 40; right: 16px; bottom: 16px; display: none; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
@media (max-width: 700px) { .cta-float.show { display: inline-flex; } }

/* ---------- Archiv ---------- */
.arch-hero { padding: clamp(120px, 16vw, 200px) var(--gutter) clamp(40px, 6vw, 70px); }
.arch-hero h1 { font-size: clamp(46px, 7vw, 96px); max-width: 14ch; margin: 14px 0 18px; }
.arch-hero p { max-width: 58ch; color: var(--ink-soft); font-size: 18px; margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 34px 0 0; }
.filters button { all: unset; cursor: pointer; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
.filters button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: clamp(18px, 2.4vw, 30px); padding: 0 var(--gutter) clamp(70px, 10vw, 120px); }
.card { text-decoration: none; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); overflow: hidden; transition: transform .3s, box-shadow .3s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0,0,0,.12); }
.card-media { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.card:hover .card-media img { transform: scale(1.05); }
.badge { position: absolute; top: 14px; left: 14px; background: rgba(255,255,255,.92); color: #1c1a17; font: 600 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; }
.badge.film { left: auto; right: 14px; background: rgba(0,0,0,.55); color: #fff; }
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { font-size: 28px; }
.card-body .loc { color: var(--ink-soft); font-size: 14px; }
.card-meta { display: flex; gap: 18px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.card-meta b { font-weight: 600; }
.card.sold .card-media img { filter: grayscale(.6); }
.card.ghost { border: 1px dashed var(--line); background: transparent; align-items: center; justify-content: center; text-align: center; padding: 40px; color: var(--ink-soft); min-height: 300px; }

/* ---------- Druck / PDF-Exposé ---------- */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .topbar, .film, .cta-float, .lightbox, form.req, .calc, .plan-tabs, .no-print, iframe.map { display: none !important; }
  .print-only { display: block; }
  .section { padding: 10mm 0; break-inside: avoid-page; }
  .contact { background: #fff; color: #111; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery button:first-child { grid-column: span 2; }
  .print-cover img { width: 100%; height: 120mm; object-fit: cover; border-radius: 4px; }
  .print-cover h1 { font-size: 36pt; margin: 8mm 0 2mm; }
}

/* ---------- Archiv: Titelbild & Eigentümer ---------- */
.arch-cover { position: relative; min-height: 88vh; min-height: 88svh; display: flex; align-items: flex-end; color: #fff; overflow: hidden; background: #0d0c0a; }
.arch-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .78; transform: scale(1.04); animation: drift 22s ease-in-out infinite alternate; }
@keyframes drift { to { transform: scale(1.12) translate(-1.5%, -1%); } }
@media (prefers-reduced-motion: reduce) { .arch-cover img { animation: none; } }
.arch-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,0) 30%, rgba(0,0,0,.65)); }
.arch-cover .arch-hero { position: relative; z-index: 1; padding-bottom: clamp(40px, 8vh, 90px); }
.arch-cover .arch-hero p { color: rgba(255,255,255,.9); }
.arch-cover .kicker { color: #e8d3ad; }
.owner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 80px); align-items: center; }
.owner ol { padding-left: 1.2em; color: var(--ink-soft); }
.owner li { margin: 0 0 10px; }
.owner li b { color: var(--ink); }
.owner-media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; display: block; }
.owner-media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .owner { grid-template-columns: 1fr; } }

/* ---------- Demo-Zentrale ---------- */
.hub table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; font-size: 15px; }
.hub th, .hub td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.hub th { font: 600 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.hub tr:last-child td { border-bottom: 0; }
.hub .swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: 6px; border: 1px solid var(--line); }
.hub .scroll { overflow-x: auto; border-radius: var(--radius); }

/* Kontaktbereich: unabhängig von der Makler-Farbe immer gut lesbar */
.contact .kicker { color: color-mix(in srgb, var(--accent) 45%, #ffffff); }
.contact .btn-solid { background: var(--bg); border-color: var(--bg); color: var(--ink); }
.contact .agent-photo { box-shadow: 0 0 0 2px color-mix(in srgb, var(--bg) 30%, transparent); }

/* ---------- Handy: Bildsequenz ---------- */
.film-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Bühne in fester Höhe (größter Viewport), damit die ein-/ausfahrende Adressleiste nichts verschiebt */
html.seq .film-stage { height: 100vh; height: 100lvh; }
html.seq .chapter { bottom: calc(100lvh - 100svh + 72px); }
html.seq .scroll-hint { display: flex; bottom: calc(100lvh - 100svh + 14px); }
html.seq .scroll-hint i { height: 22px; }
html.seq .loader { bottom: calc(100lvh - 100svh + 18px); }
