.match-wall {
  --match-card-width: 226px;
  --match-gap: 18px;
  padding: 33px 0 42px;
  background: #f8f7f3;
}

.match-wall-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-bottom: 30px;
}

.match-wall-heading .eyebrow { margin-bottom: 13px; }
.match-wall-heading h2 { font-size: 30px; letter-spacing: -1px; }
.match-wall-heading h2 > span { color: #c5523b; }
.match-wall-heading p { font-size: 12px; color: #65705e; margin-top: 12px; }

.match-motion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: none;
  min-width: 100px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid #d7dccf;
  border-radius: 24px;
  background: #fffaf6;
  font-size: 11px;
  color: #535f4b;
  transition: background .2s, border-color .2s;
}

.match-motion:hover { background: #ecefe4; border-color: #aebba0; }
.match-motion-icon { font-size: 14px; line-height: 1; min-width: 12px; }

.match-viewport {
  /* Keep the carousel's positive scroll coordinates and physical arrow keys
     consistent; card text still follows the selected interface direction. */
  direction: ltr;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  padding: 14px 0 20px;
  scroll-behavior: auto;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}

.match-viewport::-webkit-scrollbar { display: none; }
.match-viewport:focus-visible { outline-offset: -4px; }
.match-track, .match-group { display: flex; gap: var(--match-gap); width: max-content; }
.match-group { list-style: none; padding: 0; margin: 0; }

.connection-card {
  position: relative;
  flex: 0 0 var(--match-card-width);
  width: var(--match-card-width);
  height: 328px;
  border: 1px solid #e4e5db;
  border-radius: 15px;
  background: #e5e5d8;
  overflow: hidden;
  box-shadow: 0 7px 18px #3a35220a;
  isolation: isolate;
}

[dir=rtl] .connection-card { direction: rtl; }

.connection-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  transition: transform .6s ease;
}

.connection-card:hover .connection-photo { transform: scale(1.045); }
.connection-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, #17271912, transparent 30%, #15201612 44%, #152016bd 80%, #111c16e0);
}

.connection-matched {
  position: absolute;
  z-index: 2;
  top: 13px;
  left: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #ffffffbf;
  border-radius: 20px;
  background: #fffdf5f0;
  box-shadow: 0 2px 8px #1520160a;
  color: #566d46;
  font-size: 10px;
  font-weight: 600;
}

.connection-matched svg { width: 12px; height: 12px; stroke-width: 2; }
.connection-details { position: absolute; z-index: 2; left: 17px; right: 17px; bottom: 17px; color: #fffdf6; }
.connection-title { display: flex; align-items: baseline; gap: 8px; font-size: 23px; font-weight: 600; line-height: 1.3; letter-spacing: -.5px; }
.connection-title span { font-size: 17px; font-weight: 400; letter-spacing: 0; color: #fffcf0; }
.connection-caption { font-size: 10px; line-height: 1.7; margin-top: 7px; color: #fffdf3; }
.connection-tags { display: flex; gap: 5px; align-items: center; margin-top: 12px; }
.connection-tags > span { font-size: 9px; line-height: 1.5; border: 1px solid #fff8; border-radius: 4px; padding: 3px 7px; background: #0e201c26; color: #fff; }
.connection-heart { margin-left: auto; display: grid; place-items: center; width: 29px; height: 29px; background: #e66d559c; border: 1px solid #f6cab285; border-radius: 50%; }
.connection-heart svg { width: 14px; height: 14px; stroke: #fff; fill: #fff; stroke-width: 1; }
.match-wall-footer { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-top: 11px; }
.match-wall-footer > p { color: #656e5e; font-size: 11px; }
.match-wall-footer > a { display: inline-flex; align-items: center; gap: 9px; color: #566647; font-size: 11px; font-weight: 600; }
.match-wall-footer > a:hover { color: #ba4831; }
.match-wall-footer > a > svg { width: 14px; height: 14px; }
.match-noscript { font-size: 13px; padding: 20px 0; }

@media (min-width: 1700px) {
  .match-wall { --match-card-width: 252px; --match-gap: 22px; }
  .connection-card { height: 362px; }
}

@media (max-width: 960px) {
  .match-wall { --match-card-width: 210px; --match-gap: 15px; padding-top: 23px; }
  .connection-card { height: 306px; }
  .match-wall-heading h2 { font-size: 25px; }
  .match-wall-heading p { font-size: 11px; }
}

@media (max-width: 760px) {
  .match-wall { --match-card-width: 186px; --match-gap: 12px; padding: 23px 0 29px; }
  .match-wall-heading { gap: 12px; margin-bottom: 15px; align-items: flex-start; }
  .match-wall-heading .eyebrow { font-size: 6px; letter-spacing: 1.25px; }
  .match-wall-heading h2 { font-size: 24px; letter-spacing: -.6px; }
  .match-wall-heading h2 > span { display: block; }
  .match-wall-heading p { font-size: 10px; max-width: 260px; line-height: 1.9; }
  .match-motion { min-width: 42px; width: 42px; height: 42px; margin-top: 25px; padding: 0; }
  .match-motion-label { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
  .match-viewport { padding-block: 10px 15px; -webkit-mask-image: none; mask-image: none; }
  .connection-card { height: 276px; border-radius: 12px; }
  .connection-matched { top: 11px; left: 11px; font-size: 9px; padding: 5px 8px; gap: 4px; }
  .connection-matched svg { width: 11px; height: 11px; }
  .connection-details { left: 13px; right: 13px; bottom: 13px; }
  .connection-title { font-size: 21px; gap: 7px; }
  .connection-title > span { font-size: 15px; }
  .connection-caption { font-size: 9px; margin-top: 6px; }
  .connection-tags { margin-top: 10px; gap: 4px; }
  .connection-tags > span { font-size: 8px; padding: 3px 6px; }
  .connection-heart { width: 25px; height: 25px; }
  .connection-heart svg { width: 12px; height: 12px; }
  .match-wall-footer { flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 8px; }
  .match-wall-footer > p { font-size: 10px; }
  .match-wall-footer > a { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .connection-photo { transition: none; }
  .connection-card:hover .connection-photo { transform: none; }
}
