.speed {
  background-color: var(--opt-white);
}

.speed__wrap {
  display: flex;
  flex-direction: column;
  gap: 64px;
  max-width: 1152px;
  width: 100%;
  min-width: 0;
}

.speed__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 24px 64px;
}

.speed__head-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  flex: 1 1 420px;
  min-width: 0;
}

.speed__eyebrow {
  display: inline-flex;
  padding: 7px 14px;
  border: 1px solid var(--opt-green);
  border-radius: 999px;
  background-color: var(--opt-white);
  font-size: 14px;
  font-weight: 500;
  color: var(--opt-ink);
}

.speed__title {
  margin-top: 0;
}

.speed__head-text {
  flex: 1 1 420px;
  min-width: 0;
}

.speed__lead {
  max-width: 480px;
  color: #151515;
  line-height: 1.5;
}

.speed__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.speed__foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.speed__charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.speed-chart {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 440px;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(500px 240px at 50% 0%, rgba(255, 255, 255, 0.55), transparent 70%),
    linear-gradient(180deg, #bfe9d2 0%, #ddf4e7 45%, #a7ddbf 100%);
}

.speed-chart__dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px);
  background-size: 14px 14px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 40%);
  mask-image: linear-gradient(180deg, #000, transparent 40%);
  pointer-events: none;
}

.speed-chart__fade {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 110px;
  background: linear-gradient(180deg, rgba(167, 221, 191, 0), rgba(110, 180, 140, 0.55));
  pointer-events: none;
}

.speed-chart__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 26px 0;
}

.speed-chart__title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--opt-ink);
}

.speed-chart__hint {
  padding: 5px 12px;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--opt-green-dark);
}

.speed-chart__bars {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 48px;
  padding: 0 48px 64px;
}

.speed-bar {
  position: relative;
  gap: 10px;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  height: 100%;
}

.speed-bar__tag {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.speed-bar__value {
  padding: 8px 14px;
  border-radius: 10px;
  background-color: var(--opt-white);
  box-shadow: 0 10px 24px -14px rgba(0, 60, 30, 0.5);
  font-size: 22px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--opt-ink);
}

.speed-bar__pointer {
  width: 0;
  height: 0;
  border-top: 7px solid var(--opt-white);
  border-right: 7px solid transparent;
  border-left: 7px solid transparent;
}

.speed-bar__line {
  height: 22px;
  border-left: 1.5px dotted rgba(255, 255, 255, 0.9);
}

.speed-bar__body {
  position: relative;
  width: 100%;
  max-width: 104px;
  transform-origin: bottom;
  animation: speed-grow 1.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.speed-bar__body--mid {
  height: 176px;
}

.speed-bar__body--tall {
  height: 208px;
}

.speed-bar__body--short {
  height: 34px;
}

.speed-bar__half {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
}

.speed-bar__half--left {
  left: 0;
}

.speed-bar__half--right {
  right: 0;
}

.speed-bar__gem {
  position: absolute;
  top: -26px;
  right: 0;
  left: 0;
  height: 52px;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.speed-bar__body--gold .speed-bar__half--left {
  background: linear-gradient(180deg, #f7d774, rgba(247, 215, 116, 0.8));
}

.speed-bar__body--gold .speed-bar__half--right {
  background: linear-gradient(180deg, #ebc24f, rgba(235, 194, 79, 0.8));
}

.speed-bar__body--gold .speed-bar__gem {
  background: radial-gradient(closest-side, #ffffff 0 3px, #fff1bf 10px, #f9de86 100%);
}

.speed-bar__body--pink .speed-bar__half--left {
  background: linear-gradient(180deg, #f5a3c0, rgba(245, 163, 192, 0.8));
}

.speed-bar__body--pink .speed-bar__half--right {
  background: linear-gradient(180deg, #e987aa, rgba(233, 135, 170, 0.8));
}

.speed-bar__body--pink .speed-bar__gem {
  background: radial-gradient(closest-side, #ffffff 0 3px, #ffd9e6 10px, #f7b4cb 100%);
}

.speed-bar__body--green .speed-bar__half--left {
  background: linear-gradient(180deg, #0e9f55, rgba(14, 159, 85, 0.8));
}

.speed-bar__body--green .speed-bar__half--right {
  background: linear-gradient(180deg, #007a3d, rgba(0, 122, 61, 0.8));
}

.speed-bar__body--green .speed-bar__gem {
  background: radial-gradient(closest-side, #ffffff 0 3px, #3fd18a 10px, #14b866 100%);
}

.speed-chart:nth-child(1) .speed-bar:nth-child(2) .speed-bar__body {
  animation-delay: 0.15s;
}

.speed-chart:nth-child(2) .speed-bar:nth-child(1) .speed-bar__body {
  animation-delay: 0.3s;
}

.speed-chart:nth-child(2) .speed-bar:nth-child(2) .speed-bar__body {
  animation-delay: 0.45s;
}

.speed-bar__label {
  position: absolute;
  bottom: 20px;
  left: 50%;
  z-index: 2;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background-color: rgba(10, 40, 24, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--opt-white);
  transform: translateX(-50%);
}

.speed__note {
  margin: 0;
  font-size: 14px;
  color: #3e4943;
}

.speed__link {
  display: inline-block;
  align-self: flex-start;
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
  color: var(--opt-ink);
}

@keyframes speed-grow {
  from {
    transform: scaleY(0);
  }

  to {
    transform: scaleY(1);
  }
}

@media (max-width: 991.98px) {
  .speed-chart__bars {
    gap: 32px;
  }
}

/* Tablet: the two charts stay side by side down to 700px (each then about a phone
   wide) instead of two very wide cards with the bars lost in the middle. */
@media (max-width: 899.98px) {
  .speed__wrap {
    gap: 40px;
  }
}

@media (max-width: 699.98px) {
  .speed__charts {
    grid-template-columns: 1fr;
  }
}

/* Phone: a shorter chart with the bars scaled down with it, tighter side padding,
   smaller value tags and less air above and below the heading block. */
@media (max-width: 575.98px) {
  .speed__wrap {
    gap: 32px;
  }

  .speed__head {
    gap: 16px;
  }

  .speed__lead {
    font-size: 16px;
    line-height: 1.55;
  }

  .speed-chart {
    height: 380px;
  }

  .speed-chart__bars {
    gap: 16px;
    padding: 0 24px 52px;
  }

  .speed-bar__value {
    padding: 6px 12px;
    font-size: 18px;
  }

  .speed-bar__body--mid {
    height: 140px;
  }

  .speed-bar__body--tall {
    height: 168px;
  }

  .speed-bar__body--short {
    height: 30px;
  }
}

/* Tablet and small laptop (576px-1199px). */
@media (min-width: 576px) and (max-width: 1199.98px) {

  /* The name pills sit under the bars instead of inside their base (bottom: 20px put the
     pill 20-53px above the floor). The "16 ms" bar is only 34px tall, so its "With LeadX"
     pill covered the who/* The heading broke as "Every millisecond makes a / difference." at 576-612px, and the intro
d not be seen. Now every bar is whole and the pills read as the
     chart's axis labels, in the 64px of floor the chart already reserves under the bars
     (pill bottom 18px above the card edge). 1200px and up keeps the pills on the bars. */
  .speed-bar__label {
    bottom: -46px;
  }
}

/* Tablet header (576-991px): the eyebrow, the heading and the intro are centred over the two
   charts, like the headings of Features, Promises and How it works, with the note and the link
   under the charts centred too. The title and the intro are stacked on purpose: left to the
   flex-wrap they sat side by side from 951px up and stacked below it, so the header changed
   shape inside the tablet range. From 992px they sit side by side as designed; phones (below
   576px) are left alone.
   The heading is two lines, "Every millisecond makes a / difference.". Its width is capped in
   em so it follows the font size: "Every millisecond makes a" is 11.28em wide and the whole
   heading 16.2em, so 13.5em (the middle) always breaks before "difference." Without the cap it
   ran out as one long line at 613-991px.
   Was, tried and removed: text-wrap: balance on .speed__title, and max-width: 9.5em, which broke
   it as "Every millisecond / makes a difference." (left-aligned, both removed at the owner's
   request). */
@media (min-width: 576px) and (max-width: 991.98px) {
  .speed__head {
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
  }

  .speed__head-title {
    flex: 0 0 auto;
    align-items: center;
    width: 100%;
  }

  .speed__head-text {
    flex: 0 0 auto;
    width: 100%;
  }

  .speed__title {
    max-width: 13.5em;
  }

  .speed__lead {
    margin-inline: auto;
  }

  .speed__note {
    text-align: center;
  }

  .speed__link {
    align-self: center;
  }
}

/* The intro ended on "120 ms." alone at 992px. Only from 992px, where the intro sits beside the
   heading: on the centred tablet header (576-991px) it keeps its natural line breaks. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .speed__lead {
    text-wrap: balance;
  }
}

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