/* ============================================================
   ROOMMATE.CSS — Roommate Matching v2
   Card-stack UI, photo profiles, gender preference,
   swipe gestures.
   ============================================================ */
/* ── Page transition ── */
body {
  opacity: 0;
}
body.page-loaded {
  opacity: 1;
  transition: opacity 0.3s ease;
}
body.page-exiting {
  opacity: 0;
  transition: opacity 0.2s ease;
}



/* ── Page container ── */
.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── Page header ── */
.page-header { margin-bottom: 36px; }
.page-title {
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 10px;
}
.page-title em { font-style: italic; color: var(--clay); }
.page-sub { font-size: 15px; color: var(--warm-grey); line-height: 1.65; max-width: 520px; }

/* ── Form cards ── */
.form-card {
  background: white;
  border: 1px solid var(--sand);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 16px;
}
.form-card-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--sand);
  letter-spacing: -0.02em;
}
.form-hint-inline {
  font-size: 12px;
  color: var(--warm-grey);
  font-weight: 400;
  font-family: var(--sans);
}
.bio-counter {
  font-size: 11px;
  color: var(--warm-grey);
  text-align: right;
  margin-top: 4px;
}

/* ── Photo upload ── */
.photo-upload-row {
  display: flex;
  align-items: center;
}
.photo-upload-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
}
.photo-upload-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px dashed var(--sand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: border-color var(--duration-normal) var(--ease-out);
}
.photo-upload-wrap:hover .photo-upload-circle {
  border-color: var(--clay);
}
.photo-upload-initials {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--warm-grey-light);
}
.photo-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--duration-fast) ease;
  border-radius: 50%;
}
.photo-upload-wrap:hover .photo-upload-overlay {
  opacity: 1;
}
.photo-upload-info {}
.photo-upload-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}
.photo-upload-sub {
  font-size: 12px;
  color: var(--warm-grey);
}

/* ── Pill group ── */
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 8px 16px;
  border: 1.5px solid var(--sand);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--warm-grey);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  user-select: none;
  background: white;
  font-family: var(--sans);
}
.pill:hover { border-color: var(--clay-light); color: var(--ink); }
.pill.selected {
  border-color: var(--clay);
  background: rgba(196,98,45,0.07);
  color: var(--clay);
  font-weight: 600;
}

/* ── Range slider ── */
.range-row { display: flex; align-items: center; gap: 14px; }

.range-input {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 100px;
  background: linear-gradient(to right, var(--clay) 50%, var(--sand) 50%);
  outline: none;
  cursor: pointer;
  transition: background 0.1s ease;
}

/* Webkit thumb */
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  border: 2.5px solid var(--clay);
  box-shadow: 0 2px 8px rgba(196,98,45,0.25);
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring), box-shadow 0.15s ease;
}
.range-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 14px rgba(196,98,45,0.35);
}
.range-input::-webkit-slider-thumb:active {
  transform: scale(1.1);
}

/* Firefox thumb */
.range-input::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  border: 2.5px solid var(--clay);
  box-shadow: 0 2px 8px rgba(196,98,45,0.25);
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring);
}
.range-input::-moz-range-thumb:hover { transform: scale(1.2); }

/* Firefox track */
.range-input::-moz-range-track {
  height: 6px;
  border-radius: 100px;
  background: var(--sand);
}
.range-input::-moz-range-progress {
  height: 6px;
  border-radius: 100px;
  background: var(--clay);
}

/* ── Privacy notice ── */
.privacy-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(196,98,45,0.04);
  border: 1px solid rgba(196,98,45,0.12);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 20px;
  font-size: 13px;
}

/* ── Submit button ── */
.form-submit {
  width: 100%;
  padding: 16px;
  background: var(--clay);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.form-submit:hover:not(:disabled) {
  background: var(--clay-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(196,98,45,0.3);
}
.form-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }


/* ════════════════════════════════════════════════
   MATCHES VIEW
════════════════════════════════════════════════ */

.matches-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.matches-title {
  font-family: var(--serif);
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 700;
  line-height: 1.15;
}
.matches-title em { font-style: italic; color: var(--clay); }
.matches-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.pause-btn {
  font-size: 12px;
  color: var(--warm-grey);
  background: white;
  border: 1px solid var(--sand);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 500;
  transition: all var(--duration-fast) ease;
}
.pause-btn:hover { border-color: var(--warm-grey-light); color: var(--ink); }

.edit-profile-btn {
  font-size: 13px;
  color: var(--clay);
  background: none;
  border: 1px solid var(--sand);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 500;
  transition: all var(--duration-fast) ease;
}
.edit-profile-btn:hover { border-color: var(--clay); }

/* ── Filter bar ── */
.stack-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.stack-filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--warm-grey);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 4px;
}
.stack-filter-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--sand);
  font-size: 12px;
  font-weight: 600;
  color: var(--warm-grey);
  background: white;
  cursor: pointer;
  font-family: var(--sans);
  transition: all var(--duration-fast) ease;
}
.stack-filter-pill:hover { border-color: var(--warm-grey-light); color: var(--ink); }
.stack-filter-pill.active { background: var(--ink); color: white; border-color: var(--ink); }
.stack-progress {
  margin-left: auto;
  font-size: 12px;
  color: var(--warm-grey);
  font-weight: 500;
}

/* ── Card stack wrap ── */
.card-stack-wrap {
  position: relative;
  margin-bottom: 24px;
}

/* ── Card stack container ── */
.card-stack {
  position: relative;
  height: 560px;
  margin-bottom: 24px;
  user-select: none;
}

/* ── Individual match card ── */
.match-card-stack {
  position: absolute;
  inset: 0;
  background: white;
  border: 1px solid var(--sand);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(26,22,18,0.08);
  cursor: grab;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}
.match-card-stack:active { cursor: grabbing; }

/* Stack peek effect */
.card-behind-1 {
  transform: translateY(12px) scale(0.97);
  z-index: 1;
  pointer-events: none;
  box-shadow: 0 2px 16px rgba(26,22,18,0.05);
}
.card-behind-2 {
  transform: translateY(22px) scale(0.94);
  z-index: 0;
  pointer-events: none;
  box-shadow: none;
}
/* Top card is z-index 2 by default */
.match-card-stack:not(.card-behind-1):not(.card-behind-2) {
  z-index: 2;
}

/* Swipe direction hints (overlay text) */
.card-swipe-hint {
  position: absolute;
  top: 28px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  padding: 6px 14px;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  border: 3px solid;
  transition: opacity 0.1s ease;
}
.pass-hint {
  left: 24px;
  color: #C0392B;
  border-color: #C0392B;
  transform: rotate(-10deg);
}
.connect-hint {
  right: 24px;
  color: #2D7A3A;
  border-color: #2D7A3A;
  transform: rotate(10deg);
}

/* ── Card avatar ── */
.card-avatar-wrap {
  width: 100%;
  height: 200px;
  background: var(--cream);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.card-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 72px;
  font-weight: 700;
  color: white;
}

/* ── Card body ── */
.card-body {
  padding: 20px 22px 20px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
}

.card-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.card-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
}
.card-verified {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: #DCFCE7;
  color: #166534;
}
.card-gender-badge {
  font-size: 14px;
  color: var(--warm-grey);
}
.card-meta {
  font-size: 13px;
  color: var(--warm-grey);
  margin-bottom: 10px;
}
.card-bio {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.6;
  margin-bottom: 14px;
  font-style: italic;
  opacity: 0.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Compat score ── */
.card-compat {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.card-compat-score {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 700;
  color: var(--clay);
  line-height: 1;
  flex-shrink: 0;
}
.card-compat-pct {
  font-size: 16px;
  font-weight: 500;
}
.card-compat-right { flex: 1; }
.compat-bar-track {
  height: 7px;
  background: var(--sand);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 5px;
}
.compat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--clay-light), var(--clay));
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
}
.card-compat-label {
  font-size: 11px;
  color: var(--warm-grey);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Compat breakdown (Phase 5 — expandable full list) ── */
.compat-breakdown {
  margin: 8px 0 12px;
  padding: 10px 12px;
  background: var(--cream);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.compat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
}
.compat-row.match { color: #166534; }
.compat-row.miss { color: #92400E; }
.compat-icon { font-size: 13px; flex-shrink: 0; width: 16px; text-align: center; }
.compat-text { flex: 1; }
.compat-pts { font-size: 10px; font-weight: 600; color: var(--warm-grey); flex-shrink: 0; }

/* Segmented compatibility bar */
.seg-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; gap: 1px; }
.seg-bar-piece { height: 100%; border-radius: 2px; transition: opacity 0.2s; }
.seg-match { background: #22c55e; }
.seg-miss { background: #f59e0b; }

/* Mutual match badge */
.card-mutual {
  display: inline-flex; align-items: center; gap: 3px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b); color: white;
  font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 100px;
  animation: mutualPulse 2s ease infinite;
}
@keyframes mutualPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(251,191,36,0.4); } 50% { box-shadow: 0 0 0 6px rgba(251,191,36,0); } }

/* ── Legacy compat tags (kept for fallback) ── */
.compat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.compat-tag {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}
.compat-tag.match { background: #DCFCE7; color: #166534; }
.compat-tag.miss  { background: #FEF3C7; color: #92400E; }

/* ── Card tags ── */
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.match-tag {
  font-size: 11px;
  background: var(--cream);
  border: 1px solid var(--sand);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  color: var(--ink);
  font-weight: 500;
}

/* ── Swipe hint overlay ── */
.swipe-hint {
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--warm-grey);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.4s ease;
  margin-bottom: 8px;
  pointer-events: none;
}

/* ── Pass / Connect buttons ── */
.stack-actions {
  display: flex;
  justify-content: center;
  gap: 32px;
  align-items: center;
}
.stack-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 32px;
  border-radius: var(--radius-full);
  border: 2px solid;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-spring);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-width: 120px;
}
.stack-btn:hover { transform: scale(1.06); }
.stack-btn:active { transform: scale(0.96); }

.stack-pass {
  background: white;
  border-color: #E8D0CC;
  color: #C0392B;
}
.stack-pass:hover {
  background: #FFF5F5;
  border-color: #C0392B;
  box-shadow: 0 6px 24px rgba(192,57,43,0.15);
}

.stack-connect {
  background: var(--clay);
  border-color: var(--clay);
  color: white;
}
.stack-connect:hover {
  background: var(--clay-dark);
  border-color: var(--clay-dark);
  box-shadow: 0 8px 28px rgba(196,98,45,0.4);
}

/* ── Empty state ── */
.stack-empty {
  text-align: center;
  padding: 64px 32px;
  background: white;
  border: 1px solid var(--sand);
  border-radius: 24px;
}
.stack-empty-icon { font-size: 52px; margin-bottom: 16px; }
.stack-empty-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}
.stack-empty-sub {
  font-size: 14px;
  color: var(--warm-grey);
  line-height: 1.65;
  margin-bottom: 24px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Loading ── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--sand);
  border-top-color: var(--clay);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}


/* ════════════════════════════════════════════════
   CONNECT MODAL
════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,22,18,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: white;
  border-radius: 24px;
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 460px;
  position: relative;
  animation: modalIn 0.3s var(--ease-spring) both;
}
.modal-close-x {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--cream);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warm-grey);
  transition: all var(--duration-fast) ease;
}
.modal-close-x:hover { background: var(--sand); color: var(--ink); }

.modal-match-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.modal-preview-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--sand);
}
.modal-preview-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  color: white;
}

.modal-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}
.modal-sub {
  font-size: 13px;
  color: var(--warm-grey);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 18px;
}
.modal-textarea {
  width: 100%;
  padding: 13px 15px;
  font-size: 14px;
  font-family: var(--sans);
  border: 1.5px solid var(--sand);
  border-radius: var(--radius-md);
  background: var(--cream);
  color: var(--ink);
  outline: none;
  resize: vertical;
  min-height: 100px;
  transition: border-color var(--duration-fast) ease;
  margin-bottom: 16px;
}
.modal-textarea:focus { border-color: var(--clay); background: white; }
.modal-actions {
  display: flex;
  gap: 10px;
}
.modal-cancel {
  flex: 1;
  padding: 12px;
  background: none;
  border: 1.5px solid var(--sand);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--warm-grey);
  cursor: pointer;
  font-family: var(--sans);
  transition: all var(--duration-fast) ease;
}
.modal-cancel:hover { border-color: var(--warm-grey-light); color: var(--ink); }
.modal-send {
  flex: 2;
  padding: 12px;
  background: var(--clay);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sans);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--duration-fast) ease;
}
.modal-send:hover:not(:disabled) { background: var(--clay-dark); }
.modal-send:disabled { opacity: 0.6; cursor: not-allowed; }


/* ════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .page { padding: 28px 16px 80px; }
  .page-title { font-size: 28px; }
  .form-card { padding: 22px 16px; }
  .matches-header { flex-direction: column; gap: 12px; }
  .matches-header-actions { align-self: flex-end; }
  .card-stack { height: 500px; }
  .card-avatar-wrap { height: 160px; }
  .card-body { padding: 16px 16px 16px; }
  .card-name { font-size: 18px; }
  .card-compat-score { font-size: 28px; }
  .stack-btn { padding: 14px 24px; min-width: 100px; font-size: 12px; }
  .modal { padding: 28px 18px 22px; }
}

@media (max-width: 480px) {
  .card-stack { height: 460px; }
  .stack-actions { gap: 16px; }
  .stack-btn { padding: 14px 18px; min-width: 90px; }
  .card-avatar-wrap { height: 140px; }
  .card-compat-score { font-size: 24px; }
  .matches-title { font-size: 26px; }
  .stack-filters { gap: 6px; }
  .stack-filter-pill { padding: 5px 10px; font-size: 11px; }
  .stack-progress { display: none; }
}


/* ════════════════════════════════════════════════
   LOGGED-OUT GATE — Award-level redesign
════════════════════════════════════════════════ */

/* Break gate sections out of .page container for full-width */
#gate-view {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
}

/* ── Dark Hero ── */
.rm-hero {
  background: var(--ink);
  position: relative;
  overflow: hidden;
  padding: clamp(100px, 14vw, 160px) 52px clamp(80px, 10vw, 120px);
  text-align: center;
}
.rm-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
}
.rm-hero::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 60%;
  height: 80%;
  background: radial-gradient(circle, rgba(196,98,45,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.rm-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}
.rm-hero .eyebrow { color: var(--clay-light); }
.rm-hero .page-title { color: white; font-size: clamp(36px, 6vw, 56px); margin-bottom: 16px; }
.rm-hero .page-title em { color: var(--clay-light); }
.rm-hero .page-sub { color: rgba(255,255,255,0.45); max-width: 480px; margin: 0 auto; }
.rm-hero-actions { margin-top: 40px; }
.rm-hero .gate-btn { background: var(--clay); border-color: var(--clay); }
.rm-hero .gate-btn:hover { background: var(--clay-light); transform: translateY(-2px); box-shadow: 0 12px 32px rgba(196,98,45,0.35); }
.rm-hero .gate-signin { color: rgba(255,255,255,0.35); }
.rm-hero .gate-signin a { color: var(--clay-light); }

/* ── Steps Section ── */
.rm-steps {
  background: var(--cream);
  padding: clamp(64px, 8vw, 100px) 52px;
}
.rm-steps-inner {
  max-width: 960px;
  margin: 0 auto;
}
.rm-section-title {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 48px;
}
.rm-section-title em { font-style: italic; color: var(--clay); }

.rm-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.rm-step {
  padding: 0;
}
.rm-step-num {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 700;
  color: var(--clay);
  opacity: 0.3;
  margin-bottom: 16px;
  line-height: 1;
}
.rm-step h3 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.rm-step p {
  font-size: 14px;
  color: var(--warm-grey);
  line-height: 1.65;
}

/* ── Feature Cards ── */
.rm-features {
  background: white;
  padding: clamp(64px, 8vw, 100px) 52px;
}
.rm-features-inner {
  max-width: 960px;
  margin: 0 auto;
}

.gate-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.gate-card {
  background: var(--cream);
  border: 1px solid var(--sand);
  border-radius: 20px;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.2s;
}
.gate-card:hover {
  box-shadow: 0 12px 36px rgba(26,22,18,0.08);
  border-color: transparent;
}
.gate-card-icon { font-size: 28px; margin-bottom: 14px; }
.gate-card h3 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.gate-card p {
  font-size: 13px;
  color: var(--warm-grey);
  line-height: 1.65;
}

/* ── Bottom CTA ── */
.rm-bottom-cta {
  background: var(--ink);
  text-align: center;
  padding: clamp(64px, 8vw, 100px) 52px;
}
.rm-bottom-cta .rm-section-title { color: white; margin-bottom: 32px; }
.rm-bottom-cta .rm-section-title em { color: var(--clay-light); }

.gate-cta { text-align: center; padding-bottom: 0; }
.gate-btn {
  display: inline-flex;
  max-width: 340px;
  margin: 0 auto 14px;
  text-decoration: none;
}
.gate-signin { font-size: 13px; color: var(--warm-grey); margin: 0; }
.gate-signin a { color: var(--clay); font-weight: 600; text-decoration: none; }
.gate-signin a:hover { text-decoration: underline; }
.rm-bottom-cta .gate-signin { color: rgba(255,255,255,0.35); }
.rm-bottom-cta .gate-signin a { color: var(--clay-light); }

/* ── Gate Responsive ── */
@media (max-width: 768px) {
  .rm-hero, .rm-steps, .rm-features, .rm-bottom-cta { padding-left: 24px; padding-right: 24px; }
  .rm-steps-grid { grid-template-columns: 1fr; gap: 28px; }
  .gate-cards { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .rm-hero { padding-top: 80px; padding-bottom: 60px; }
  .rm-hero .page-title { font-size: 30px; }
}

/* ================================================================
   PHASE 5 — Discovery Filters + Top Matches
   ================================================================ */

/* Top matches mini-cards */
.top-matches { margin-bottom: 20px; }
.top-matches-label {
  font-size: 11px; font-weight: 700; color: var(--clay);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px;
}
.top-matches-row { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.top-matches-row::-webkit-scrollbar { display: none; }
.top-match-card {
  flex-shrink: 0; width: 100px; text-align: center; padding: 14px 10px;
  background: white; border: 1px solid var(--sand); border-radius: 14px;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.top-match-card:hover { border-color: var(--clay-light); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(196,98,45,0.1); }
.top-match-img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; margin: 0 auto 8px; display: block; }
.top-match-initials {
  width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 18px; font-weight: 700; color: white;
}
.top-match-name { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-match-score { font-size: 11px; color: var(--clay); font-weight: 600; }
.top-match-mutual { font-size: 10px; color: #f59e0b; font-weight: 700; margin-top: 2px; }

/* Extended filter bar */
.stack-filters-extra {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center;
}
.stack-filter-select {
  font-family: var(--sans); font-size: 12px; padding: 7px 12px;
  border: 1.5px solid var(--sand); border-radius: 8px; background: white;
  color: var(--ink); cursor: pointer; outline: none;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238C8278' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; padding-right: 24px;
}
.stack-filter-select:focus { border-color: var(--clay); }
.stack-filter-budget { display: flex; align-items: center; gap: 4px; }
.stack-filter-input {
  font-family: var(--sans); font-size: 12px; padding: 7px 10px;
  border: 1.5px solid var(--sand); border-radius: 8px; background: white;
  color: var(--ink); outline: none; width: 80px;
}
.stack-filter-input:focus { border-color: var(--clay); }
.stack-filter-dash { color: var(--warm-grey); font-size: 12px; }

/* Phase 5 responsive for filters + top matches */
@media (max-width: 768px) {
  .stack-filters-extra { gap: 6px; }
  .stack-filter-select, .stack-filter-input { font-size: 11px; padding: 6px 8px; }
  .stack-filter-input { width: 65px; }
  .top-match-card { width: 85px; padding: 10px 8px; }
  .top-match-img, .top-match-initials { width: 40px; height: 40px; }
}
@media (max-width: 480px) {
  .stack-filters-extra { flex-direction: column; align-items: stretch; }
  .stack-filter-budget { width: 100%; }
  .stack-filter-input { flex: 1; width: auto; }
}
