/* ==========================================================
   Einheitlicher Hintergrund – Schrader Betreuung
   Datei: css/hintergrund.css

   Wirkung:
   - Hintergrundbild kleiner und rechtsbündig
   - leicht schräg und räumlich im Hintergrund
   - zum letzten Buchstaben hin kleiner und blasser
   - deutlicher Milchglas-Effekt
   ========================================================== */

:root {
  --hintergrundbild: url("../assets/Hintergrund.png");
}

/* ----------------------------------------------------------
   Gemeinsame Grundlage aller Hero-Bereiche
   ---------------------------------------------------------- */

.startseite .hero,
.leistungen-hero,
.kontakt-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: #ffffff;
}

/* Der eigentliche Seiteninhalt bleibt über dem Hintergrund. */
.startseite .hero > *,
.leistungen-hero > *,
.kontakt-hero > * {
  position: relative;
  z-index: 2;
}

/* ----------------------------------------------------------
   Hintergrundbild
   ---------------------------------------------------------- */

.startseite .hero::before,
.leistungen-hero::before,
.kontakt-hero::before {
  content: "";
  position: absolute;
  top: 45px;
  right: 0;
  z-index: 0;

  width: 620px;
  height: 420px;

  pointer-events: none;

  background-image: var(--hintergrundbild);
  background-repeat: no-repeat;
  background-position: right center;
  background-size: contain;

  /* Die rechte Kante bleibt beim Verkleinern rechtsbündig. */
  transform-origin: right center;
  transform:
    perspective(1100px)
    rotateY(17deg)
    rotateZ(-4deg)
    scale(0.96);

  opacity: 0.66;
  filter:
    blur(0.8px)
    saturate(0.72)
    contrast(0.92)
    brightness(1.05);

  /* Weiches Verblassen im Bereich des letzten Buchstabens. */
  -webkit-mask-image: linear-gradient(
    90deg,
    #000000 0%,
    #000000 58%,
    rgba(0, 0, 0, 0.96) 66%,
    rgba(0, 0, 0, 0.76) 76%,
    rgba(0, 0, 0, 0.48) 87%,
    rgba(0, 0, 0, 0.24) 100%
  );
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: 100% 100%;

  mask-image: linear-gradient(
    90deg,
    #000000 0%,
    #000000 58%,
    rgba(0, 0, 0, 0.96) 66%,
    rgba(0, 0, 0, 0.76) 76%,
    rgba(0, 0, 0, 0.48) 87%,
    rgba(0, 0, 0, 0.24) 100%
  );
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: 100% 100%;
}

/* ----------------------------------------------------------
   Milchglasscheibe und Aufhellung
   ---------------------------------------------------------- */

.startseite .hero::after,
.leistungen-hero::after,
.kontakt-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;

  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.96) 38%,
    rgba(255, 255, 255, 0.76) 58%,
    rgba(255, 255, 255, 0.42) 78%,
    rgba(255, 255, 255, 0.08) 100%
  );

  -webkit-backdrop-filter: blur(1.5px);
  backdrop-filter: blur(1.5px);
}

/* ----------------------------------------------------------
   Tablet
   ---------------------------------------------------------- */

@media (max-width: 1000px) {
  .startseite .hero::before,
  .leistungen-hero::before,
  .kontakt-hero::before {
    top: 48px;
    right: 0;
    width: 540px;
    height: 380px;

    background-position: right center;

    transform:
      perspective(1000px)
      rotateY(15deg)
      rotateZ(-3deg)
      scale(0.95);
  }
}

/* ----------------------------------------------------------
   Kleines Tablet und Smartphone
   ---------------------------------------------------------- */

@media (max-width: 700px) {
  .startseite .hero::before,
  .leistungen-hero::before,
  .kontakt-hero::before {
    top: 58px;
    right: 0;
    width: 430px;
    height: 320px;

    background-position: right center;

    transform:
      perspective(900px)
      rotateY(13deg)
      rotateZ(-2deg)
      scale(0.94);

    opacity: 0.54;
  }

  .startseite .hero::after,
  .leistungen-hero::after,
  .kontakt-hero::after {
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(255, 255, 255, 0.92) 45%,
      rgba(255, 255, 255, 0.66) 72%,
      rgba(255, 255, 255, 0.16) 100%
    );
  }
}

/* ----------------------------------------------------------
   Sehr kleine Smartphones
   ---------------------------------------------------------- */

@media (max-width: 430px) {
  .startseite .hero::before,
  .leistungen-hero::before,
  .kontakt-hero::before {
    top: 72px;
    right: 0;
    width: 360px;
    height: 270px;

    background-position: right center;

    transform:
      perspective(800px)
      rotateY(11deg)
      rotateZ(-2deg)
      scale(0.93);

    opacity: 0.46;
  }
}