/* =========================
   Services — common styles
========================= */

.services {
  --services-accent: #ea0044;
  --services-surface: #141316;
  --services-text: #f0f0f0;
  --services-muted: #b8b8b8;

  --services-shadow:
    0 0.597144px 0.597144px -0.9375px rgb(0 0 0 / 7%),
    0 1.81088px 1.81088px -1.875px rgb(0 0 0 / 7%),
    0 4.78699px 4.78699px -2.8125px rgb(0 0 0 / 6%),
    0 15px 15px -3.75px rgb(0 0 0 / 3%);

  width: 100%;
  min-width: 0;
  position: relative;

  color: var(--services-text);
  font-family: "Roboto", Arial, Helvetica, sans-serif;

  scroll-margin-top: 100px;

  /* Let animated cards extend beyond the section edges. */
  overflow: visible;
}

.services,
.services *,
.services *::before,
.services *::after {
  box-sizing: border-box;
}

.services .services__inner {
  width: 100%;
  min-width: 0;
  position: relative;

  overflow: visible;
}

.services .services__intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  min-width: 0;
  z-index: 1;
}

.services .services__heading {
  width: 100%;
  margin: 0;

  color: var(--services-text);
  font-family: "Space Grotesk", Arial, Helvetica, sans-serif;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;

  overflow-wrap: break-word;
}

.services .services__word {
  display: inline-block;
}

.services .services__word--accent {
  color: var(--services-accent);
}

/* Heading entrance */

.services .services__heading.is-ready .services__word {
  opacity: 0.001;
  transform: translateY(10px);

  transition:
    opacity 0.9s cubic-bezier(0.55, 0.01, 0.2, 1),
    transform 0.9s cubic-bezier(0.55, 0.01, 0.2, 1);

  transition-delay: var(--services-word-delay, 0s);
}

.services .services__heading.is-visible .services__word {
  opacity: 1;
  transform: none;
}

/* =========================
   Tools
========================= */

.services .services__tools {
  display: flex;
  flex-direction: column;
  gap: 16px;

  width: 100%;
  min-width: 0;
}

.services .services__tools-label {
  margin: 0;

  color: var(--services-muted);
  font-size: 20px;
  line-height: 1.3;
}

.services .services__tools-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 60px));
  gap: 8px;

  width: 100%;
  max-width: 468px;
  margin: 0;
  padding: 0;

  list-style: none;
}

.services .services__tool {
  position: relative;

  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
}

/* Tool entrance */

.services .services__tool.is-ready {
  opacity: 0;
  transform: translateX(var(--services-tool-x, 0px));

  transition:
    opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);

  transition-delay: var(--services-tool-delay, 0s);
}

.services .services__tool.is-visible {
  opacity: 1;
  transform: none;
}

.services .services__tool-button {
  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;
  z-index: 2;

  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;

  border: 0;
  border-radius: 13px;

  background: var(--services-surface);
  color: #dedede;
  box-shadow: var(--services-shadow);

  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

.services .services__tool-button::after {
  content: "";
  position: absolute;
  inset: 0;

  border: 1.07px solid rgb(84 84 84 / 50%);
  border-radius: inherit;

  pointer-events: none;
}

.services .services__tool-button:focus-visible {
  outline: 2px solid var(--services-accent);
  outline-offset: 3px;
}

.services .services__tool-icon {
  display: block;

  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}

.services .services__tool-icon path {
  fill: currentColor;
}

.services .services__tooltip {
  position: absolute;
  top: -32px;
  left: 50%;
  z-index: 3;

  padding: 4px 8px;
  border-radius: 1000px;

  transform: translateX(calc(-50% + var(--services-tooltip-shift, 0px)));

  background: var(--services-surface);
  color: var(--services-surface);

  font-size: 13px;
  line-height: 1.12;
  letter-spacing: -0.01em;
  white-space: nowrap;

  opacity: 0;
  pointer-events: none;
  user-select: none;
}

/* Hover/focus fallback */

.services .services__tool:not(.has-hover-js):hover .services__tool-button,
.services
  .services__tool:not(.has-hover-js):focus-within
  .services__tool-button {
  color: var(--services-accent);
}

.services .services__tool:not(.has-hover-js):hover .services__tooltip,
.services .services__tool:not(.has-hover-js):focus-within .services__tooltip {
  background: var(--services-accent);
  color: #fafafa;
  opacity: 1;
}

/* =========================
   Cards
========================= */

.services .services__stack {
  width: 100%;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.services .services__item {
  width: 100%;
  min-width: 0;
}

.services .services__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;

  width: 100%;
  min-width: 0;
  padding: 20px;

  position: relative;

  border-radius: 24px;
  background: var(--services-surface);
  box-shadow: var(--services-shadow);

  /* Clip only this card's content to its rounded corners. */
  overflow: clip;

  transform-origin: 50% 50%;
}

.services .services__card::after {
  content: "";
  position: absolute;
  inset: 0;

  border: 2px solid #2b2b2b;
  border-radius: inherit;

  pointer-events: none;
}

.services .services__card--accent {
  background: var(--services-accent);
}

.services .services__card--accent::after {
  border-color: rgb(130 130 130 / 50%);
}

.services .services__card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;

  width: 100%;
  min-width: 0;
}

.services .services__card-heading {
  display: flex;
  align-items: center;
  gap: 16px;

  width: 100%;
  min-width: 0;
  min-height: 46px;
}

.services .services__card-icon {
  display: block;

  width: 32px;
  height: 32px;
  flex: 0 0 32px;

  color: var(--services-accent);
}

.services .services__card-title {
  margin: 0;
  min-width: 0;

  color: #fafafa;
  font-family: "Space Grotesk", Arial, Helvetica, sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;

  overflow-wrap: break-word;
}

.services .services__card-description {
  margin: 0;

  color: var(--services-muted);
  font-size: 20px;
  line-height: 1.3;

  overflow-wrap: break-word;
}

.services .services__card--accent .services__card-icon,
.services .services__card--accent .services__card-description {
  color: #fff;
}

.services .services__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;

  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;

  list-style: none;
}

.services .services__tag {
  position: relative;

  max-width: 100%;
  padding: 8px 16px;
  border-radius: 100px;

  background: var(--services-surface);
  color: var(--services-text);

  font-size: 16px;
  line-height: 1.4;

  overflow-wrap: break-word;
}

.services .services__tag::after {
  content: "";
  position: absolute;
  inset: 0;

  border: 1px solid #545454;
  border-radius: inherit;

  pointer-events: none;
}

.services .services__card--accent .services__tag {
  background: transparent;
}

.services .services__card--accent .services__tag::after {
  border: 0.5px solid #f7f7f7;
}

.services .services__item.is-animated .services__card {
  will-change: transform, opacity;
}

.services::selection,
.services *::selection {
  background: transparent;
  color: #fff;
}

/* =========================
   1. Laptop — 1025px+
========================= */

@media (min-width: 1025px) {
  .services {
    padding: 75px 0;
  }

  .services .services__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 442px;
    align-items: start;
    gap: 54px;

    padding-bottom: 120px;
  }

  .services .services__intro {
    position: sticky;
    top: 180px;
    gap: 54px;
  }

  .services .services__heading {
    font-size: 60px;
  }

  .services .services__stack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 54px;
  }

  .services .services__item {
    position: sticky;
    top: 180px;

    flex: 0 0 auto;
  }

  .services .services__card {
    min-height: 280px;
  }
}

/* =========================
   2. Tablet — 769px–1024px
========================= */

@media (min-width: 769px) and (max-width: 1024px) {
  .services {
    padding: 60px 0;
  }

  .services .services__inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 48px;

    padding-bottom: 60px;
  }

  .services .services__intro {
    position: relative;
    top: auto;
    gap: 32px;
  }

  .services .services__heading {
    font-size: 60px;
  }

  .services .services__tools-label {
    font-size: 18px;
  }

  .services .services__stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 24px;
  }

  .services .services__item {
    position: relative;
    top: auto;
  }

  .services .services__card {
    height: 100%;
    min-height: 330px;
  }

  .services .services__card-title {
    font-size: 28px;
  }

  .services .services__card-description {
    font-size: 18px;
  }

  .services .services__item--digital {
    grid-column: 1 / -1;
  }

  .services .services__item--digital .services__card {
    min-height: 220px;
  }
}

/* =========================
   3. Phone — up to 768px
========================= */

@media (max-width: 768px) {
  .services {
    padding: 48px 0;
    scroll-margin-top: 96px;
  }

  .services .services__inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 48px;

    padding-bottom: 120px;
  }

  .services .services__intro {
    position: relative;
    top: auto;
    gap: 28px;
  }

  .services .services__heading {
    font-size: clamp(32px, 8.5vw, 44px);
  }

  .services .services__tools-label {
    font-size: 18px;
  }

  .services .services__tools-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;

    max-width: none;
  }

  .services .services__tool {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
  }

  .services .services__tool-button {
    border-radius: 10.54px;
  }

  .services .services__tool-button::after {
    border-width: 0.86px;
  }

  .services .services__tool-icon {
    width: 21px;
    height: 21px;
  }

  .services .services__tooltip {
    top: -26px;

    padding: 4px 7px;
    font-size: 11px;
  }

  .services .services__stack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 32px;
  }

  .services .services__item {
    position: sticky;
    top: 96px;

    flex: 0 0 auto;
  }

  .services .services__card {
    min-height: 325px;
  }

  .services .services__card-title {
    font-size: clamp(28px, 8.5vw, 32px);
  }

  .services .services__card-description {
    font-size: 18px;
  }

  .services .services__tag {
    padding: 8px 14px;
    font-size: 15px;
  }
}

/* Natural positions for the existing scroll animation. */

.services.is-measuring .services__intro,
.services.is-measuring .services__item {
  position: relative;
  top: auto;
}

/* Motion preference */

@media (prefers-reduced-motion: reduce) {
  .services .services__heading.is-ready .services__word,
  .services .services__tool.is-ready {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .services .services__item.is-animated .services__card {
    transform: none !important;
    opacity: 1 !important;
    will-change: auto;
  }
}
