/* Homepage product engineering story */
.engineering.engineering-story {
  position: relative;
  height: 380vh;
  padding-block: 0;
  overflow: visible;
  background: #edf1f4;
  transition: background-color 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.engineering.engineering-story.engineering-story--white {
  background: #fff;
}

.engineering-story .engineering__inner {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(34px, 4vw, 76px);
  align-items: center;
  height: 100dvh;
  padding-block: clamp(42px, 6vh, 72px);
}

.engineering-story .engineering__content {
  position: relative;
  z-index: 2;
  max-width: 430px;
}

.engineering-story__visual {
  position: relative;
  align-self: center;
  height: min(82vh, 820px);
  min-height: 620px;
  overflow: hidden;
  isolation: isolate;
  background: transparent;
}

.engineering-story__rail {
  position: absolute;
  top: 24px;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 76px auto;
  gap: 10px;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(13, 28, 39, 0.58);
  font-variant-numeric: tabular-nums;
}

.engineering-story__rail-line {
  position: relative;
  display: block;
  height: 1px;
  overflow: hidden;
  background: rgba(13, 28, 39, 0.18);
}

.engineering-story__rail-line i {
  position: absolute;
  inset: 0;
  background: var(--nashorn-blue);
  transform: scaleX(var(--engineering-progress, 0.1429));
  transform-origin: left center;
  transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.engineering-story__state {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  background: transparent;
  transform: translate3d(0, 56px, 0);
  transition:
    opacity 420ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 420ms;
}

.engineering-story__state.is-entering--above {
  visibility: visible;
  transform: translate3d(0, -56px, 0);
}

.engineering-story__state.is-entering--below {
  visibility: visible;
}

.engineering-story__state.is-transition-prep {
  transition: none !important;
}

.engineering-story__state.is-leaving--up,
.engineering-story__state.is-leaving--down {
  z-index: 1;
  visibility: visible;
  opacity: 0;
  transition-delay: 0s;
}

.engineering-story__state.is-leaving--up {
  transform: translate3d(0, -56px, 0);
}

.engineering-story__state.is-leaving--down {
  transform: translate3d(0, 56px, 0);
}

.engineering-story__state.is-active {
  z-index: 2;
  visibility: visible;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: 0s;
}

.engineering-story__media {
  position: absolute;
  inset: 54px 0 106px;
  display: grid;
  place-items: center;
}

.engineering-story__media > img {
  display: block;
  width: auto;
  max-width: 82%;
  height: auto;
  max-height: 82%;
  object-fit: contain;
  filter: drop-shadow(0 24px 25px rgba(27, 44, 57, 0.09));
  transition: none;
}

.engineering-story__product {
  position: absolute;
  right: 0;
  bottom: 25px;
  left: 0;
  z-index: 8;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-top: 17px;
  border-top: 1px solid rgba(13, 28, 39, 0.2);
}

.engineering-story__product p,
.engineering-story__product h3 {
  margin: 0;
  color: var(--navy-900);
}

.engineering-story__product p {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 1.9vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.engineering-story__product h3 {
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-align: right;
  text-transform: uppercase;
}

.engineering-story__callouts,
.engineering-story__facts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.engineering-story__callouts {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.engineering-story__callouts li {
  position: absolute;
  top: var(--cy);
  left: var(--cx);
  max-width: 190px;
  padding-left: 18px;
  font-family: var(--font-heading);
  font-size: clamp(0.82rem, 1vw, 1rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--navy-900);
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity 440ms ease, transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
}

.engineering-story__callouts li::before {
  content: "";
  position: absolute;
  top: 0.38em;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--nashorn-blue);
}

.engineering-story__state.is-active .engineering-story__callouts li {
  opacity: 1;
  transform: none;
}

.engineering-story__state.is-active .engineering-story__callouts li:nth-child(1) { transition-delay: 280ms; }
.engineering-story__state.is-active .engineering-story__callouts li:nth-child(2) { transition-delay: 390ms; }
.engineering-story__state.is-active .engineering-story__callouts li:nth-child(3) { transition-delay: 500ms; }

.engineering-story__facts {
  position: absolute;
  right: 0;
  bottom: 6%;
  z-index: 4;
  display: grid;
  gap: 0;
  width: min(38%, 260px);
}

.engineering-story__facts li {
  position: relative;
  padding: 11px 0 11px 20px;
  border-top: 0;
  background: transparent;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--navy-900);
}

.engineering-story__facts li + li {
  border-top: 1px solid rgba(13, 28, 39, 0.18);
}

.engineering-story__facts li:last-child {
  border-bottom: 0;
}

.engineering-story__facts li::before {
  content: "";
  position: absolute;
  top: 1.05rem;
  left: 0;
  width: 7px;
  height: 7px;
  background: var(--nashorn-blue);
}

.engineering-story__cabinet-loop {
  position: relative;
  left: -6%;
  width: min(68%, 470px);
  aspect-ratio: 1;
}

.engineering-story__cabinet-loop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  display: none;
}

.engineering-story__cabinet-loop img.is-current {
  display: block;
}

.engineering-story__media--table > img {
  max-width: 78%;
  max-height: 70%;
}

.engineering-story__facts--table {
  right: 0;
  bottom: 2%;
  left: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
}

.engineering-story__facts--table li {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  padding-right: 14px;
  border: 0;
}

.engineering-story__facts--table li + li {
  padding-left: 28px;
}

.engineering-story__facts--table li:last-child {
  border-bottom: 0;
}

.engineering-story__hotspots {
  display: block;
}

.engineering-story__hotspots .hotspots__stage {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.engineering-story__hotspots .hotspots__product {
  width: min(70%, 540px);
}

.engineering-story__hotspots .hotspots__product img {
  max-height: 470px;
  object-fit: contain;
  filter: drop-shadow(0 24px 25px rgba(27, 44, 57, 0.09));
}

.engineering-story__hotspots--cl02 .hotspots__product {
  width: min(72%, 640px);
}

.engineering-story__hotspots--mattress .hotspots__product {
  width: min(76%, 620px);
}

.engineering-story__hotspots--chair .hotspots__product {
  width: min(60%, 460px);
}

.engineering-story__hotspots--chair .hotspots__product img {
  max-height: 500px;
}

.engineering-story__state:is([data-engineering-state="4"], [data-engineering-state="5"]) .engineering-story__media {
  z-index: 2;
}

.engineering-story__state:is([data-engineering-state="4"], [data-engineering-state="5"]) .engineering-story__product {
  z-index: auto;
  border-top: 0;
}

.engineering-story__state:is([data-engineering-state="4"], [data-engineering-state="5"]) .engineering-story__product::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  height: 1px;
  background: rgba(13, 28, 39, 0.2);
}

.engineering-story__state:is([data-engineering-state="4"], [data-engineering-state="5"]) .engineering-story__product :is(p, h3) {
  position: relative;
  z-index: 3;
}

.engineering-story__media--family {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 44px);
  align-items: center;
  padding-inline: 0;
}

.engineering-story__media--family figure {
  display: grid;
  gap: 12px;
  margin: 0;
}

.engineering-story__media--family img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.engineering-story__media--family figcaption {
  display: grid;
  gap: 2px;
  color: var(--navy-900);
}

.engineering-story__media--family strong {
  font-family: var(--font-heading);
  font-size: clamp(0.9rem, 1.1vw, 1.1rem);
}

.engineering-story__media--family span {
  font-size: clamp(0.9rem, 1vw, 1rem);
  line-height: 1.5;
  color: var(--muted-text);
}

.engineering-story__legacy[hidden] {
  display: none !important;
}

/* Desktop Master owns the annotation layout even when its tablet column is
   narrower than the generic 680px hotspot container threshold. */
.engineering-story__hotspots.hotspots.is-wide-layout .hotspots__stage {
  display: grid;
  min-height: 580px;
}

.engineering-story__hotspots.hotspots.is-wide-layout .hotspots__product {
  grid-area: 1 / 1;
  width: min(72%, 640px);
  margin-inline: 0;
  align-self: center;
  justify-self: center;
}

.engineering-story__hotspots--cl02.hotspots.is-wide-layout .hotspots__product {
  width: min(72%, 640px);
}

.engineering-story__hotspots--mattress.hotspots.is-wide-layout .hotspots__product {
  width: min(76%, 620px);
}

.engineering-story__hotspots--chair.hotspots.is-wide-layout .hotspots__product {
  width: min(60%, 460px);
}

.engineering-story__hotspots.hotspots.is-wide-layout .hotspot__num {
  font-size: 0;
}

.engineering-story__hotspots.hotspots.is-wide-layout .hotspots__product img {
  pointer-events: none;
}

.engineering-story__hotspots.hotspots.is-wide-layout .hotspot {
  z-index: 5;
  pointer-events: auto;
}

.engineering-story__hotspots.hotspots.is-wide-layout .hotspot::before,
.engineering-story__hotspots.hotspots.is-wide-layout .hotspot::after {
  width: 14px;
  height: 14px;
}

.engineering-story__hotspots.hotspots.is-wide-layout .hotspot::before {
  background: var(--white);
  border-color: var(--nashorn-blue);
}

.engineering-story__hotspots.hotspots.is-wide-layout .hotspot:hover::before,
.engineering-story__hotspots.hotspots.is-wide-layout .hotspot:focus-visible::before,
.engineering-story__hotspots.hotspots.is-wide-layout .hotspot.is-active::before {
  transform: scale(1.35);
  background: var(--nashorn-blue);
  border-color: var(--white);
}

.engineering-story__hotspots.hotspots.is-wide-layout .hotspot-lines {
  display: block;
}

.engineering-story__hotspots.hotspots.is-wide-layout.is-enhanced .hotspot-labels {
  position: absolute;
  inset: 0;
  display: block;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  pointer-events: none;
}

.engineering-story__hotspots.hotspots.is-wide-layout.is-enhanced .hotspot-label,
.engineering-story__hotspots.hotspots.is-wide-layout.is-enhanced .hotspot-label.is-active {
  position: absolute;
  top: var(--ly);
  left: var(--lx);
  display: flex;
  width: 210px;
  translate: none;
  animation: none;
  pointer-events: auto;
}

.engineering-story__hotspots.hotspots.is-wide-layout.is-enhanced .hotspot-label--right,
.engineering-story__hotspots.hotspots.is-wide-layout.is-enhanced .hotspot-label--right.is-active {
  flex-direction: row-reverse;
  translate: -100% 0;
}

.engineering-story__hotspots.hotspots.is-wide-layout .hotspot-label--right .hotspot-label__body {
  text-align: right;
}

@media (min-width: 1200px) {
  .engineering-story__product {
    bottom: 0;
  }

  .engineering-story__state[data-engineering-state="0"] #engineering-cl02-4 {
    --ly: 68% !important;
  }

  .engineering-story__state[data-engineering-state="0"] #engineering-cl02-5 {
    --ly: 60% !important;
  }
}

@media (max-width: 767.98px),
       (min-width: 768px) and (max-width: 1023.98px) and (orientation: portrait),
       (min-width: 768px) and (max-width: 1199.98px) and (orientation: landscape) and (max-height: 600px) {
  .engineering.engineering-story {
    height: auto;
    padding-block: clamp(80px, 11vw, 120px);
    overflow: hidden;
  }

  .engineering-story .engineering__inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
    height: auto;
    padding-block: 0;
  }

  .engineering-story__visual {
    display: grid;
    gap: 18px;
    height: auto;
    min-height: 0;
    overflow: visible;
    background: transparent;
  }

  .engineering-story__rail { display: none; }

  .engineering-story__state,
  .engineering-story__state.is-active {
    position: relative;
    inset: auto;
    min-height: 620px;
    visibility: visible;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 767.98px) {
  .engineering-story__state,
  .engineering-story__state.is-active {
    min-height: 520px;
  }

  .engineering-story__media {
    inset: 42px 16px 100px;
  }

  .engineering-story__product {
    right: 18px;
    bottom: 20px;
    left: 18px;
    gap: 12px;
  }

  .engineering-story__product p {
    font-size: 1.18rem;
  }

  .engineering-story__product h3 {
    max-width: 48%;
    font-size: 0.65rem;
  }

  .engineering-story__callouts li {
    max-width: 130px;
    font-size: 0.72rem;
  }

  .engineering-story__facts {
    right: 0;
    bottom: 2%;
    max-width: 170px;
  }

  .engineering-story__facts li {
    padding: 7px 9px;
    font-size: 0.69rem;
  }

  .engineering-story__facts--table {
    left: 0;
    width: 100%;
    max-width: none;
  }

  .engineering-story__facts--table li + li {
    padding-left: 18px;
  }

  .engineering-story__media--family {
    gap: 12px;
    padding-inline: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .engineering-story__state,
  .engineering-story__media > img,
  .engineering-story__callouts li,
  .engineering-story__rail-line i {
    transition: none;
  }

  .engineering-story__cabinet-loop img {
    animation: none;
  }

  .engineering-story__cabinet-loop img:first-child {
    opacity: 1;
    transform: none;
  }
}
