/* Shared components: section frame, pills, project tile, card stack, scroll hint,
   toggle cards, contact CTA. Values from Figma (Components page). */

/* ---------- Section frame ---------- */

.section {
  padding: var(--layout-section) max(var(--layout-margin), (100% - var(--layout-content)) / 2);
}

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

/* Lead text offset to the right (Figma "Text Right": 600px desktop).
   The offset gives way first: the text keeps at least 480px (or the full width when there is less),
   so it never shrinks to a thin column on tablets and small desktops. */
.offset-text {
  padding-left: max(0px, min(600px, 50%, 100% - 480px));
  color: var(--color-text-secondary);
}

/* Writer bold → <mark>: accent in the project text color */
.accent-marks mark {
  background: none;
  color: var(--project-text, var(--color-interactive-primary));
}

/* ---------- Pill (Figma 172:33) ---------- */

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  justify-content: inherit;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding-inline: var(--space-16);
  border-radius: var(--radius-pill);
  background: var(--color-fixed-dark);
  color: var(--color-fixed-light);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  letter-spacing: var(--letter-spacing-small);
  white-space: nowrap;
}

/* Outline variant (e.g. case year): inset stroke keeps the pill height */
.pill--outline {
  background: transparent;
  color: var(--color-fixed-dark);
  box-shadow: inset 0 0 0 1.5px currentColor;
}

.pill--project {
  height: 24px;
  background: var(--project-text);
  color: var(--project-surface);
}

/* ---------- Project tile, portrait 360 × 480 (Figma 339:210) ---------- */

.project-tile {
  --pad: var(--space-16);
  --grow: 0px;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  width: 360px;
  height: 480px;
  padding: var(--pad);
  /* concentric corners: image radius 16 + padding */
  border-radius: calc(var(--radius-16) + var(--pad));
  color: var(--project-text, var(--color-text-primary));
}

/* the coloured surface is its own layer: on hover it grows outwards (8px per side), so the
   padding reads 24 while the image keeps its size and crop (Leoš) */
.project-tile::before,
.project-tile-landscape::before {
  content: "";
  position: absolute;
  inset: calc(var(--grow) * -1);
  z-index: -1;
  border-radius: calc(var(--image-radius, var(--radius-16)) + var(--pad) + var(--grow));
  background: var(--project-surface, var(--color-surface-raised));
  box-shadow: var(--shadow-bubble);
  transition:
    inset 0.7s var(--ease-calm),
    border-radius 0.7s var(--ease-calm),
    box-shadow 0.7s var(--ease-calm);
}

@media (hover: hover) {
  .project-tile:hover,
  .project-tile:focus-visible,
  .project-tile-landscape:hover,
  .project-tile-landscape:focus-visible {
    --grow: var(--space-8);
  }

  .project-tile:hover::before,
  .project-tile:focus-visible::before,
  .project-tile-landscape:hover::before,
  .project-tile-landscape:focus-visible::before {
    box-shadow: var(--shadow-button-hover);
  }
}

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

.project-tile__title {
  font-size: 3.5rem;
  font-weight: var(--font-weight-bold);
  line-height: 1;
  letter-spacing: var(--letter-spacing-h2);
}

.project-tile__pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.project-tile__image {
  position: relative;
  flex: 1;
  overflow: hidden;
  border-radius: var(--radius-16);
}

.project-tile__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale 0.9s var(--ease-calm);
}

/* Cursor chip (Figma 306:1139): centered in the image, fades in on hover */
.cursor-chip {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  background: var(--color-fixed-light);
  color: var(--color-fixed-dark);
  box-shadow: var(--shadow-float);
  opacity: 0;
  translate: -50% -50%;
  scale: 0.6;
  transition: opacity 0.4s ease, scale 0.6s var(--ease-calm);
}

.cursor-chip .icon {
  width: 20px;
  height: 20px;
}

/* Internal links point right (→, the ↗ icon turned 45°) – also on touch screens without hover;
   the arrow stays centred in its chip. External links (live sites, mail, client folders) keep ↗. */
.cursor-chip .icon,
.service-card__arrow .icon,
.next-card__arrow .icon {
  rotate: 45deg;
  transition: rotate 0.45s var(--ease-pop);
}

.project-tile:hover .cursor-chip,
.project-tile:focus-visible .cursor-chip {
  opacity: 1;
  scale: 1;
}

.project-tile:hover .project-tile__image img {
  scale: 1.04;
}

/* ---------- Landscape tile 1200 × 520 scaled to its container (pills min 12px) ---------- */
.project-tile-landscape {
  /* uniform with all case tiles (portrait tiles, coverflow): padding 16, image radius 16,
     outer radius = image radius + padding; hover grows the surface outwards (see ::before above) */
  --pad: var(--space-16);
  --grow: 0px;
  --image-radius: var(--radius-16);
  position: relative;
  isolation: isolate;
  display: flex;
  gap: var(--space-16);
  aspect-ratio: 1200 / 520;
  padding: var(--pad);
  border-radius: calc(var(--image-radius) + var(--pad));
  color: var(--project-text);
  container-type: inline-size;
}

.project-tile-landscape__image {
  position: relative;
  flex-shrink: 0;
  width: 46.67cqw;
  overflow: hidden;
  border-radius: var(--image-radius);
}

.project-tile-landscape__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale 0.9s var(--ease-calm);
}

@media (hover: hover) {
  .project-tile-landscape:hover .project-tile-landscape__image img {
    scale: 1.04;
  }

  .project-tile-landscape:hover .cursor-chip,
  .project-tile-landscape:focus-visible .cursor-chip {
    opacity: 1;
    scale: 1;
  }
}

.project-tile-landscape__head {
  display: flex;
  flex-direction: column;
  gap: 1.33cqw;
  padding-block: 1.33cqw;
}

.project-tile-landscape__title {
  font-size: 5.6cqw; /* 1.2 × Figma (Leoš) */
  font-weight: var(--font-weight-bold);
  line-height: 1;
  letter-spacing: var(--letter-spacing-h2);
}

.project-tile-landscape .pill--project {
  height: auto;
  min-height: 18px;
  padding: 0.2em 0.9em;
  font-size: max(12px, 1.25cqw);
}

.project-tile-landscape .pill--more {
  display: none;
}

/* small tiles (phones): a bigger title, the first pill plus "+2" instead of a stack of pills
   that outweighs the title (the hidden pills stay readable for screen readers) */
@container (max-width: 520px) {
  .project-tile-landscape__title {
    font-size: 6.6cqw;
  }

  .project-tile-landscape .pill--project:not(:first-child, .pill--more) {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .project-tile-landscape .pill--more {
    display: inline-flex;
  }
}

/* phones: a thinner coloured frame on all case tiles (the outer radius follows via --pad);
   the card-stack collage is excluded, it scales its tiles down as a whole already */
@media (max-width: 600px) {
  .project-tile-landscape,
  .project-tile:not(.card-stack__item > *) {
    --pad: var(--space-8);
  }
}

/* ---------- Card stack "Entdecken …" (Figma 358:1951) ---------- */

/* The stack is designed on a 1200 × 760 stage. --s (set by site.js from the real width, ≤ 1)
   scales stage height, card positions and the tiles themselves, so it shrinks as one piece. */
.card-stack {
  --s: 1;
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: calc(760px * var(--s));
}

.card-stack__item {
  width: calc(360px * var(--s));
  height: calc(480px * var(--s));
}

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

.card-stack__item {
  --rotate: 0deg;
  --shift: 0px;
  position: absolute;
  rotate: var(--rotate);
  translate: var(--shift) 0;
  transition: rotate 0.7s var(--ease-calm), translate 0.7s var(--ease-calm), scale 0.7s var(--ease-calm);
}

/* Card centres from Figma, rotations −4 / +7 / −3 / +5 / −3 */
.card-stack__item:nth-child(1) { left: 1.3%;  top: calc(57px * var(--s));  --rotate: -4deg; }
.card-stack__item:nth-child(2) { left: 14.9%; top: calc(250px * var(--s)); --rotate: 7deg; }
.card-stack__item:nth-child(3) { left: 36%;   top: 0;                       --rotate: -3deg; }
.card-stack__item:nth-child(4) { left: 50.7%; top: calc(215px * var(--s)); --rotate: 5deg; }
.card-stack__item:nth-child(5) { left: 71%;   top: calc(30px * var(--s));  --rotate: -3deg; }

@media (hover: hover) {
  /* hovered card straightens, lifts 48px, grows to 105 % and comes to the front */
  .card-stack__item:hover,
  .card-stack__item:focus-within {
    z-index: 10;
    rotate: 0deg;
    translate: 0 -32px;
    scale: 1.03;
  }

  /* neighbours make room: 28px aside, 2° more tilt */
  .card-stack__item:has(+ .card-stack__item:hover) {
    --shift: -20px;
    rotate: calc(var(--rotate) - 2deg);
  }

  .card-stack__item:hover + .card-stack__item {
    --shift: 20px;
    rotate: calc(var(--rotate) + 2deg);
  }
}

/* Phones: the same five-card collage as on desktop, on a stage wider than the screen
   (centred, the outer cards bleed off both edges) so the tiles stay readable */
@media (max-width: 600px) {
  .card-stack {
    width: 170%;
    max-width: none;
    margin-inline: -35%;
  }
}

/* ---------- Scroll hint (Figma 684:8028) ---------- */

.scroll-hint {
  position: absolute;
  bottom: var(--space-32);
  left: 50%;
  z-index: 2;
  translate: -50% 0;
  color: var(--color-fixed-dark);
  transition: opacity 0.4s ease;
}

.scroll-hint--light {
  color: var(--color-fixed-light);
}

.scroll-hint.is-hidden {
  opacity: 0;
}

.scroll-hint__mouse {
  position: relative;
  display: block;
  width: 24px;
  height: 36px;
  border: 2px solid currentColor;
  border-radius: var(--radius-pill);
}

.scroll-hint__wheel {
  position: absolute;
  top: 5px;
  left: 8px;
  width: 4px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: currentColor;
  animation: scroll-wheel 1.4s ease-in infinite;
}

.scroll-hint__arrow {
  display: none;
}

.scroll-hint__arrow .icon {
  width: 24px;
  height: 14px;
  animation: scroll-arrow 1.4s ease-in infinite;
}

@keyframes scroll-wheel {
  0% { translate: 0 0; opacity: 1; }
  80%, 100% { translate: 0 12px; opacity: 0; }
}

@keyframes scroll-arrow {
  0% { translate: 0 0; opacity: 1; }
  80%, 100% { translate: 0 12px; opacity: 0; }
}

@media (max-width: 600px) {
  .scroll-hint__mouse { display: none; }
  .scroll-hint__arrow { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint__wheel,
  .scroll-hint__arrow .icon {
    animation: none;
  }
}

/* ---------- Toggle card head (System Card, Chapter Card) ---------- */

.toggle-card__head {
  display: flex;
  gap: var(--space-16);
  align-items: center;
  justify-content: space-between;
}

.toggle-card__button {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  background: var(--toggle-bg, var(--color-text-secondary));
  color: var(--toggle-fg, var(--color-fixed-light));
  transition: scale 0.2s ease;
}

.toggle-card__button:hover,
.is-toggle:hover .toggle-card__button {
  scale: 1.06;
}

.is-toggle {
  cursor: pointer;
}

.toggle-card__button .icon {
  width: 24px;
  height: 24px;
}

.toggle-card__button .icon--minus,
.toggle-card__button[aria-expanded="true"] .icon--plus {
  display: none;
}

.toggle-card__button[aria-expanded="true"] .icon--minus {
  display: block;
}

/* ---------- Contact CTA (Figma 343:1685) ---------- */

.contact-cta {
  /* title left, text + button top right: the footer slides up over this section from below,
     so the button sits high and stays visible longest */
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(400px, 34%);
  gap: var(--space-32) var(--space-64);
  align-items: start;
  padding: var(--layout-section) max(var(--layout-margin), (100% - var(--layout-content)) / 2);
  background: var(--color-surface-base);
  color: var(--color-text-primary);
}

.contact-cta__title {
  color: var(--color-interactive-primary);
}

.contact-cta__aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
  align-items: flex-start;
  padding-top: 0.6em;
}

.contact-cta__text {
  color: var(--color-text-secondary);
}

@media (max-width: 1023px) {
  .contact-cta {
    grid-template-columns: 1fr;
  }

  .contact-cta__aside {
    padding-top: 0;
  }
}

/* ---------- Logo carousel (Figma 684:7647) ---------- */

.logo-carousel {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-48);
  background: var(--color-surface-base);
}

.logo-carousel::before,
.logo-carousel::after {
  content: "";
  position: absolute;
  inset-block: 0;
  z-index: 1;
  width: 240px;
  pointer-events: none;
}

.logo-carousel::before {
  left: 0;
  background: linear-gradient(90deg, var(--color-surface-base), transparent);
}

.logo-carousel::after {
  right: 0;
  background: linear-gradient(270deg, var(--color-surface-base), transparent);
}

.logo-carousel__track {
  display: flex;
  width: max-content;
  animation: logo-marquee 40s linear infinite;
}

.logo-carousel:hover .logo-carousel__track {
  animation-play-state: paused;
}

.logo-carousel__list {
  display: flex;
  gap: var(--space-64);
  padding-right: var(--space-64); /* trailing gap = loop seam */
}

.logo-carousel__cell {
  display: grid;
  place-items: center;
  min-width: 180px;
  height: 72px;
}

/* logo tinted text/secondary via mask (works for SVG and transparent PNG) */
.client-logo {
  display: block;
  background: var(--color-text-secondary);
  -webkit-mask: var(--logo) center / contain no-repeat;
  mask: var(--logo) center / contain no-repeat;
}

@keyframes logo-marquee {
  to { translate: -50% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-carousel__track {
    animation: none;
  }
}

@media (max-width: 600px) {
  .logo-carousel {
    padding-block: var(--space-24);
  }

  .logo-carousel::before,
  .logo-carousel::after {
    width: 72px;
  }

  .logo-carousel__list {
    gap: var(--space-24);
    padding-right: var(--space-24);
  }

  .logo-carousel__cell {
    width: 120px;
    height: 64px;
  }

  .logo-carousel__cell .client-logo {
    scale: 0.75;
  }
}

/* ---------- Services section (Figma 730:10707), Service Card (314:232) ---------- */

.services-section {
  display: flex;
  gap: var(--space-128);
  align-items: flex-start;
  padding: var(--layout-section) max(var(--layout-margin), (100% - var(--layout-content)) / 2);
  background: var(--color-surface-base);
  color: var(--color-text-primary);
}

.services-section__intro {
  position: sticky;
  top: calc(var(--header-height) + var(--space-48));
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: var(--space-24);
  align-items: flex-start;
  width: 480px;
}

.services-section__intro .text-h1 {
  margin-bottom: var(--space-24);
}

.services-section__intro .text-lead {
  color: var(--color-text-secondary);
}

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

.service-card {
  display: flex;
  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);
  transition: background-color 0.3s var(--ease-out-soft), color 0.3s var(--ease-out-soft);
}

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

.service-card__arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--color-fixed-dark);
  color: var(--color-fixed-light);
  opacity: 0;
  scale: 0.6;
  transition: opacity 0.3s ease, scale 0.3s var(--ease-out-soft);
}

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

/* description folds open on hover/focus */
.service-card__text {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: calc(-1 * var(--space-24));
  color: var(--color-core-tone-graphite);
  transition: grid-template-rows 0.3s var(--ease-out-soft), margin 0.3s var(--ease-out-soft);
}

.service-card__text > span {
  overflow: hidden;
}

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

.pill--service {
  background: var(--color-surface-inverse);
  color: var(--color-surface-raised);
}

:where(.services-section:not(.services-section--accordion)) .service-card:hover,
.service-card:focus-visible,
.service-card.is-open {
  background: var(--color-fixed-light);
  color: var(--color-fixed-dark);
}

:where(.services-section:not(.services-section--accordion)) .service-card:hover .service-card__arrow,
.service-card:focus-visible .service-card__arrow,
.service-card.is-open .service-card__arrow {
  opacity: 1;
  scale: 1;
}

:where(.services-section:not(.services-section--accordion)) .service-card:hover .service-card__text,
.service-card:focus-visible .service-card__text,
.service-card.is-open .service-card__text {
  grid-template-rows: 1fr;
  margin-top: 0;
}

:where(.services-section:not(.services-section--accordion)) .service-card:hover .pill--service,
.service-card:focus-visible .pill--service,
.service-card.is-open .pill--service {
  background: var(--color-core-tone-chalk);
  color: var(--color-core-tone-graphite);
}

/* Scroll accordion (Figma 531:79): one calm curve for every movement (height, colour, list shift),
   text fades in shortly after the card opens */
.services-section--accordion {
  --acc-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --acc-time: 0.7s;
}

.services-section--accordion .service-card {
  transition: background-color var(--acc-time) var(--acc-ease), color var(--acc-time) var(--acc-ease);
}

.services-section--accordion .service-card__text {
  transition: grid-template-rows var(--acc-time) var(--acc-ease), margin var(--acc-time) var(--acc-ease);
}

.services-section--accordion .service-card__text > span {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.services-section--accordion .service-card.is-open .service-card__text > span {
  opacity: 1;
  transition: opacity 0.45s ease 0.12s;
}

.services-section--accordion .pill--service {
  transition: background-color var(--acc-time) var(--acc-ease), color var(--acc-time) var(--acc-ease);
}

/* desktop: both columns stay pinned while the section scrolls by, about half a window per card */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  /* both pinned columns are as tall as one open card (so they leave together without an empty band);
     the waiting cards overflow the list box, the section clips them */
  .services-section--accordion {
    min-height: calc(var(--count) * 50svh + 60svh);
    overflow: clip;
  }

  .services-section--accordion .service-cards {
    height: min(440px, 100svh - var(--header-height) - var(--space-32));
    transition: translate var(--acc-time) var(--acc-ease);
    position: sticky;
    top: calc(var(--header-height) + var(--space-16));
    gap: var(--space-8);
  }

  .services-section--accordion .services-section__intro {
    top: calc(var(--header-height) + var(--space-16));
    height: min(440px, 100svh - var(--header-height) - var(--space-32));
  }

  /* compact cards */
  .services-section--accordion .service-card {
    gap: var(--space-16);
    padding: var(--space-24);
  }

  .services-section--accordion .service-card__text {
    margin-top: calc(-1 * var(--space-16));
  }

  /* finished cards shrink a little and fade out quickly, before they reach the blurred header
     (under the header blur their rounded corners would smear into a rectangle) */
  .services-section--accordion .service-card {
    transform-origin: 50% 0;
    transition:
      background-color var(--acc-time) var(--acc-ease),
      color var(--acc-time) var(--acc-ease),
      opacity 0.3s ease,
      scale var(--acc-time) var(--acc-ease);
  }

  .services-section--accordion .service-card.is-past {
    opacity: 0;
    scale: 0.94;
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .services-section--accordion .service-card,
  .services-section--accordion .service-card__text,
  .services-section--accordion .service-card__text > span {
    transition: none;
  }
}

@media (max-width: 1023px) {
  .services-section {
    flex-direction: column;
    gap: var(--space-48);
  }

  .services-section__intro {
    position: static;
    width: auto;
  }

  /* tap accordion: closed cards are compact title rows, only the open card shows text + pills */
  .services-section--accordion .service-cards {
    gap: var(--space-8);
  }

  .services-section--accordion .service-card {
    gap: var(--space-16);
    padding: var(--space-16) var(--space-24);
    scroll-margin-top: calc(var(--header-height) + var(--space-16));
  }

  .services-section--accordion .service-card.is-open {
    padding-block: var(--space-24);
  }

  .services-section--accordion .service-card__head {
    justify-content: space-between;
  }

  .services-section--accordion .service-card__text {
    margin-top: calc(-1 * var(--space-16));
  }

  .services-section--accordion .service-card__pills {
    display: none;
  }

  .services-section--accordion .service-card.is-open .service-card__pills {
    display: flex;
  }

  /* closed: the chip stays visible as a quiet "open" hint */
  .services-section--accordion .service-card:not(.is-open) .service-card__arrow {
    opacity: 1;
    scale: 0.8;
    background: var(--color-fixed-light);
    color: var(--color-fixed-dark);
    rotate: 135deg;
  }
}

/* phones + tablets: the same scroll accordion. The intro scrolls away first, then the card list
   pins under the header while the section scrolls by (about 40% of a window per card); the open
   card sits at the top, finished cards slide up and fade out, the next ones wait below. */
@media (max-width: 1023px) and (prefers-reduced-motion: no-preference) {
  .services-section--accordion {
    min-height: calc(var(--count) * 40svh + 100svh);
    overflow: clip;
  }

  /* the sticky button belongs at the end of the scroll room, so it stays pinned at the bottom
     the whole way (right after the list it would scroll away with the list's natural position) */
  .services-section--accordion .cta-sticky {
    margin-top: auto;
  }

  .services-section--accordion .service-cards {
    flex: none; /* the section is a column here: don't grow into the scroll room */
    position: sticky;
    top: calc(var(--header-height) + var(--space-16));
    height: min(600px, 100svh - var(--header-height) - var(--space-32));
    transition: translate var(--acc-time) var(--acc-ease);
  }

  .services-section--accordion .service-card {
    transform-origin: 50% 0;
    transition:
      background-color var(--acc-time) var(--acc-ease),
      color var(--acc-time) var(--acc-ease),
      opacity 0.3s ease,
      scale var(--acc-time) var(--acc-ease);
  }

  .services-section--accordion .service-card.is-past {
    opacity: 0;
    scale: 0.94;
    pointer-events: none;
  }
}

/* ---------- Testimonial (Figma 363:1775) ---------- */

.testimonial__figure {
  display: flex;
  flex-direction: column;
  gap: var(--space-48);
  max-width: 1000px;
}

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

.testimonial__sender > span:last-child {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.testimonial__photo {
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--color-core-tone-fog);
}

.testimonial__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

/* ---------- Stage hero: dark stage, coral title (Figma 731:10677 / 731:11454) ---------- */

.stage-hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100svh;
  overflow: hidden;
  background: var(--color-surface-base);
}

.stage-hero__stage {
  position: absolute;
  inset: 0;
}

.stage-hero__cutout {
  position: absolute;
  overflow: hidden;
  border-radius: var(--radius-24);
}

.stage-hero__cutout img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* positions in % of the 1440 × 900 frame. Each slot has a width (--w) and the ratio from Figma (--r);
   the image brings its own ratio (--ratio, stage-hero.php), and the width adapts so the slot keeps
   about the same area: a portrait image in a landscape slot gets narrower and taller, not huge. */
.stage-hero--projects .stage-hero__cutout {
  width: calc(var(--w) * sqrt(var(--ratio, var(--r)) / var(--r)));
  aspect-ratio: var(--ratio, var(--r));
}

.stage-hero--projects .stage-hero__cutout:nth-child(1) { left: -5.4%; top: 26.7%; --w: 16.7%; --r: 0.6667; }
.stage-hero--projects .stage-hero__cutout:nth-child(2) { left: 21%;   top: 15.1%; --w: 15.3%; --r: 1; }
.stage-hero--projects .stage-hero__cutout:nth-child(3) { left: 51.4%; top: 15.6%; --w: 20.8%; --r: 1.5; }
.stage-hero--projects .stage-hero__cutout:nth-child(4) { left: 84.7%; top: 15.8%; --w: 20.1%; --r: 0.6744; }
.stage-hero--projects .stage-hero__cutout:nth-child(5) { left: 11.3%; top: 73.9%; --w: 25%;   --r: 2; }
.stage-hero--projects .stage-hero__cutout:nth-child(6) { left: 54.2%; top: 77.8%; --w: 30.6%; --r: 1.6923; }

.stage-hero__title {
  position: relative;
  z-index: 1;
  padding-inline: var(--layout-margin);
  color: var(--color-interactive-primary);
  text-align: center;
}


/* services: 5 cutouts, title on two lines */
.stage-hero--services .stage-hero__cutout:nth-child(1) { left: -4.8%; top: 15.8%; width: 20.1%; aspect-ratio: 290 / 430; }
.stage-hero--services .stage-hero__cutout:nth-child(2) { left: 29.2%; top: 10%;   width: 20.8%; aspect-ratio: 300 / 200; }
.stage-hero--services .stage-hero__cutout:nth-child(3) { left: 20.8%; top: 77.9%; width: 30.6%; aspect-ratio: 440 / 305; }
.stage-hero--services .stage-hero__cutout:nth-child(4) { left: 63.8%; top: 73.9%; width: 25%;   aspect-ratio: 360 / 180; }
.stage-hero--services .stage-hero__cutout:nth-child(5) { left: 79.9%; top: 14.6%; width: 16.7%; aspect-ratio: 240 / 360; }

.stage-hero--services .stage-hero__title {
  max-width: calc(820px + 2 * var(--layout-margin));
}

@media (max-width: 600px) {
  .stage-hero--projects .stage-hero__cutout:nth-child(1) { left: -14%; top: 14%; --w: 34%; }
  .stage-hero--projects .stage-hero__cutout:nth-child(2) { left: 64%;  top: 10%; --w: 30%; }
  .stage-hero--projects .stage-hero__cutout:nth-child(3) { display: none; }
  .stage-hero--projects .stage-hero__cutout:nth-child(4) { left: 74%;  top: 64%; --w: 34%; }
  .stage-hero--projects .stage-hero__cutout:nth-child(5) { left: -8%;  top: 74%; --w: 56%; }
  .stage-hero--projects .stage-hero__cutout:nth-child(6) { display: none; }


  .stage-hero--services .stage-hero__cutout:nth-child(1) { left: -14%; top: 14%; width: 34%; }
  .stage-hero--services .stage-hero__cutout:nth-child(2) { left: 64%;  top: 10%; width: 40%; }
  .stage-hero--services .stage-hero__cutout:nth-child(3) { left: -8%;  top: 74%; width: 56%; }
  .stage-hero--services .stage-hero__cutout:nth-child(4) { display: none; }
  .stage-hero--services .stage-hero__cutout:nth-child(5) { left: 74%;  top: 66%; width: 30%; }
}

/* services page: all cards open (Figma 730:10707) */
.services-section--open .service-card {
  background: var(--color-fixed-light);
  color: var(--color-fixed-dark);
}

.services-section--open .service-card__arrow {
  opacity: 1;
  scale: 1;
}

.services-section--open .service-card__text {
  grid-template-rows: 1fr;
  margin-top: 0;
}

.services-section--open .pill--service {
  background: var(--color-core-tone-chalk);
  color: var(--color-core-tone-graphite);
}

/* ---------- Sticky CTA (spec 4.14) ---------- */

[data-sticky-cta] {
  position: relative;
}

.sticky-cta--floating,
.sticky-cta--docked {
  left: 50%;
  bottom: var(--space-24);
  z-index: 90; /* below the fixed header (100) so it never covers the menu */
  translate: -50% 0;
}

.sticky-cta--floating {
  position: fixed;
}

.sticky-cta--docked {
  position: absolute;
}

.sticky-cta--pop {
  animation: sticky-cta-pop 0.35s var(--ease-pop);
}

.sticky-cta-placeholder {
  display: inline-block;
  visibility: hidden;
}

@keyframes sticky-cta-pop {
  from { opacity: 0; scale: 0.8; }
}


@media (prefers-reduced-motion: reduce) {
  .sticky-cta--pop {
    animation: none;
  }
}

/* ---------- Stage hero: floating cutouts (Leoš: images drift, cast a shadow) ---------- */

.stage-hero__cutout {
  box-shadow: 0 32px 64px -16px rgb(0 0 0 / 0.55);
}

/* Hero image with a project: framed like the case tiles (padding 16, image radius 16, outer 32) in its colours */
.stage-hero__cutout--framed {
  padding: var(--space-16);
  border-radius: calc(var(--radius-16) + var(--space-16));
  background: var(--project-surface);
}

.stage-hero__cutout--framed img {
  border-radius: var(--radius-16);
}

/* phones: thin frame like the case tiles */
@media (max-width: 600px) {
  .stage-hero__cutout--framed {
    padding: var(--space-8);
    border-radius: calc(var(--radius-16) + var(--space-8));
  }
}

/* ---------- Service bubbles (Leistungen hero): the bubble itself grows into a small image card ----------
   Same principle as the case tiles, a size smaller: padding 8 + image radius 8 = outer radius 16,
   background in the colour of the project shown, fading along with the slides. */

.stage-hero__bubbles {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.service-bubble {
  --r: 0deg;
  --pad: var(--space-8);
  --image-radius: var(--radius-8);
  position: absolute;
  z-index: 1;
  translate: -50% -50%;
  rotate: var(--r);
  pointer-events: auto;
  transition: rotate 0.8s var(--ease-calm);
}

.service-bubble.is-open {
  z-index: 2;
  rotate: 0deg;
}

/* around the headline (no static images on Leistungen) */
.service-bubble:nth-child(1) { left: 17%; top: 31%; --r: -6deg; }
.service-bubble:nth-child(2) { left: 82%; top: 30%; --r: 5deg; }
.service-bubble:nth-child(3) { left: 23%; top: 73%; --r: 4deg; }
.service-bubble:nth-child(4) { left: 78%; top: 72%; --r: -7deg; }
.service-bubble:nth-child(5) { left: 50%; top: 17%; --r: 3deg; }
.service-bubble:nth-child(6) { left: 9%;  top: 53%; --r: 6deg; }
.service-bubble:nth-child(7) { left: 91%; top: 51%; --r: -4deg; }

.service-bubble__card {
  position: relative;
  display: block;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-pill);
  background: var(--color-fixed-light);
  color: var(--color-fixed-dark);
  box-shadow: 0 16px 32px -8px rgb(0 0 0 / 0.45);
  cursor: pointer;
  transition: box-shadow 0.6s var(--ease-calm);
}

.service-bubble__label {
  display: block;
  padding: var(--space-4);
  white-space: nowrap;
  transition: opacity 0.4s ease;
}

/* open: the text fades, the pill keeps its size and place (no layout shift) */
.service-bubble.is-open .service-bubble__label {
  opacity: 0;
}

.service-bubble.is-open .service-bubble__card {
  box-shadow: none;
}

.service-bubble__card:focus-visible {
  outline: 2px solid var(--color-interactive-primary);
  outline-offset: 4px;
}

/* image card: a layer centred on the pill that grows out of it (scale from the centre);
   padding 16 (like the case tiles) + image radius 8 = outer radius 24, frame in the project colour */
.service-bubble__show {
  --pad: var(--space-16);
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 400px; /* image 368 × 276 (4:3) */
  height: 308px;
  padding: var(--pad);
  border-radius: calc(var(--image-radius) + var(--pad));
  background: var(--slide-color);
  box-shadow: 0 32px 64px -16px rgb(0 0 0 / 0.6);
  opacity: 0;
  translate: -50% -50%;
  scale: 0.3;
  pointer-events: none;
  transition:
    scale 0.8s var(--ease-calm),
    opacity 0.5s ease,
    background-color 0.9s ease;
}

.service-bubble.is-open .service-bubble__show {
  opacity: 1;
  scale: 1;
  pointer-events: auto; /* keeps the hover alive over the whole card */
}

.service-bubble__show img {
  position: absolute;
  inset: var(--pad);
  width: calc(100% - var(--pad) * 2);
  height: calc(100% - var(--pad) * 2);
  border-radius: var(--image-radius);
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.service-bubble__show img.is-active {
  opacity: 1;
}

@media (max-width: 600px) {
  .service-bubble:nth-child(1) { left: 30%; top: 23%; }
  .service-bubble:nth-child(2) { left: 72%; top: 32%; }
  .service-bubble:nth-child(3) { left: 28%; top: 68%; }
  .service-bubble:nth-child(4) { left: 70%; top: 77%; }
  .service-bubble:nth-child(5) { left: 68%; top: 14%; }
  .service-bubble:nth-child(6) { left: 72%; top: 62%; }
  .service-bubble:nth-child(7) { left: 30%; top: 85%; }

  .service-bubble__show {
    width: 240px;
    height: 187px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .service-bubble,
  .service-bubble__card,
  .service-bubble__show,
  .service-bubble__show img {
    transition: none;
  }
}

/* ---------- Sticky CTA (native): one place, centred under its section's content ----------
   position: sticky keeps it at the bottom of the screen while the section scrolls by and lets it
   settle at the end of the section, so it never jumps between two positions. */
.cta-sticky {
  position: sticky;
  bottom: var(--space-24);
  z-index: 20;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

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

/* some CTAs sit in the text on desktop and become a sticky button on mobile */
.cta-mobile {
  display: none;
}

@media (max-width: 1023px) {
  .cta-desktop {
    display: none;
  }

  .cta-mobile {
    display: flex;
    width: 100%;
  }
}

/* ---------- Project fan (Home "Ausgewählt", Leistungen "Kunden") ----------
   Landscape tiles in a zig-zag, each overlapping the previous one; the 4th tile runs half under
   the next section ("there's more"), the sticky "Alle Projekte" sits on its visible half. */
.fan-section {
  --tile-w: min(720px, 0.6 * (100vw - 2 * var(--layout-margin)));
  --tile-h: calc(var(--tile-w) * 520 / 1200);
  position: relative;
  z-index: 0; /* own stack: the next section (z 1) covers the 4th tile */
  display: flex;
  flex-direction: column;
  gap: var(--space-64);
  overflow-x: clip;
  padding-bottom: 0;
}

.fan-section .card-fan {
  margin-bottom: calc(var(--tile-h) * -0.5 - var(--space-64) - 52px - var(--space-24));
}

.fan-section .cta-sticky {
  padding-bottom: var(--space-24);
}

.fan-section + * {
  position: relative;
  z-index: 1;
}

/* the covering section needs a background of its own (zero specificity: own colours win) */
:where(.fan-section + *) {
  background-color: var(--color-surface-base);
}

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

.card-fan__item {
  --rotate: 0deg;
  --shift: 0px;
  position: relative;
  width: min(720px, 60%);
  container-type: inline-size;
  cursor: pointer;
}

/* The list item is the stable hit area: only the tile inside rotates, lifts and moves. Otherwise
   the hovered tile would slide away under the cursor, the neighbour would take the hover and the
   two would flip back and forth (the jitter). Clicks on the item are passed to the link (site.js). */
.card-fan__item > .project-tile-landscape {
  pointer-events: none;
  rotate: var(--rotate);
  translate: 0 var(--shift);
  transition: rotate 0.7s var(--ease-calm), translate 0.7s var(--ease-calm), scale 0.7s var(--ease-calm);
}

/* zig-zag: left, right, centre-left, right. A right tile (image on its left) slides far up over the
   empty, single-colour lower right of the left tile above it, stopping just below its title + pills;
   a left tile only tucks in a little (it would otherwise cover the image or the title above). */
.card-fan__item:nth-child(1) { --rotate: 3deg;    z-index: 1; }
.card-fan__item:nth-child(2) { --rotate: -2deg;   z-index: 2; margin: calc(var(--tile-h) * -0.56 - var(--space-24)) 0 0 auto; }
.card-fan__item:nth-child(3) { --rotate: 2.5deg;  z-index: 3; margin: calc(var(--tile-h) * -0.12 - var(--space-24)) 0 0 15%; }
.card-fan__item:nth-child(4) { --rotate: -2.5deg; z-index: 4; margin: calc(var(--tile-h) * -0.56 - var(--space-24)) 0 0 auto; }
.card-fan__item:nth-child(n + 5) { display: none; }

@media (hover: hover) {
  .card-fan__item:hover,
  .card-fan__item:focus-within {
    z-index: 10;
  }

  .card-fan__item:hover > .project-tile-landscape,
  .card-fan__item:focus-within > .project-tile-landscape {
    --grow: var(--space-8);
    rotate: 0deg;
    translate: 0 calc(var(--shift) - 16px);
    scale: 1.015;
  }

  .card-fan__item:hover > .project-tile-landscape::before {
    box-shadow: var(--shadow-button-hover);
  }

  .card-fan__item:hover .project-tile-landscape__image img {
    scale: 1.04;
  }

  .card-fan__item:hover .cursor-chip {
    opacity: 1;
    scale: 1;
  }

  .card-fan__item:hover .cursor-chip .icon {
    rotate: 45deg;
  }

  .card-fan__item:has(+ .card-fan__item:hover) {
    --shift: -20px;
  }

  .card-fan__item:has(+ .card-fan__item:hover) > .project-tile-landscape {
    rotate: calc(var(--rotate) + 1deg);
  }

  .card-fan__item:hover + .card-fan__item {
    --shift: 20px;
  }

  .card-fan__item:hover + .card-fan__item > .project-tile-landscape {
    rotate: calc(var(--rotate) - 1deg);
  }
}

@media (max-width: 1023px) and (min-width: 601px) {
  .fan-section {
    --tile-w: calc(0.75 * (100vw - 2 * var(--layout-margin)));
  }

  .card-fan__item {
    width: 75%;
  }

  .card-fan__item:nth-child(2),
  .card-fan__item:nth-child(4) {
    margin-top: calc(var(--tile-h) * -0.5 - var(--space-24));
  }

  .card-fan__item:nth-child(3) {
    margin-top: calc(var(--tile-h) * -0.2 - var(--space-24));
  }
}

@media (max-width: 600px) {
  .fan-section {
    --tile-w: calc(0.92 * (100vw - 2 * var(--layout-margin)));
  }

  /* mobile: narrower tiles, zig-zag, each overlapping the previous one by about a third */
  .card-fan {
    gap: 0;
  }

  .card-fan__item,
  .card-fan__item:nth-child(n) {
    width: 92%;
    margin: 0;
  }

  .card-fan__item:nth-child(even) {
    margin-top: calc(var(--tile-h) * -0.36);
  }

  .card-fan__item:nth-child(odd):not(:first-child) {
    margin-top: calc(var(--tile-h) * -0.22);
  }

  .card-fan__item:nth-child(even) {
    margin-left: auto;
  }

  .card-fan__item:nth-child(odd) { --rotate: 2.5deg; }
  .card-fan__item:nth-child(even) { --rotate: -2.5deg; }
}

/* ---------- Facts stack (Figma 267:1003): three overlapping number cards, rotating (cases + Home) ---------- */

.facts-stack {
  --u: 1px;
  position: relative;
  width: calc(840 * var(--u));
  height: calc(460 * var(--u));
}

.facts-stack__card {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  overflow: hidden;
  border-radius: var(--radius-24);
  color: var(--color-fixed-light);
  font-weight: var(--font-weight-bold);
  text-align: right;
  box-shadow: 0 20px 40px 0 rgb(0 0 0 / 0.14);
  transition: left 0.6s var(--ease-out-soft), top 0.6s var(--ease-out-soft), width 0.6s var(--ease-out-soft),
    height 0.6s var(--ease-out-soft), padding 0.6s var(--ease-out-soft), background-color 0.6s ease;
}

.facts-stack__figure,
.facts-stack__label {
  transition: font-size 0.6s var(--ease-out-soft);
}

.facts-stack__figure {
  width: 100%;
}

.facts-stack__label {
  width: 100%;
}

/* largest card in front */
.facts-stack__card[data-pos="1"] {
  z-index: 3;
  left: 0;
  top: 0;
  width: calc(440 * var(--u));
  height: calc(440 * var(--u));
  padding: calc(48 * var(--u));
  background: var(--color-core-tone-graphite);
}

.facts-stack__card[data-pos="2"] {
  z-index: 2;
  left: calc(330 * var(--u));
  top: calc(70 * var(--u));
  width: calc(340 * var(--u));
  height: calc(370 * var(--u));
  padding: calc(32 * var(--u));
  background: var(--color-text-tertiary);
}

.facts-stack__card[data-pos="3"] {
  z-index: 1;
  left: calc(580 * var(--u));
  top: calc(140 * var(--u));
  width: calc(260 * var(--u));
  height: calc(300 * var(--u));
  padding: calc(24 * var(--u));
  background: var(--color-core-tone-fog);
}

.facts-stack__card:is([data-pos="1"], [data-pos="2"]) .facts-stack__figure {
  font-size: calc(160 * var(--u));
  line-height: var(--line-height-display);
  letter-spacing: var(--letter-spacing-display);
}

.facts-stack__card:is([data-pos="1"], [data-pos="2"]) .facts-stack__label {
  font-size: calc(32 * var(--u));
  line-height: var(--line-height-h3);
  letter-spacing: var(--letter-spacing-h3);
}

.facts-stack__card[data-pos="3"] .facts-stack__figure {
  font-size: calc(96 * var(--u));
  line-height: var(--line-height-h1);
  letter-spacing: var(--letter-spacing-h1);
}

.facts-stack__card[data-pos="3"] .facts-stack__label {
  font-size: max(12px, calc(15 * var(--u)));
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-small);
}

/* the cards can be clicked: a back card comes forward, the front card hands over to the next */
.facts-stack__card.is-pickable {
  cursor: pointer;
}

.facts-stack__card.is-pickable:focus-visible {
  outline: 2px solid var(--color-interactive-primary);
  outline-offset: 4px;
}

@media (hover: hover) {
  .facts-stack__card.is-pickable:not([data-pos="1"]):hover {
    filter: brightness(1.08);
  }
}

/* four-digit figures (e.g. a year) at a smaller size so they fit every card */
.facts-stack__card[data-pos] .facts-stack__figure.facts-stack__figure--long {
  font-size: calc(160 * 0.6 * var(--u));
  white-space: nowrap;
}

.facts-stack__card[data-pos="3"] .facts-stack__figure.facts-stack__figure--long {
  font-size: calc(96 * 0.6 * var(--u));
}

@media (max-width: 900px) {
  .facts-stack {
    --u: calc((100vw - 2 * var(--layout-margin)) / 840);
  }
}

/* ---------- FAQ (shared: contact page, service pages) ---------- */

/* FAQ Item (Figma 192:168) */
.faq {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.faq__item {
  border-bottom: 1px solid var(--color-border-subtle);
}

.faq__question {
  display: flex;
  gap: var(--space-24);
  align-items: center;
  justify-content: space-between;
  padding: var(--space-24) 0;
  cursor: pointer;
  list-style: none;
}

.faq__question::-webkit-details-marker {
  display: none;
}

.faq__question .icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.faq__item[open] .icon--plus,
.faq__item:not([open]) .icon--minus {
  display: none;
}

.faq__question:hover .icon {
  color: var(--color-interactive-primary);
}

/* answer reads clearly apart from the question: smaller, regular weight, secondary colour */
.faq__answer {
  max-width: 34em;
  margin-bottom: var(--space-24);
  color: var(--color-text-secondary);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-body);
}

.faq__answer p + p {
  margin-top: 0.75em;
}

.faq__item[open] .faq__answer {
  animation: faq-open 0.5s var(--ease-calm) both;
}

@keyframes faq-open {
  from {
    opacity: 0;
    translate: 0 -8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq__item[open] .faq__answer {
    animation: none;
  }
}

/* ---------- Service cards: hover says "clickable", open and closed ----------
   closed (dark): lifts, surface lightens, the arrow chip fades in
   open (light):  lifts with a shadow, the arrow chip turns coral and points right */
.services-section--accordion .service-card {
  cursor: pointer;
}

@media (hover: hover) {
  .services-section--accordion .service-card {
    transition:
      background-color var(--acc-time) var(--acc-ease),
      color var(--acc-time) var(--acc-ease),
      translate 0.4s var(--ease-calm),
      box-shadow 0.4s var(--ease-calm),
      opacity 0.3s ease,
      scale var(--acc-time) var(--acc-ease);
  }

  .services-section--accordion .service-card__arrow {
    transition: opacity 0.3s ease, scale 0.4s var(--ease-pop), background-color 0.3s ease, color 0.3s ease;
  }

  .services-section--accordion .service-card:not(.is-open):hover {
    background: color-mix(in srgb, var(--color-surface-raised) 85%, var(--color-core-surface-paper));
    translate: 0 calc(-1 * var(--space-4));
  }

  .services-section--accordion .service-card:not(.is-open):hover .service-card__arrow {
    opacity: 1;
    scale: 0.8;
    background: var(--color-fixed-light);
    color: var(--color-fixed-dark);
  }

  .services-section--accordion .service-card.is-open:hover {
    translate: 0 calc(-1 * var(--space-4));
    box-shadow: 0 16px 32px -12px rgb(0 0 0 / 0.5);
  }

  .services-section--accordion .service-card.is-open:hover .service-card__arrow {
    scale: 1.1;
    background: var(--color-interactive-primary);
    color: var(--color-fixed-light);
  }
}

.services-section--accordion .service-card:focus-visible {
  outline: 2px solid var(--color-interactive-primary);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .services-section--accordion .service-card:hover {
    translate: none;
  }
}

/* ---------- Services teaser (home): the list fades out, a button to the services page below ---------- */

.services-teaser {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-16);
  align-items: center;
  min-width: 0;
}

.services-teaser .service-cards {
  position: relative;
  align-self: stretch;
  max-height: 720px;
  /* cut at the bottom only; focus rings and hover lift stay visible at the sides and top */
  clip-path: inset(calc(-1 * var(--space-8)) calc(-1 * var(--space-8)) 0);
}

/* the fade: the last cards sink into the section background */
.services-teaser .service-cards::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 280px;
  background: linear-gradient(to bottom, transparent, var(--color-surface-base) 92%);
  pointer-events: none;
}

@media (max-width: 1023px) {
  .services-teaser {
    flex: none;
    width: 100%;
  }

  .services-teaser .service-cards {
    max-height: 340px;
    gap: var(--space-8);
  }

  .services-teaser .service-cards::after {
    height: 140px;
  }

  /* compact title rows like the mobile accordion; a tap opens the service page */
  .services-teaser .service-card {
    gap: var(--space-16);
    padding: var(--space-16) var(--space-24);
  }

  .services-teaser .service-card__head {
    justify-content: space-between;
  }

  .services-teaser .service-card__text,
  .services-teaser .service-card__pills {
    display: none;
  }

  .services-teaser .service-card__arrow {
    opacity: 1;
    scale: 0.8;
  }
}

/* touch screens: no stuck hover motion on cards and tiles after a tap */
@media (hover: none) {
  .project-tile:hover .project-tile__image img,
  .toggle-card__button:hover,
  .is-toggle:hover .toggle-card__button {
    scale: 1;
  }

  .next-card:hover .next-card__arrow .icon {
    rotate: 0deg;
  }
}

/* ---------- Scroll progress under sideways rows (site.js) ---------- */

.scroll-progress {
  --size: 0.5;
  --pos: 0;
  position: relative;
  width: 120px;
  height: 4px;
  /* right under the row: cancels the 48px gap of the service sections; the row's own bottom
     padding (room for shadows) leaves about 16px to the cards */
  margin: calc(-1 * var(--space-48)) auto 0;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, currentColor 18%, transparent);
}

.scroll-progress[hidden] {
  display: none;
}

.scroll-progress__thumb {
  position: absolute;
  top: 0;
  left: calc(var(--pos) * (1 - var(--size)) * 100%);
  width: calc(var(--size) * 100%);
  height: 100%;
  border-radius: inherit;
  background: currentColor;
}

/* studio (admin) preview note, shown on the client pages only to the Panel account */
.client-preview {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8) var(--space-24);
  align-items: center;
  justify-content: space-between;
  margin: 0 0 var(--space-24);
  padding: var(--space-16) var(--space-24);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-8);
}

.client-preview__edit {
  display: inline-flex;
  gap: var(--space-4);
  align-items: center;
  font-weight: var(--font-weight-bold);
  text-decoration: underline;
}

.client-preview__edit .icon {
  width: 14px;
  height: 14px;
}
