/* ============================================================
   BaWeRa Hausverwaltung GmbH — Stylesheet
   Corporate Design: Grün #2D6619 / Schwarz #000000 / Bahnschrift
   ============================================================ */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--color-primary, #2d6619);
  outline-offset: 2px;
  border-radius: 4px;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

:root {
  --color-primary: #2d6619;
  --color-primary-dark: #204c12;
  --color-primary-light: #eaf3e6;
  --color-black: #000000;
  --color-text: #1c1e1b;
  --color-text-muted: #55594f;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f6f4;
  --color-border: #e2e5de;
  --font-family: "Bahnschrift", "Segoe UI", Roboto, Arial, sans-serif;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 10px 30px rgba(15, 26, 8, 0.08);
  --shadow-sm: 0 4px 14px rgba(15, 26, 8, 0.06);
  --max-width: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-black);
  overflow-wrap: anywhere;
  hyphens: auto;
}

h1 { font-size: clamp(1.9rem, 4vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.75em;
}

.section {
  padding: 88px 0;
}

.section--alt {
  background: var(--color-bg-alt);
}

.section-head {
  max-width: 680px;
  margin: 0 0 48px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.lead {
  font-size: 1.15rem;
  color: var(--color-text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, background 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.96);
  transition-duration: 0.08s;
}

.btn-outline {
  background: transparent;
  border-color: var(--color-black);
  color: var(--color-black);
}

.btn-outline:hover {
  background: var(--color-black);
  color: #fff;
  transform: translateY(-2px);
}

.btn-outline:active {
  transform: translateY(0) scale(0.96);
  transition-duration: 0.08s;
}

.btn-outline.on-dark {
  border-color: #fff;
  color: #fff;
}

.btn-outline.on-dark:hover {
  background: #fff;
  color: var(--color-black);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: 0 6px 20px rgba(15, 26, 8, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  transition: padding 0.25s ease;
}

.site-header.scrolled .header-inner {
  padding: 8px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(-6px);
  animation: brandIn 0.5s ease 0.05s forwards;
}

@keyframes brandIn {
  to { opacity: 1; transform: translateY(0); }
}

.brand img {
  height: 44px;
  width: auto;
  transition: height 0.25s ease;
}

.site-header.scrolled .brand img {
  height: 34px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav ul {
  display: flex;
  gap: 4px;
}

.main-nav a {
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--color-text);
  transition: background 0.15s ease, color 0.15s ease;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.header-cta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 26px;
  height: 2px;
  background: var(--color-black);
  border-radius: 2px;
}

/* Hero */
.hero {
  padding: 76px 0 96px;
  background:
    radial-gradient(circle at 85% 10%, var(--color-primary-light) 0%, transparent 55%),
    var(--color-bg);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.hero-inner > div {
  min-width: 0;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.hero-meta {
  display: flex;
  gap: 32px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.hero-meta > div {
  min-width: 0;
}

.hero-meta div strong {
  display: block;
  font-size: 1.5rem;
  color: var(--color-primary);
}

.hero-meta div span {
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.hero-visual svg,
.hero-visual img {
  width: 100%;
  max-width: 420px;
  height: auto;
}

/* Logo im Hero: schwebt sanft, blendet beim Laden ein und bekommt einmal einen Lichtreflex */
.hero-visual:not(.has-photo) {
  animation: heroFloat 6s ease-in-out 1.4s infinite;
}

.hero-visual:not(.has-photo) img {
  opacity: 0;
}

.hero-visual:not(.has-photo).play img {
  animation: logoIn 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Glanz: liegt über dem Bild, sichtbar nur innerhalb der Logo-Form (Maske = Logo selbst) */
.hero-visual:not(.has-photo)::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(100%, 420px);
  aspect-ratio: 852 / 654;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.85) 50%, transparent 62%) no-repeat;
  background-size: 250% 100%;
  background-position: 130% 0;
  -webkit-mask: url("../img/logo-hero.png") center / contain no-repeat;
  mask: url("../img/logo-hero.png") center / contain no-repeat;
}

.hero-visual:not(.has-photo).play::after {
  animation: logoShine 1.3s ease-in-out 0.9s both;
}

@keyframes logoIn {
  from { opacity: 0; transform: translateY(16px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

@keyframes logoShine {
  0% { opacity: 1; background-position: 130% 0; }
  100% { opacity: 1; background-position: -30% 0; }
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-visual:not(.has-photo),
  .hero-visual:not(.has-photo).play img,
  .hero-visual:not(.has-photo).play::after { animation: none; }
  .hero-visual:not(.has-photo) img { opacity: 1; }
  .hero-visual:not(.has-photo)::after { display: none; }
}

/* Cards grid */
.grid {
  display: grid;
  gap: 28px;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease, border-color 0.28s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--color-primary-light);
}

.card:hover .card-icon {
  transform: scale(1.1) rotate(-6deg);
  background: var(--color-primary);
  color: #fff;
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--color-primary);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease, color 0.25s ease;
}

.card-icon svg {
  width: 26px;
  height: 26px;
}

.card a.card-link {
  display: inline-block;
  margin-top: 8px;
  font-weight: 700;
  color: var(--color-primary);
}

/* Pillars (Warum BaWeRa) */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.pillar {
  padding: 8px;
}

.pillar .num {
  display: block;
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-primary);
  letter-spacing: 0.02em;
  margin: 20px 0 8px;
}

.pillar .feature-visual {
  margin-bottom: 4px;
}

/* Feature split (image/text alternating) */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.feature + .feature {
  margin-top: 88px;
}

.feature.reverse .feature-visual {
  order: 2;
}

.feature-visual {
  background: var(--color-primary-light);
  border-radius: var(--radius-lg);
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-visual svg,
.feature-visual img {
  width: 100%;
  max-width: 280px;
  height: auto;
}

.lead--strong {
  color: var(--color-black);
  font-weight: 700;
}

blockquote.quote {
  border-left: 4px solid var(--color-primary);
  padding: 4px 0 4px 24px;
  font-size: 1.3rem;
  font-style: normal;
  font-weight: 600;
  color: var(--color-black);
  margin: 24px 0;
}

/* CTA band */
.cta-band {
  background: var(--color-black);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 56px;
  text-align: center;
  margin: 0 24px;
}

.cta-band h2,
.cta-band p {
  color: #fff;
}

.cta-band .btn-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* Footer */
.site-footer {
  background: #0e130a;
  color: #cfd6c8;
  padding: 64px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-grid h4 {
  color: #fff;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 18px;
}

.footer-grid img {
  height: 40px;
  margin-bottom: 14px;
}

.footer-grid ul li {
  margin-bottom: 2px;
}

.footer-grid a {
  display: inline-block;
  padding: 8px 0;
}

.footer-grid a:hover {
  color: #fff;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom ul {
  display: flex;
  gap: 20px;
}

.footer-bottom a {
  display: inline-block;
  padding: 8px 0;
}

/* Page hero (inner pages) */
.page-hero {
  padding: 56px 0 64px;
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

/* Leistungen list */
.service-block {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 24px;
  padding: 36px 0;
  border-bottom: 1px solid var(--color-border);
}

/* Leistungen mit Illustration: Icon | Text | Szene */
.service-block:has(.feature-visual) {
  grid-template-columns: 60px 1fr minmax(0, 440px);
  gap: 24px 40px;
  align-items: center;
}

.service-block:has(.feature-visual) .card-icon {
  align-self: start;
}

.service-block .feature-visual {
  min-width: 0;
}

@media (max-width: 1100px) {
  .service-block:has(.feature-visual) {
    grid-template-columns: 60px 1fr minmax(0, 340px);
    gap: 24px 28px;
  }
}

.service-block:last-child {
  border-bottom: none;
}

.service-block .card-icon {
  margin-bottom: 0;
}

.service-block ul {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}

.service-block ul li {
  padding-left: 22px;
  position: relative;
  color: var(--color-text-muted);
}

.service-block ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
}

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

.team-card {
  text-align: center;
  padding: 36px 24px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.team-avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--color-primary-dark);
}

.team-card .role {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

/* Contact info card (im Kontakt-Panel sowie in der Einsatzgebiet-Karte auf "Über uns") */
.contact-info-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  padding: 36px;
}

.contact-info-card .row {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}

.contact-info-card .row .card-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  margin-bottom: 0;
}

.contact-info-card .row .card-icon svg {
  width: 20px;
  height: 20px;
}

.map-frame {
  margin-top: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.map-frame iframe {
  width: 100%;
  height: 260px;
  border: 0;
  display: block;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

input, textarea, select {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.98rem;
  background: #fff;
  color: var(--color-text);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

textarea {
  resize: vertical;
  min-height: 140px;
}

/* Kontakt-Panel (slide-in von rechts, ersetzt die frühere Kontakt-Seite) */
.kontakt-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(14, 19, 10, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.kontakt-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.kontakt-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(440px, 100%);
  background: #fff;
  box-shadow: -20px 0 50px rgba(15, 26, 8, 0.18);
  padding: 48px 36px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.kontakt-overlay.open .kontakt-panel {
  transform: translateX(0);
}

.kontakt-panel h2 {
  margin-top: 0;
}

.kontakt-panel .contact-info-card {
  margin-top: 24px;
  padding: 24px;
}

.kontakt-panel-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.kontakt-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text);
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.25s ease;
}

.kontakt-close:hover {
  background: var(--color-black);
  color: #fff;
  transform: rotate(90deg);
}

.kontakt-close svg {
  width: 18px;
  height: 18px;
}

body.kontakt-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .kontakt-overlay,
  .kontakt-panel {
    transition: none;
  }
}

@media (max-width: 480px) {
  .kontakt-panel {
    width: 100%;
    padding: 40px 22px;
  }
}

/* Legal pages */
.legal-content h2 {
  margin-top: 2em;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p, .legal-content li {
  color: var(--color-text-muted);
  white-space: pre-line;
}

.legal-content ul {
  margin: 1em 0;
  padding-left: 1.2em;
  list-style: disc;
}

.legal-note {
  background: #fff7e0;
  border: 1px solid #f0d98c;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 0.9rem;
  margin-bottom: 32px;
}

/* Responsive */
@media (max-width: 960px) {
  .hero-inner,
  .feature,
  .feature.reverse .feature-visual {
    grid-template-columns: 1fr;
  }

  .feature.reverse .feature-visual {
    order: 0;
  }

  .grid-3,
  .pillars,
  .team-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .service-block,
  .service-block:has(.feature-visual) {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .service-block .feature-visual {
    max-width: 520px;
  }

  .service-block ul {
    grid-template-columns: 1fr;
  }

  .main-nav { display: none; }

  .nav-toggle { display: flex; }

  .site-header.nav-open .main-nav {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 16px 24px 24px;
    border-bottom: 1px solid var(--color-border);
    animation: navSlideDown 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: top center;
  }

  @keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-8px) scaleY(0.96); }
    to { opacity: 1; transform: translateY(0) scaleY(1); }
  }

  .nav-toggle span {
    transition: transform 0.25s ease, opacity 0.2s ease;
  }

  .site-header.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  .site-header.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .site-header.nav-open .main-nav ul {
    flex-direction: column;
    width: 100%;
  }

  .site-header.nav-open .main-nav a {
    display: block;
    font-size: 1.15rem;
    padding: 14px 18px;
  }

  .header-cta .btn-primary { display: none; }
}

@media (max-width: 720px) {
  .grid-3, .grid-2, .pillars, .team-grid {
    grid-template-columns: 1fr;
  }

  .cta-band {
    padding: 40px 24px;
    margin: 0 16px;
  }

  .section {
    padding: 64px 0;
  }
}

/* Illustrierte Szenen (Beirat, Eigentümerversammlung): Ebenen-PNGs, die beim Einblenden nacheinander erscheinen */
.feature-visual[data-scene] {
  padding: 0;
  overflow: hidden;
}

.scene {
  --slow: 2.5; /* Aufbau-Animationen der Szenen 2,5x so langsam (ca. 3 Sekunden länger) */
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  cursor: pointer;
}

.scene .l {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  transform-origin: var(--ox, 50%) var(--oy, 50%);
  pointer-events: none;
}

:is(.feature, .service-block, .pillar).reveal:not(.visible) .scene .l {
  opacity: 0;
}

:is(.feature, .service-block, .pillar).visible .scene .l-bg {
  animation: sceneFade calc(0.9s * var(--slow, 1)) ease calc(var(--d, 0s) * var(--slow, 1)) both;
}

:is(.feature, .service-block, .pillar).visible .scene .l-table {
  animation: sceneTable calc(0.7s * var(--slow, 1)) cubic-bezier(0.22, 1, 0.36, 1) calc(var(--d, 0s) * var(--slow, 1)) both;
}

:is(.feature, .service-block, .pillar).visible .scene .l-person {
  animation: scenePerson calc(0.75s * var(--slow, 1)) cubic-bezier(0.34, 1.45, 0.64, 1) calc(var(--d, 0s) * var(--slow, 1)) both;
}

:is(.feature, .service-block, .pillar).visible .scene .l-bubble,
:is(.feature, .service-block, .pillar).visible .scene .l-badge {
  animation:
    scenePop calc(0.6s * var(--slow, 1)) cubic-bezier(0.34, 1.7, 0.64, 1) calc(var(--d, 0s) * var(--slow, 1)) both,
    sceneBob 3.4s ease-in-out calc((var(--d, 0s) + 0.9s) * var(--slow, 1)) infinite alternate;
}

/* Weitere Ebenen-Typen: Balken wachsen, Linien zeichnen sich, Zahnrad dreht sich, Funkwellen pulsieren */
:is(.feature, .service-block, .pillar).visible .scene .l-grow {
  animation: sceneGrow calc(0.8s * var(--slow, 1)) cubic-bezier(0.22, 1, 0.36, 1) calc(var(--d, 0s) * var(--slow, 1)) both;
}

:is(.feature, .service-block, .pillar).visible .scene .l-wipe {
  animation: sceneWipe calc(0.9s * var(--slow, 1)) ease calc(var(--d, 0s) * var(--slow, 1)) both;
}

:is(.feature, .service-block, .pillar).visible .scene .l-spin {
  animation:
    scenePop calc(0.6s * var(--slow, 1)) cubic-bezier(0.34, 1.7, 0.64, 1) calc(var(--d, 0s) * var(--slow, 1)) both,
    sceneSpin var(--spin, 24s) linear calc((var(--d, 0s) + 0.6s) * var(--slow, 1)) infinite;
}

:is(.feature, .service-block, .pillar).visible .scene .l-pulse {
  animation:
    scenePop calc(0.6s * var(--slow, 1)) cubic-bezier(0.34, 1.7, 0.64, 1) calc(var(--d, 0s) * var(--slow, 1)) both,
    scenePulse 2.2s ease-in-out calc((var(--d, 0s) + 0.8s) * var(--slow, 1)) infinite;
}

@keyframes sceneGrow {
  from { opacity: 0; transform: scaleY(0); }
  to { opacity: 1; transform: none; }
}

@keyframes sceneWipe {
  from { opacity: 1; clip-path: inset(0 100% 0 0); }
  to { opacity: 1; clip-path: inset(0 0 0 0); }
}

@keyframes sceneSpin {
  /* beide Werte ausdrücklich als rotate(): mit "none" als Startwert rechnet der Browser gar keine Drehung */
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

:is(.feature, .service-block, .pillar).visible .scene .l-slide {
  animation: sceneSlide calc(1s * var(--slow, 1)) cubic-bezier(0.22, 1, 0.36, 1) calc(var(--d, 0s) * var(--slow, 1)) both;
}

/* Wasserwaage: kippelt kurz und pendelt sich waagerecht ein */
:is(.feature, .service-block, .pillar).visible .scene .l-level {
  animation: sceneLevel calc(1.4s * var(--slow, 1)) ease-out calc(var(--d, 0s) * var(--slow, 1)) both;
}

@keyframes sceneLevel {
  0% { opacity: 0; transform: rotate(-9deg) translateY(-16px); }
  15% { opacity: 1; }
  35% { transform: rotate(6deg); }
  55% { transform: rotate(-3deg); }
  75% { transform: rotate(1.4deg); }
  100% { opacity: 1; transform: none; }
}

@keyframes sceneSlide {
  from { opacity: 0; transform: translateX(80px); }
  to { opacity: 1; transform: none; }
}

@keyframes scenePulse {
  0%, 100% { opacity: 1; transform: none; }
  50% { opacity: 0.4; transform: scale(1.05); }
}

/* Logo-Wechsel (Über uns): Rahman-Logo -> BaWeRa-Logo mit Übergang von links nach rechts, BaWeRa bleibt stehen */
.scene .l-edge {
  inset: auto;
  top: 12%;
  bottom: 12%;
  left: 0;
  width: 5px;
  height: auto;
  border-radius: 3px;
  background: linear-gradient(to bottom, transparent, rgba(45, 102, 25, 0.95) 30%, rgba(45, 102, 25, 0.95) 70%, transparent);
  box-shadow: 0 0 18px 6px rgba(45, 102, 25, 0.4);
  transform: translateX(-50%);
  opacity: 0;
}

:is(.feature, .service-block, .pillar).visible .scene[data-swap] .l-old {
  animation:
    sceneFade 0.8s ease 0s both,
    swapOut 1.5s cubic-bezier(0.65, 0, 0.35, 1) 2.2s both;
}

:is(.feature, .service-block, .pillar).visible .scene[data-swap] .l-new {
  animation: swapIn 1.5s cubic-bezier(0.65, 0, 0.35, 1) 2.2s both;
}

:is(.feature, .service-block, .pillar).visible .scene[data-swap] .l-edge {
  animation: swapEdge 1.5s cubic-bezier(0.65, 0, 0.35, 1) 2.2s both;
}

@keyframes swapOut {
  from { clip-path: inset(0 0 0 0); }
  to { clip-path: inset(0 0 0 100%); }
}

@keyframes swapIn {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

@keyframes swapEdge {
  0% { left: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .scene[data-swap] .l-old,
  .scene[data-swap] .l-edge { display: none; }
  .scene[data-swap] .l-new { animation: none !important; clip-path: none; }
}

@keyframes sceneFade {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes sceneTable {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: none; }
}

@keyframes scenePerson {
  from { opacity: 0; transform: translateY(46px) scale(0.92); }
  to { opacity: 1; transform: none; }
}

@keyframes scenePop {
  from { opacity: 0; transform: scale(0); }
  to { opacity: 1; transform: none; }
}

@keyframes sceneBob {
  from { transform: translateY(0); }
  to { transform: translateY(-5px); }
}

@media (prefers-reduced-motion: reduce) {
  :is(.feature, .service-block, .pillar).reveal:not(.visible) .scene .l { opacity: 1; }
  :is(.feature, .service-block, .pillar).visible .scene .l { animation: none; }
}

/* Feature-Bild mit Logo (Über uns): Lichtreflex, sobald der Abschnitt eingeblendet wird */
.feature-visual[data-shine]:not(.has-photo) {
  position: relative;
}

.feature-visual[data-shine]:not(.has-photo)::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(280px, calc(100% - 96px));
  aspect-ratio: 852 / 654;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.85) 50%, transparent 62%) no-repeat;
  background-size: 250% 100%;
  background-position: 130% 0;
  -webkit-mask: url("../img/logo-hero.png") center / contain no-repeat;
  mask: url("../img/logo-hero.png") center / contain no-repeat;
}

.feature.visible .feature-visual[data-shine]:not(.has-photo)::after {
  animation: logoShine 1.3s ease-in-out 0.6s both;
}

@media (prefers-reduced-motion: reduce) {
  .feature-visual[data-shine]::after { display: none; }
}

/* Kleine Handys: lange Wörter wie "Eigentümergemeinschaft" müssen in die Zeile passen */
@media (max-width: 480px) {
  h1 { font-size: 7.3vw; }
}

/* Eigene Bilder (über admin.html hochgeladen) */
.hero-visual.has-photo img {
  max-width: 520px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: none;
}

.feature-visual.has-photo {
  padding: 0;
  overflow: hidden;
}

.feature-visual.has-photo img {
  max-width: none;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.team-avatar.has-photo {
  overflow: hidden;
}

.team-avatar.has-photo img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
