/* =============================================================================
   KELLER GRUNDBAU – Messe-Touchscreen
   ============================================================================= */

/* Schrift: Keller nutzt „Effra" (kommerziell). „Figtree" ist der offene,
   Effra-nahe Ersatz – bei Lizenz kann Effra hier eingesetzt werden. */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap');

:root {
  --navy:        #003366;
  --navy-dark:   #00274d;
  --navy-800:    #0a3f70;
  --gold:        #fdc600;
  --gold-dark:   #e0ad00;
  --steel:       #d2dbe4;
  --steel-light: #eef2f6;
  --paper:       #f1f3f5;
  --ink:         #333333;
  --white:       #ffffff;

  --radius:  0;
  --radius-lg: 0;
  --service-h: clamp(32px, 4vh, 40px);
  --header-h:  clamp(58px, 7vh, 80px);
  --topbar-h:  calc(var(--service-h) + var(--header-h));
  --font: 'Effra', 'Figtree', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;

  --shadow: none;
  --shadow-lg: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
}

body.hide-cursor,
body.hide-cursor * { cursor: none !important; }

img { -webkit-user-drag: none; user-drag: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* =============================================================================
   SERVICE-BAR + HEADER + NAVIGATION   (Aufbau analog kellergrundbau.de)
   ============================================================================= */

/* --- schmale dunkle Service-Leiste, Inhalt rechtsbündig -------------------- */
.servicebar {
  flex: 0 0 auto;
  height: var(--service-h);
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 clamp(14px, 2.4vw, 40px);
  z-index: 31;
}
.servicebar__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(12px, 1.05vw, 15px);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.92);
}
.servicebar__item svg { width: 1.15em; height: 1.15em; flex: 0 0 auto; }

/* --- weiße Kopfzeile: Logo | Navigation | Aktion -------------------------- */
.header {
  flex: 0 0 auto;
  height: var(--header-h);
  background: var(--white);
  color: var(--navy);
  display: flex;
  align-items: stretch;
  padding: 0 clamp(14px, 2.4vw, 40px);
  gap: clamp(12px, 2vw, 34px);
  border-bottom: 1px solid var(--steel);
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.brand__logo { height: clamp(26px, 3.4vh, 40px); width: auto; display: block; }

.nav {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: clamp(2px, 0.5vw, 8px);
  overflow: hidden;
}

.nav__btn {
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 0 clamp(10px, 1.3vw, 18px);
  border-radius: 0;
  border-bottom: 3px solid transparent;
  font-size: clamp(13px, 1.25vw, 18px);
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
/* Navigation wie kellergrundbau.de: reine Textlinks – Icons/Nummern aus */
.nav__btn svg,
.nav__btn .nav__nr { display: none; }
.nav__btn:hover { background: var(--steel-light); }
.nav__btn.is-active {
  color: var(--navy);
  font-weight: 700;
  border-bottom-color: var(--gold);
  background: transparent;
}

.header__actions { display: flex; align-items: center; flex: 0 0 auto; }

/* gold-eckiger Aktionsbutton mit navyfarbenem Pfeil-Tab (analog CTA) */
.cta-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  height: clamp(38px, 4.6vh, 48px);
  padding: 0 clamp(14px, 1.6vw, 22px) 0 clamp(26px, 2.6vw, 38px);
  border-radius: 0;
  background: var(--gold);
  color: var(--navy);
  font-family: inherit;
  font-size: clamp(13px, 1.2vw, 17px);
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s;
}
.cta-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: clamp(16px, 1.7vw, 24px);
  background: var(--navy);
  clip-path: polygon(0 0, 55% 0, 100% 50%, 55% 100%, 0 100%);
}
.cta-btn svg { width: 1.25em; height: 1.25em; flex: 0 0 auto; }
.cta-btn:hover { background: var(--gold-dark); }

@media (max-width: 900px) {
  .cta-btn span { display: none; }
  .cta-btn { padding-right: clamp(12px, 1.6vw, 18px); }
}

/* =============================================================================
   STAGE / VIEWS
   ============================================================================= */
.stage {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
}

.view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.view.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* --- HOME ------------------------------------------------------------------ */
.home {
  background:
    radial-gradient(120% 80% at 50% -10%, #ffffff 0%, var(--paper) 55%, var(--steel) 130%);
  padding: clamp(18px, 3.5vh, 48px) clamp(20px, 4vw, 72px) clamp(16px, 3vh, 40px);
  overflow-y: auto;
}
.home__head { text-align: center; margin-bottom: clamp(16px, 3vh, 40px); flex: 0 0 auto; }
.home__head h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(28px, 4.4vw, 60px);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.home__head p {
  margin: 8px 0 0;
  color: #5b6b7a;
  font-size: clamp(15px, 1.8vw, 24px);
  font-weight: 600;
}

.tiles {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: clamp(12px, 2vw, 30px);
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  align-content: center;
}

.tile {
  position: relative;
  background: var(--white);
  border-radius: 0;
  padding: clamp(18px, 2.6vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease;
  border: 1px solid var(--steel);
  min-height: 150px;
}
.tile::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--gold);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.2s ease;
}
.tile:hover { transform: translateY(-4px); border-color: var(--navy); }
.tile:active { transform: translateY(0) scale(0.99); }
.tile:hover::after { transform: scaleY(1); }

.tile__nr {
  position: absolute;
  right: clamp(14px, 1.8vw, 26px);
  top: clamp(10px, 1.4vw, 20px);
  font-size: clamp(30px, 4vw, 58px);
  font-weight: 800;
  color: var(--steel-light);
  line-height: 1;
}
.tile__icon {
  width: clamp(44px, 5vw, 68px);
  height: clamp(44px, 5vw, 68px);
  border-radius: 0;
  background: var(--navy);
  color: var(--white);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.tile__icon svg { width: 60%; height: 60%; }
.tile__title {
  font-size: clamp(19px, 2.2vw, 30px);
  font-weight: 800;
  color: var(--navy);
  margin-top: auto;
}
.tile__tagline {
  font-size: clamp(13px, 1.4vw, 18px);
  color: #6b7a88;
  font-weight: 600;
}

.home__foot {
  flex: 0 0 auto;
  text-align: center;
  padding-top: clamp(12px, 2vh, 28px);
  color: #8a99a6;
  font-size: 13px;
  font-weight: 600;
}

/* --- CONTENT VIEW -------------------------------------------------------- */
.content { background: var(--navy-dark); }

.content__bar {
  flex: 0 0 auto;
  height: clamp(52px, 6.5vh, 74px);
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(12px, 2vw, 26px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.back-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 800;
  font-size: clamp(14px, 1.5vw, 19px);
  padding: 11px clamp(14px, 1.8vw, 22px);
  border-radius: 0;
  min-height: 46px;
}
.back-btn svg { width: 1.2em; height: 1.2em; }
.content__title {
  font-weight: 800;
  font-size: clamp(15px, 1.7vw, 22px);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.content__title .nr { color: var(--gold); }
.content__spacer { flex: 1 1 auto; }

.bar-btn {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font-weight: 700;
  font-size: clamp(12px, 1.3vw, 16px);
  padding: 9px 16px;
  border-radius: 0;
  min-height: 40px;
}
.bar-btn:hover { background: var(--gold); color: var(--navy); }

.content__body {
  flex: 1 1 auto;
  position: relative;
  background: var(--navy-dark);
  overflow: hidden;
}
.content__body iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--white);
}

/* video */
.content__body video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* iframe blocked fallback */
.blocked {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 8vh 12vw;
  color: var(--white);
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
}
.blocked.is-visible { display: flex; }
.blocked svg { width: 64px; height: 64px; color: var(--gold); }
.blocked h3 { margin: 0; font-size: clamp(20px, 2.4vw, 30px); }
.blocked p { margin: 0; max-width: 640px; line-height: 1.55; color: rgba(255,255,255,0.8); font-size: clamp(14px,1.5vw,18px); }

/* =============================================================================
   YOUTUBE FACADE (performantes Embed)
   ============================================================================= */
.yt {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #000 center / cover no-repeat;
  cursor: pointer;
}
.yt::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0,0,0,0.15), rgba(0,0,0,0.5));
}
.yt__play {
  position: relative;
  width: clamp(80px, 9vw, 130px);
  height: clamp(80px, 9vw, 130px);
  border-radius: 0;
  background: var(--gold);
  display: grid;
  place-items: center;
  transition: transform 0.15s;
}
.yt:hover .yt__play { transform: scale(1.06); }
.yt__play svg { width: 42%; height: 42%; margin-left: 8%; color: var(--navy); }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* =============================================================================
   FLIPBOOK
   ============================================================================= */
.flip {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2vh, 26px);
  background:
    radial-gradient(120% 90% at 50% 0%, #0c477e 0%, var(--navy-dark) 70%);
}
.flip__stage {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.flip__book { touch-action: pan-y; }
.flip__book .page {
  background: var(--white);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
}
.flip__book .page img { width: 100%; height: 100%; display: block; }

.flip__controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 30px);
  margin-top: clamp(8px, 1.6vh, 20px);
  color: var(--white);
}
.flip__nav {
  width: clamp(52px, 6vw, 74px);
  height: clamp(52px, 6vw, 74px);
  border-radius: 0;
  background: rgba(255,255,255,0.12);
  display: grid;
  place-items: center;
  transition: background 0.15s, transform 0.15s;
}
.flip__nav svg { width: 44%; height: 44%; }
.flip__nav:hover { background: var(--gold); color: var(--navy); }
.flip__nav:active { transform: scale(0.94); }
.flip__nav[disabled] { opacity: 0.3; pointer-events: none; }
.flip__counter {
  font-weight: 800;
  font-size: clamp(14px, 1.6vw, 20px);
  min-width: 90px;
  text-align: center;
  letter-spacing: 0.03em;
}

.loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--white);
  gap: 18px;
  background: var(--navy-dark);
}
.loader.is-hidden { display: none; }
.loader__ring {
  width: 56px; height: 56px;
  border: 5px solid rgba(255,255,255,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.loader__text { font-weight: 700; letter-spacing: 0.04em; font-size: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

.flip__error {
  color: rgba(255,255,255,0.85);
  text-align: center;
  padding: 6vh 10vw;
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.6;
}
.flip__error strong { color: var(--gold); display: block; margin-bottom: 8px; font-size: 1.15em; }

/* =============================================================================
   ATTRACTION MODE (Screensaver)
   ============================================================================= */
.attraction {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
}
.attraction.is-active { display: flex; }
.attraction video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.attraction__hint {
  position: absolute;
  left: 0; right: 0; bottom: clamp(30px, 7vh, 80px);
  text-align: center;
  color: var(--white);
  font-size: clamp(18px, 2.4vw, 34px);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 24px rgba(0,0,0,0.6);
  animation: pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pulse { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }

/* animierte Ersatzgrafik, falls kein Video vorhanden */
.attraction__fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #001c38 60%, #000 100%);
  overflow: hidden;
}
.attraction__fallback.is-visible { display: flex; }
.attraction__fallback .kf-mark {
  width: min(38vw, 320px);
  color: var(--gold);
  animation: floaty 6s ease-in-out infinite;
  filter: drop-shadow(0 20px 60px rgba(253,198,0,0.25));
}
.attraction__fallback .kf-rings {
  position: absolute;
  width: 140vmax; height: 140vmax;
  background: repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,0.04) 0 2px, transparent 2px 90px);
  animation: spin 40s linear infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(-10px) rotate(-2deg); } 50% { transform: translateY(10px) rotate(2deg); } }

/* =============================================================================
   FULLSCREEN-HINWEIS
   ============================================================================= */
.fs-hint {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 40;
  background: var(--navy);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 0;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.fs-hint svg { width: 18px; height: 18px; color: var(--gold); }
.fs-hint.is-hidden { display: none; }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 1024px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .nav__btn { padding: 0 clamp(7px, 1vw, 12px); font-size: clamp(12px, 1.15vw, 16px); }
}
@media (max-width: 640px), (orientation: portrait) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .servicebar { display: none; }
}
@media (max-height: 560px) {
  .home { padding-top: 12px; padding-bottom: 8px; }
  .tile { min-height: 110px; }
}

/* Kein Fokus-Ring bei Touch, aber sichtbar bei Tastatur */
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
