@media (min-width: 992px) {
  .hero-section {
    margin-bottom: 15rem;
  }
}

/* Haus ragt auf dem Desktop über die Hero-Section hinaus */
.hero-section .image {
  display: block;
  position: relative;
  height: clamp(16rem, 80vw, 32rem);

  #start_house {
    position: absolute;
    right: 0;
    bottom: 0;
    height: 100%;
    width: 100%;
  }
}

@media (max-width: 991.98px) {
  .hero-section .image #start_house img {
    width: 100%;
    height: 100%;
    max-height: none;
  }
}

@media (min-width: 992px) {
  .hero-section .image {
    position: static;
    height: 100%;

    #start_house {
      height: 140%;
      /* Breite höchstens ~55vw, damit der Titel auf kleineren Desktops frei bleibt */
      max-height: min(60rem, calc(55vw / var(--ratio, 1)));
      min-height: 20rem;
      width: auto;
      max-width: none;
      bottom: auto;
      /* auf schmalen Desktops (bis ~1500px) etwas tiefer, damit der Titel
         in der freien Ecke oben links steht */
      top: calc(50% - 12rem + clamp(0px, (1500px - 100vw) * 0.4, 7rem));
    }

    img {
      max-width: unset;
    }
  }
}

:root {
  --fs-h1: clamp(2.2rem, 12vw - 0.4rem, 4.5rem);
}

@media (min-width: 992px) {
  :root {
    --fs-h1: clamp(3rem, 6.67vw, 7rem);
  }
}

/* Icons: gleiche Höhe statt %-Breite, damit sie auf jedem Bildschirm
   gleich gross wirken */
.features {
  padding: 0 clamp(1rem, 2vw, 2.5rem);
  margin-bottom: 3rem;

  img {
    margin: 0 auto 1.5rem;
    display: block;
    object-fit: contain;
    width: auto;
    max-width: 100%;
    height: clamp(8rem, 5rem + 5vw, 12rem);
  }

  /* Dach ist sehr breit: in der Breite begrenzen, Höhe bleibt gleich */
  .dach {
    max-width: clamp(9rem, 6rem + 5vw, 14rem);
  }

  h3 {
    text-align: center;
  }
  p {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
  }
}

@media (min-width: 768px) {
  .features {
    margin-bottom: 0;
  }
}

.fact-wrapper {
  row-gap: 0.5rem;

  .text {
    color: var(--bg-primary);
    font-size: 1.5rem;
    text-align: right;
    font-weight: 500;
    margin: 0;
  }

  .number {
    font-size: 7rem;
    font-weight: 600;
  }

  .fact {
    margin: 0 0 0 2rem;
    color: var(--brand-yellow);
    font-size: 3rem;
    font-weight: 600;
  }
}

@media (max-width: 767.98px) {
  .fact-wrapper {
    margin-bottom: 2.5rem;

    > div {
      justify-content: center;
    }

    .text {
      text-align: center;
    }

    .fact {
      margin: 0;
      text-align: center;
    }
  }
}

section.kontakt {
  display: flex;
  justify-content: center;

  .col-12 {
    margin: 5rem -1.5px;
    border: 3px solid var(--border-metal);
  }

  h2 {
    font-weight: 600;
    text-align: center;
    margin: 2.5rem 0 1.5rem;
  }

  p {
    text-align: center;
    font-weight: 500;
    font-size: 1.3rem;
    width: 90%;
    margin: 1rem auto;
  }

  .button {
    margin: 1rem auto 2.5rem;
  }

  a {
    transition: all 0.3s;
  }
  a:hover {
    opacity: 0.7;
    transform: scale(1.05);
  }
  .tel {
    text-decoration: none;
    color: var(--brand-blue);
    font-size: 4.5rem;
    font-weight: 600;
    text-align: center;
  }

  .email-link {
    text-decoration: none;
    color: var(--text-grey);
    font-size: 1.7rem;
    font-weight: 600;
    text-align: center;
    overflow-wrap: anywhere;
  }
}

/* Mobile: eine Box, oben Text, unten Telefon/E-Mail */
@media (max-width: 767.98px) {
  section.kontakt {
    .col-12 {
      margin: 0;
    }

    .col-12:first-child {
      margin-top: 2rem;
      border-bottom: none;
    }

    .col-12:last-child {
      margin-bottom: 2rem;
      border-top: none;
      padding-bottom: 2.5rem;
    }

    .button {
      margin-bottom: 1.5rem;
    }
  }
}

/* Dienstleistungs-Karussell (JS: js/service_marquee.js) */
section.service-marquee {
  padding-left: 0;
  padding-right: 0;

  .marquee {
    overflow: hidden;
    padding: 1rem 0;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%);
  }

  /* Reduzierte Bewegung: nicht animieren, von Hand scrollbar */
  .marquee.is-static {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .marquee-track {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    will-change: transform;
  }

  .marquee-item {
    position: relative;
    flex: 0 0 auto;
    height: 20rem;
    aspect-ratio: 4 / 3;
    border-radius: 1em;
    overflow: hidden;
    background: var(--bg-grey);
    scroll-snap-align: center;

    .img-wrapper,
    .img-small,
    .lazy-img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .lazy-img {
      transition: opacity 1s ease, transform 0.6s cubic-bezier(0.3, 1, 0.8, 1);
    }
  }

  .marquee-item:hover .lazy-img,
  .marquee-item:focus-visible .lazy-img {
    transform: scale(1.06);
  }

  .marquee-item:focus-visible {
    outline: 3px solid var(--brand-yellow);
    outline-offset: -3px;
  }

  .marquee-title {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    padding: 3rem 1.5rem 1.2rem;
    background: linear-gradient(to top, rgb(21 21 18 / 0.85) 0%, transparent 100%);
    color: var(--text-light);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(1rem);
    transition: opacity 0.35s ease, transform 0.35s ease;

    &::after {
      content: "";
      display: block;
      width: 2.5rem;
      height: 4px;
      margin-top: 0.5rem;
      border-radius: 2px;
      background: var(--brand-yellow);
    }
  }

  .marquee-item:hover .marquee-title,
  .marquee-item:focus-visible .marquee-title {
    opacity: 1;
    transform: none;
  }

  /* Touch hat kein Hover: Titel immer zeigen */
  @media (hover: none) {
    .marquee-title {
      opacity: 1;
      transform: none;
    }
  }

  .button {
    margin: 2.5rem auto 0;
  }
}

@media (max-width: 767px) {
  section.service-marquee {
    .marquee-item {
      height: 14rem;
    }

    .marquee-title {
      font-size: 1.4rem;
      padding: 2rem 1rem 0.9rem;
    }
  }
}

/* Mobile: Schriften verkleinern (Desktop-Werte siehe oben) */
@media (max-width: 767.98px) {
  .fact-wrapper {
    .number {
      font-size: 4.5rem;
    }

    .fact {
      font-size: 2rem;
    }
  }

  section.kontakt {
    .tel {
      font-size: 2.6rem;
    }

    .email-link {
      font-size: 1.3rem;
    }
  }
}
