.landing-hero {
  display: grid;
  align-items: center;
  gap: 3.5rem;
  padding-block: 2rem 3rem;
}

.landing-hero__copy { min-width: 0; }

.matching-demo {
  --demo-duration: 7.5s;
  position: relative;
  min-width: 0;
  padding: 1.5rem;
  border: 1px solid #dde5ed;
  border-radius: 1.5rem;
  background: #eef2f7;
  color: #263345;
}

.matching-demo__heading,
.matching-demo__customer-heading,
.matching-demo__result-heading,
.matching-demo__controls,
.matching-demo__field,
.matching-demo__field dd {
  display: flex;
  align-items: center;
}

.matching-demo__heading { justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.matching-demo__heading h2 { font-size: .875rem; font-weight: 600; }
.matching-demo__example { border: 1px solid #cfd9e5; border-radius: 99px; padding: .2rem .6rem; font-size: .75rem; color: #52627a; }
.matching-demo__scene { --result-ink: #991b1b; --result-bg: #fef2f2; --result-border: #fecaca; --field-ink: #b91c1c; --field-bg: #fee2e2; }
.matching-demo__scene--partial { --result-ink: #8a4b0f; --result-bg: #fff3db; --result-border: #ead5ad; --field-ink: #a35a10; --field-bg: #fff0d4; }
.matching-demo__scene--none { --result-ink: #11684e; --result-bg: #e5f5ec; --result-border: #bcdccc; --field-ink: #177a5b; --field-bg: #e5f5ec; }
.matching-demo__scene[hidden], .matching-demo [hidden] { display: none; }

.matching-demo__customer {
  position: relative;
  overflow: hidden;
  border: 1px solid #dbe2eb;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 4px 6px -4px #26334512, 0 16px 32px -24px #26334540;
}

.matching-demo__customer-heading { gap: .75rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid #edf0f5; }
.matching-demo__avatar { display: grid; place-items: center; flex-shrink: 0; width: 2.75rem; height: 2.75rem; border-radius: .875rem; background: #e9edfc; color: #4b5da5; font-size: .875rem; font-weight: 600; }
.matching-demo__eyebrow { margin-bottom: .15rem; font-size: .75rem; color: #647184; }
.matching-demo__name { font-size: 1rem; font-weight: 600; letter-spacing: -.02em; }
.matching-demo__parcel { margin-left: auto; width: 1.65rem; height: 1.65rem; color: #a6b2c3; }
.matching-demo__fields { padding: .5rem 1.25rem .75rem; }
.matching-demo__field { justify-content: space-between; gap: .75rem; min-height: 2.3rem; font-size: .875rem; }
.matching-demo__field + .matching-demo__field { border-top: 1px solid #f0f2f6; }
.matching-demo__field dt { flex-shrink: 0; color: #647184; font-size: .875rem; }
.matching-demo__field dd { justify-content: flex-end; gap: .65rem; min-width: 0; text-align: right; }
.matching-demo__field dd > span:first-child { overflow-wrap: anywhere; }
.matching-demo__field-mark { display: grid; place-items: center; flex: 0 0 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--field-bg); color: var(--field-ink); font-size: .8125rem; font-weight: 700; }
.matching-demo__field--different .matching-demo__field-mark { background: #eef1f6; color: #8793a5; }
.matching-demo__connection { position: relative; width: 1px; height: 2.5rem; margin-inline: auto; border-left: 1px dashed #b7c5d7; }
.matching-demo__connection-dot { position: absolute; top: -.2rem; left: -.25rem; width: .45rem; height: .45rem; border-radius: 50%; background: #7b8fbb; }
.matching-demo__checking { position: absolute; top: .5rem; left: .75rem; width: max-content; font-size: .75rem; color: #69788c; opacity: 0; }

.matching-demo__result {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  align-items: start;
  gap: .75rem;
  min-height: 7.5rem;
  padding: 1.1rem;
  border: 1px solid var(--result-border);
  border-radius: 1rem;
  background: var(--result-bg);
  color: var(--result-ink);
}

.matching-demo__result-icon { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border: 1px solid var(--result-border); border-radius: .75rem; background: #ffffff80; font-size: 1.25rem; font-weight: 500; }
.matching-demo__result-heading { flex-wrap: wrap; justify-content: space-between; gap: .35rem .5rem; padding-block: .15rem .4rem; }
.matching-demo__result h3 { font-size: .9375rem; font-weight: 650; letter-spacing: -.02em; }
.matching-demo__count { white-space: nowrap; border: 1px solid var(--result-border); border-radius: 99px; padding: .1rem .4rem; font-size: .75rem; }
.matching-demo__result p { max-width: 24rem; font-size: .875rem; line-height: 1.6; }
.matching-demo__controls { justify-content: space-between; gap: .75rem; margin-top: 1.25rem; }
.matching-demo__scenarios { display: flex; gap: .35rem; }
.matching-demo__scenario { position: relative; overflow: hidden; min-height: 2.75rem; padding: .5rem .65rem; border: 1px solid transparent; border-radius: .5rem; font-size: .875rem; color: #65748a; cursor: pointer; }
.matching-demo__scenario:hover { color: #263345; background: #ffffff80; }
.matching-demo__scenario[aria-pressed="true"] { color: #263345; border-color: #d7e0eb; background: #fff; }
.matching-demo__scenario::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: #db8b8b; transform: scaleX(0); transform-origin: left; }
.matching-demo__scenario--partial::after { background: #d3a75e; }
.matching-demo__scenario--none::after { background: #86b8a4; }
.matching-demo__toggle { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; flex-shrink: 0; min-height: 2.75rem; padding: .4rem .25rem; color: #5e6d82; font-size: .875rem; cursor: pointer; }
.matching-demo__toggle:hover { color: #263345; }
.matching-demo__toggle svg { width: .9rem; height: .9rem; }
.matching-demo figcaption { margin-top: .75rem; text-align: center; color: #788599; font-size: .75rem; line-height: 1.6; }
.matching-demo__scan { display: none; }

.matching-demo[data-motion="true"] .matching-demo__scene:not([hidden]) { animation: matching-cycle var(--demo-duration) linear both; }
.matching-demo[data-motion="true"] .matching-demo__scene:not([hidden]) .matching-demo__result { animation: matching-result var(--demo-duration) ease both; }
.matching-demo[data-motion="true"] .matching-demo__scene:not([hidden]) .matching-demo__field-mark { animation: matching-mark var(--demo-duration) ease both; }
.matching-demo[data-motion="true"] .matching-demo__field:nth-child(2) .matching-demo__field-mark { animation-delay: .12s; }
.matching-demo[data-motion="true"] .matching-demo__field:nth-child(3) .matching-demo__field-mark { animation-delay: .24s; }
.matching-demo[data-motion="true"] .matching-demo__field:nth-child(4) .matching-demo__field-mark { animation-delay: .36s; }
.matching-demo[data-motion="true"] .matching-demo__field:nth-child(5) .matching-demo__field-mark { animation-delay: .48s; }
.matching-demo[data-motion="true"] .matching-demo__field:nth-child(6) .matching-demo__field-mark { animation-delay: .6s; }
.matching-demo[data-motion="true"] .matching-demo__scene:not([hidden]) .matching-demo__checking { animation: matching-checking var(--demo-duration) linear both; }
.matching-demo[data-motion="true"] .matching-demo__scene:not([hidden]) .matching-demo__connection-dot { animation: matching-transfer var(--demo-duration) ease both; }
.matching-demo[data-motion="true"] .matching-demo__scene:not([hidden]) .matching-demo__scan { display: block; position: absolute; top: 5rem; left: 0; right: 0; height: 2px; background: #a5b9e6; box-shadow: 0 -8px 22px 4px #a5b9e633; animation: matching-scan var(--demo-duration) ease both; }
.matching-demo[data-motion="true"] .matching-demo__scenario[aria-pressed="true"]::after { animation: matching-progress var(--demo-duration) linear both; }
.matching-demo[data-paused="true"] *, .matching-demo[data-paused="true"] *::after { animation-play-state: paused !important; }
.matching-demo[data-manual="true"] .matching-demo__scene:not([hidden]),
.matching-demo[data-manual="true"] .matching-demo__scene:not([hidden]) .matching-demo__result,
.matching-demo[data-manual="true"] .matching-demo__scene:not([hidden]) .matching-demo__field-mark { opacity: 1; transform: none; animation: none; }
.matching-demo[data-manual="true"] .matching-demo__checking, .matching-demo[data-manual="true"] .matching-demo__scan { display: none; }
.matching-demo[data-manual="true"] .matching-demo__scenario[aria-pressed="true"]::after { animation: none; transform: scaleX(1); }

@keyframes matching-cycle {
  0% { opacity: 0; transform: translateY(.5rem); }
  6%, 95% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-.25rem); }
}
@keyframes matching-result {
  0%, 29% { opacity: 0; transform: translateY(.6rem); }
  37%, 100% { opacity: 1; transform: translateY(0); }
}
@keyframes matching-mark {
  0%, 14% { opacity: 0; transform: scale(.65); }
  20%, 100% { opacity: 1; transform: scale(1); }
}
@keyframes matching-scan {
  0%, 4% { opacity: 0; transform: translateY(0); }
  8% { opacity: 1; transform: translateY(0); }
  28% { opacity: 1; transform: translateY(14rem); }
  31%, 100% { opacity: 0; transform: translateY(14rem); }
}
@keyframes matching-checking { 0%, 5% { opacity: 0; } 9%, 26% { opacity: 1; } 30%, 100% { opacity: 0; } }
@keyframes matching-transfer { 0%, 25% { opacity: 0; transform: translateY(0); } 28% { opacity: 1; } 34%, 100% { opacity: 0; transform: translateY(2.5rem); } }
@keyframes matching-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (min-width: 64rem) {
  .landing-hero { grid-template-columns: .85fr 1.15fr; gap: 3.5rem; min-height: 65svh; padding-block: 1rem 3rem; }
}

@media (max-width: 30rem) {
  .landing-hero { gap: 2.5rem; padding-top: .5rem; }
  .matching-demo { padding: 1rem; border-radius: 1.125rem; }
  .matching-demo__heading { gap: .5rem; }
  .matching-demo__customer-heading { padding: 1rem; }
  .matching-demo__fields { padding-inline: .85rem; }
  .matching-demo__field { gap: .4rem; min-height: 2.45rem; font-size: .875rem; }
  .matching-demo__field dd { gap: .4rem; }
  .matching-demo__result { gap: .6rem; padding: .9rem; min-height: 9rem; }
  .matching-demo__controls { flex-wrap: wrap; gap: 0; }
  .matching-demo__scenario { padding-inline: .55rem; }
  .matching-demo__toggle { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .matching-demo *, .matching-demo *::after { animation: none !important; }
  .matching-demo__scan, .matching-demo__checking { display: none !important; }
}
