/* ============================================================
   RACE FOR IMPACT — NYC microsite
   site-specific styles. RFI tokens live in /styles/rfi-tokens.css
   ============================================================ */

html, body { background: #000; color: #fff; }
body { font-family: "Chakra Petch", system-ui, sans-serif; }

/* tap-target floor: 56px on mobile per booth-context brief */
.rfi-btn-primary,
.rfi-btn-accent,
.rfi-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 64px;
  padding: 18px 22px;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease, background-color .15s ease;
  width: 100%;
}
.rfi-btn-primary  { background: #3759B6; color: #fff; }
.rfi-btn-accent   { background: #97CEFF; color: #000; }
.rfi-btn-ghost    { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px #97CEFF; }

/* CTA label — clamps from 16px on phones up to 19px on desktop */
.rfi-btn-label {
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  font-size: clamp(15px, 4.2vw, 19px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}

.rfi-btn-primary:hover,
.rfi-btn-accent:hover,
.rfi-btn-ghost:hover  { filter: brightness(1.08); }
.rfi-btn-primary:active,
.rfi-btn-accent:active,
.rfi-btn-ghost:active { transform: translateY(1px); filter: brightness(.92); }

@media (min-width: 640px) {
  .rfi-btn-primary, .rfi-btn-accent, .rfi-btn-ghost {
    width: auto;
  }
}

/* ── Racer card ─────────────────────────────────────────────── */
.racer-card {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #fff;
  color: #000;
  border: 2px solid #000;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
  min-height: 88px;
}
@media (min-width: 640px) {
  .racer-card { grid-template-columns: 56px 1fr auto; gap: 14px; padding: 16px; }
}
.racer-card:hover  { background: #97CEFF; border-color: #3759B6; }
.racer-card:active { transform: translateY(1px); }

.racer-card .avatar {
  width: 52px; height: 52px; border-radius: 9999px;
  background: #D9D9D9;
  display: grid; place-items: center;
  font-family: "Brutal Type", sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.05em;
  color: #000;
  text-transform: uppercase;
  overflow: hidden;
}
.racer-card .avatar.avatar--photo { background: #000; }
.racer-card .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.racer-card .racer-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  background: #3759B6; color: #fff;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700; font-size: 10px;
  letter-spacing: 0.08em;
  vertical-align: 2px;
}

/* Skeleton + loading state for the racer list. Keeps section
   height stable while the Raisely API call is in flight. */
.racer-skeleton {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 12px;
  padding: 14px;
  background: #fff;
  border: 2px solid #D9D9D9;
  min-height: 88px;
  align-items: center;
}
.racer-skeleton .sk { background: linear-gradient(90deg, #ECECEC 0%, #F6F6F6 50%, #ECECEC 100%); background-size: 200% 100%; animation: sk-shimmer 1.4s ease infinite; }
.racer-skeleton .sk-avatar { width: 52px; height: 52px; border-radius: 9999px; }
.racer-skeleton .sk-lines { display: flex; flex-direction: column; gap: 8px; }
.racer-skeleton .sk-line { height: 12px; width: 60%; }
.racer-skeleton .sk-line.short { width: 40%; }
.racer-skeleton .sk-line.bar { height: 6px; width: 100%; border-radius: 30px; }
@keyframes sk-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .racer-skeleton .sk { animation: none; }
}
.racer-card .name {
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700; font-size: 17px; line-height: 1.05;
  text-transform: uppercase; letter-spacing: -0.01em;
  color: #000;
}
.racer-card .meta {
  margin-top: 4px;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 500; font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3D3C3C;
}
.racer-card .progress {
  margin-top: 8px;
  height: 6px; background: #D9D9D9; border-radius: 30px; overflow: hidden;
}
.racer-card .progress > .fill {
  height: 100%; background: #3759B6; border-radius: 30px;
  transition: width .4s cubic-bezier(.2,.8,.2,1);
}
.racer-card .raised {
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700; font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3759B6;
  margin-top: 6px;
}
.racer-card .arrow {
  align-self: center;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: #000; color: #fff;
  transition: background-color .15s ease;
}
@media (min-width: 640px) {
  .racer-card .arrow { width: 44px; height: 44px; }
}
.racer-card:hover .arrow { background: #3759B6; }

/* ── Fund card ─────────────────────────────────────────────── */
.fund-card {
  position: relative;
  display: flex; flex-direction: column;
  background: #000;
  color: #fff;
  border: 2px solid #97CEFF;
  padding: 16px 14px 14px;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform .15s ease, border-color .15s ease, background-color .15s ease;
  min-height: 220px;
}
@media (min-width: 640px) {
  .fund-card { padding: 18px 18px 16px; min-height: 260px; }
}
@media (min-width: 1024px) {
  .fund-card { min-height: 320px; padding: 22px 20px 18px; }
}
.fund-card:hover { border-color: #fff; background: #0a1428; }
.fund-card:active { transform: translateY(1px); }
.fund-card::before {
  /* keep ::before as a pure black underlay — actual image is on .fund-bg */
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background: #000;
}
.fund-bg {
  /* Background photo. Inline style sets background-image; URL is resolved
     in the HTML document context (correct path) rather than via a CSS
     var inside site.css (wrong path). */
  position: absolute; inset: 0; z-index: 1;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0.35;
  transition: opacity .25s ease;
}
.fund-overlay {
  /* Downward darken so the Donate button at the bottom keeps contrast,
     and the headline area at the top stays slightly clearer. */
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.55) 55%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
}
/* All content above the bg/overlay */
.fund-card > .icon,
.fund-card > h3,
.fund-card > .rule,
.fund-card > .stat,
.fund-card > .donate { position: relative; z-index: 3; }

.fund-card:hover { border-color: #fff; }
.fund-card:hover .fund-bg { opacity: 0.5; }
.fund-card:active { transform: translateY(1px); }

.fund-card .icon {
  width: 48px; height: 48px;
  margin-bottom: 10px;
}
.fund-card .icon img { width: 100%; height: 100%; display: block; }
@media (min-width: 640px) {
  .fund-card .icon { width: 56px; height: 56px; margin-bottom: 14px; }
}
.fund-card h3 {
  font-family: "Brutal Type", sans-serif;
  font-weight: 800;
  font-size: 22px;
  line-height: 0.92;
  letter-spacing: -0.07em;
  text-transform: uppercase;
  margin: 0;
}
@media (min-width: 640px) {
  .fund-card h3 { font-size: 26px; }
}
.fund-card .rule {
  width: 32px; height: 3px; background: #97CEFF;
  margin: 8px 0 10px;
}
.fund-card .stat {
  font-family: "Chakra Petch", sans-serif;
  font-weight: 600; font-size: 12px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: rgba(255,255,255,0.92);
  text-transform: none;
  margin: 0;
  flex: 1;
}
@media (min-width: 640px) {
  .fund-card .stat { font-size: 13px; }
}
.fund-card .donate {
  margin-top: 12px;
  display: inline-flex; align-items: center; justify-content: space-between;
  background: #97CEFF; color: #000;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700; font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 12px;
  min-height: 44px;
  transition: filter .15s ease;
}
@media (min-width: 640px) {
  .fund-card .donate { font-size: 14px; padding: 12px 14px; min-height: 48px; }
}
.fund-card:hover .donate { filter: brightness(1.08); }

/* desktop: a touch larger */
@media (min-width: 1024px) {
  .fund-card h3 { font-size: 30px; }
  .fund-card .icon { width: 64px; height: 64px; }
}

/* ── Misc ───────────────────────────────────────────────────── */
.rfi-rule { display:block; width:100%; height:4px; background:#97CEFF; border:0; margin:0; }
.rfi-rule--blue { background:#3759B6; }

::selection { background: #97CEFF; color: #000; }

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
