/* ==========================================================================
   Websulting – Responsive Anpassungen
   Breakpoints: 1400 / 1100 / 900 / 640 (siehe variables.css)
   ========================================================================== */

/* ---------- Große Bildschirme: Leistungspanels stapeln sich beim Scrollen ---------- */
@media (min-width: 1100px) and (min-height: 860px) {
  .service {
    position: sticky;
    top: calc(var(--header-h) + var(--subnav-h) + 1.25rem + var(--stack-i, 0) * 0.9rem);
    box-shadow: 0 -24px 50px -34px rgba(31, 24, 35, 0.45);
  }
  .service:nth-child(2) { --stack-i: 1; }
  .service:nth-child(3) { --stack-i: 2; }
  .service:nth-child(4) { --stack-i: 3; }
}

/* ---------- unter 1560px: Telefonnummer im Header wird zum runden Knopf ---------- */
@media (max-width: 1559px) {
  .header-phone span { display: none; }
  .header-phone {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--c-orange-tint);
    color: var(--c-orange-hover);
  }
  .site-header__end { gap: 0.9rem; }
}

/* ---------- unter 1400px: Hero-Themen ohne Icons, damit neun Begriffe in eine Reihe passen ---------- */
@media (max-width: 1399px) {
  .funnel__topics .icon { display: none; }
}

/* ---------- unter 1280px: Hero-Themen umbrechen, Linienbündel in kompakter Form ---------- */
@media (max-width: 1279px) {
  .funnel__topics { display: flex; flex-wrap: wrap; justify-content: center; max-width: 44rem; }
  .funnel__topics li { padding-inline: 1em; }
  .funnel__topics .icon { display: block; }
  .funnel__lines { display: none; }
  .funnel__lines--compact { display: block; width: min(100%, 34rem); height: 60px; margin-top: 10px; }
}

/* ---------- unter 1200px ---------- */
@media (max-width: 1199px) {
  .logo img { height: 68px; }
  .nav-pill__link { padding-inline: 0.9em; }
  .mega__inner { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mega__aside { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 1.5rem; }
  .mega__aside-cta { margin: 0 0 0 auto; padding: 0; white-space: nowrap; }
  .clients__grid { --per-row: 6; }
  .header-social { display: none; }
}

/* ---------- unter 1100px: zweispaltige Sektionen werden einspaltig ---------- */
@media (max-width: 1099px) {
  /* Header: Anfrage-Knopf weicht, die Kapsel bleibt */
  .site-header__end .btn { display: none; }
  .site-header__inner { gap: 1rem; }
  .nav-pill__link { padding-inline: 0.75em; font-size: 1rem; }
  .logo img { height: 60px; }

  .one-hand__grid,
  .difference__grid,
  .personal__grid,
  .why__grid,
  .faq__grid,
  .region__grid,
  .contact__card,
  .service {
    grid-template-columns: minmax(0, 1fr);
  }

  .service { min-height: 0; align-items: start; }
  .service__visual { max-width: 34rem; width: 100%; margin-inline: auto; }
  .cloudviz,
  .serpviz { margin-inline: auto; }
  .webviz { margin-inline: auto; }

  .why__intro,
  .faq__intro { position: static; }

  .personal__photo { max-width: 34rem; }
  .personal__blocks { right: 0; left: 6%; }

  .system { width: min(100%, 36rem); }
  .map { max-width: 34rem; }

  /* Hero: Themen in zwei Reihen, Linienbündel wird zu einer Linie */

  .more { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- unter 900px: Kapsel-Navigation weicht dem Menü-Knopf ---------- */
@media (max-width: 899px) {
  .nav-pill,
  .mega,
  .section-nav { display: none; }
  .clients__grid { --per-row: 4; }

  /* Logo links, Telefon und Menü-Knopf rechts */
  .site-header__inner { grid-template-columns: 1fr auto auto; gap: 0.6rem; }
  .site-header__start,
  .site-header__end { display: contents; }
  .logo { order: 1; justify-self: start; }
  .header-phone { order: 2; }
  .menu-toggle { display: grid; order: 3; width: 52px; height: 52px; }
  .header-phone { width: 52px; height: 52px; }
  .site-header__end .btn { display: none; }
  .logo img { height: 56px; }

  /* Menü kommt auf kleinen Geräten von rechts und füllt den Bildschirm */
  .menu__panel { width: 100%; margin-left: auto; transform: translateX(100%); }
  @starting-style {
    .menu[open] .menu__panel { transform: translateX(100%); }
  }

  .hero__card { border-radius: var(--r-lg); }

  .section-head--split { flex-direction: column; align-items: flex-start; }
  .cta-row { flex-direction: column; align-items: flex-start; }

  .projects__grid { gap: 2.5rem 1.25rem; }
  .project,
  .project--wide,
  .project--narrow { grid-column: 1 / -1; }
  .project--narrow:nth-child(2) { margin-top: 0; }
  .project__arrow { width: 44px; height: 44px; }

  /* Zusammenarbeit: senkrechte Zeitleiste */
  .steps { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .steps::before,
  .steps::after {
    top: 29px;
    right: auto;
    bottom: 60px;
    left: 29px;
    width: 2px;
    height: auto;
    transform-origin: 50% 0;
  }
  .steps::after { transform: scaleY(1); }
  .steps.is-waiting::after { transform: scaleY(0); }
  .step { display: grid; grid-template-columns: 60px minmax(0, 1fr); column-gap: 1.25rem; }
  .step__num { grid-row: span 2; }
  .step h3 { margin-top: 0.35rem; }
  .step p { max-width: none; }

  .industry { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
  .industry .industry__clients { text-align: left; }

  .news__grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 2.25rem; }
  .post--lead { grid-row: auto; }
  .post--row + .post--row { padding-top: 2.25rem; }

  /* Zusammenarbeit: ein durchgehender Grund, keine sichtbare Naht im Seitenrand */
  .process { background: none; }
}

/* ---------- unter 640px: Smartphones ---------- */
@media (max-width: 639px) {
  :root {
    --fs-display: clamp(1.75rem, 9vw, 3.25rem);
    --r-xl: 28px;
    --r-lg: 22px;
  }

  .hero { padding-inline: 0.75rem; }
  .funnel__lines--compact { height: 52px; }
  .hero__card { padding: 3rem 1rem 1.5rem; }
  .hero__title { line-height: 1.02; }
  .hero__actions { flex-direction: column; gap: 0.9rem; }
  .hero__actions .btn { width: 100%; }
  .funnel__topics { gap: 6px; }
  .funnel__topics li { font-size: 0.8125rem; padding: 0.45em 0.9em; }
  .funnel__topics .icon { display: none; }

  .btn { white-space: normal; text-align: center; }

  .ticks { grid-template-columns: minmax(0, 1fr); }
  .bubble { max-width: 94%; }

  .service { padding: 1.5rem 1.25rem 1.75rem; }
  /* Themen als umbrechende Schlagworte statt zweispaltiger Liste */
  .service__topics { display: flex; flex-wrap: wrap; gap: 6px; columns: auto; border-top: 0; }
  .service__topics li { padding: 0.35em 0.85em; border: 1px solid var(--service-line); border-radius: var(--r-pill); font-size: 0.875rem; }
  .cloudviz__apps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cloudviz__places li { flex-direction: column; font-size: 0.8125rem; border-radius: var(--r-md); }

  .cta-row__actions,
  .cta-row__actions .btn { width: 100%; }

  .system__nodes li { padding: 0.45rem 0.7rem; font-size: 0.75rem; }
  .system__nodes .icon { display: none; }

  .personal__photo { margin-bottom: 0; }
  .personal__blocks {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    grid-template-columns: minmax(0, 1fr);
    margin: -2.5rem 0.75rem 0;
  }
  .personal__contact .btn { width: 100%; }

  .clients__grid { --per-row: 3; --gap: 8px; }
  .clients__grid li { padding: 0.7rem 0.5rem; }

  .why__row { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }

  .post--row a { grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); align-items: start; }
  .post--row h4 { font-size: 1.0625rem; }

  /* Diagramme: Beschriftungen bleiben auf dem Smartphone lesbar (mind. 12px) */
  .netviz text { font-size: 20px; }
  .netviz .netviz__side { font-size: 21px; }
  .netviz .netviz__side--muted { display: none; }
  .map__city text { font-size: 28px; }
  .map__city--minor text { font-size: 21px; }
  .map__home text { font-size: 32px; }

  .form__submit { padding-inline: 1rem; font-size: 1rem; }

  .faq__answer { padding-right: 0; }
  .faq__list summary { gap: 1rem; }

  .contact__card { padding: 2.25rem 1.25rem 1.25rem; }
  .form__row { grid-template-columns: minmax(0, 1fr); }
  .contact__details a { font-size: 1.0625rem; }

  .menu__groups { grid-template-columns: minmax(0, 1fr); }
  .site-footer__claim { font-size: clamp(1.75rem, 9vw, 3.25rem); }
  .site-footer__grid { grid-template-columns: minmax(0, 1fr); }
}
