/*
 * ╔══════════════════════════════════════════════════════╗
 * ║           RUNTREE DESIGN SYSTEM v1.0                 ║
 * ║           runtree.co                                 ║
 * ╚══════════════════════════════════════════════════════╝
 *
 * Import this in every page:
 * <link rel="stylesheet" href="runtree.css">
 * <link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800;900&family=Barlow:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap" rel="stylesheet">
 *
 * TABLE OF CONTENTS
 * 1.  Tokens (CSS Variables)
 * 2.  Reset & Base
 * 3.  Typography
 * 4.  Layout & Grid
 * 5.  Logo
 * 6.  Navigation
 * 7.  Buttons
 * 8.  Badges & Tags
 * 9.  Cards
 * 10. Forms & Inputs
 * 11. Sport Colors
 * 12. Stats & Metrics
 * 13. Avatars
 * 14. Progress Bars
 * 15. Dividers & Separators
 * 16. Alerts & Toasts
 * 17. Footer
 * 18. Animations & Motion
 * 19. Utilities
 * 20. Responsive Breakpoints
 */


/* ════════════════════════════════════════════════════════
   1. TOKENS — CSS Variables
   ════════════════════════════════════════════════════════ */
:root {
  /* — Brand Colors — */
  --rt-green:        #16a34a;
  --rt-green-light:  #22c55e;
  --rt-green-dark:   #15803d;
  --rt-green-muted:  rgba(22, 163, 74, 0.12);
  --rt-green-glow:   rgba(22, 163, 74, 0.25);

  /* — Neutrals — */
  --rt-black:    #0d0d0d;
  --rt-gray-900: #111111;
  --rt-gray-800: #1c1c1c;
  --rt-gray-700: #2e2e2e;
  --rt-gray-600: #444444;
  --rt-gray-500: #6b6b6b;
  --rt-gray-400: #909090;
  --rt-gray-300: #c4c4c4;
  --rt-gray-200: #e5e5e5;
  --rt-gray-100: #f4f4f2;
  --rt-white:    #ffffff;

  /* — Sport Accent Colors — */
  --rt-trail:      #16a34a;
  --rt-course:     #f97316;
  --rt-triathlon:  #2563eb;
  --rt-natation:   #0891b2;
  --rt-velo:       #9333ea;

  --rt-trail-muted:     rgba(22,163,74,0.10);
  --rt-course-muted:    rgba(249,115,22,0.10);
  --rt-triathlon-muted: rgba(37,99,235,0.10);
  --rt-natation-muted:  rgba(8,145,178,0.10);
  --rt-velo-muted:      rgba(147,51,234,0.10);

  /* — Social — */
  --rt-instagram: #e1306c;
  --rt-strava:    #fc4c02;
  --rt-youtube:   #ff0000;
  --rt-garmin:    #007cc3;

  /* — Semantic — */
  --rt-success: #16a34a;
  --rt-warning: #f59e0b;
  --rt-error:   #ef4444;
  --rt-info:    #3b82f6;

  /* — Typography — */
  --rt-font-display: 'Barlow Condensed', sans-serif;
  --rt-font-body:    'Barlow', sans-serif;

  --rt-text-xs:   11px;
  --rt-text-sm:   13px;
  --rt-text-base: 15px;
  --rt-text-md:   17px;
  --rt-text-lg:   20px;
  --rt-text-xl:   24px;
  --rt-text-2xl:  32px;
  --rt-text-3xl:  48px;
  --rt-text-4xl:  64px;
  --rt-text-hero: clamp(56px, 10vw, 112px);

  /* — Spacing (4pt grid) — */
  --rt-space-1:  4px;
  --rt-space-2:  8px;
  --rt-space-3:  12px;
  --rt-space-4:  16px;
  --rt-space-5:  20px;
  --rt-space-6:  24px;
  --rt-space-8:  32px;
  --rt-space-10: 40px;
  --rt-space-12: 48px;
  --rt-space-16: 64px;
  --rt-space-20: 80px;
  --rt-space-24: 96px;

  /* — Radius — */
  --rt-radius-sm:   6px;
  --rt-radius-md:   12px;
  --rt-radius-lg:   18px;
  --rt-radius-xl:   24px;
  --rt-radius-full: 9999px;

  /* — Shadows — */
  --rt-shadow-sm:  0 1px 4px rgba(0,0,0,0.06);
  --rt-shadow-md:  0 4px 16px rgba(0,0,0,0.08);
  --rt-shadow-lg:  0 8px 32px rgba(0,0,0,0.12);
  --rt-shadow-xl:  0 16px 48px rgba(0,0,0,0.16);
  --rt-shadow-green: 0 8px 32px rgba(22,163,74,0.28);

  /* — Transitions — */
  --rt-ease:      cubic-bezier(0.16, 1, 0.3, 1);
  --rt-ease-out:  cubic-bezier(0.0, 0.0, 0.2, 1);
  --rt-duration:  200ms;

  /* — Layout — */
  --rt-max-width:       1200px;
  --rt-max-width-tight: 780px;
  --rt-nav-height:      64px;
  --rt-page-px:         clamp(20px, 5vw, 80px);
}

/* Dark theme overrides */
[data-theme="dark"] {
  --rt-bg:       var(--rt-gray-900);
  --rt-surface:  var(--rt-gray-800);
  --rt-surface2: var(--rt-gray-700);
  --rt-border:   var(--rt-gray-700);
  --rt-text:     #e8e8f0;
  --rt-muted:    var(--rt-gray-400);
}

/* Light theme (default) */
:root,
[data-theme="light"] {
  --rt-bg:       var(--rt-gray-100);
  --rt-surface:  var(--rt-white);
  --rt-surface2: #f8f8f6;
  --rt-border:   var(--rt-gray-200);
  --rt-text:     var(--rt-black);
  --rt-muted:    var(--rt-gray-500);
}


/* ════════════════════════════════════════════════════════
   2. RESET & BASE
   ════════════════════════════════════════════════════════ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--rt-font-body);
  font-size: var(--rt-text-base);
  background: var(--rt-bg);
  color: var(--rt-text);
  line-height: 1.6;
  min-height: 100vh;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }


/* ════════════════════════════════════════════════════════
   3. TYPOGRAPHY
   ════════════════════════════════════════════════════════ */

/* Display headings — Barlow Condensed */
.rt-display {
  font-family: var(--rt-font-display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: 0.5px;
}

.rt-h1 { font-size: var(--rt-text-hero);  font-family: var(--rt-font-display); font-weight: 900; text-transform: uppercase; line-height: 0.92; }
.rt-h2 { font-size: var(--rt-text-4xl);   font-family: var(--rt-font-display); font-weight: 800; text-transform: uppercase; line-height: 1.0; }
.rt-h3 { font-size: var(--rt-text-3xl);   font-family: var(--rt-font-display); font-weight: 700; text-transform: uppercase; line-height: 1.05; }
.rt-h4 { font-size: var(--rt-text-2xl);   font-family: var(--rt-font-display); font-weight: 700; line-height: 1.1; }
.rt-h5 { font-size: var(--rt-text-xl);    font-family: var(--rt-font-display); font-weight: 700; line-height: 1.2; }

/* Body text */
.rt-body-lg  { font-size: var(--rt-text-md);   font-weight: 300; line-height: 1.7; }
.rt-body     { font-size: var(--rt-text-base);  font-weight: 400; line-height: 1.6; }
.rt-body-sm  { font-size: var(--rt-text-sm);    font-weight: 400; line-height: 1.5; }

/* Labels & caps */
.rt-label {
  font-family: var(--rt-font-display);
  font-size: var(--rt-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--rt-muted);
}

.rt-mono {
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: var(--rt-text-sm);
}

/* Gradient text */
.rt-text-gradient {
  background: linear-gradient(90deg, var(--rt-green), var(--rt-green-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rt-text-sport-gradient {
  background: linear-gradient(90deg, var(--rt-course), var(--rt-trail), var(--rt-triathlon), var(--rt-natation));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rt-muted { color: var(--rt-muted); }
.rt-green { color: var(--rt-green); }


/* ════════════════════════════════════════════════════════
   4. LAYOUT & GRID
   ════════════════════════════════════════════════════════ */
.rt-container {
  max-width: var(--rt-max-width);
  margin: 0 auto;
  padding: 0 var(--rt-page-px);
}

.rt-container--tight {
  max-width: var(--rt-max-width-tight);
  margin: 0 auto;
  padding: 0 var(--rt-page-px);
}

.rt-section {
  padding: var(--rt-space-20) 0;
}

.rt-section--lg {
  padding: var(--rt-space-24) 0;
}

.rt-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--rt-space-6); }
.rt-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--rt-space-6); }
.rt-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--rt-space-5); }

.rt-flex        { display: flex; }
.rt-flex-center { display: flex; align-items: center; justify-content: center; }
.rt-flex-between{ display: flex; align-items: center; justify-content: space-between; }
.rt-flex-col    { display: flex; flex-direction: column; }
.rt-gap-2 { gap: var(--rt-space-2); }
.rt-gap-3 { gap: var(--rt-space-3); }
.rt-gap-4 { gap: var(--rt-space-4); }
.rt-gap-6 { gap: var(--rt-space-6); }
.rt-gap-8 { gap: var(--rt-space-8); }


/* ════════════════════════════════════════════════════════
   5. LOGO
   ════════════════════════════════════════════════════════ */
.rt-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  user-select: none;
}

.rt-logo__icon {
  width: 32px;
  height: 32px;
  background: var(--rt-green);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--rt-shadow-green);
  flex-shrink: 0;
  transition: transform var(--rt-duration) var(--rt-ease);
}

.rt-logo:hover .rt-logo__icon {
  transform: rotate(-8deg) scale(1.05);
}

.rt-logo__wordmark {
  font-family: var(--rt-font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--rt-text);
  line-height: 1;
}

.rt-logo__wordmark em {
  font-style: normal;
  color: var(--rt-green);
}

.rt-logo__tld {
  font-size: 11px;
  color: var(--rt-muted);
  font-family: var(--rt-font-body);
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 1px;
}

/* Size variants */
.rt-logo--sm .rt-logo__icon    { width: 24px; height: 24px; font-size: 14px; border-radius: 7px; }
.rt-logo--sm .rt-logo__wordmark { font-size: 17px; }
.rt-logo--lg .rt-logo__icon    { width: 44px; height: 44px; font-size: 24px; border-radius: 12px; }
.rt-logo--lg .rt-logo__wordmark { font-size: 30px; }


/* ════════════════════════════════════════════════════════
   6. NAVIGATION
   ════════════════════════════════════════════════════════ */
.rt-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--rt-nav-height);
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--rt-border);
  display: flex;
  align-items: center;
}

.rt-nav[data-theme="dark"] {
  background: rgba(17,17,17,0.88);
}

.rt-nav__inner {
  max-width: var(--rt-max-width);
  margin: 0 auto;
  padding: 0 var(--rt-page-px);
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--rt-space-8);
}

.rt-nav__links {
  display: flex;
  align-items: center;
  gap: var(--rt-space-1);
  margin-left: auto;
}

.rt-nav__link {
  font-size: var(--rt-text-sm);
  font-weight: 500;
  color: var(--rt-muted);
  padding: 6px 12px;
  border-radius: var(--rt-radius-full);
  transition: all var(--rt-duration) var(--rt-ease);
  white-space: nowrap;
}

.rt-nav__link:hover  { color: var(--rt-text); background: var(--rt-gray-100); }
.rt-nav__link.active { color: var(--rt-text); font-weight: 600; }

.rt-nav__actions {
  display: flex;
  align-items: center;
  gap: var(--rt-space-2);
  margin-left: var(--rt-space-4);
}


/* ════════════════════════════════════════════════════════
   7. BUTTONS
   ════════════════════════════════════════════════════════ */
.rt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--rt-font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  border-radius: var(--rt-radius-md);
  transition: all var(--rt-duration) var(--rt-ease);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;

  /* default: md */
  font-size: 14px;
  padding: 12px 22px;
  height: 44px;
}

.rt-btn:active { transform: scale(0.97); }

/* — Primary — */
.rt-btn--primary {
  background: var(--rt-green);
  color: white;
  box-shadow: 0 4px 16px var(--rt-green-glow);
}
.rt-btn--primary:hover {
  background: var(--rt-green-dark);
  box-shadow: 0 6px 24px var(--rt-green-glow);
  transform: translateY(-1px);
}

/* — Secondary — */
.rt-btn--secondary {
  background: var(--rt-surface);
  color: var(--rt-text);
  border: 1.5px solid var(--rt-border);
}
.rt-btn--secondary:hover {
  border-color: var(--rt-green);
  color: var(--rt-green);
  transform: translateY(-1px);
}

/* — Ghost — */
.rt-btn--ghost {
  background: transparent;
  color: var(--rt-muted);
  border: 1.5px solid transparent;
}
.rt-btn--ghost:hover {
  color: var(--rt-text);
  background: var(--rt-gray-100);
}

/* — Danger — */
.rt-btn--danger {
  background: var(--rt-error);
  color: white;
}
.rt-btn--danger:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* — Social OAuth — */
.rt-btn--strava  { background: var(--rt-strava); color: white; }
.rt-btn--google  { background: white; color: #444; border: 1.5px solid var(--rt-border); }
.rt-btn--garmin  { background: var(--rt-garmin); color: white; }

/* — Sizes — */
.rt-btn--sm { font-size: 12px; padding: 8px 16px; height: 34px; border-radius: var(--rt-radius-sm); }
.rt-btn--lg { font-size: 16px; padding: 16px 32px; height: 54px; border-radius: var(--rt-radius-lg); }
.rt-btn--xl { font-size: 18px; padding: 18px 40px; height: 62px; border-radius: var(--rt-radius-lg); }

/* — Full width — */
.rt-btn--block { width: 100%; }

/* — Icon only — */
.rt-btn--icon { width: 44px; padding: 0; }
.rt-btn--icon.rt-btn--sm { width: 34px; }
.rt-btn--icon.rt-btn--lg { width: 54px; }

/* — Pill shape — */
.rt-btn--pill { border-radius: var(--rt-radius-full); }

/* — Loading state — */
.rt-btn[disabled], .rt-btn--loading {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}


/* ════════════════════════════════════════════════════════
   8. BADGES & TAGS
   ════════════════════════════════════════════════════════ */
.rt-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--rt-radius-full);
  font-family: var(--rt-font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.rt-badge--green     { background: var(--rt-green-muted);       color: var(--rt-green); }
.rt-badge--orange    { background: var(--rt-course-muted);       color: var(--rt-course); }
.rt-badge--blue      { background: var(--rt-triathlon-muted);    color: var(--rt-triathlon); }
.rt-badge--cyan      { background: var(--rt-natation-muted);     color: var(--rt-natation); }
.rt-badge--purple    { background: var(--rt-velo-muted);         color: var(--rt-velo); }
.rt-badge--gray      { background: var(--rt-gray-100);           color: var(--rt-muted); }
.rt-badge--dark      { background: var(--rt-black);              color: var(--rt-white); }

/* Sport-specific */
.rt-badge--trail     { background: var(--rt-trail-muted);        color: var(--rt-trail); }
.rt-badge--course    { background: var(--rt-course-muted);       color: var(--rt-course); }
.rt-badge--triathlon { background: var(--rt-triathlon-muted);    color: var(--rt-triathlon); }
.rt-badge--natation  { background: var(--rt-natation-muted);     color: var(--rt-natation); }

/* Pro badge */
.rt-badge--pro {
  background: linear-gradient(135deg, var(--rt-green), var(--rt-green-light));
  color: white;
  box-shadow: 0 2px 8px var(--rt-green-glow);
}

/* NEW badge */
.rt-badge--new {
  background: var(--rt-course);
  color: white;
  animation: rt-pulse 2s ease infinite;
}

@keyframes rt-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(249,115,22,0); }
}


/* ════════════════════════════════════════════════════════
   9. CARDS
   ════════════════════════════════════════════════════════ */
.rt-card {
  background: var(--rt-surface);
  border-radius: var(--rt-radius-lg);
  border: 1px solid var(--rt-border);
  padding: var(--rt-space-6);
  transition: all var(--rt-duration) var(--rt-ease);
}

.rt-card--hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--rt-shadow-lg);
  border-color: var(--rt-green);
}

.rt-card--flat {
  box-shadow: none;
  border: 1px solid var(--rt-border);
}

.rt-card--raised {
  box-shadow: var(--rt-shadow-md);
  border: none;
}

.rt-card--sport {
  border-left: 4px solid var(--sport-color, var(--rt-green));
  padding-left: calc(var(--rt-space-6) - 4px);
}

/* Pricing card */
.rt-card--pricing {
  position: relative;
  padding: var(--rt-space-8);
}

.rt-card--pricing.featured {
  border-color: var(--rt-green);
  box-shadow: 0 0 0 1px var(--rt-green), var(--rt-shadow-lg);
}

.rt-card--pricing.featured::before {
  content: '⭐ POPULAIRE';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--rt-green);
  color: white;
  font-family: var(--rt-font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 4px 16px;
  border-radius: var(--rt-radius-full);
}


/* ════════════════════════════════════════════════════════
   10. FORMS & INPUTS
   ════════════════════════════════════════════════════════ */
.rt-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--rt-space-2);
}

.rt-label-text {
  font-size: var(--rt-text-sm);
  font-weight: 600;
  color: var(--rt-text);
  letter-spacing: 0.2px;
}

.rt-input {
  width: 100%;
  height: 48px;
  padding: 0 var(--rt-space-4);
  background: var(--rt-surface);
  border: 1.5px solid var(--rt-border);
  border-radius: var(--rt-radius-md);
  font-family: var(--rt-font-body);
  font-size: var(--rt-text-base);
  color: var(--rt-text);
  transition: all var(--rt-duration) var(--rt-ease);
  outline: none;
}

.rt-input::placeholder { color: var(--rt-gray-400); }

.rt-input:focus {
  border-color: var(--rt-green);
  box-shadow: 0 0 0 3px var(--rt-green-muted);
}

.rt-input:invalid:not(:placeholder-shown) {
  border-color: var(--rt-error);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.rt-input--sm { height: 38px; font-size: var(--rt-text-sm); padding: 0 12px; }
.rt-input--lg { height: 56px; font-size: var(--rt-text-md); padding: 0 20px; }

/* Handle input (runtree.co/...) */
.rt-input--handle {
  padding-left: 110px;
}

.rt-input-handle-wrap {
  position: relative;
}

.rt-input-handle-prefix {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 var(--rt-space-4);
  font-size: var(--rt-text-sm);
  color: var(--rt-muted);
  font-weight: 500;
  pointer-events: none;
  border-right: 1.5px solid var(--rt-border);
  white-space: nowrap;
}

/* Textarea */
.rt-textarea {
  width: 100%;
  padding: var(--rt-space-3) var(--rt-space-4);
  background: var(--rt-surface);
  border: 1.5px solid var(--rt-border);
  border-radius: var(--rt-radius-md);
  font-family: var(--rt-font-body);
  font-size: var(--rt-text-base);
  color: var(--rt-text);
  resize: vertical;
  min-height: 100px;
  outline: none;
  transition: all var(--rt-duration) var(--rt-ease);
}

.rt-textarea:focus {
  border-color: var(--rt-green);
  box-shadow: 0 0 0 3px var(--rt-green-muted);
}

/* Checkbox & Radio */
.rt-checkbox, .rt-radio {
  display: flex;
  align-items: center;
  gap: var(--rt-space-3);
  cursor: pointer;
  font-size: var(--rt-text-sm);
}

.rt-checkbox input[type="checkbox"],
.rt-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--rt-green);
  cursor: pointer;
}

/* Divider with text */
.rt-form-divider {
  display: flex;
  align-items: center;
  gap: var(--rt-space-4);
  color: var(--rt-muted);
  font-size: var(--rt-text-sm);
}

.rt-form-divider::before,
.rt-form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rt-border);
}

/* Form hint / error */
.rt-hint {
  font-size: var(--rt-text-xs);
  color: var(--rt-muted);
  margin-top: 4px;
}

.rt-error-msg {
  font-size: var(--rt-text-xs);
  color: var(--rt-error);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}


/* ════════════════════════════════════════════════════════
   11. SPORT COLORS — utility classes
   ════════════════════════════════════════════════════════ */
.rt-sport-trail     { --sport-color: var(--rt-trail);     --sport-bg: var(--rt-trail-muted); }
.rt-sport-course    { --sport-color: var(--rt-course);    --sport-bg: var(--rt-course-muted); }
.rt-sport-triathlon { --sport-color: var(--rt-triathlon); --sport-bg: var(--rt-triathlon-muted); }
.rt-sport-natation  { --sport-color: var(--rt-natation);  --sport-bg: var(--rt-natation-muted); }
.rt-sport-velo      { --sport-color: var(--rt-velo);      --sport-bg: var(--rt-velo-muted); }

.rt-sport-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--rt-radius-md);
  background: var(--sport-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}


/* ════════════════════════════════════════════════════════
   12. STATS & METRICS
   ════════════════════════════════════════════════════════ */
.rt-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rt-stat__value {
  font-family: var(--rt-font-display);
  font-size: var(--rt-text-3xl);
  font-weight: 900;
  line-height: 1;
  color: var(--rt-text);
}

.rt-stat__value--green { color: var(--rt-green); }
.rt-stat__value--sport { color: var(--sport-color); }

.rt-stat__unit {
  font-family: var(--rt-font-display);
  font-size: var(--rt-text-lg);
  font-weight: 600;
  color: var(--rt-muted);
}

.rt-stat__label {
  font-size: var(--rt-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--rt-muted);
  font-family: var(--rt-font-display);
  margin-top: var(--rt-space-1);
}

/* Stat grid */
.rt-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--rt-border);
  border: 1px solid var(--rt-border);
  border-radius: var(--rt-radius-lg);
  overflow: hidden;
}

.rt-stat-grid__item {
  background: var(--rt-surface);
  padding: var(--rt-space-6) var(--rt-space-6);
  transition: background var(--rt-duration);
}

.rt-stat-grid__item:hover { background: var(--rt-surface2); }


/* ════════════════════════════════════════════════════════
   13. AVATARS
   ════════════════════════════════════════════════════════ */
.rt-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--rt-radius-full);
  background: linear-gradient(135deg, var(--rt-course), var(--rt-trail), var(--rt-triathlon));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--rt-font-display);
  font-weight: 900;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
  user-select: none;
}

.rt-avatar--sm  { width: 28px; height: 28px; font-size: 12px; }
.rt-avatar--md  { width: 40px; height: 40px; font-size: 16px; }
.rt-avatar--lg  { width: 64px; height: 64px; font-size: 24px; }
.rt-avatar--xl  { width: 88px; height: 88px; font-size: 32px; }
.rt-avatar--2xl { width: 120px; height: 120px; font-size: 44px; }

/* Spinning ring */
.rt-avatar-wrap { position: relative; display: inline-block; }

.rt-avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(var(--rt-course) 0%, var(--rt-trail) 33%, var(--rt-triathlon) 66%, var(--rt-natation) 100%);
  z-index: -1;
  animation: rt-spin 8s linear infinite;
}

@keyframes rt-spin { to { transform: rotate(360deg); } }


/* ════════════════════════════════════════════════════════
   14. PROGRESS BARS
   ════════════════════════════════════════════════════════ */
.rt-progress {
  height: 6px;
  background: var(--rt-gray-200);
  border-radius: var(--rt-radius-full);
  overflow: hidden;
}

.rt-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rt-green), var(--rt-green-light));
  border-radius: var(--rt-radius-full);
  transition: width 1s var(--rt-ease-out);
}

.rt-progress--sport .rt-progress__fill {
  background: linear-gradient(90deg, var(--sport-color), color-mix(in srgb, var(--sport-color) 60%, white));
}

.rt-progress--thin { height: 3px; }
.rt-progress--thick { height: 10px; }


/* ════════════════════════════════════════════════════════
   15. DIVIDERS
   ════════════════════════════════════════════════════════ */
.rt-divider {
  height: 1px;
  background: var(--rt-border);
  margin: var(--rt-space-6) 0;
}

.rt-divider--dashed {
  background: none;
  border-top: 1px dashed var(--rt-border);
}


/* ════════════════════════════════════════════════════════
   16. ALERTS & TOASTS
   ════════════════════════════════════════════════════════ */
.rt-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--rt-space-3);
  padding: var(--rt-space-4);
  border-radius: var(--rt-radius-md);
  font-size: var(--rt-text-sm);
  border: 1px solid transparent;
}

.rt-alert--success { background: var(--rt-green-muted); color: var(--rt-green-dark); border-color: rgba(22,163,74,0.2); }
.rt-alert--error   { background: rgba(239,68,68,0.08);  color: #b91c1c; border-color: rgba(239,68,68,0.2); }
.rt-alert--warning { background: rgba(245,158,11,0.08); color: #92400e; border-color: rgba(245,158,11,0.2); }
.rt-alert--info    { background: rgba(59,130,246,0.08); color: #1d4ed8; border-color: rgba(59,130,246,0.2); }


/* ════════════════════════════════════════════════════════
   17. FOOTER
   ════════════════════════════════════════════════════════ */
.rt-footer {
  border-top: 1px solid var(--rt-border);
  padding: var(--rt-space-10) 0 var(--rt-space-8);
  background: var(--rt-surface);
}

.rt-footer__inner {
  max-width: var(--rt-max-width);
  margin: 0 auto;
  padding: 0 var(--rt-page-px);
}

.rt-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--rt-space-10);
  margin-bottom: var(--rt-space-10);
}

.rt-footer__tagline {
  font-size: var(--rt-text-sm);
  color: var(--rt-muted);
  font-weight: 300;
  line-height: 1.6;
  margin-top: var(--rt-space-3);
  max-width: 260px;
}

.rt-footer__col-title {
  font-family: var(--rt-font-display);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--rt-text);
  margin-bottom: var(--rt-space-4);
}

.rt-footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--rt-space-2);
}

.rt-footer__link {
  font-size: var(--rt-text-sm);
  color: var(--rt-muted);
  transition: color var(--rt-duration);
}

.rt-footer__link:hover { color: var(--rt-green); }

.rt-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--rt-space-6);
  border-top: 1px solid var(--rt-border);
  font-size: var(--rt-text-xs);
  color: var(--rt-muted);
  flex-wrap: wrap;
  gap: var(--rt-space-4);
}


/* ════════════════════════════════════════════════════════
   18. ANIMATIONS & MOTION
   ════════════════════════════════════════════════════════ */

/* Entrance animations */
@keyframes rt-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes rt-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes rt-slide-down {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes rt-pop-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes rt-zoom-in {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

/* Apply classes */
.rt-animate-fade    { animation: rt-fade-in   0.4s var(--rt-ease) forwards; }
.rt-animate-up      { animation: rt-slide-up  0.5s var(--rt-ease) forwards; }
.rt-animate-down    { animation: rt-slide-down 0.5s var(--rt-ease) forwards; }
.rt-animate-pop     { animation: rt-pop-in    0.4s var(--rt-ease) forwards; }
.rt-animate-zoom    { animation: rt-zoom-in   0.6s var(--rt-ease) forwards; }

/* Stagger delays */
.rt-delay-1 { animation-delay: 0.05s; }
.rt-delay-2 { animation-delay: 0.10s; }
.rt-delay-3 { animation-delay: 0.15s; }
.rt-delay-4 { animation-delay: 0.20s; }
.rt-delay-5 { animation-delay: 0.25s; }
.rt-delay-6 { animation-delay: 0.30s; }

/* Hover lift */
.rt-lift {
  transition: transform var(--rt-duration) var(--rt-ease), box-shadow var(--rt-duration) var(--rt-ease);
}
.rt-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--rt-shadow-lg);
}

/* Glow effect */
.rt-glow:hover {
  box-shadow: 0 0 20px var(--rt-green-glow);
}


/* ════════════════════════════════════════════════════════
   19. UTILITIES
   ════════════════════════════════════════════════════════ */
.rt-text-center { text-align: center; }
.rt-text-left   { text-align: left; }
.rt-text-right  { text-align: right; }

.rt-mt-2 { margin-top: var(--rt-space-2); }
.rt-mt-4 { margin-top: var(--rt-space-4); }
.rt-mt-6 { margin-top: var(--rt-space-6); }
.rt-mt-8 { margin-top: var(--rt-space-8); }
.rt-mt-12 { margin-top: var(--rt-space-12); }

.rt-mb-2 { margin-bottom: var(--rt-space-2); }
.rt-mb-4 { margin-bottom: var(--rt-space-4); }
.rt-mb-6 { margin-bottom: var(--rt-space-6); }
.rt-mb-8 { margin-bottom: var(--rt-space-8); }
.rt-mb-12 { margin-bottom: var(--rt-space-12); }

.rt-p-4 { padding: var(--rt-space-4); }
.rt-p-6 { padding: var(--rt-space-6); }
.rt-p-8 { padding: var(--rt-space-8); }

.rt-w-full  { width: 100%; }
.rt-h-full  { height: 100%; }

.rt-hidden  { display: none; }
.rt-sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

/* Noise texture overlay */
.rt-noise::after {
  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)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.4;
}

/* Background meshes */
.rt-mesh-green {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(22,163,74,0.15) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(22,163,74,0.08) 0%, transparent 50%);
}

.rt-mesh-sport {
  background:
    radial-gradient(ellipse at 15% 15%, rgba(249,115,22,0.10) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 85%, rgba(37,99,235,0.08) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(22,163,74,0.06) 0%, transparent 50%);
}


/* ════════════════════════════════════════════════════════
   20. RESPONSIVE BREAKPOINTS
   ════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .rt-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .rt-footer__grid { grid-template-columns: 1fr 1fr; gap: var(--rt-space-8); }
}

@media (max-width: 768px) {
  :root {
    --rt-nav-height: 56px;
  }

  .rt-grid-2,
  .rt-grid-3,
  .rt-grid-4 { grid-template-columns: 1fr; }

  .rt-footer__grid { grid-template-columns: 1fr; gap: var(--rt-space-6); }

  .rt-nav__links { display: none; }

  .rt-h1 { font-size: clamp(48px, 14vw, 72px); }
  .rt-h2 { font-size: clamp(36px, 10vw, 52px); }
  .rt-h3 { font-size: clamp(28px, 8vw, 40px); }

  .rt-hide-mobile { display: none !important; }
  .rt-show-mobile { display: block !important; }
}

@media (min-width: 769px) {
  .rt-show-mobile { display: none !important; }
}
