/* Service detail pages – Figma "1b · Leistungs-Unterseiten" (04a–04g).
   Sections alternate light / dark ([data-theme="dark"] = Dark mode of the semantic tokens). */

.service-section {
  --pad-top: var(--space-96);
  --pad-bottom: var(--space-96);
  padding: var(--pad-top) max(var(--layout-margin), (100% - var(--layout-content)) / 2) var(--pad-bottom);
  background: var(--color-surface-base);
  color: var(--color-text-primary);
}

/* "Worauf wir vertrauen" + "Zusammenarbeit" read as one block (Website & Shop) */
.service-section--tight-bottom { --pad-bottom: var(--space-24); }
.service-section--tight-top { --pad-top: var(--space-24); }

/* ---------- Hero (835:4616) ---------- */

.service-hero {
  display: flex;
  gap: var(--space-64);
  align-items: center;
  padding: calc(var(--header-height) + var(--space-48)) max(var(--layout-margin), (100% - var(--layout-content)) / 2) var(--space-96);
  background: var(--color-surface-base);
}

.service-hero__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-32);
  align-items: flex-start;
  min-width: 0;
}

.service-hero__lead {
  color: var(--color-text-secondary);
}

.service-hero__pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.pill--quiet {
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
}

.service-hero__graphic {
  flex-shrink: 0;
  width: min(560px, 45%);
}

.service-graphic {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Projekte dazu (855:19968) ---------- */

.service-projects {
  display: flex;
  flex-direction: column;
  gap: var(--space-48);
}

.service-projects__head {
  display: flex;
  gap: var(--space-24);
  align-items: center;
  justify-content: space-between;
}

/* 282 × 376 tiles (portrait tile scaled), tilted, overlapping by 20 */
.service-projects__tiles {
  --s: 0.7833;
  display: flex;
  justify-content: center;
}

.service-projects__item {
  --rotate: 0deg;
  position: relative;
  flex-shrink: 0;
  width: calc(360px * var(--s));
  height: calc(480px * var(--s));
  rotate: var(--rotate);
  transition: rotate 0.7s var(--ease-calm), translate 0.7s var(--ease-calm), scale 0.7s var(--ease-calm);
}

.service-projects__item + .service-projects__item {
  margin-left: calc(-1 * var(--space-24));
}

.service-projects__item:nth-child(4n + 1) { --rotate: 3deg; }
.service-projects__item:nth-child(4n + 2) { --rotate: -2deg; }
.service-projects__item:nth-child(4n + 3) { --rotate: 1.5deg; }
.service-projects__item:nth-child(4n + 4) { --rotate: -2.5deg; }

.service-projects__item .project-tile {
  transform: scale(var(--s));
  transform-origin: top left;
}

@media (hover: hover) {
  .service-projects__item:hover,
  .service-projects__item:focus-within {
    z-index: 2;
    rotate: 0deg;
    translate: 0 calc(-1 * var(--space-16));
    scale: 1.04;
  }
}

/* ---------- Ablauf (836:13789) ---------- */

.service-process {
  display: flex;
  gap: var(--space-96);
  align-items: flex-start;
}

.service-process__intro {
  position: sticky;
  top: calc(var(--header-height) + var(--space-32));
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-24);
  min-width: 0;
}

.service-process__intro .text-body {
  color: var(--color-text-secondary);
}

.service-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  width: min(720px, 60%);
}

/* Prozess-Schritt (835:4611): like a service card without arrow */
.service-step {
  display: flex;
  gap: var(--space-24);
  align-items: flex-start;
  padding: var(--space-32);
  border-radius: var(--radius-24);
  background: var(--color-surface-raised);
}

.service-step__number {
  flex-shrink: 0;
  width: 56px;
  color: var(--color-text-accent);
}

.service-step__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  min-width: 0;
}

.service-step__content .text-body {
  color: var(--color-text-secondary);
}

.service-step__title {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8) var(--space-16);
  align-items: center;
}

.service-step__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--color-interactive-primary);
}

.service-rounds {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--color-text-secondary);
}

.service-rounds--small {
  width: 14px;
  height: 14px;
}

/* ---------- Beispiel-Timeline (836:13825) ---------- */

.service-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.service-timeline__text {
  max-width: 760px;
  color: var(--color-text-secondary);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding: var(--space-32);
  border-radius: var(--radius-24);
  background: var(--color-surface-raised);
}

.timeline__row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-16);
  align-items: center;
}

.timeline__label {
  display: flex;
  gap: var(--space-8);
  align-items: center;
}

.timeline__cells {
  display: grid;
  grid-template-columns: repeat(var(--columns), 1fr);
  gap: var(--space-4);
}

.timeline__unit {
  color: var(--color-text-tertiary);
  text-align: center;
}

.timeline__cell {
  height: 20px;
  border-radius: var(--radius-4);
}

.timeline__cell--studio {
  background: var(--color-interactive-primary);
}

.timeline__cell--client {
  background: var(--color-core-surface-linen);
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8) var(--space-24);
}

.timeline-legend li {
  display: flex;
  gap: var(--space-8);
  align-items: center;
  color: var(--color-text-secondary);
}

.timeline-legend__swatch {
  width: 24px;
  height: 12px;
  border-radius: var(--radius-8);
}

.service-timeline__note {
  color: var(--color-text-tertiary);
}

/* ---------- Worauf wir vertrauen (839:4589) ---------- */

.service-tech {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
}

.service-tech__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-24);
}

.info-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  padding: var(--space-48);
  border-radius: var(--radius-24);
  background: var(--color-surface-raised);
}

.info-card__logo {
  display: block;
  align-self: flex-start;
  width: auto;
  height: 42px;
  margin-bottom: var(--space-8);
}

.info-card__logo--kirby svg {
  width: 36px;
  height: 42px;
  color: var(--color-text-primary);
}

.info-card .text-body {
  color: var(--color-text-secondary);
}

.info-card__list {
  color: var(--color-text-secondary);
}

/* ---------- Zusammenarbeit (846:4691) + Lieferumfang (846:4872) ---------- */

.service-delivery {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.role-card {
  display: flex;
  gap: var(--space-64);
  align-items: flex-start;
  padding: var(--space-48);
  border-radius: var(--radius-24);
  background: var(--color-surface-base);
  color: var(--color-text-primary);
}

.role-card__statement {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-24);
  min-width: 0;
}

.role-card__statement .text-body,
.role-card__label {
  color: var(--color-text-secondary);
}

.role-card__needs {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-16);
  min-width: 0;
}

.role-card__list li {
  display: flex;
  gap: var(--space-16);
  align-items: center;
  padding-block: var(--space-16);
  border-top: 1px solid var(--color-text-primary);
}

.role-card__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--color-interactive-primary);
}

.deliverables {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
  padding: var(--space-48);
  border-radius: var(--radius-24);
  background: var(--color-surface-raised);
}

.deliverables__top {
  display: flex;
  gap: var(--space-64);
  align-items: flex-start;
}

.deliverables__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  width: min(420px, 40%);
  flex-shrink: 0;
}

.deliverables__text .text-body {
  color: var(--color-text-secondary);
}

.deliverables__lists {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-24);
  min-width: 0;
}

.deliverables__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

/* Listenpunkt (862:4778): always = filled circle, optional = 1.5 px outline */
.deliverable {
  display: flex;
  gap: var(--space-16);
  align-items: center;
}

.deliverable__number {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--color-text-primary);
  border-radius: var(--radius-pill);
  background: var(--color-text-primary);
  color: var(--color-surface-base);
  font-size: 1rem;
}

.deliverable--optional .deliverable__number {
  background: transparent;
  color: var(--color-text-primary);
}

.rights-box {
  display: flex;
  gap: var(--space-16);
  align-items: flex-start;
  padding: var(--space-24);
  border-radius: var(--radius-16);
  background: var(--color-surface-base);
}

.rights-box > div {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.rights-box .text-body {
  color: var(--color-text-secondary);
}

.rights-box__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--color-interactive-primary);
}

.deliverables__graphic {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
}

/* ---------- Gut zu wissen (840:15052) ---------- */

.service-faq {
  display: flex;
  gap: var(--space-96);
  align-items: flex-start;
}

.service-faq > .text-h2 {
  flex: 1;
}

.service-faq .faq {
  width: min(720px, 60%);
}

/* ---------- Hier können wir Dich auch unterstützen (864:4838) ---------- */

.service-next {
  display: flex;
  flex-direction: column;
  gap: var(--space-48);
  background: var(--color-surface-warm);
}

/* full-bleed section: head and track carry the gutter themselves, so the track can run to the window edge */
.service-next.service-section {
  --gutter: max(var(--layout-margin), (100% - var(--layout-content)) / 2);
  padding-inline: 0;
}

.service-next__head {
  padding-inline: var(--gutter);
  display: flex;
  gap: var(--space-24);
  align-items: flex-end;
  justify-content: space-between;
}

.service-next__nav {
  display: flex;
  flex-shrink: 0;
  gap: var(--space-8);
}

/* slider: three cards in view, the row runs out to the window edge; scroll-snap, arrows on desktop */
.service-next__cards {
  display: flex;
  gap: var(--space-24);
  padding: var(--space-8) var(--gutter) var(--space-16);
  overflow-x: auto;
  scroll-padding-inline: var(--gutter);
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.service-next__cards::-webkit-scrollbar {
  display: none;
}

.service-next__cards li {
  display: flex;
  flex: 0 0 calc((100% - 2 * var(--space-24)) / 3);
  scroll-snap-align: start;
}

/* built like the service card: whole card is the link, hover lightens the surface */
.next-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-24);
  padding: var(--space-32);
  border-radius: var(--radius-24);
  background: var(--color-surface-raised);
  color: var(--color-text-primary);
  text-decoration: none;
  transition: background-color 0.3s var(--ease-out-soft), translate 0.5s var(--ease-pop);
}

.next-card .text-body {
  color: var(--color-text-secondary);
}

.next-card__head {
  display: flex;
  gap: var(--space-16);
  align-items: center;
}

.next-card__arrow {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--color-fixed-dark);
  color: var(--color-fixed-light);
}

.next-card__arrow .icon {
  width: 20px;
  height: 20px;
}

.next-card:hover,
.next-card:focus-visible {
  background: var(--color-surface-base);
  translate: 0 calc(-1 * var(--space-4));
}


/* ---------- Fixed CTA ---------- */

.service-fixed-cta {
  /* full-width row, centred content: a left:50% box would only get half the width and squeeze the arrow */
  position: fixed;
  right: 0;
  bottom: var(--space-32);
  left: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.4s ease, translate 0.4s var(--ease-out-soft);
}

.service-fixed-cta > * {
  pointer-events: auto;
}

.service-fixed-cta.is-hidden {
  opacity: 0;
  translate: 0 var(--space-24);
}

.service-fixed-cta.is-hidden > * {
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .service-projects__item,
  .next-card,
  .next-card__arrow,
  .service-fixed-cta {
    transition: none;
  }
}

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

@media (max-width: 1023px) {
  .service-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .service-hero__graphic {
    width: min(560px, 100%);
  }

  .service-process,
  .service-faq,
  .deliverables__top,
  .role-card {
    flex-direction: column;
    gap: var(--space-32);
  }

  .service-process__intro {
    position: static;
  }

  .service-steps,
  .service-faq .faq,
  .deliverables__text {
    width: 100%;
  }

  /* tablet: two cards in view */
  .service-next__cards li {
    flex-basis: calc((100% - var(--space-24)) / 2);
  }

  /* projects scroll sideways */
  .service-projects__tiles {
    justify-content: flex-start;
    margin-inline: calc(-1 * var(--layout-margin));
    padding: var(--space-24) var(--layout-margin);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .service-projects__item {
    scroll-snap-align: center;
  }
}

@media (max-width: 600px) {
  /* phones: one card plus a peek of the next, swipe; no arrows */
  .service-next__cards li {
    flex-basis: 82%;
  }

  .service-next__cards {
    gap: var(--space-16);
  }

  .service-next__nav {
    display: none;
  }

  /* every section the same rhythm on phones, clearly apart from the next */
  .service-section {
    --pad-top: var(--space-64);
    --pad-bottom: var(--space-64);
  }

  .service-section--tight-bottom { --pad-bottom: var(--space-24); }
  .service-section--tight-top { --pad-top: var(--space-24); }

  .service-hero {
    gap: var(--space-48);
    padding-bottom: var(--space-64);
  }

  .service-hero__text {
    gap: var(--space-24);
  }

  /* step: small number next to the icon instead of a big line of its own */
  .service-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-8) var(--space-16);
    padding: var(--space-24);
  }

  .service-step__number {
    width: auto;
    padding-top: 0.15em;
    font-size: 1rem;
    color: var(--color-text-tertiary);
  }

  .service-step__title {
    gap: var(--space-8);
  }

  .service-step__icon {
    width: 20px;
    height: 20px;
  }

  .service-delivery .text-h2,
  .service-process__intro .text-h2 {
    font-size: 1.875rem;
  }

  .role-card,
  .deliverables,
  .timeline {
    padding: var(--space-24);
  }

  /* timeline as a list: phase above, its units below */
  .timeline__row {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .timeline__row--head .timeline__label {
    display: none;
  }

  .timeline__row + .timeline__row {
    margin-top: var(--space-8);
  }

  .timeline__unit {
    font-size: 0.6875rem;
  }

  .timeline__cell {
    height: 14px;
  }

  .service-projects__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* headings never hyphenate (narrow sticky column: "Analy-se") */
.service-hero h1,
.service-section h2,
.service-step__title,
.next-card .text-h3 {
  hyphens: manual;
}

/* all cards fit: no arrows */
.service-next.is-static .service-next__nav {
  display: none;
}

/* touch screens: the card does not stay lifted after a tap */
@media (hover: none) {
  .next-card:hover {
    background: var(--color-surface-raised);
    translate: 0 0;
  }
}
