@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --navy: #2a3c58;
  --navy-light: #3c5279;
  --navy-soft: #66799c;
  --red: #c8102e;
  --red-dark: #9c0c23;
  --bg: #f3f4f6;
  --card: #fbfbfc;
  --text: #384252;
  --text-light: #667085;
  --border: #e3e7ed;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-md: 0 4px 10px rgba(16,24,40,.06), 0 10px 24px rgba(16,24,40,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Carousel page lock: html/body don't scroll, the carousel viewport scrolls internally.
   The html-level lock is applied via a tiny inline script (see index.html) instead of
   a CSS :has() selector, because :has() support is inconsistent on older mobile
   browsers — without it the outer page could scroll instead of the carousel,
   which breaks the "jump to slide" navigation entirely. */
body.carousel-page {
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
html.carousel-lock { height: 100%; overflow: hidden; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header {
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 72px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-mark { display: flex; align-items: center; gap: 12px; }
.logo-svg { height: 40px; width: auto; }
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-text .name {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.7rem;
  letter-spacing: 0.01em;
  max-width: 235px;
}

nav ul { display: flex; align-items: center; gap: 30px; }
nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  transition: color .15s;
  position: relative;
}
nav a:not(.btn):after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--red);
  transition: width .2s;
}
nav a:not(.btn):hover { color: var(--red); }
nav a:not(.btn):hover:after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  min-width: 44px;
  min-height: 44px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--navy); border-radius: 2px; }

/* ===== Carousel ===== */
.carousel-viewport {
  height: calc(100vh - 72px);
  height: calc(100svh - 72px);
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  /* Smoothing is handled by JS (rAF) so it can suspend scroll-snap during
     programmatic navigation — CSS smooth-scroll would otherwise fight it,
     especially on iOS Safari. */
  scroll-behavior: auto;
  overscroll-behavior-y: contain;
}

.slide {
  min-height: calc(100vh - 72px);
  min-height: calc(100svh - 72px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  position: relative;
}

.slide > .container,
.slide > .hero-inner { width: 100%; }

.slide-alt { background: #eef0f3; }

.slide-label {
  position: absolute;
  top: 26px;
  right: 28px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  opacity: 0.6;
}
.hero .slide-label { color: rgba(255,255,255,.45); }

/* Dot navigation */
.carousel-nav {
  position: fixed;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.carousel-nav .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--navy-soft);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background .2s, border-color .2s, transform .2s;
  position: relative;
}
.carousel-nav .dot:hover { transform: scale(1.2); }
.carousel-nav .dot.active { background: var(--red); border-color: var(--red); transform: scale(1.25); }

.carousel-nav .dot .tip {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--navy);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.carousel-nav .dot:hover .tip { opacity: 1; }

.carousel-arrows {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.carousel-arrows button {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s, background .15s;
}
.carousel-arrows button:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); background: #fff; }
.carousel-arrows button:disabled { opacity: .35; cursor: default; transform: none; box-shadow: var(--shadow-sm); }
.carousel-arrows svg { width: 18px; height: 18px; }

@media (max-width: 720px) {
  .carousel-nav { right: 14px; gap: 12px; }
  .carousel-nav .dot .tip { display: none; }
  .carousel-arrows { right: 14px; bottom: 16px; }
  .slide-label { display: none; }
}

/* Hero */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--navy-light) 0%, var(--navy) 70%);
  color: #fff;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 40px 24px;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 50px;
  align-items: stretch;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  column-gap: 28px;
  row-gap: 18px;
  margin-top: 38px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,.14);
}
.hstat { display: flex; flex-direction: column; }
.hstat strong { font-size: 1.35rem; font-weight: 800; color: #fff; }
.hstat strong { color: #fff; }
.hstat span { font-size: 0.76rem; color: #aab7cc; margin-top: 2px; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffb3bd;
  margin-bottom: 20px;
  padding: 6px 14px;
  border: 1px solid rgba(255,179,189,.35);
  border-radius: 999px;
}

.hero h1 {
  font-size: clamp(2rem, 3.4vw, 2.7rem);
  font-weight: 800;
  line-height: 1.22;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.hero p {
  font-size: 1.05rem;
  color: #c9d2e0;
  max-width: 520px;
  margin-bottom: 34px;
}

.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  transition: transform .15s, box-shadow .15s, background .15s;
  border: none;
  cursor: pointer;
}
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(200,16,46,.28); }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-2px); }
.btn-outline { border: 1.5px solid rgba(255,255,255,.35); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.6); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-light); transform: translateY(-2px); }
.btn-block { width: 100%; justify-content: center; }

/* Hero visual — a fixed aspect-ratio everywhere is simpler and more
   predictable than trying to stretch the image to match the text column
   (that cross-referencing between grid/flex stretch and aspect-ratio is
   fragile and was the source of the mobile distortion bug). */
.hero-visual { position: relative; display: flex; align-items: center; justify-content: center; }
.hero-photo {
  position: relative;
  width: 100%;
  max-width: 420px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--shadow-md);
  aspect-ratio: 4 / 5;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  display: block;
}
.hero-photo-credit {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 0.62rem;
  color: rgba(255,255,255,.75);
  background: rgba(15,23,42,.45);
  padding: 3px 7px;
  border-radius: 4px;
  letter-spacing: 0.01em;
}
.hero-badge {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: var(--navy);
  border-radius: 10px;
  padding: 12px 20px;
  box-shadow: var(--shadow-md);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}
.hero-badge span { color: var(--red); }

/* Stats bar */
.stats-bar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.stats-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 24px;
}
.stat { text-align: center; padding: 0 12px; border-left: 1px solid var(--border); }
.stat:first-child { border-left: none; }
.stat .num { font-size: 1.7rem; font-weight: 800; color: var(--navy); }
.stat .num span { color: var(--red); }
.stat .label { font-size: 0.8rem; color: var(--text-light); margin-top: 4px; }

/* Section headings */
.section { padding: 84px 0; }
.section-alt { background: #eef0f3; }
.section-tight { padding-top: 60px; }

.eyebrow {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
  display: block;
}
.section-title { font-size: 2rem; font-weight: 800; color: var(--navy); margin-bottom: 16px; letter-spacing: -0.01em; }
.section-lead { color: var(--text-light); max-width: 660px; margin-bottom: 46px; font-size: 1.02rem; }

/* Cards grid */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card h3 { font-size: 1.12rem; color: var(--navy); margin-bottom: 12px; font-weight: 700; }
.card p { color: var(--text-light); font-size: 0.96rem; }

.icon-badge {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(200,16,46,.08);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.icon-badge svg { width: 24px; height: 24px; stroke: var(--red); }
.icon-badge.navy { background: rgba(22,35,59,.06); }
.icon-badge.navy svg { stroke: var(--navy); }

.service-list { margin-top: 8px; }
.service-list li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; font-weight: 600; color: var(--navy);
  border-bottom: 1px dashed var(--border); font-size: 0.95rem;
}
.service-list li:last-child { border-bottom: none; }
.service-list li::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); margin-top: 8px; flex-shrink: 0;
}

.map-illustration {
  width: 100%; height: 150px; border-radius: 10px;
  background: var(--bg); margin-top: 20px;
  display: flex; align-items: center; justify-content: center;
}

/* Referenzen */
.portal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: stretch; }

.quote-card {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #fff; border-radius: var(--radius);
  padding: 40px 34px; display: flex; flex-direction: column; justify-content: center;
  box-shadow: var(--shadow-md);
}
.quote-card .icon-badge { background: rgba(255,255,255,.12); }
.quote-card .icon-badge svg { stroke: #fff; }
.quote-card p { color: #dbe1ea; font-size: 1.08rem; line-height: 1.6; font-weight: 500; }
.quote-card .who { margin-top: 22px; font-size: 0.82rem; color: #9fb0cc; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

.partner-stack { display: flex; flex-direction: column; gap: 18px; }
.partner-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 26px; display: flex; align-items: center; gap: 18px;
  box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s;
}
.partner-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.partner-badge {
  font-weight: 800; font-size: 0.78rem; padding: 8px 14px; border-radius: 8px;
  flex-shrink: 0; white-space: nowrap;
}
.badge-bik { background: #f2f3f5; color: var(--navy); border: 1px solid var(--border); }
.badge-immowelt { background: #ffd300; color: #16233b; }
.partner-card strong { color: var(--navy); font-size: 1rem; }
.partner-card p { font-size: .87rem; color: var(--text-light); margin-top: 3px; }
.partner-card .arrow { margin-left: auto; color: var(--red); font-weight: 700; flex-shrink: 0; }

/* Mieter-Info */
.mieter-box {
  background: var(--navy); color: #fff; border-radius: var(--radius);
  padding: 46px; display: grid; grid-template-columns: 1fr 1fr; gap: 46px;
  box-shadow: var(--shadow-md);
}
.mieter-box .icon-badge { background: rgba(255,255,255,.1); margin-bottom: 18px; }
.mieter-box .icon-badge svg { stroke: #ffb3bd; }
.mieter-box h3 { color: #fff; margin-bottom: 12px; font-size: 1.15rem; font-weight: 700; }
.mieter-box p { color: #c6cedd; margin-bottom: 10px; font-size: 0.95rem; }
.mieter-box a.contact-link { color: #ffb3bd; font-weight: 700; }
.mieter-box ul { margin-top: 14px; }
.mieter-box ul li { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: #c6cedd; font-size: 0.92rem; }
.mieter-box ul li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ffb3bd; flex-shrink: 0; }

/* Kontakt */
.kontakt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 46px; align-items: start; }
.kontakt-item { display: flex; gap: 16px; margin-bottom: 24px; }
.kontakt-item .icon-badge { margin-bottom: 0; flex-shrink: 0; }
.kontakt-item .label { font-size: 0.8rem; color: var(--text-light); margin-bottom: 2px; }
.kontakt-item .value { font-weight: 700; color: var(--navy); font-size: 1rem; }
.kontakt-item .value:hover { color: var(--red); }

.map-wrap {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md);
  border: 1px solid var(--border); height: 260px;
}
.map-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }

.map-consent {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 28px;
  background: var(--bg);
}
.map-consent p {
  font-size: 0.86rem;
  color: var(--text-light);
  margin-bottom: 16px;
  max-width: 360px;
}
.map-consent p a { color: var(--red); font-weight: 600; }
.map-consent .btn { width: auto; padding: 11px 22px; }

.hours-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 28px; margin-top: 20px; box-shadow: var(--shadow-sm);
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
}
.hours-card .label { font-size: .8rem; color: var(--text-light); }
.hours-card .value { font-weight: 700; color: var(--navy); }

/* CTA band */
.cta-band {
  background: linear-gradient(120deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff; border-radius: var(--radius);
  padding: 44px 46px; display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; box-shadow: var(--shadow-md);
}
.cta-band h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.cta-band p { color: #ffd9de; font-size: .95rem; }
.cta-band .btn { background: #fff; color: var(--red-dark); }
.cta-band .btn:hover { background: #fdeef0; transform: translateY(-2px); }

/* Footer */
footer { background: var(--navy); color: #aab4c6; padding: 46px 0 28px; font-size: 0.86rem; }
footer.inline-footer {
  border-radius: var(--radius);
  padding: 38px 34px 26px;
  margin-top: 40px;
  box-shadow: var(--shadow-md);
}
.footer-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 30px; padding-bottom: 30px; margin-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-brand .logo-text .name { color: #fff; max-width: 260px; }
.footer-brand p { margin-top: 12px; color: #8b96ac; max-width: 320px; font-size: .85rem; }
.footer-col h4 { color: #fff; font-size: .85rem; margin-bottom: 14px; letter-spacing: .04em; text-transform: uppercase; }
.footer-col a, .footer-col p { display: block; color: #aab4c6; margin-bottom: 8px; font-size: .88rem; }
.footer-col a:hover { color: #fff; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a:hover { color: #fff; }

/* Impressum */
.impressum { padding: 60px 0 90px; max-width: 760px; margin: 0 auto; }
.impressum h2 { color: var(--navy); margin: 30px 0 10px; font-size: 1.1rem; font-weight: 700; }
.impressum p { margin-bottom: 10px; color: var(--text); }
.impressum a { color: var(--red); font-weight: 600; }
.placeholder { color: var(--text-light); font-style: italic; }

/* Responsive */
@media (max-width: 900px) {
  /* Slides taller than the viewport are common on mobile (stacked cards,
     kontakt grid + footer). "proximity" lets people scroll past a slide's
     midpoint without the snap fighting them, while still snapping cleanly
     when they're near a slide boundary. */
  .carousel-viewport { scroll-snap-type: y proximity; }

  /* More breathing room per section so content doesn't feel stacked
     edge-to-edge once slides grow taller than the viewport. */
  .slide { padding: 64px 0; }
  .slide.hero { padding: 0; }

  .hero-inner { grid-template-columns: 1fr; text-align: center; padding-bottom: 48px; }
  .hero p { margin-left: auto; margin-right: auto; }
  .hero-ctas { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { order: -1; margin-bottom: 10px; }
  .hero-photo { max-width: 300px; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); row-gap: 22px; }
  .stat:nth-child(3) { border-left: none; }
  .section-lead { margin-bottom: 40px; }
  .grid-3 { grid-template-columns: 1fr; gap: 36px; }
  .portal-grid { grid-template-columns: 1fr; gap: 36px; }
  .kontakt-grid { grid-template-columns: 1fr; gap: 48px; }
  .mieter-box { grid-template-columns: 1fr; padding: 32px 26px; gap: 40px; }
  .partner-stack { gap: 22px; }
  footer.inline-footer { margin-top: 56px; }
  .cta-band { justify-content: center; text-align: center; }
}

@media (max-width: 720px) {
  #navList {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; flex-direction: column; align-items: flex-start;
    padding: 20px 24px; gap: 16px; border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: none;
  }
  #navList.open { display: flex; }
  .nav-toggle { display: flex; }
  nav ul:not(#navList) { gap: 14px; }

  /* Bigger touch targets for the carousel controls */
  .carousel-nav { gap: 18px; }
  .carousel-nav .dot { width: 16px; height: 16px; }
  .carousel-arrows { gap: 10px; }
  .carousel-arrows button { width: 44px; height: 44px; }
  .carousel-arrows svg { width: 20px; height: 20px; }
}

@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .header-inner { padding: 0 16px; }
  .logo-text .name { font-size: 0.62rem; max-width: 165px; }
  .logo-svg { height: 34px; }

  .hero-inner { padding: 28px 18px 40px; }
  .hero h1 { font-size: 1.6rem; }
  .hero p { font-size: 0.96rem; }
  .hero-eyebrow { font-size: 0.68rem; padding: 5px 12px; }
  .hero-photo { max-width: 260px; }
  .hero-stats { column-gap: 22px; row-gap: 16px; }
  .hstat strong { font-size: 1.15rem; }

  .slide { padding: 52px 0; }
  .section-title { font-size: 1.55rem; }
  .section-lead { margin-bottom: 36px; font-size: 0.96rem; }
  .eyebrow { margin-bottom: 8px; }

  .card { padding: 24px 20px; }
  .grid-3 { gap: 28px; }
  .portal-grid { gap: 28px; }
  .quote-card { padding: 28px 22px; }
  .partner-card { padding: 20px 18px; gap: 14px; }
  .partner-stack { gap: 18px; }
  .mieter-box { padding: 26px 20px; gap: 32px; }
  .kontakt-grid { gap: 36px; }
  .kontakt-item { gap: 12px; margin-bottom: 20px; }
  .map-wrap { height: 220px; }
  .map-consent { padding: 20px; }
  .map-consent .btn { width: 100%; }
  .hours-card { padding: 20px; }
  footer.inline-footer { padding: 28px 20px 20px; margin-top: 44px; }
  .footer-brand .logo-text .name { max-width: 200px; }

  .slide-label { display: none; }
}
