/* ============================================================
   RideFit — by Bicyclotron
   Static storefront stylesheet.

   Design system ported from ridefit-goals-site/css/ridefit.css
   onto the Bicyclotron dark theme (website/css/main.css +
   website-landing/css/landing.css tokens): orange primary on
   deep-navy surfaces, Inter, 44px touch targets, visible focus.
   ============================================================ */

/* ── Design Tokens ── */
:root {
  /* Brand (Bicyclotron primary) */
  --rf-primary: #ff6b35;
  --rf-primary-hover: #e55a2b;
  --rf-primary-light: rgba(255, 107, 53, 0.15);
  --rf-primary-border: rgba(255, 107, 53, 0.3);
  /* Text/icons on solid orange. White on #ff6b35 is 2.84:1 (fails AA);
     deep navy is 6.02:1 on primary and 4.73:1 on hover. */
  --rf-on-primary: #1a1a2e;
  /* Foreground tokens for normal-sized text on dark/translucent surfaces.
     --rf-primary stays for solid backgrounds, borders, focus rings, and
     non-text decoration; these lighter tones pass 4.5:1 even against the
     lightest body-gradient endpoint (#0f3460) after alpha compositing. */
  --rf-primary-text: #ffa07a;
  --rf-primary-text-hover: #ffc0a8;
  --rf-success-text: #86efac;
  --rf-error-text: #fca5a5;
  --rf-warning-text: #fde68a;
  --rf-info-text: #bfdbfe;

  /* Background & surfaces (Bicyclotron dark) */
  --rf-bg-body: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --rf-bg-solid: #1a1a2e;
  --rf-surface-1: rgba(255, 255, 255, 0.05);
  --rf-surface-2: rgba(255, 255, 255, 0.08);
  --rf-surface-3: rgba(255, 255, 255, 0.03);
  --rf-border: rgba(255, 255, 255, 0.1);
  --rf-border-hover: rgba(255, 255, 255, 0.2);

  /* Text — high contrast on dark backgrounds (never below #d1d5db) */
  --rf-text-primary: #ffffff;
  --rf-text-highlight: #f1f5f9;
  --rf-text-secondary: #e2e8f0;
  --rf-text-muted: #d1d5db;

  /* Semantic */
  --rf-success: #4ade80;
  --rf-success-bg: rgba(74, 222, 128, 0.2);
  --rf-error: #f87171;
  --rf-error-bg: rgba(248, 113, 113, 0.2);
  --rf-warning: #fbbf24;
  --rf-warning-bg: rgba(251, 191, 36, 0.2);
  --rf-info: #60a5fa;
  --rf-info-bg: rgba(96, 165, 250, 0.2);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Layout */
  --nav-height: 64px;
  --max-width: 1140px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 0.15s;
  --duration-normal: 0.3s;
}

/* ── Reset & Base ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--rf-bg-body);
  background-attachment: fixed;
  background-color: var(--rf-bg-solid);
  color: var(--rf-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--rf-primary-text); text-decoration: none; transition: color var(--duration-fast); }
a:hover { color: var(--rf-primary-text-hover); }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

::selection { background: rgba(255, 107, 53, 0.3); color: #fff; }

/* Keyboard focus (a11y): Bicyclotron visible-ring convention */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--rf-primary);
  outline-offset: 2px;
}

/* ── Navbar ── */
.rf-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(26, 26, 46, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--rf-border);
  z-index: 1000;
  transition: box-shadow var(--duration-normal) var(--ease-out);
}
.rf-nav.scrolled { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4); }
.rf-nav-inner {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

/* RideFit / by Bicyclotron lockup */
.rf-nav-brand {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  text-decoration: none;
  flex-shrink: 0;
}
.rf-nav-brand-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--rf-text-primary);
  letter-spacing: -0.5px;
}
.rf-nav-brand-by { font-size: 12px; font-weight: 500; color: var(--rf-text-muted); }

.rf-nav-links { display: flex; align-items: center; gap: var(--space-lg); }
.rf-nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--rf-text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast);
}
.rf-nav-link:hover, .rf-nav-link.active { color: var(--rf-primary-text); }

/* Organiser CTA in nav */
.rf-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 8px 18px;
  min-height: 40px;
  background: var(--rf-primary);
  color: var(--rf-on-primary);
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--duration-fast), transform var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}
.rf-nav-cta:hover { background: var(--rf-primary-hover); color: var(--rf-on-primary); transform: translateY(-1px); }

.rf-nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  background: none; border: none; cursor: pointer; padding: 10px;
  -webkit-tap-highlight-color: transparent;
}
.rf-nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--rf-text-primary); border-radius: 2px;
  transition: all var(--duration-normal) var(--ease-out);
}
.rf-nav-hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.rf-nav-hamburger.active span:nth-child(2) { opacity: 0; }
.rf-nav-hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.rf-mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height); left: 0; right: 0; bottom: 0;
  background: rgba(26, 26, 46, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999;
  padding: var(--space-xl);
  opacity: 0; visibility: hidden;
  transition: opacity var(--duration-normal) var(--ease-out), visibility var(--duration-normal);
}
.rf-mobile-menu.active { opacity: 1; visibility: visible; }
.rf-mobile-menu-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--space-md);
  font-size: 17px; font-weight: 500;
  color: var(--rf-text-secondary); text-decoration: none;
  border-bottom: 1px solid var(--rf-border);
  transition: color var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
}
.rf-mobile-menu-link:hover, .rf-mobile-menu-link:active { color: var(--rf-primary-text); }
.rf-mobile-menu-link::after { content: '\203A'; font-size: 22px; color: var(--rf-text-muted); }
.rf-mobile-menu-cta {
  display: block; margin-top: var(--space-lg);
  padding: 14px; text-align: center;
  background: var(--rf-primary); color: var(--rf-on-primary);
  border-radius: var(--radius-md); font-weight: 700; font-size: 15px;
  text-decoration: none;
}
.rf-mobile-menu-cta:hover { background: var(--rf-primary-hover); color: var(--rf-on-primary); }

/* ── Main Layout ── */
.rf-main { padding-top: var(--nav-height); min-height: 100vh; }
.rf-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}
.rf-section { padding: var(--space-3xl) 0; }
.rf-section--alt { background: var(--rf-surface-3); }

/* ── Typography ── */
.rf-hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  color: var(--rf-text-primary);
}
.rf-hero-title em { font-style: normal; color: var(--rf-primary); }
.rf-hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--rf-text-secondary);
  line-height: 1.6;
  max-width: 580px;
}
.rf-section-title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--rf-text-highlight);
  margin-bottom: var(--space-sm);
}
.rf-section-subtitle {
  font-size: 1rem;
  color: var(--rf-text-secondary);
  max-width: 540px;
  margin-bottom: var(--space-xl);
}
.rf-text-center { text-align: center; }
.rf-text-muted { color: var(--rf-text-muted); }
.rf-text-secondary { color: var(--rf-text-secondary); }
.rf-text-sm { font-size: 14px; }
.rf-text-lg { font-size: 18px; }

/* ── Buttons (Bicyclotron .btn conventions: 44px, radius-md, 600) ── */
.rf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 24px;
  min-height: 44px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
  transition: background var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}
.rf-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.rf-btn-primary { background: var(--rf-primary); color: var(--rf-on-primary); }
.rf-btn-primary:hover:not(:disabled) { background: var(--rf-primary-hover); color: var(--rf-on-primary); transform: translateY(-1px); }
.rf-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--rf-text-primary);
  border: 1px solid var(--rf-border-hover);
}
.rf-btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.15); color: #fff; }
.rf-btn-ghost {
  background: transparent;
  color: var(--rf-text-secondary);
  border: 1px solid var(--rf-border);
}
.rf-btn-ghost:hover:not(:disabled) { background: var(--rf-surface-1); color: var(--rf-text-primary); border-color: var(--rf-border-hover); }
.rf-btn-lg { padding: 16px 32px; font-size: 16px; }
.rf-btn-block { width: 100%; }

/* ── CTA treatments ── */
/* Organiser (primary audience): filled orange, prominent */
.rf-cta-organiser { background: var(--rf-primary); color: var(--rf-on-primary); font-weight: 700; }
.rf-cta-organiser:hover:not(:disabled) { background: var(--rf-primary-hover); color: var(--rf-on-primary); }
/* Rider (secondary audience): outlined */
.rf-cta-rider {
  background: transparent;
  color: var(--rf-text-primary);
  border: 1px solid var(--rf-border-hover);
}
.rf-cta-rider:hover:not(:disabled) { background: var(--rf-surface-2); color: #fff; border-color: var(--rf-primary-border); }

.rf-hero {
  padding: var(--space-3xl) 0 var(--space-2xl);
  background: linear-gradient(180deg, var(--rf-primary-light) 0%, transparent 60%);
}
.rf-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 16px;
  background: var(--rf-primary-light);
  border: 1px solid var(--rf-primary-border);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--rf-primary-text);
  margin-bottom: var(--space-lg);
}
.rf-hero-cta-row {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

.rf-cta-box {
  background: var(--rf-surface-1);
  border: 1px solid var(--rf-primary-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
}
.rf-cta-box h2 { font-size: 24px; font-weight: 800; margin-bottom: var(--space-sm); color: var(--rf-text-highlight); }
.rf-cta-box p { font-size: 15px; color: var(--rf-text-secondary); margin-bottom: var(--space-lg); }

/* ── Challenge Grid & Cards ── */
.rf-challenge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}
.rf-challenge-card {
  background: var(--rf-surface-1);
  border: 1px solid var(--rf-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: border-color var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out);
}
.rf-challenge-card:hover {
  border-color: var(--rf-primary-border);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  color: inherit;
}
.rf-challenge-card-image {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  background: var(--rf-surface-2);
}
.rf-challenge-card-body {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex: 1;
}
.rf-challenge-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
}
.rf-challenge-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--rf-text-primary);
  line-height: 1.3;
}
.rf-challenge-desc {
  font-size: 14px;
  color: var(--rf-text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rf-challenge-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--rf-border);
}
.rf-challenge-target { font-size: 13px; font-weight: 700; color: var(--rf-primary-text); }
.rf-challenge-link { font-size: 13px; font-weight: 600; color: var(--rf-primary-text); }
.rf-challenge-link:hover { color: var(--rf-primary-text-hover); }

/* ── Challenge Type Icon ── */
.rf-type-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  flex-shrink: 0;
  background: var(--rf-surface-2);
  color: var(--rf-text-secondary);
}
/* Foregrounds are lighter shades of the same hue so each icon passes
   4.5:1 on its translucent background even over the lightest body-
   gradient endpoint (#0f3460). Background hues are unchanged. */
.rf-type-icon[data-type="streak"] { background: var(--rf-warning-bg); color: var(--rf-warning-text); }
.rf-type-icon[data-type="distance_cumulative"] { background: var(--rf-info-bg); color: var(--rf-info-text); }
.rf-type-icon[data-type="activity_count"] { background: var(--rf-success-bg); color: var(--rf-success-text); }
.rf-type-icon[data-type="consistency"] { background: rgba(167, 139, 250, 0.2); color: #ddd6fe; }
.rf-type-icon[data-type="monthly_distance"] { background: rgba(244, 114, 182, 0.2); color: #fbcfe8; }

/* ── Status Badges ── */
.rf-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.rf-status--active { background: var(--rf-success-bg); color: var(--rf-success-text); }
.rf-status--upcoming { background: var(--rf-info-bg); color: var(--rf-info-text); }
.rf-status--completed { background: var(--rf-surface-2); color: var(--rf-text-muted); }

/* ── Metadata (date / club / participants) ── */
.rf-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  font-size: 12px;
  color: var(--rf-text-muted);
  margin-top: var(--space-xs);
}
.rf-meta span { display: inline-flex; align-items: center; gap: 4px; }

/* ── Filter Controls & Search ── */
.rf-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: flex-end;
  margin-bottom: var(--space-xl);
}
.rf-filter-group { display: flex; flex-direction: column; gap: 4px; }
.rf-filter-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--rf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rf-filter-group select,
.rf-filter-group input {
  padding: 10px 12px;
  min-height: 44px;
  background: var(--rf-surface-2);
  border: 1px solid var(--rf-border);
  border-radius: var(--radius-md);
  color: var(--rf-text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.rf-filter-group select option { background: var(--rf-bg-solid); color: var(--rf-text-primary); }
.rf-filter-group select:focus,
.rf-filter-group input:focus {
  outline: none;
  border-color: var(--rf-primary);
  box-shadow: 0 0 0 3px var(--rf-primary-light);
}
.rf-filter-group input::placeholder { color: var(--rf-text-muted); }

.rf-search { flex: 1; min-width: 200px; }
.rf-search input { width: 100%; }

.rf-pills { display: flex; gap: var(--space-xs); flex-wrap: wrap; }
.rf-pill {
  padding: 8px 16px;
  min-height: 36px;
  font-size: 13px; font-weight: 600;
  color: var(--rf-text-secondary);
  background: var(--rf-surface-1);
  border: 1px solid var(--rf-border);
  border-radius: var(--radius-full);
  cursor: pointer; font-family: inherit;
  transition: color var(--duration-fast), border-color var(--duration-fast), background var(--duration-fast);
}
.rf-pill:hover { color: var(--rf-text-primary); border-color: var(--rf-border-hover); }
.rf-pill.active { background: var(--rf-primary); color: var(--rf-on-primary); border-color: transparent; }

/* ── Async States: loading / error / empty / no-results ── */
.rf-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
}
.rf-state-title { font-size: 20px; font-weight: 700; color: var(--rf-text-primary); margin-bottom: var(--space-sm); }
.rf-state-desc { font-size: 14px; color: var(--rf-text-muted); max-width: 400px; margin: 0 auto; }
.rf-state .rf-btn { margin-top: var(--space-lg); }

.rf-state--error .rf-state-title { color: var(--rf-error-text); }

.rf-spinner {
  display: inline-block;
  width: 32px; height: 32px;
  border: 3px solid var(--rf-primary-light);
  border-top-color: var(--rf-primary);
  border-radius: 50%;
  animation: rf-spin 0.8s linear infinite;
  margin-bottom: var(--space-md);
}
@keyframes rf-spin { to { transform: rotate(360deg); } }

/* Skeleton placeholders for loading grids */
.rf-skeleton {
  background: var(--rf-surface-1);
  border: 1px solid var(--rf-border);
  border-radius: var(--radius-xl);
  min-height: 180px;
  position: relative;
  overflow: hidden;
}
.rf-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--rf-surface-2), transparent);
  animation: rf-shimmer 1.4s infinite;
}
@keyframes rf-shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* ── Detail Layout ── */
.rf-detail-header {
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}
.rf-detail-cover {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--radius-xl);
  border: 1px solid var(--rf-border);
  margin-bottom: var(--space-lg);
  background: var(--rf-surface-2);
}
.rf-detail-title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  color: var(--rf-text-primary);
  margin-bottom: var(--space-xs);
}
.rf-detail-subtitle { font-size: 1.1rem; color: var(--rf-text-secondary); }
.rf-detail-club { font-size: 14px; font-weight: 600; color: var(--rf-primary-text); margin-bottom: var(--space-xs); }

.rf-detail-target-box {
  background: var(--rf-primary-light);
  border: 1px solid var(--rf-primary-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  text-align: center;
}
.rf-detail-target-value { font-size: 28px; font-weight: 800; color: var(--rf-primary); }
.rf-detail-target-label { font-size: 14px; color: var(--rf-text-secondary); margin-top: var(--space-xs); }

.rf-detail-section { margin-bottom: var(--space-2xl); }
.rf-detail-section h2 { font-size: 20px; font-weight: 700; margin-bottom: var(--space-md); color: var(--rf-text-highlight); }
.rf-detail-section ul li {
  display: flex; align-items: flex-start; gap: var(--space-sm);
  padding: var(--space-sm) 0;
  font-size: 14px; color: var(--rf-text-secondary);
  border-bottom: 1px solid var(--rf-border);
}
.rf-detail-section ul li:last-child { border-bottom: none; }
.rf-detail-section ul li::before {
  content: '\2713';
  color: var(--rf-success);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Metadata cards (starts / ends / entry / joined) */
.rf-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}
.rf-meta-card {
  background: var(--rf-surface-1);
  border: 1px solid var(--rf-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}
.rf-meta-card .k {
  font-size: 12px;
  font-weight: 600;
  color: var(--rf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.rf-meta-card .v { font-size: 15px; font-weight: 700; color: var(--rf-text-primary); }

/* ── Leaderboard Table ── */
.rf-lb-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rf-lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.rf-lb-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--rf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--rf-border);
  white-space: nowrap;
}
.rf-lb-table td {
  padding: 12px 16px;
  color: var(--rf-text-secondary);
  border-bottom: 1px solid var(--rf-border);
}
.rf-lb-table tbody tr:hover { background: var(--rf-surface-2); }
.rf-lb-table tbody tr:last-child td { border-bottom: none; }
.rf-lb-rank { font-weight: 700; color: var(--rf-text-primary); width: 48px; }
.rf-lb-rider { font-weight: 600; color: var(--rf-text-primary); }
.rf-lb-anon { color: var(--rf-text-muted); font-style: italic; }
.rf-lb-metric { white-space: nowrap; }

/* ── FAQ Accordion ── */
.rf-faq-list { max-width: 760px; margin: 0 auto; }
.rf-faq-item { border-bottom: 1px solid var(--rf-border); overflow: hidden; }
.rf-faq-q {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-md) 0;
  min-height: 44px;
  font-size: 16px; font-weight: 600;
  color: var(--rf-text-primary);
  cursor: pointer;
  background: none; border: none; width: 100%;
  text-align: left; font-family: inherit;
  transition: color var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
}
.rf-faq-q:hover { color: var(--rf-primary-text); }
.rf-faq-q-icon { font-size: 20px; color: var(--rf-text-muted); transition: transform 0.2s; flex-shrink: 0; margin-left: var(--space-md); }
.rf-faq-item.open .rf-faq-q-icon { transform: rotate(45deg); }
.rf-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-normal) var(--ease-out);
}
.rf-faq-item.open .rf-faq-a { max-height: 400px; }
.rf-faq-a-inner { padding: 0 0 var(--space-md); font-size: 14px; color: var(--rf-text-secondary); line-height: 1.7; }

/* ── Steps (How It Works) ── */
.rf-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.rf-step { text-align: center; padding: var(--space-lg); }
.rf-step-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--rf-primary);
  color: var(--rf-on-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
  margin: 0 auto var(--space-md);
}
.rf-step-title { font-size: 16px; font-weight: 700; margin-bottom: var(--space-xs); color: var(--rf-text-primary); }
.rf-step-desc { font-size: 14px; color: var(--rf-text-secondary); }

/* ── Footer ── */
.rf-footer {
  background: var(--rf-bg-solid);
  border-top: 1px solid var(--rf-border);
  color: var(--rf-text-secondary);
  padding: var(--space-2xl) 0 var(--space-xl);
}
.rf-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}
.rf-footer-brand { font-size: 18px; font-weight: 800; color: var(--rf-text-primary); margin-bottom: var(--space-xs); }
.rf-footer-by { font-size: 13px; color: var(--rf-text-muted); margin-bottom: var(--space-lg); }
.rf-footer-links { display: flex; flex-wrap: wrap; gap: var(--space-lg); margin-bottom: var(--space-lg); }
.rf-footer-links a { color: var(--rf-text-secondary); font-size: 13px; text-decoration: none; transition: color var(--duration-fast); }
.rf-footer-links a:hover { color: var(--rf-primary-text); }
.rf-footer-bottom {
  font-size: 12px;
  color: var(--rf-text-muted);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--rf-border);
}

/* ── Reveal Animation (reduced-motion safe; see media query below) ── */
.rf-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.rf-reveal.rf-visible { opacity: 1; transform: translateY(0); }

/* ── Utility ── */
.rf-row { display: flex; align-items: center; gap: var(--space-md); }
.rf-col { display: flex; flex-direction: column; gap: var(--space-md); }
.rf-spread { display: flex; align-items: center; justify-content: space-between; }
.rf-wrap { flex-wrap: wrap; }
.rf-gap-sm { gap: var(--space-sm); }
.rf-mt-sm { margin-top: var(--space-sm); }
.rf-mt-md { margin-top: var(--space-md); }
.rf-mt-lg { margin-top: var(--space-lg); }
.rf-mt-xl { margin-top: var(--space-xl); }
.rf-mb-md { margin-bottom: var(--space-md); }
.rf-mb-lg { margin-bottom: var(--space-lg); }
.rf-mb-xl { margin-bottom: var(--space-xl); }
.rf-hidden { display: none !important; }
.rf-flex-1 { flex: 1; }
.rf-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .rf-steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .rf-nav-links { display: none; }
  .rf-nav-hamburger { display: flex; }
  .rf-mobile-menu { display: block; }
  .rf-nav-inner { padding: 0 var(--space-md); }

  .rf-steps { grid-template-columns: 1fr; }
  .rf-detail-header { flex-direction: column; }
  .rf-filters { flex-direction: column; align-items: stretch; }
  .rf-filter-group { width: 100%; }
  .rf-filter-group select, .rf-filter-group input { width: 100%; }

  /* Leaderboard on small screens: tighter cells, horizontal scroll via .rf-lb-wrap */
  .rf-lb-table th, .rf-lb-table td { padding: 10px 12px; }
}

@media (max-width: 480px) {
  :root { --nav-height: 56px; --space-3xl: 48px; --space-2xl: 36px; }
  .rf-nav-brand-name { font-size: 17px; }
  .rf-hero-cta-row { flex-direction: column; }
  .rf-hero-cta-row .rf-btn { width: 100%; }
  .rf-challenge-grid { grid-template-columns: 1fr; }
  .rf-meta-grid { grid-template-columns: repeat(2, 1fr); }
  .rf-btn { width: 100%; }
  .rf-pill { flex: 1; text-align: center; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .rf-reveal { opacity: 1; transform: none; }
  .rf-skeleton::after { animation: none; }
}

/* ── Bicyclotron brand logo (Know Your Ride lockup) ───────── */
.rf-hero-logo {
  height: 64px;
  width: auto;
  max-width: 100%;
}

.rf-footer-logo {
  height: 64px;
  width: auto;
  max-width: 100%;
  margin-top: 4px;
}

/* ── Two-tone RideFit wordmark: "Ride" white, "Fit" orange ── */
.rf-wm-ride { color: var(--rf-text-primary); }
.rf-wm-fit { color: var(--rf-primary); }
.rf-hero-title em .rf-wm-ride { color: var(--rf-text-primary); }
.rf-hero-title em .rf-wm-fit { color: var(--rf-primary); }

/* ── Powered by Strava (official asset, unmodified) ───────── */
.rf-footer-strava { margin-top: 14px; opacity: 0.65; }
.rf-strava-logo { height: 24px; width: auto; display: inline-block; }
