:root {
  color-scheme: light;
  --charcoal: #202020;
  --silver: #d4d3d5;
  --silver-light: #ecebed;
  --warm: #895a48;
  --white: #ffffff;
  --serif: Didot, "Bodoni 72", "Bodoni MT", "Times New Roman", serif;
  --sans: "Avenir Next", Avenir, Futura, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
  background: var(--silver);
  color: var(--charcoal);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html {
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  display: none;
}

a {
  color: inherit;
}

.scroll-story {
  position: relative;
  height: 300svh;
  min-height: 108rem;
}

.scroll-stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.36), transparent 46%),
    linear-gradient(180deg, #d9d7d9, #c9c8ca);
}

.machine-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(236, 235, 237, 0.08), rgba(32, 32, 32, 0.05)),
    url("./assets/xerf-machine-scene-background-v2-approved.png") center center / cover no-repeat;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.075);
  transform-origin: 52% 50%;
  will-change: opacity, transform;
}

.cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  opacity: 1;
  transform: scale(1);
  transform-origin: 50% 48%;
  will-change: opacity, transform;
}

.cover::before,
.cover::after {
  position: absolute;
  inset-inline: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
}

.cover::before {
  top: 0;
  height: clamp(10rem, 27svh, 18rem);
  background: linear-gradient(180deg, rgba(25, 20, 18, 0.72), rgba(25, 20, 18, 0.18) 64%, transparent);
}

.cover::after {
  bottom: 0;
  height: clamp(16rem, 39svh, 28rem);
  background: linear-gradient(0deg, rgba(224, 224, 226, 0.99) 14%, rgba(224, 224, 226, 0.82) 48%, transparent 100%);
}

.cover__portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform-origin: 50% 48%;
  will-change: transform;
}

.cover__brands {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  left: 50%;
  z-index: 2;
  display: flex;
  width: min(calc(100% - 2rem), 42rem);
  align-items: center;
  justify-content: center;
  gap: clamp(0.7rem, 2.8vw, 1.25rem);
  transform: translateX(-50%);
  will-change: transform;
}

.cover__xerf,
.cover__mansito {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
  will-change: opacity, transform;
}

.cover__xerf {
  width: clamp(6.4rem, 29vw, 11.5rem);
}

.cover__mansito {
  width: clamp(7.4rem, 34vw, 13.5rem);
}

.cover__divider {
  width: 1px;
  height: clamp(2.1rem, 7vw, 3.4rem);
  flex: 0 0 1px;
  background: rgba(255, 255, 255, 0.72);
  transform-origin: 50% 50%;
  will-change: opacity, transform;
}

.cover__slogan {
  position: absolute;
  right: 1rem;
  bottom: max(2rem, calc(1.5rem + env(safe-area-inset-bottom)));
  left: 1rem;
  z-index: 2;
  max-width: 17ch;
  margin: 0 auto;
  color: var(--charcoal);
  font-family: var(--serif);
  font-size: clamp(2rem, 7.4vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.98;
  text-align: center;
  text-wrap: balance;
  will-change: opacity, transform;
}

.motion-word {
  display: inline-block;
  white-space: nowrap;
}

.motion-letter {
  display: inline-block;
  transform-origin: 50% 80%;
  will-change: opacity, transform;
}

.offers-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem max(0.75rem, env(safe-area-inset-bottom));
  pointer-events: none;
}

.offers-card {
  width: min(100%, 36rem);
  max-height: calc(100svh - 1.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  margin: 0 auto;
  padding: 0.85rem 0.8rem 0.9rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 1.85rem;
  background:
    radial-gradient(circle at 75% 0%, rgba(137, 90, 72, 0.09), transparent 34%),
    rgba(228, 226, 227, 0.96);
  box-shadow:
    0 1.65rem 4.5rem rgba(30, 25, 23, 0.22),
    inset 0 1px rgba(255, 255, 255, 0.8);
  opacity: 0;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
  visibility: hidden;
  will-change: opacity, transform;
  backdrop-filter: blur(1.4rem) saturate(0.8);
  -webkit-backdrop-filter: blur(1.4rem) saturate(0.8);
}

.offers-card__handle {
  width: 2.7rem;
  height: 0.18rem;
  margin: 0 auto 0.75rem;
  border-radius: 999px;
  background: rgba(32, 32, 32, 0.18);
}

.offers-card__header {
  padding: 0.3rem 0.4rem 1rem;
  text-align: center;
}

.offers-card__header h2 {
  margin: 0;
  color: var(--warm);
  font-family: var(--sans);
  font-size: clamp(1rem, 3.3vw, 1.2rem);
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1;
  text-transform: uppercase;
}

.offers-card__header h2 .motion-letter {
  transform-origin: 50% 100%;
}

.offer-list {
  display: grid;
  gap: 0.58rem;
}

.offer-pill {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
  min-height: 4.65rem;
  padding: 0.68rem 0.72rem 0.68rem 1.05rem;
  border: 0;
  border-radius: 999px;
  background: rgba(250, 249, 250, 0.68);
  box-shadow:
    0 0.45rem 1.3rem rgba(33, 28, 26, 0.075),
    inset 0 1px rgba(255, 255, 255, 0.88);
  text-decoration: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
  will-change: opacity, transform;
  -webkit-tap-highlight-color: transparent;
}

.scroll-story.is-reduced-motion {
  height: auto;
  min-height: 0;
}

.scroll-story.is-reduced-motion .scroll-stage {
  position: relative;
  height: auto;
  overflow: visible;
}

.scroll-story.is-reduced-motion .cover,
.scroll-story.is-reduced-motion .offers-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
}

.scroll-story.is-reduced-motion .machine-scene {
  top: 100svh;
  bottom: auto;
  height: 100svh;
  opacity: 1;
  transform: none;
}

.scroll-story.is-reduced-motion .offers-card {
  opacity: 1;
  transform: none;
  visibility: visible;
}

.offer-pill--discount {
  background: rgba(245, 241, 240, 0.78);
}

.offer-pill:hover,
.offer-pill:focus-visible {
  box-shadow:
    0 0.85rem 1.9rem rgba(32, 32, 32, 0.13),
    inset 0 1px rgba(255, 255, 255, 0.95);
  outline: none;
  transform: translateY(-2px);
}

.offer-pill:active {
  transform: translateY(1px) scale(0.995);
}

.offer-pill__identity,
.offer-pill__value {
  display: grid;
  min-width: 0;
}

.offer-pill__identity {
  gap: 0.25rem;
}

.offer-pill__value {
  justify-items: end;
}

.offer-pill__meta {
  display: flex;
  gap: 0.38rem;
  align-items: center;
  min-width: 0;
}

.offer-pill__name {
  overflow: hidden;
  font-size: clamp(0.76rem, 2.85vw, 0.9rem);
  font-weight: 500;
  letter-spacing: 0.075em;
  line-height: 1.05;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.offer-pill__regular {
  color: rgba(32, 32, 32, 0.48);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.offer-pill__price {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 5.1vw, 1.75rem);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.9;
  white-space: nowrap;
}

.offer-pill__badge {
  padding: 0.24rem 0.4rem;
  border-radius: 999px;
  background: var(--warm);
  color: var(--white);
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.offer-pill__arrow {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border-radius: 50%;
  background: rgba(32, 32, 32, 0.93);
  color: #f6f6f6;
  font-size: 1rem;
  line-height: 1;
}

.offer-pill__arrow svg {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 42rem) {
  .offers-stage {
    padding-inline: 1.5rem;
  }

  .offers-card {
    padding: 1rem 1rem 1.15rem;
  }
}

@media (max-width: 23rem) {
  .scroll-story {
    min-height: 96rem;
  }

  .cover__brands {
    width: calc(100% - 1.25rem);
  }

  .cover__slogan {
    right: 0.75rem;
    left: 0.75rem;
  }

  .offers-card {
    border-radius: 1.55rem;
  }

  .offer-pill {
    gap: 0.5rem;
    min-height: 4.35rem;
    padding-left: 0.9rem;
  }

  .offer-pill__price {
    font-size: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-story {
    height: auto;
    min-height: 0;
  }

  .scroll-stage {
    position: relative;
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }

  .cover {
    position: relative;
    min-height: 100svh;
  }

  .machine-scene {
    top: 100svh;
    bottom: auto;
    height: 100svh;
    opacity: 1;
    transform: none;
  }

  .offers-stage {
    position: relative;
    min-height: 100svh;
  }

  .offers-card {
    --card-progress: 1;
  }

  .offer-pill {
    transition: none;
  }
}
