/* Quotes are readable before enhancement and when motion is reduced. */
.stack-area {
  --deck-gap: calc(0.875 * var(--home-unit));
  --deck-card-ratio: calc(380 / 452);
  --deck-header-half: 2.45rem;
  position: relative;
  color: #182c32;
  background: var(--paper);
}
.stack-stage {
  container-type: inline-size;
  padding: 5rem 0 9.1rem;
}
.stack {
  --deck-card-width: calc((min(100cqw, var(--wrap)) - 2 * var(--pad) - 2 * var(--deck-gap)) / 3);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: var(--deck-gap);
}
.story-card {
  width: var(--deck-card-width);
  aspect-ratio: var(--deck-card-ratio);
  flex: none;
  position: relative;
  container-type: inline-size;
}
.story-card[data-customer="xentral"] {
  --tint: #315832;
  --ink: #8ad8a0;
  --type-color: #122012;
}
.story-card[data-customer="cotiss"] {
  --tint: #194173;
  --ink: #a2aee7;
  --type-color: #122012;
}
.story-card[data-customer="ingestro"] {
  --tint: #2b4050;
  --ink: #a4aebf;
  --type-color: #152932;
}
.story-card-inner,
.story-card-face {
  position: absolute;
  inset: 0;
}
.story-card-inner {
  transform-style: preserve-3d;
  transform: perspective(210.53cqw) rotateY(var(--flip, 180deg));
}
.story-card-face {
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 10.5cqw;
  color: var(--type-color);
  background: linear-gradient(145deg, #eff7f3 0%, #f9faf9 52%, #f0eff8 100%);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.story-card-front {
  padding: 9.47cqw;
  justify-content: space-between;
  align-items: flex-start;
}
.story-card-chip {
  padding: 1.45cqw 3.16cqw;
  border-radius: 7cqw;
  font-size: 3.69cqw;
  line-height: 1.42;
  font-weight: 500;
  color: var(--tint);
  background: color-mix(in srgb, var(--tint) 8%, transparent);
}
.story-card-result {
  color: var(--tint);
}
.story-card-result p {
  font:
    400 11.58cqw/0.97 "OPPO Sans",
    sans-serif;
  color: var(--type-color);
  white-space: nowrap;
  letter-spacing: -0.022em;
}
.story-card-result small {
  display: block;
  margin-top: 2.7cqw;
  font-size: 4.21cqw;
  line-height: 1.32;
}
.story-card-logo {
  align-self: flex-end;
  height: 6cqw;
  width: auto;
  max-width: 38cqw;
  opacity: 0.4;
}
.story-card-back {
  transform: rotateY(180deg);
  padding: 5.8cqw 9.47cqw 9.2cqw;
}
.story-quote-mark {
  display: block;
  margin-left: -2.65cqw;
  height: 7.25cqw;
  color: var(--ink);
  font:
    500 10.2cqw/1.05 "OPPO Sans",
    sans-serif;
}
.story-card blockquote {
  margin: 0;
  font:
    400 4.74cqw/1.5 "OPPO Sans",
    sans-serif;
}
.story-card blockquote p + p {
  margin-top: 2.1cqw;
}
.story-card mark,
.story-card .ink-line {
  color: inherit;
  background-color: transparent;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-position: left 65%;
  background-repeat: no-repeat;
  background-size: 100% 0.85em;
}
.story-card .ink-line {
  background-position: left 99%;
  background-size: 100% 0.11em;
}
.story-card figcaption {
  display: flex;
  align-items: center;
  gap: 4.2cqw;
  color: var(--tint);
  font-size: 4.2cqw;
  line-height: 1.4;
  white-space: nowrap;
}
.story-card-preview {
  flex: none;
  width: 100%;
  min-height: 0;
  aspect-ratio: 16 / 9;
  margin-block: auto;
  padding: calc(1.75cqw + 10px);
  border: 1px solid rgb(255 255 255 / 78%);
  border-radius: 2.65cqw;
  background: linear-gradient(145deg, rgb(255 255 255 / 82%), rgb(212 225 235 / 56%));
  box-shadow:
    0 1.4cqw 3.4cqw rgb(31 50 65 / 8%),
    0 0.35cqw 0.9cqw rgb(31 50 65 / 4%);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.story-card-preview img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 1.35cqw;
  background: #f7f8fa;
  object-fit: contain;
}
.story-card figcaption strong {
  display: block;
  font-weight: 500;
}
.story-card figcaption small {
  display: block;
  font-size: 1em;
  opacity: 0.85;
}
.story-avatar {
  position: relative;
  flex: 0 0 12.63cqw;
  aspect-ratio: 1;
  border-radius: 3.42cqw;
  overflow: hidden;
  background: color-mix(in srgb, var(--tint) 10%, transparent);
}
.story-avatar img {
  position: absolute;
  width: 106%;
  top: 4%;
  left: -4%;
}
.story-card[data-customer="cotiss"] .story-avatar img {
  width: 135%;
  top: 2%;
  left: -16%;
}
.story-card[data-customer="ingestro"] .story-avatar img {
  width: 129%;
  top: -10%;
  left: -27%;
}

@media (min-width: 800px) and (prefers-reduced-motion: no-preference) {
  .stack-area[data-scroll-deck] .story-card:not([data-ink]) mark {
    background-size: 0% 0.85em;
  }
  .stack-area[data-scroll-deck] .story-card:not([data-ink]) .ink-line {
    background-size: 0% 0.11em;
  }
  .story-card[data-ink] mark {
    transition: background-size 0.62s ease 0.14s;
  }
  .story-card[data-ink] .ink-line {
    transition: background-size 0.62s ease 0.72s;
  }
  .stack-area[data-scroll-deck]::after {
    content: "";
    display: block;
    height: 147.5vh;
  }
  .stack-area[data-scroll-deck] .stack-stage {
    position: sticky;
    top: 0;
    padding-top: calc(50vh + var(--deck-header-half));
    /* Negative half-height margin puts the card centers on the pin line. */
  }
  .stack-area[data-scroll-deck] .stack {
    margin-top: calc(var(--deck-card-width) / var(--deck-card-ratio) / -2);
  }
}

@media (max-width: 799px) {
  .stack-stage {
    padding: 3.5rem 0 4.5rem;
  }
  .stack {
    --deck-card-width: min(82vw, 21rem);
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--pad);
    padding: 0.25rem var(--pad) 0.75rem;
  }
  .story-card {
    scroll-snap-align: center;
  }
  .stack:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: -2px;
  }
}
