/* Screening engine section on /features/screening: applicants move through a
   screening check and come out marked Meets criteria or Needs review. Pure CSS
   motion; static/js/public-screening-engine.js scales the scene, switches the
   criteria board per applicant and pauses off screen. */
#main-content .ssp .sse {
  --sse-ink: #042238; --sse-muted: #4D5D6D; --sse-purple: #6B48E0; --sse-purple-deep: #3B2A8C;
  --sse-lime: #74C600; --sse-yellow: #FFCD00; --sse-dark: #1B1C1A;
  --sse-card: #EFEAFE; --sse-bg: #F7F8FB; --sse-track: #E7E4EE;
  --sse-shadow-window: 0 16px 44px -20px rgba(4, 34, 56, .30);
  --sse-shadow-card: 0 12px 34px -18px rgba(4, 34, 56, .24);
  --sse-dur: 22s; --sse-beat: 2.75s;
  background: var(--sse-bg);
}
#main-content .ssp .sse .sse-lede { margin-top: 16px; color: var(--sse-ink); }
#main-content .ssp .sse .sse-viewport { position: relative; overflow: hidden; }
#main-content .ssp .sse .sse-viewport::before,
#main-content .ssp .sse .sse-viewport::after { content: ""; position: absolute; top: 0; bottom: 0; width: 48px; z-index: 6; pointer-events: none; }
#main-content .ssp .sse .sse-viewport::before { left: 0; background: linear-gradient(90deg, var(--sse-bg), transparent); }
#main-content .ssp .sse .sse-viewport::after { right: 0; background: linear-gradient(-90deg, var(--sse-bg), transparent); }
#main-content .ssp .sse .sse-stage { position: absolute; left: 50%; top: 0; width: 1360px; height: 640px; transform: translateX(-50%); transform-origin: center top; }
#main-content .ssp .sse .sse-scene, #main-content .ssp .sse .sse-belt, #main-content .ssp .sse .sse-glass,
#main-content .ssp .sse .sse-wires, #main-content .ssp .sse .sse-board { position: absolute; inset: 0; }
#main-content .ssp .sse .sse-belt { z-index: 1; }
#main-content .ssp .sse .sse-glass { z-index: 2; }
#main-content .ssp .sse .sse-wires { z-index: 3; }
#main-content .ssp .sse .sse-board { z-index: 4; }

#main-content .ssp .sse .sse-badge { position: absolute; left: 556px; top: 46px; width: 248px; min-height: 44px; padding: 4px 16px 4px 10px; border-radius: 999px; background: var(--sse-ink); box-shadow: 0 0 0 3px rgba(209, 244, 140, .55), 0 8px 20px -10px rgba(4, 34, 56, .5); color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 600; }
/* The official mark, never smaller than 30px on screen however far the scene is scaled down. */
#main-content .ssp .sse .sse-badge img { flex: none; width: max(32px, calc(30px / var(--sse-scale, 1))); height: max(32px, calc(30px / var(--sse-scale, 1))); max-width: none; }

/* glass engine */
#main-content .ssp .sse .sse-mono { position: absolute; left: 545px; top: 111px; width: 270px; height: 330px; border-radius: 42px; border: 1.5px solid rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .45); -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2); box-shadow: var(--sse-shadow-window); }
#main-content .ssp .sse .sse-layer { position: absolute; left: 22px; right: 22px; height: 66px; border-radius: 22px; background: rgba(4, 34, 56, .06); display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 10px; font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--sse-ink); }
#main-content .ssp .sse .sse-l1 { top: 32px; }
#main-content .ssp .sse .sse-l2 { top: 132px; }
#main-content .ssp .sse .sse-l3 { top: 232px; }
#main-content .ssp .sse .sse-lit { position: absolute; inset: 0; border-radius: 22px; border: 2.5px solid #fff; background: var(--sse-purple); color: #fff; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 10px; opacity: 0; }
@keyframes sseGlow { 0%, 4% { opacity: 0; } 10%, 26% { opacity: 1; } 34%, 100% { opacity: 0; } }
#main-content .ssp .sse .sse-l1 .sse-lit { animation: sseGlow var(--sse-beat) ease-in-out -.55s infinite; }
#main-content .ssp .sse .sse-l2 .sse-lit { animation: sseGlow var(--sse-beat) ease-in-out -.2s infinite; }
#main-content .ssp .sse .sse-l3 .sse-lit { animation: sseGlow var(--sse-beat) ease-in-out -2.6s infinite; }

/* eight carriers on one linear belt, one every beat */
#main-content .ssp .sse .sse-carrier { position: absolute; left: 0; top: 0; width: 0; height: 0; animation: sseBelt var(--sse-dur) linear var(--d) infinite; will-change: transform; }
@keyframes sseBelt { from { transform: translateX(-100px); } to { transform: translateX(1460px); } }
#main-content .ssp .sse .sse-c1 { --d: 0s; }
#main-content .ssp .sse .sse-c2 { --d: -2.75s; }
#main-content .ssp .sse .sse-c3 { --d: -5.5s; }
#main-content .ssp .sse .sse-c4 { --d: -8.25s; }
#main-content .ssp .sse .sse-c5 { --d: -11s; }
#main-content .ssp .sse .sse-c6 { --d: -13.75s; }
#main-content .ssp .sse .sse-c7 { --d: -16.5s; }
#main-content .ssp .sse .sse-c8 { --d: -19.25s; }

/* applicant card folds into the engine */
#main-content .ssp .sse .sse-app { position: absolute; left: -92px; top: 124px; width: 184px; height: 300px; border-radius: 16px; overflow: hidden; background: var(--sse-card); box-shadow: var(--sse-shadow-window); transform-origin: 100% 50%; animation: sseFold var(--sse-dur) linear var(--d) infinite; }
@keyframes sseFold {
  0% { opacity: 1; transform: scale(1); }
  26% { opacity: 1; transform: scale(1); animation-timing-function: cubic-bezier(.5, 0, .85, .5); }
  38% { opacity: 1; transform: scale(.2); }
  42%, 100% { opacity: 0; transform: scale(.2); }
}
#main-content .ssp .sse .sse-app-top { position: absolute; left: 0; right: 0; top: 0; padding: 13px 14px 0; }
#main-content .ssp .sse .sse-pill, #main-content .ssp .sse .sse-tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 10px 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1; }
#main-content .ssp .sse .sse-pill { background: #212121; color: #fff; }
#main-content .ssp .sse .sse-pill i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: ssePulse 1.2s ease-in-out infinite; }
@keyframes ssePulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
#main-content .ssp .sse .sse-name { margin-top: 9px; font-size: 20px; font-weight: 700; line-height: 1.05; color: var(--sse-ink); }
#main-content .ssp .sse .sse-photo { position: absolute; left: 0; right: 0; bottom: 0; height: 206px; background: #D9D3E8; }
#main-content .ssp .sse .sse-photo img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 18%; }
#main-content .ssp .sse .sse-chip { position: absolute; bottom: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 62px; padding: 6px 9px; border-radius: 8px; background: rgba(255, 255, 255, .95); box-shadow: 0 5px 13px -6px rgba(4, 34, 56, .32); }
#main-content .ssp .sse .sse-chip.l { left: 8px; }
#main-content .ssp .sse .sse-chip.r { right: 8px; }
#main-content .ssp .sse .sse-chip b { font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--sse-muted); white-space: nowrap; }
#main-content .ssp .sse .sse-shim { width: 28px; height: 5px; border-radius: 99px; background: linear-gradient(90deg, #DCD8E6 0, #DCD8E6 35%, #fff 50%, #DCD8E6 65%, #DCD8E6 100%); background-size: 220% 100%; animation: sseShim 1.2s linear infinite; }
@keyframes sseShim { from { background-position: 160% 0; } to { background-position: -60% 0; } }

/* result card appears inside the glass and slides out */
#main-content .ssp .sse .sse-res { position: absolute; left: 30px; top: 218px; width: 184px; height: 112px; padding: 13px 15px; border-radius: 16px; background: #fff; box-shadow: var(--sse-shadow-window); opacity: 0; animation: sseShow var(--sse-dur) linear var(--d) infinite; }
@keyframes sseShow { 0%, 44.4% { opacity: 0; } 45.4%, 100% { opacity: 1; } }
#main-content .ssp .sse .sse-tag { background: var(--sse-lime); color: var(--sse-dark); }
#main-content .ssp .sse .sse-tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--sse-dark); }
#main-content .ssp .sse .sse-res.is-review .sse-tag { background: var(--sse-yellow); }
#main-content .ssp .sse .sse-rname { margin-top: 9px; font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--sse-ink); }
#main-content .ssp .sse .sse-rfacts { margin-top: 4px; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--sse-muted); font-variant-numeric: tabular-nums; }

/* wires between the engine and the criteria board */
#main-content .ssp .sse .sse-wires svg { position: absolute; inset: 0; }
#main-content .ssp .sse .sse-dn { animation: sseDn var(--sse-beat) ease-in-out infinite; }
@keyframes sseDn { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } 38%, 100% { transform: translateY(73px); opacity: 0; } }
#main-content .ssp .sse .sse-up { animation: sseUp var(--sse-beat) ease-in-out infinite; }
@keyframes sseUp { 0%, 48% { transform: translateY(0); opacity: 0; } 56% { opacity: 1; } 84%, 100% { transform: translateY(-73px); opacity: 0; } }

/* criteria board */
#main-content .ssp .sse .sse-crit { position: absolute; left: 450px; top: 518px; width: 460px; padding: 12px 16px 14px; border-radius: 12px; background: #fff; box-shadow: var(--sse-shadow-card); }
#main-content .ssp .sse .sse-crit-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
#main-content .ssp .sse .sse-crit-h b { font-size: 13px; font-weight: 700; color: var(--sse-ink); }
#main-content .ssp .sse .sse-crit-h span { font-size: 12px; color: var(--sse-muted); }
#main-content .ssp .sse .sse-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; row-gap: 9px; margin-top: 9px; }
#main-content .ssp .sse .sse-row { display: flex; align-items: center; gap: 8px; }
#main-content .ssp .sse .sse-row .sse-lbl { width: 84px; font-size: 12px; font-weight: 600; color: var(--sse-muted); white-space: nowrap; }
#main-content .ssp .sse .sse-row .sse-val { width: 34px; text-align: right; font-size: 12px; font-weight: 700; color: var(--sse-ink); font-variant-numeric: tabular-nums; }
#main-content .ssp .sse .sse-trk { position: relative; flex: 1; height: 4px; border-radius: 2px; background: var(--sse-track); }
#main-content .ssp .sse .sse-fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--v, 50%); border-radius: 2px; background: var(--sse-purple); transition: width .9s cubic-bezier(.4, 0, .2, 1); }
#main-content .ssp .sse .sse-knob { position: absolute; top: 50%; left: var(--v, 50%); width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--sse-purple); transform: translate(-50%, -50%); transition: left .9s cubic-bezier(.4, 0, .2, 1); }

/* side cards from the rental criteria settings: household choices left of the board, the applicant view right */
#main-content .ssp .sse .sse-side { position: absolute; bottom: 12px; width: 262px; padding: 12px 16px 14px; border-radius: 12px; background: #fff; box-shadow: var(--sse-shadow-card); }
#main-content .ssp .sse .sse-house { left: 166px; }
#main-content .ssp .sse .sse-see { left: 932px; background: #C9ECFF; }
#main-content .ssp .sse .sse-side .sse-crit-h { margin-bottom: 6px; }
#main-content .ssp .sse .sse-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; border-top: 1px solid #EEF0F4; }
#main-content .ssp .sse .sse-opt .sse-lbl { font-size: 12px; font-weight: 600; color: var(--sse-muted); white-space: nowrap; }
#main-content .ssp .sse .sse-state { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--sse-ink); white-space: nowrap; }
#main-content .ssp .sse .sse-sw { position: relative; width: 26px; height: 14px; border-radius: 99px; background: #6F6A78; }
#main-content .ssp .sse .sse-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
#main-content .ssp .sse .sse-sw.is-on { background: var(--sse-purple); }
#main-content .ssp .sse .sse-sw.is-on::after { left: 14px; }
#main-content .ssp .sse .sse-see-line { position: relative; display: block; margin-top: 5px; padding-left: 14px; font-size: 12px; line-height: 1.4; color: var(--sse-ink); }
#main-content .ssp .sse .sse-see-line::before { content: ""; position: absolute; left: 0; top: .5em; width: 6px; height: 6px; background: var(--sse-purple); }

/* phones: the board leaves the scaled scene and sits below it at full size; below 900px the side cards follow it */
#main-content .ssp .sse .sse-slot { display: grid; gap: 12px; justify-content: center; grid-template-columns: minmax(0, 460px); }
#main-content .ssp .sse .sse-slot:empty { display: none; }
#main-content .ssp .sse .sse-slot .sse-side { position: relative; bottom: auto; left: auto; width: auto; }
#main-content .ssp .sse .sse-slot :is(.sse-opt .sse-lbl, .sse-state, .sse-see-line) { font-size: 14px; }
#main-content .ssp .sse .sse-slot .sse-crit { position: relative; left: auto; top: auto; width: auto; max-width: 460px; margin: 0; }
#main-content .ssp .sse .sse-slot .sse-grid { grid-template-columns: 1fr; row-gap: 12px; }
#main-content .ssp .sse .sse-slot .sse-row .sse-lbl { width: 108px; font-size: 14px; }
#main-content .ssp .sse .sse-slot .sse-row .sse-val { width: 48px; font-size: 14px; }
#main-content .ssp .sse .sse-slot .sse-crit-h b { font-size: 16px; }
#main-content .ssp .sse .sse-slot .sse-crit-h span { font-size: 14px; }

#main-content .ssp .sse .is-paused, #main-content .ssp .sse .is-paused * { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  #main-content .ssp .sse .sse-scene, #main-content .ssp .sse .sse-scene * { animation: none !important; }
  #main-content .ssp .sse .sse-fill, #main-content .ssp .sse .sse-knob { transition: none; }
  #main-content .ssp .sse .sse-c1 { transform: translateX(-100px); }
  #main-content .ssp .sse .sse-c2 { transform: translateX(95px); }
  #main-content .ssp .sse .sse-c3 { transform: translateX(290px); }
  #main-content .ssp .sse .sse-c4 { transform: translateX(485px); }
  #main-content .ssp .sse .sse-c5 { transform: translateX(680px); }
  #main-content .ssp .sse .sse-c6 { transform: translateX(875px); }
  #main-content .ssp .sse .sse-c7 { transform: translateX(1070px); }
  #main-content .ssp .sse .sse-c8 { transform: translateX(1265px); }
  #main-content .ssp .sse :is(.sse-c4, .sse-c5, .sse-c6, .sse-c7, .sse-c8) .sse-app { opacity: 0; }
  #main-content .ssp .sse :is(.sse-c6, .sse-c7, .sse-c8) .sse-res { opacity: 1; }
  #main-content .ssp .sse :is(.sse-l1, .sse-l2) .sse-lit { opacity: 1; }
  #main-content .ssp .sse :is(.sse-dn, .sse-up) { opacity: 0; }
}
