/* Decoration between sections: the key-row divider and the technologies strip. Both are aria-hidden. */

/* Divider: a row of small keycaps (assets/divider-keys.svg) with the D and M of the logo in the middle and a few
   keys lit in --accent. It sits on the seam between two sections, in the empty padding both of them have:
   a negative margin of half its height centres it on the seam without adding any space to the page. */
.keys-divider {
  position: relative; /* paints above the background of the section that follows */
  z-index: 1;
  width: min(100% - 2 * var(--gutter), 560px);
  height: 28px;
  margin-block: -14px;
  margin-inline: auto;
  background: url('/assets/divider-keys.svg') center / contain no-repeat;
}

/* Technologies strip. .tech-track is the only moving element and has no padding and no gap: the spacing is
   inside every item (padding-inline-end), so the two identical .tech-set halves are exactly 50% of the track
   and translateX(-50%) lands the second half where the first one started. */
.tech-strip {
  overflow: hidden; /* the wide track never makes the page scroll sideways */
  padding-block: 40px;
  background: var(--bg);
  border-top: 1px solid var(--line-soft);
  user-select: none;
}

.tech-track {
  display: flex;
  width: max-content;
  animation: tech-slide 70s linear infinite;
}

.tech-strip:hover .tech-track {
  animation-play-state: paused;
}

.tech-set {
  display: flex;
  flex: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tech-item {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.4em;
  padding-inline-end: 0.4em;
  font-size: clamp(56px, 9vw, 120px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  white-space: nowrap;
  color: var(--text);
}

/* Every other word is only an outline. Fill = page background and the stroke is painted underneath it: the
   variable font has overlapping contours, and a transparent fill would show them as stray inner lines. */
.tech-item:nth-child(even) .tech-word {
  color: var(--bg);
  -webkit-text-stroke: 3px var(--text-2);
  paint-order: stroke fill;
}

/* Separator: a small blue keycap turned into a diamond, like the keys of the logo. */
.tech-item::after {
  content: '';
  flex: none;
  width: 0.2em;
  height: 0.2em;
  margin-inline-start: 0.2em;
  border-radius: 0.04em;
  background: var(--accent);
  box-shadow: 0 0.04em 0 var(--accent-side);
  transform: rotate(45deg);
}

@keyframes tech-slide {
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  /* Still strip: one set, centred, wrapping onto as many rows as it needs. */
  .tech-track {
    display: block; /* the set takes the container's width, so its items wrap instead of overflowing */
    width: auto;
    animation: none;
  }

  .tech-set {
    flex-wrap: wrap;
    justify-content: center;
    padding-inline: var(--gutter);
  }

  .tech-set:nth-child(2) {
    display: none;
  }

  .tech-item {
    font-size: clamp(36px, 6vw, 64px);
  }
}
