.products {
  --fg: 27 32 29;
  --bg: 242 238 230;
  position: relative;
  scroll-margin-top: 0;
  padding: 168px var(--gutter) 128px;
  background: rgb(var(--bg));
  color: rgb(var(--fg));
}

.products-intro {
  max-width: 900px;
  margin-bottom: 24px;
}

.products-eyebrow {
  margin: 0 0 22px;
  color: rgb(var(--fg) / 0.6);
  font: 17px/24px var(--serif);
}

.products h2 {
  margin: 0;
  font: 300 clamp(36px, 3.6vw, 56px)/1.1 var(--serif);
  letter-spacing: -0.012em;
}

.products h2 span {
  color: rgb(var(--fg) / 0.5);
}

.story {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(48px, 6vw, 112px);
}

.chapter {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 92vh;
  padding: 48px 0;
  opacity: 0.3;
  scroll-snap-align: center;
  transition: opacity 700ms ease;
}

.chapter.is-active {
  opacity: 1;
}

.chapter-index {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgb(var(--fg) / 0.5);
  font: 15px/20px var(--serif);
}

.chapter-index::after {
  content: "";
  width: 40px;
  height: 1px;
  background: rgb(var(--fg) / 0.25);
}

.chapter h3 {
  margin: 18px 0 14px;
  font: 300 clamp(40px, 3.4vw, 54px)/1.04 var(--serif);
  letter-spacing: -0.014em;
}

.chapter-lede {
  max-width: 420px;
  margin: 0;
  color: rgb(var(--fg) / 0.82);
  font: 300 22px/1.35 var(--serif);
}

.chapter-body {
  max-width: 440px;
  margin: 16px 0 0;
  color: rgb(var(--fg) / 0.66);
  font: 16px/1.65 var(--sans);
}

.chapter-stats {
  display: flex;
  gap: 48px;
  margin: 36px 0 0;
  padding-top: 28px;
  border-top: 1px solid rgb(var(--fg) / 0.12);
}

.chapter-stats dt {
  font: 300 34px/1 var(--serif);
  letter-spacing: -0.01em;
}

.chapter-stats dd {
  max-width: 170px;
  margin: 8px 0 0;
  color: rgb(var(--fg) / 0.58);
  font: 13px/1.45 var(--sans);
}

.chapter-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  font: 14px/20px var(--sans-medium);
  letter-spacing: 0.01em;
  text-decoration: none;
}

.chapter-link i {
  width: 20px;
  height: 12px;
  background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
  transition: transform 420ms var(--ease-out);
}

.chapter-link:hover i {
  transform: translateX(4px);
}

.chapter-visual {
  display: none;
}

.story-stage {
  position: sticky;
  top: max(96px, calc(50vh - 330px));
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-self: start;
  height: min(660px, calc(100vh - 140px));
  margin-top: 4vh;
}

.stage-frame {
  --fg: 244 239 227;
  --bg: 15 34 24;
  position: relative;
  flex: 1;
  overflow: hidden;
  border-radius: 28px;
  background: rgb(var(--bg));
  color: rgb(var(--fg));
  box-shadow: 0 60px 100px -64px rgb(6 16 11 / 0.7);
}

.scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: clamp(28px, 4vw, 56px);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 600ms ease, transform 900ms var(--ease-out);
  pointer-events: none;
}

.scene.is-active {
  opacity: 1;
  transform: none;
}

.scene.is-active [style*="--n"] {
  animation: rise-in 900ms var(--ease-out) both;
  animation-delay: calc(300ms + var(--n) * 420ms);
}

.call-head {
  display: flex;
  align-items: center;
  align-self: flex-start;
  gap: 14px;
  padding: 8px 22px 8px 8px;
  border: 1px solid rgb(var(--fg) / 0.16);
  border-radius: 999px;
  background: rgb(var(--fg) / 0.07);
}

.call-avatar,
.chip-icon,
.result-check {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
}

.call-avatar {
  width: 40px;
  height: 40px;
  background: rgb(var(--fg));
  color: rgb(var(--bg));
  font: 300 16px/1 var(--serif);
}

.chip-icon {
  width: 40px;
  height: 40px;
  background: rgb(var(--fg) / 0.12);
  color: rgb(var(--fg));
}

.chip-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.call-who strong,
.scene-result strong {
  display: block;
  font: 14px/19px var(--sans-medium);
}

.call-who small {
  display: block;
  color: rgb(var(--fg) / 0.6);
  font: 12.5px/17px var(--sans);
}

.call-wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  margin-left: 12px;
}

.call-wave i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: rgb(var(--accent));
  transform: scaleY(0.3);
  animation: wave 900ms ease-in-out infinite alternate;
}

.call-wave i:nth-child(2) {
  animation-delay: 150ms;
}

.call-wave i:nth-child(3) {
  animation-delay: 300ms;
}

.call-wave i:nth-child(4) {
  animation-delay: 450ms;
}

.call-wave i:nth-child(5) {
  animation-delay: 600ms;
}

.call-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0;
}

.bubble {
  max-width: 78%;
  margin: 0;
  padding: 14px 18px;
  border-radius: 18px;
  font: 14.5px/1.5 var(--sans);
}

.bubble-them {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  background: rgb(var(--fg) / 0.1);
}

.bubble-halo {
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  background: rgb(var(--paper));
  color: rgb(var(--ink));
}

.scene-result {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px 16px 16px;
  border-radius: 18px;
  background: rgb(var(--paper));
  color: rgb(var(--ink));
  box-shadow: 0 30px 60px -36px rgb(6 16 11 / 0.8);
}

.scene-result small {
  display: block;
  color: rgb(var(--ink) / 0.55);
  font: 12.5px/18px var(--sans);
}

.result-check {
  position: relative;
  width: 30px;
  height: 30px;
  background: rgb(var(--bg));
}

.result-check::after {
  content: "";
  width: 14px;
  height: 14px;
  background: rgb(var(--fg));
  -webkit-mask: var(--check) center / contain no-repeat;
  mask: var(--check) center / contain no-repeat;
}

.note,
.claim {
  overflow: hidden;
  border-radius: 20px;
  background: rgb(var(--paper));
  color: rgb(var(--ink));
  box-shadow: 0 40px 80px -44px rgb(6 16 11 / 0.85);
}

.note-head,
.claim-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgb(var(--ink) / 0.07);
}

.note-head small,
.claim-head small {
  display: block;
  color: rgb(var(--ink) / 0.5);
  font: 12px/16px var(--sans);
}

.note-head strong,
.claim-head strong {
  display: block;
  margin-top: 2px;
  font: 300 20px/25px var(--serif);
}

.note-listen {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: rgb(var(--bg) / 0.07);
  color: rgb(var(--bg));
  font: 12px/16px var(--sans-medium);
}

.note-listen i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgb(var(--accent));
  animation: live-pulse 1400ms ease-out infinite;
}

.note-body {
  margin: 0;
  padding: 4px 24px;
}

.note-body div {
  padding: 14px 0;
}

.note-body div + div {
  border-top: 1px solid rgb(var(--ink) / 0.06);
}

.note-body dt {
  color: rgb(var(--ink) / 0.5);
  font: 12px/16px var(--sans-medium);
  letter-spacing: 0.01em;
}

.note-body dd {
  margin: 4px 0 0;
  color: rgb(var(--ink) / 0.86);
  font: 14.5px/1.5 var(--sans);
}

.note-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px 18px;
  border-top: 1px solid rgb(var(--ink) / 0.07);
}

.note-foot small {
  color: rgb(var(--ink) / 0.5);
  font: 12.5px/18px var(--sans);
}

.note-sign {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgb(var(--bg));
  color: rgb(var(--fg));
  font: 12.5px/16px var(--sans-medium);
  white-space: nowrap;
}

.claim-amount {
  font: 300 28px/1 var(--serif);
  letter-spacing: -0.01em;
}

.claim-lines {
  margin: 0;
  padding: 4px 24px 8px;
  list-style: none;
}

.claim-lines li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 0;
  font: 14px/20px var(--sans);
}

.claim-lines li + li {
  border-top: 1px solid rgb(var(--ink) / 0.06);
}

.claim-lines li span:first-child {
  color: rgb(var(--ink) / 0.5);
  font-variant-numeric: tabular-nums;
}

.claim-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 18px 8px 22px;
  border-top: 1px solid rgb(var(--ink) / 0.07);
  background: rgb(var(--ink) / 0.025);
  list-style: none;
}

.claim-track li {
  position: relative;
  padding-top: 20px;
  color: rgb(var(--ink) / 0.6);
  font: 12px/16px var(--sans);
  text-align: center;
}

.claim-track li::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(50% - 5px);
  z-index: 1;
  width: 10px;
  height: 10px;
  border: 1px solid rgb(var(--ink) / 0.25);
  border-radius: 50%;
  background: rgb(var(--paper));
}

.claim-track li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 5px;
  right: calc(-50% + 5px);
  left: calc(50% + 5px);
  height: 1px;
  background: rgb(var(--ink) / 0.14);
}

.scene.is-active .claim-track li::before {
  animation: dot-fill 500ms ease both;
  animation-delay: calc(900ms + var(--n) * 420ms);
}

.stage-steps {
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage-steps li {
  flex: 1;
  padding-top: 14px;
  border-top: 1px solid rgb(var(--fg) / 0.14);
  color: rgb(var(--fg) / 0.45);
  font: 13px/18px var(--sans);
  cursor: pointer;
  transition: color 500ms ease, border-color 500ms ease;
}

.stage-steps li:hover {
  border-top-color: rgb(var(--fg) / 0.4);
  color: rgb(var(--fg) / 0.75);
  transition-duration: 200ms;
}

.products[data-active="0"] .stage-steps [data-step="0"],
.products[data-active="1"] .stage-steps [data-step="1"],
.products[data-active="2"] .stage-steps [data-step="2"] {
  border-top-color: rgb(var(--fg));
  color: rgb(var(--fg));
}

@keyframes wave {
  to {
    transform: scaleY(1);
  }
}

@keyframes dot-fill {
  to {
    border-color: rgb(var(--bg));
    background: rgb(var(--bg));
  }
}

@media (max-width: 980px) {
  .products {
    padding: 120px 32px 96px;
  }

  .story {
    grid-template-columns: 1fr;
  }

  .story-stage {
    display: none;
  }

  .chapter {
    min-height: 0;
    padding: 64px 0 0;
    opacity: 1;
  }

  .chapter-visual {
    display: block;
    align-self: stretch;
    margin-top: 40px;
  }

  .chapter-visual .stage-frame {
    height: 600px;
  }

  .chapter {
    scroll-margin-top: 72px;
  }

  .scene.is-active [style*="--n"] {
    animation-duration: 520ms;
    animation-delay: calc(120ms + var(--n) * 240ms);
  }

  .scene.is-active .claim-track li::before {
    animation-delay: calc(480ms + var(--n) * 240ms);
  }
}

@media (max-width: 600px) {
  .products {
    padding: 96px 22px 80px;
  }

  .chapter-stats {
    gap: 28px;
  }

  .chapter-stats dt {
    font-size: 28px;
  }

  .chapter-visual .stage-frame {
    height: 620px;
    border-radius: 22px;
  }

  .scene {
    padding: 20px;
  }

  .bubble {
    max-width: 88%;
    font-size: 13.5px;
  }

  .note-head,
  .claim-head {
    padding: 16px 18px 12px;
  }

  .note-body,
  .claim-lines {
    padding-right: 18px;
    padding-left: 18px;
  }

  .note-foot {
    padding-right: 18px;
    padding-left: 18px;
  }

  .claim-track {
    padding-right: 4px;
    padding-left: 4px;
  }

  .note-body dd {
    font-size: 13.5px;
  }

  .claim-track li {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chapter,
  .scene,
  .stage-steps li {
    transition: none;
  }

  .scene.is-active [style*="--n"],
  .scene.is-active .claim-track li::before,
  .call-wave i,
  .note-listen i {
    animation: none;
  }
}
