.legy-features {
  position: relative;
  z-index: 0;
  color: var(--ink);
  background: #ffffff;
}

.legy-features__divider {
  position: absolute;
  z-index: 2;
  top: -1px;
  left: 0;
  display: block;
  width: 100%;
  height: clamp(34px, 5vw, 76px);
  fill: var(--paper);
  pointer-events: none;
}

.legy-features__track {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: clamp(78px, 9vw, 132px) var(--gutter);
}

.legy-features__sticky {
  width: 100%;
  max-width: 1600px;
  margin-inline: auto;
}

.legy-features__container {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: clamp(48px, 6vw, 96px);
  align-items: center;
}

.legy-features__visual {
  position: relative;
  width: 100%;
  display: grid;
  gap: 16px;
  border-radius: clamp(22px, 2.4vw, 36px);
  background: transparent;
}

.legy-features__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: clamp(22px, 2.4vw, 36px);
  background: #f5f5f5;
  object-fit: contain;
  object-position: center;
}

.legy-features__content {
  min-width: 0;
}

.legy-features__eyebrow {
  flex: 0 0 auto;
}

.legy-features__eyebrow.catalog-categories__eyebrow {
  color: #ffffff;
  background: #171717;
  font-weight: 400;
}

.legy-features__states {
  margin-top: clamp(34px, 4vw, 56px);
}

.legy-features__state {
  position: relative;
  padding: 0;
}

.legy-features__state + .legy-features__state {
  margin-top: clamp(54px, 6vw, 92px);
}

.legy-features__state-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  color: #656565;
}

.legy-features__state-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.legy-features__state-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.legy-features__state h2 {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: clamp(34px, 3.2vw, 52px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.legy-features__state p {
  max-width: 500px;
  margin: 24px 0 0;
  color: #656565;
  font-family: var(--font-copy);
  font-size: clamp(17px, 1.25vw, 19px);
  font-weight: 300;
  line-height: 1.58;
}

.legy-features.is-ready {
  height: 420svh;
}

.legy-features.is-ready .legy-features__track {
  min-height: 100%;
  padding: 0 var(--gutter);
}

.legy-features.is-ready .legy-features__sticky {
  position: sticky;
  top: 0;
  display: grid;
  min-height: 100svh;
  align-items: center;
  box-sizing: border-box;
  padding-block: clamp(92px, 10vh, 128px) clamp(40px, 6vh, 82px);
}

.legy-features.is-ready .legy-features__visual {
  display: block;
  height: min(64svh, 680px);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: clamp(22px, 2.4vw, 36px);
  background: #f5f5f5;
}

.legy-features.is-ready .legy-features__image {
  position: absolute;
  inset: 0;
  height: 100%;
  border-radius: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  backface-visibility: hidden;
  will-change: opacity;
}

.legy-features.is-ready .legy-features__image[data-feature-index="0"] {
  opacity: 1;
}

.legy-features.is-ready .legy-features__states {
  position: relative;
  min-height: clamp(270px, 29vw, 390px);
}

.legy-features.is-ready .legy-features__state {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 12px, 0);
  backface-visibility: hidden;
  will-change: opacity, transform;
}

.legy-features.is-ready .legy-features__state[data-feature-index="0"] {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@keyframes legy-features-entry-image {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes legy-features-entry-state {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.legy-features.is-ready.is-feature-entry
  .legy-features__image[data-feature-index="0"] {
  animation: legy-features-entry-image 900ms var(--ease) both;
}

.legy-features.is-ready.is-feature-entry
  .legy-features__state[data-feature-index="0"] {
  animation: legy-features-entry-state 900ms var(--ease) both;
}

@media (max-width: 1100px) {
  .legy-features__container {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
    gap: clamp(32px, 5vw, 64px);
  }

  .legy-features.is-ready .legy-features__sticky {
    padding-block: 88px 48px;
  }

  .legy-features.is-ready .legy-features__visual {
    height: min(58svh, 540px);
  }

  .legy-features.is-ready .legy-features__states {
    min-height: clamp(250px, 34vw, 330px);
  }
}

@media (max-width: 767.98px) {
  .legy-features__track {
    padding-inline: clamp(20px, 6vw, 28px);
  }

  .legy-features__container {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }

  .legy-features__content {
    display: contents;
  }

  .legy-features__eyebrow {
    order: 1;
    align-self: flex-start;
    margin-bottom: 22px;
  }

  .legy-features__visual {
    order: 2;
    border-radius: 22px;
  }

  .legy-features__states {
    order: 3;
    margin-top: 26px;
  }

  .legy-features__state h2 {
    font-size: clamp(30px, 8vw, 42px);
    line-height: 1.06;
  }

  .legy-features__state p {
    max-width: 36ch;
    margin-top: 18px;
    font-size: 15px;
    line-height: 1.55;
  }

  .legy-features__state-icon {
    width: 46px;
    height: 46px;
  }

  .legy-features__state-icon svg {
    width: 26px;
    height: 26px;
  }

  .legy-features.is-ready {
    height: 430svh;
  }

  .legy-features.is-ready .legy-features__sticky {
    min-height: 100svh;
    padding-block: max(78px, calc(env(safe-area-inset-top) + 64px)) 30px;
  }

  .legy-features.is-ready .legy-features__visual {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .legy-features.is-ready .legy-features__states {
    min-height: clamp(190px, 53vw, 250px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .legy-features.is-ready .legy-features__image,
  .legy-features.is-ready .legy-features__state {
    transition: none;
  }
}
