:root {
  --brand: #B2966C;
  --brand-contrast: #1d1d1f;
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --glass: rgba(255, 255, 255, 0.78);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(0, 0, 0, 0.08);
  --hover: rgba(0, 0, 0, 0.05);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.16), 0 1px 3px rgba(0, 0, 0, 0.08);
  --radius: 18px;
  --radius-small: 12px;
  --gap: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1d1d1f;
  color: var(--ink);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
a { color: inherit; }

.icon { width: 20px; height: 20px; flex: none; }

.app { position: fixed; inset: 0; }

.showcase {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--hover);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .15s ease, transform .15s ease;
}
.btn:hover { background: rgba(0, 0, 0, 0.09); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible, .drawer__item:focus-visible, .chip:focus-visible, .bar__brand:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.btn--icon { width: 40px; padding: 0; background: transparent; }
.btn--icon:hover { background: var(--hover); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--hover); }
.btn--primary { background: var(--brand); color: var(--brand-contrast); }
.btn--primary:hover { background: var(--brand); filter: brightness(1.06); }
.btn--large { min-height: 52px; padding: 0 28px; font-size: 17px; }
.btn--small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn--small .icon { width: 16px; height: 16px; }

/* ---------- Kopfleiste ---------- */

.bar {
  position: absolute;
  top: calc(var(--gap) + var(--safe-top));
  left: var(--gap);
  right: var(--gap);
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 8px 8px 8px 16px;
  border-radius: var(--radius);
  z-index: 10;
}

.bar__brand {
  display: flex;
  align-items: center;
  flex: none;
  max-width: 34%;
  text-decoration: none;
  border-radius: 8px;
}
.bar__brand img { display: block; max-height: 36px; max-width: 100%; }

.wordmark {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  padding-left: 12px;
  border-left: 3px solid var(--brand);
}

.bar__title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.bar__title strong, .bar__title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar__title strong { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.bar__title span { font-size: 13px; color: var(--ink-soft); }
.bar__title span:empty { display: none; }

.bar__actions { display: flex; align-items: center; gap: 4px; flex: none; }

/* ---------- Kategorie-Chips ---------- */

.chips {
  position: absolute;
  top: calc(var(--gap) * 2 + 56px + var(--safe-top));
  left: var(--gap);
  right: var(--gap);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  z-index: 9;
  pointer-events: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.chip__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--chip-color);
  box-shadow: inset 0 0 0 2px #fff;
  outline: 1px solid var(--chip-color);
}
.chip[aria-pressed="false"] { color: var(--ink-soft); }
.chip[aria-pressed="false"] .chip__dot { background: transparent; }
.chip:disabled { opacity: 0.6; cursor: progress; }

body:not(.has-sdk) .needs-sdk { display: none !important; }

/* ---------- Menü ---------- */

.drawer {
  position: absolute;
  top: calc(var(--gap) + var(--safe-top));
  right: var(--gap);
  bottom: calc(var(--gap) + var(--safe-bottom));
  width: min(340px, calc(100vw - 2 * var(--gap)));
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--glass-strong);
  z-index: 30;
  animation: slide-in .22s ease;
}
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 6px 20px;
  font-size: 17px;
}
.drawer__body { overflow-y: auto; padding: 0 10px 16px; }
.drawer__heading {
  margin: 16px 10px 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.drawer__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.drawer__item:hover { background: var(--hover); }
.drawer__item .icon { color: var(--ink-soft); }
.drawer__item.is-active { background: color-mix(in srgb, var(--brand) 18%, transparent); font-weight: 600; }
.drawer__item.is-active .icon { color: var(--ink); }

.drawer__legal { display: flex; gap: 16px; margin: 20px 10px 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; }
.drawer__legal a { color: var(--ink-soft); text-decoration: none; }
.drawer__legal a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Seitenfenster ---------- */

.sheet {
  position: absolute;
  top: calc(var(--gap) * 2 + 56px + var(--safe-top));
  right: var(--gap);
  bottom: calc(var(--gap) + var(--safe-bottom));
  width: min(400px, calc(100vw - 2 * var(--gap)));
  overflow-y: auto;
  border-radius: var(--radius);
  background: var(--glass-strong);
  z-index: 20;
  animation: slide-in .22s ease;
}
.sheet__close { position: sticky; top: 8px; float: right; margin: 8px 8px 0 0; background: var(--glass-strong); }
.sheet__body { padding: 20px 22px 24px; }
.sheet__body h2 { margin: 4px 44px 14px 0; font-size: 21px; line-height: 1.25; letter-spacing: -0.015em; }
.sheet__body .btn--primary { margin-top: 18px; }

.prose { color: #333336; }
.prose p { margin: 0 0 12px; }
.prose a { color: var(--ink); text-decoration-color: var(--brand); text-underline-offset: 3px; }
.prose img { max-width: 100%; border-radius: var(--radius-small); }

.gallery {
  display: flex;
  gap: 8px;
  margin: 0 -22px 16px;
  padding: 0 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery img {
  flex: none;
  width: 88%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-small);
  scroll-snap-align: center;
  background: var(--hover);
}
.gallery img:only-child { width: 100%; }

.video { position: relative; margin-bottom: 16px; aspect-ratio: 16 / 9; border-radius: var(--radius-small); overflow: hidden; background: #000; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.contact { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.contact strong { display: block; font-size: 16px; }
.contact span { color: var(--ink-soft); font-size: 14px; }
.contact__photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.contact__photo--empty { display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 22%, #fff); color: var(--ink); }
.contact__photo--empty .icon { width: 28px; height: 28px; }
.contact__rows { display: grid; gap: 6px; }
.contact__row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: var(--radius-small);
  background: var(--hover);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.contact__row:hover { background: rgba(0, 0, 0, 0.09); }

/* ---------- Startbildschirm ---------- */

.intro {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  place-items: safe center;
  overflow-y: auto;
  padding: 24px;
  z-index: 40;
  background:
    linear-gradient(180deg, rgba(20, 18, 15, 0.35), rgba(20, 18, 15, 0.7)),
    var(--intro-image, none) center / cover no-repeat,
    #2a2723;
  transition: opacity .35s ease;
}
.intro.is-leaving { opacity: 0; pointer-events: none; }
.intro__card {
  width: min(440px, 100%);
  padding: 30px 30px 32px;
  border-radius: 24px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--shadow);
  text-align: center;
}
.intro__brand { display: flex; justify-content: center; margin-bottom: 22px; }
.intro__brand img { max-height: 44px; max-width: 70%; }
.intro__brand .wordmark { border-left: 0; padding-left: 0; font-size: 13px; color: var(--ink-soft); }
.intro__brand .wordmark::before {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  margin: 0 auto 10px;
  border-radius: 2px;
  background: var(--brand);
}
.intro h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; }
.intro__subtitle { margin: 0 0 12px; color: var(--ink-soft); }
.intro__text { margin: 0 0 8px; color: #333336; }
.intro .btn--primary { margin-top: 18px; }

/* ---------- Meldungen ---------- */

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(80px + var(--safe-bottom));
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.9);
  color: #fff;
  font-size: 14px;
  z-index: 50;
}

.fatal { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: #f5f5f7; z-index: 60; }
.fatal__card { max-width: 420px; text-align: center; }
.fatal h1 { font-size: 22px; margin: 0 0 8px; }
.fatal p { color: var(--ink-soft); margin: 0; }

@keyframes slide-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: none; }
}

/* Startbildschirm mit Plakat */
.intro--poster { background: radial-gradient(120% 90% at 50% 20%, #3a3630, #16140f 75%); }
.intro--poster .intro__card { width: min(760px, 100%); padding: 18px 18px 24px; }
.intro__poster { display: block; width: 100%; max-height: 60vh; object-fit: contain; border-radius: 14px; margin-bottom: 16px; }
.intro--poster .intro__brand, .intro--poster h1, .intro--poster .intro__subtitle { display: none; }
.intro--poster .btn--primary { margin-top: 10px; }
@media (max-height: 520px) {
  .intro { padding: 12px; }
  .intro__poster { max-height: 48vh; margin-bottom: 10px; }
}

/* ---------- Sprache ---------- */

.lang { position: relative; display: inline-flex; }
.lang select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 34px;
  padding: 0 28px 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--hover) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236e6e73' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 11px center;
  font: 600 12px/1 var(--font);
  letter-spacing: 0.04em;
  color: var(--ink);
  cursor: pointer;
}
.lang select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.lang--corner { position: absolute; top: 14px; right: 14px; }
.intro__card { position: relative; }

/* ---------- Passwort ---------- */

.intro--lock {
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--brand) 45%, #2a2723), #1d1b18 70%);
}
.field {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 18px 0 0;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font: 16px var(--font);
  color: var(--ink);
  text-align: center;
}
.field:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.lock__error { margin: 10px 0 0; color: #c0322b; font-size: 14px; }
.lock__legal { display: flex; justify-content: center; gap: 16px; margin-top: 20px; font-size: 12px; }
.lock__legal a { color: var(--ink-soft); text-decoration: none; }
.lock__legal a:hover { text-decoration: underline; }
.intro--lock .btn--primary { width: 100%; }

/* ---------- 360°-Panorama ---------- */

.pano { position: absolute; inset: 0; z-index: 45; background: #111; animation: fade-in .2s ease; }
.pano__view { position: absolute; inset: 0; }
.pano__bar {
  position: absolute;
  top: calc(var(--gap) + var(--safe-top));
  left: var(--gap);
  right: var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 8px 8px 18px;
  border-radius: var(--radius);
  z-index: 3;
}
.pano__bar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pano__error { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #fff; }
.pano .pnlm-controls-container { top: calc(var(--gap) * 2 + 56px + var(--safe-top)); left: calc(var(--gap) + 4px); }
.pano .pnlm-load-box { border-radius: var(--radius); }
.pano .pnlm-zoom-controls {
  width: 40px;
  height: auto;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
}
.pano .pnlm-zoom-in, .pano .pnlm-zoom-out { width: 40px; height: 40px; background-position-x: 9px; }
.pano .pnlm-zoom-in { border-radius: 0; border-bottom: 1px solid var(--line); background-position-y: 9px; }
.pano .pnlm-zoom-out { border-radius: 0; background-position-y: -17px; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Ton ---------- */

.audio {
  position: absolute;
  left: 50%;
  bottom: calc(76px + var(--safe-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 32px);
  padding: 6px 6px 6px 8px;
  border-radius: 999px;
  z-index: 25;
}
.audio__title { padding: 0 6px; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audio #audio-toggle { background: var(--brand); color: var(--brand-contrast); }

/* ---------- Dunkles Design ---------- */

.theme-dark {
  --ink: #f5f5f7;
  --ink-soft: #a1a1a6;
  --glass: rgba(24, 24, 26, 0.72);
  --glass-strong: rgba(30, 30, 32, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --hover: rgba(255, 255, 255, 0.08);
}
.theme-dark .btn:hover, .theme-dark .contact__row:hover { background: rgba(255, 255, 255, 0.14); }
.theme-dark .btn--primary:hover { background: var(--brand); }
.theme-dark .prose { color: #d9d9de; }
.theme-dark .prose a { color: #fff; }
.theme-dark .field { background: rgba(255, 255, 255, 0.08); color: var(--ink); }
.theme-dark .lang select { background-color: rgba(255, 255, 255, 0.1); }
.theme-dark .contact__photo--empty { background: rgba(255, 255, 255, 0.12); color: var(--ink); }
.theme-dark .drawer__item.is-active { background: color-mix(in srgb, var(--brand) 30%, transparent); }
.theme-dark .intro__text { color: #d9d9de; }

/* ---------- Handy ---------- */

@media (max-width: 640px) {
  :root { --gap: 8px; }
  .bar { gap: 10px; min-height: 52px; padding: 6px 6px 6px 12px; border-radius: 16px; }
  .bar__brand { max-width: 24%; }
  .bar__brand img { max-height: 24px; }
  .bar--wordmark.bar--titled .bar__brand { display: none; }
  .bar--wordmark.bar--titled .bar__title { border-left: 0; padding-left: 4px; }
  .wordmark { font-size: 12px; padding-left: 9px; }
  .bar__title { padding-left: 10px; }
  .bar__title strong { font-size: 14px; }
  .bar__title span { font-size: 12px; }
  #btn-fullscreen { display: none !important; }
  #btn-contact span { display: none; }
  #btn-contact { width: 40px; padding: 0; background: transparent; }
  .chips { top: calc(var(--gap) * 2 + 52px + var(--safe-top)); }

  .sheet {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 72%;
    border-radius: 20px 20px 0 0;
    padding-bottom: var(--safe-bottom);
    animation: slide-up .25s ease;
  }
  .drawer { top: 0; right: 0; bottom: 0; width: min(320px, 88vw); border-radius: 20px 0 0 20px; padding-top: var(--safe-top); }


  .intro__card { padding: 26px 22px 26px; }
  .intro h1 { font-size: 23px; }
}

@keyframes slide-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
