/* ——— Leistungen „Future“: CSS-Variablen, Glas-Karten, Ambiente, CTAs ——— */
#leistungen {
  --leistung-blue: #3b82f6;
  --leistung-blue-soft: rgba(59, 130, 246, 0.35);
  --leistung-blue-deep: rgba(30, 64, 175, 0.55);
  --leistung-green: #34d399;
  --leistung-green-soft: rgba(52, 211, 153, 0.38);
  --leistung-green-deep: rgba(5, 150, 105, 0.5);
  --leistung-orange: #f59e0b;
  --leistung-orange-soft: rgba(245, 158, 11, 0.4);
  --leistung-orange-deep: rgba(180, 83, 9, 0.55);
  --leistung-atm-core: rgba(59, 130, 246, 0.22);
  --leistung-atm-edge: rgba(15, 23, 42, 0.65);
  position: relative;
  isolation: isolate;
}

.leistungen-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 95% 55% at 50% 42%, var(--leistung-atm-core), transparent 62%),
    radial-gradient(ellipse 120% 80% at 50% 120%, var(--leistung-atm-edge), transparent 55%);
  transition: background 1.1s cubic-bezier(0.25, 0.1, 0.25, 1);
}

#leistungen.leistung-theme-blue {
  --leistung-atm-core: rgba(59, 130, 246, 0.26);
  --leistung-atm-edge: rgba(15, 23, 42, 0.72);
}
#leistungen.leistung-theme-green {
  --leistung-atm-core: rgba(52, 211, 153, 0.22);
  --leistung-atm-edge: rgba(15, 23, 42, 0.75);
}
#leistungen.leistung-theme-orange {
  --leistung-atm-core: rgba(245, 158, 11, 0.2);
  --leistung-atm-edge: rgba(28, 25, 23, 0.78);
}
#leistungen.leistung-theme-slate {
  --leistung-atm-core: rgba(148, 163, 184, 0.14);
  --leistung-atm-edge: rgba(10, 10, 10, 0.82);
}
#leistungen.leistung-theme-ember {
  --leistung-atm-core: rgba(251, 146, 60, 0.2);
  --leistung-atm-edge: rgba(14, 116, 144, 0.55);
}

.leistung-panel {
  position: relative;
  z-index: 1;
}

/* Dach + SHK: gesamten Zweispalter-Block im Viewport zentrieren (Desktop) */
@media (min-width: 1024px) {
  html.kapitel-fullflip-root #leistung-dach.snap-section.leistung-panel,
  html.kapitel-fullflip-root #leistung-shk.snap-section.leistung-panel {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh;
    min-height: 100svh;
  }

  html.kapitel-fullflip-root #leistung-dach .leistung-panel-inner,
  html.kapitel-fullflip-root #leistung-shk .leistung-panel-inner {
    width: 100%;
    flex: 0 0 auto;
    margin-top: auto !important;
    margin-bottom: auto !important;
    align-self: center;
    padding-top: clamp(1rem, 2.5vh, 2rem) !important;
    padding-bottom: clamp(1rem, 2.5vh, 2rem) !important;
  }

  html.kapitel-fullflip-root #leistung-dach .leistung-panel-inner > .grid,
  html.kapitel-fullflip-root #leistung-shk .leistung-panel-inner > .grid {
    align-items: center;
  }
}

/* Mobil: Text oben, Kacheln darunter – kein Viewport-Zentrieren */
@media (max-width: 1023px) {
  html.kapitel-fullflip-root #leistung-dach.snap-section.leistung-panel,
  html.kapitel-fullflip-root #leistung-shk.snap-section.leistung-panel {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
  }

  html.kapitel-fullflip-root #leistung-dach .leistung-panel-inner,
  html.kapitel-fullflip-root #leistung-shk .leistung-panel-inner {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    width: 100%;
    align-self: stretch;
    padding-top: 1rem !important;
    padding-bottom: 1.15rem !important;
  }

  html.kapitel-fullflip-root #leistung-dach .leistung-panel-inner > .grid,
  html.kapitel-fullflip-root #leistung-shk .leistung-panel-inner > .grid {
    align-items: start;
    gap: 1.35rem;
  }
}

.leistung-panel-inner {
  position: relative;
  z-index: 2;
}


.leistung-bg-photo {
  transform: translateZ(0);
}

/* Split-Headline Zeichen */
.leistung-char-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.02em;
}
.leistung-char {
  display: inline-block;
}

.leistung-headline-sub {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.48);
}


/* Glas-Karten Pro */
.leistung-glass-card {
  --card-accent: var(--leistung-blue);
  --mx: 50%;
  --my: 50%;
  position: relative;
  cursor: pointer;
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.35s ease;
}


.leistung-glass-card[data-accent="blue"] {
  --card-accent: var(--leistung-blue);
}
.leistung-glass-card[data-accent="green"] {
  --card-accent: var(--leistung-green);
}
.leistung-glass-card[data-accent="orange"] {
  --card-accent: var(--leistung-orange);
}
.leistung-glass-card[data-accent="slate"] {
  --card-accent: #94a3b8;
}

.leistung-glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    280px circle at var(--mx) var(--my),
    rgba(255, 255, 255, 0.14),
    transparent 52%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}
.leistung-glass-card:hover::before {
  opacity: 1;
}

/* Animierter Rand-Glow („Border Beam“-Feeling, GPU-freundlich) */
.leistung-glass-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  background: linear-gradient(
    120deg,
    transparent 0%,
    transparent 38%,
    rgba(255, 255, 255, 0.35) 50%,
    var(--card-accent) 52%,
    rgba(255, 255, 255, 0.25) 56%,
    transparent 68%
  );
  background-size: 260% 260%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  padding: 1px;
  transition: opacity 0.25s ease;
}
.leistung-glass-card:hover::after {
  opacity: 1;
  animation: leistung-border-sweep 2.2s ease-in-out infinite;
}

@keyframes leistung-border-sweep {
  0% {
    background-position: 140% 50%;
  }
  100% {
    background-position: -40% 50%;
  }
}

.leistung-card-inner {
  position: relative;
  z-index: 2;
}
.leistung-tile-deck {
  display: block;
  font-size: 0.62rem;
  line-height: 1.35;
  margin-top: 0.4rem;
  color: rgba(255, 255, 255, 0.48);
  font-weight: 400;
  letter-spacing: 0.01em;
}
@media (min-width: 640px) {
  .leistung-tile-deck {
    font-size: 0.68rem;
  }
}

.leistung-glass-card svg {
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}

.leistung-glass-card:hover svg {
  color: var(--card-accent);
  filter: drop-shadow(0 0 10px var(--card-accent));
  animation: leistung-icon-pulse 1.1s ease-in-out infinite;
}

@keyframes leistung-icon-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

/* CTA Glow unter dem Button */
#leistungen .leistung-cta {
  position: relative;
  z-index: 2;
  overflow: visible;
}
#leistungen .leistung-cta::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 70%;
  height: 22px;
  transform: translateX(-50%) scale(0.85);
  background: radial-gradient(ellipse closest-side, var(--cta-glow, rgba(59, 130, 246, 0.45)), transparent 100%);
  opacity: 0;
  filter: blur(10px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: -1;
}
#leistungen .leistung-cta:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1.05);
}

#leistungen .leistung-panel[data-leistung-accent="blue"] .leistung-cta {
  --cta-glow: rgba(59, 130, 246, 0.55);
}
#leistungen .leistung-panel[data-leistung-accent="green"] .leistung-cta {
  --cta-glow: rgba(52, 211, 153, 0.5);
}
#leistungen .leistung-panel[data-leistung-accent="orange"] .leistung-cta {
  --cta-glow: rgba(245, 158, 11, 0.5);
}
#leistungen .leistung-panel[data-leistung-accent="slate"] .leistung-cta {
  --cta-glow: rgba(148, 163, 184, 0.42);
}
#leistungen .leistung-panel[data-leistung-accent="ember"] .leistung-cta {
  --cta-glow: rgba(56, 189, 248, 0.48);
}

/* Mit JS: Start unsichtbar, nach Intro sichtbar. Ohne JS: kein Flash */
#leistungen .leistung-animate {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}
#leistungen:not(.leistungen-js-ready) .leistung-animate {
  opacity: 1;
  visibility: visible;
}
#leistungen.leistungen-js-ready .leistung-animate {
  opacity: 0;
  visibility: hidden;
}
#leistungen.leistungen-js-ready .leistung-panel.leistung-intro-complete .leistung-animate {
  opacity: 1;
  visibility: visible;
}

/* Mobile: etwas luftiger */
@media (max-width: 640px) {
  #leistungen .leistung-card-grid {
    gap: 0.65rem;
  }
  .leistung-glass-card {
    border-radius: 0.85rem;
    padding: 1rem !important;
  }
}

/* Überschreibt globales .sub-tile:hover (Gold) für Leistungs-Glas */
#leistungen .leistung-glass-card.sub-tile:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}

#leistungen .leistung-cta span {
  position: relative;
  z-index: 1;
}

/* ——— Kontakt-Seite: gleiche Glas-/Glow-Logik wie Leistungs-Bento ——— */
.kontakt-glass-card {
  --card-accent: #3b82f6;
  --mx: 50%;
  --my: 50%;
  position: relative;
  cursor: default;
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.2);
  transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.35s ease;
}
.kontakt-glass-card[data-accent="blue"] {
  --card-accent: #3b82f6;
}
.kontakt-glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(280px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.12), transparent 52%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}
.kontakt-glass-card:hover::before {
  opacity: 1;
}
.kontakt-glass-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  background: linear-gradient(
    120deg,
    transparent 0%,
    transparent 38%,
    rgba(255, 255, 255, 0.28) 50%,
    var(--card-accent) 52%,
    rgba(255, 255, 255, 0.2) 56%,
    transparent 68%
  );
  background-size: 260% 260%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  padding: 1px;
  transition: opacity 0.25s ease;
}
.kontakt-glass-card:hover::after {
  opacity: 1;
  animation: leistung-border-sweep 2.2s ease-in-out infinite;
}
.kontakt-glass-card--form > form,
.kontakt-glass-card--form > .success-msg {
  position: relative;
  z-index: 2;
}
.kontakt-glass-card--form > form ~ .success-msg {
  z-index: 2;
}
.kontakt-glass-card:not(.kontakt-glass-card--form) > * {
  position: relative;
  z-index: 2;
}
.kontakt-landing .kontakt-glass-card .kontakt-aside-icon {
  color: #93c5fd;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(30, 64, 175, 0.25));
}

.kontakt-glass-chip {
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.9);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
.kontakt-glass-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(100px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.15), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.kontakt-glass-chip:hover::before {
  opacity: 0.7;
}
@media (max-width: 640px) {
  .kontakt-landing .kontakt-glass-card {
    border-radius: 0.85rem;
  }
}

/* Startseite Kontakt: heller Hintergrund wie „Unsere Geschichte“ */
.kontakt-landing--light .kontakt-glass-card {
  background: rgba(255, 255, 255, 0.78) !important;
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 10px 32px rgba(15, 23, 42, 0.07) !important;
}
.kontakt-landing--light .kontakt-glass-card .kontakt-aside-icon {
  color: #1d4ed8;
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.1), rgba(59, 130, 246, 0.16));
}
.kontakt-landing--light .kontakt-glass-card:hover::before,
.kontakt-landing--light .kontakt-glass-card:hover::after {
  opacity: 0.65;
}
.kontakt-landing--light .kontakt-glass-chip {
  color: #475569;
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

/* ——— Helle Sektionen: Bento-Glas (Team, Geschichte) ——— */
.bento-glass-card {
  --card-accent: #3b82f6;
  --mx: 50%;
  --my: 50%;
  position: relative;
  isolation: isolate;
  cursor: default;
}
.bento-glass-card[data-accent="slate"] {
  --card-accent: #94a3b8;
}
.bento-glass-card[data-accent="orange"] {
  --card-accent: #f59e0b;
}
.bento-glass-card[data-accent="blue"] {
  --card-accent: #3b82f6;
}
.bento-glass-card[data-accent="ember"] {
  --card-accent: #38bdf8;
}
.bento-glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(300px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.65), transparent 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}
.bento-glass-card:hover::before {
  opacity: 0.75;
}
.bento-glass-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  background: linear-gradient(
    120deg,
    transparent 0%,
    transparent 36%,
    rgba(255, 255, 255, 0.55) 50%,
    var(--card-accent) 52%,
    rgba(255, 255, 255, 0.4) 56%,
    transparent 68%
  );
  background-size: 260% 260%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  padding: 1px;
  transition: opacity 0.25s ease;
}
.bento-glass-card:hover::after {
  opacity: 1;
  animation: leistung-border-sweep 2.2s ease-in-out infinite;
}
.bento-glass-card > * {
  position: relative;
  z-index: 2;
}
.geschichte-bento-card .btn-primary {
  position: relative;
  z-index: 2;
}

/* Leistungs-Kacheln: Icon + Text in der Box zentriert (Dach, Sanierung, SHK) */
#leistung-dach .leistung-card-inner,
#leistung-sanierung .leistung-card-inner,
#leistung-shk .leistung-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#leistung-dach .leistung-glass-card.sub-tile i,
#leistung-dach .leistung-glass-card.sub-tile svg,
#leistung-sanierung .leistung-glass-card.sub-tile i,
#leistung-sanierung .leistung-glass-card.sub-tile svg,
#leistung-shk .leistung-glass-card.sub-tile i,
#leistung-shk .leistung-glass-card.sub-tile svg {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

#leistung-dach .leistung-glass-card.sub-tile p,
#leistung-sanierung .leistung-glass-card.sub-tile p,
#leistung-shk .leistung-glass-card.sub-tile p {
  width: 100%;
  text-align: center;
}

@media (max-width: 1023px) {
  .leistung-panel .leistung-panel-inner .grid {
    gap: 1.35rem;
  }
}
