/* Tricktionary Riders — Design System
   Aligned with events-site / coaching-hub palette */

:root {
  --base: #0d1b2e;
  --base-deep: #091422;
  --base-light: #132640;
  --base-lighter: #1a3050;
  --teal: #0ea5e9;
  --teal-glow: #38bdf8;
  --teal-dim: rgba(14, 165, 233, 0.15);
  --gold: #d4a843;
  --gold-light: #f0d078;
  --white: #f1f5f9;
  --white-dim: #cbd5e1;
  --gray: #64748b;
  --gray-dark: #475569;
  --glass: rgba(13, 27, 46, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --card-bg: #132640;
  --card-border: rgba(56, 189, 248, 0.12);
  --card-border-hover: rgba(56, 189, 248, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--base);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--base);
  color: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ─── TYPOGRAPHY ─── */
h1, h2, h3, h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  line-height: 1.15;
  color: var(--white);
}

h1 {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 700; }

p {
  color: var(--white-dim);
  line-height: 1.7;
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { color: var(--teal-glow); }

/* ─── LAYOUT ─── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1rem;
  display: block;
}

/* ─── NAV ─── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}

.site-logo {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--white);
}

.site-logo span {
  color: var(--teal);
  font-weight: 500;
}

.site-nav-links {
  display: flex;
  gap: 28px;
}

.site-nav-links a {
  color: var(--white-dim);
  font-size: 0.9rem;
  font-weight: 500;
}

.site-nav-links a:hover { color: var(--white); }

@media (max-width: 720px) {
  .site-nav-links { display: none; }
}

/* ─── HERO ─── */
.hero {
  padding: 80px 0 60px;
  background: radial-gradient(ellipse at top left, var(--base-light), var(--base) 60%);
}

.hero-sub {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  max-width: 640px;
  margin-top: 1.2rem;
  color: var(--white-dim);
  font-weight: 300;
}

/* ─── FILTER BAR ─── */
.filter-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--glass-border);
  background: var(--base-deep);
}

.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-chips-wrap {
  display: flex;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  /* Edge fades hint at horizontal scroll */
  mask-image: linear-gradient(to right, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
}

.filter-chips-wrap::-webkit-scrollbar { height: 6px; }
.filter-chips-wrap::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 3px;
}
.filter-chips-wrap::-webkit-scrollbar-track { background: transparent; }

.filter-chips-wrap .chip { flex: 0 0 auto; }

.search-toggle {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--white-dim);
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-toggle:hover {
  background: var(--base-light);
  color: var(--white);
  border-color: var(--card-border-hover);
}

.search-toggle svg { width: 18px; height: 18px; }

.search-wrap {
  position: relative;
  flex: 1 1 100%;
  display: none;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--gray);
  pointer-events: none;
}

#search {
  width: 100%;
  padding: 12px 48px 12px 44px;
  background: var(--base-light);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--white);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#search:focus {
  border-color: var(--teal);
  background: var(--base-lighter);
}

#search::placeholder { color: var(--gray); }

.search-close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--gray);
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.search-close:hover { color: var(--white); background: var(--base-lighter); }
.search-close svg { width: 16px; height: 16px; }

.filter-bar.search-open .filter-chips-wrap,
.filter-bar.search-open .search-toggle { display: none; }

.filter-bar.search-open .search-wrap { display: flex; }

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 9px 16px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--white-dim);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  background: var(--base-light);
  color: var(--white);
}

.chip.active {
  background: var(--teal);
  color: var(--base-deep);
  border-color: var(--teal);
  font-weight: 600;
}

.result-count {
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--gray);
  letter-spacing: 0.5px;
}

/* ─── GRID ─── */
.riders-section { padding: 40px 0 80px; }

.riders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--gray);
  font-style: italic;
}

/* ─── CARD ─── */
.rider-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.rider-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-border-hover);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.6),
              0 0 0 1px var(--card-border-hover);
}

.card-photo-wrap {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--base-deep);
  position: relative;
}

.card-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.rider-card:hover .card-photo-wrap img { transform: scale(1.04); }

.card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--gold);
  color: var(--base-deep);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.card-body {
  padding: 18px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.card-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.card-flag { font-size: 1.3rem; }

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.card-tag {
  background: var(--teal-dim);
  color: var(--teal-glow);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.3px;
}

.card-bio {
  font-size: 0.82rem;
  color: var(--gray);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Silhouette avatar for photo-pending or placeholder cards */
.card-photo-silhouette {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 50% 30%, var(--base-lighter) 0%, var(--base-deep) 70%);
  color: var(--gray);
}

.card-photo-silhouette svg {
  width: 48%;
  height: 48%;
  opacity: 0.55;
}

/* Placeholder "Coming Soon" cards — grayed out, non-clickable */
.rider-card.is-placeholder {
  cursor: default;
  opacity: 0.55;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(19, 38, 64, 0.4);
  filter: saturate(0.4);
}

.rider-card.is-placeholder:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.08);
  opacity: 0.7;
}

.rider-card.is-placeholder .card-photo-wrap img { transform: none !important; }

.rider-card.is-placeholder .card-name {
  color: var(--gray);
  font-weight: 600;
  font-style: italic;
}

.rider-card.is-placeholder .card-tags .card-tag {
  background: rgba(100, 116, 139, 0.15);
  color: var(--gray);
}

.rider-card.is-placeholder .card-badge {
  background: var(--gray-dark);
  color: var(--white-dim);
}

/* ─── PROFILE PAGE ─── */
.profile-body { background: var(--base-deep); }

.profile-main { padding: 0 0 80px; }

.profile-hero {
  position: relative;
  padding: 80px 0 60px;
  background:
    radial-gradient(ellipse at 20% 20%, var(--base-light) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 40%, rgba(14, 165, 233, 0.1) 0%, transparent 55%),
    var(--base-deep);
  overflow: hidden;
}

.profile-hero-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: center;
}

.profile-photo-wrap {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--teal);
  box-shadow: 0 12px 40px -8px rgba(14, 165, 233, 0.4);
  flex-shrink: 0;
}

.profile-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo-silhouette {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 30%, var(--base-lighter) 0%, var(--base-deep) 70%);
  color: var(--gray);
}

.profile-photo-silhouette svg {
  width: 55%;
  height: 55%;
  opacity: 0.55;
}

.profile-header-content { display: flex; flex-direction: column; gap: 14px; }

.profile-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--teal);
}

.profile-name-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.profile-name {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.profile-flag { font-size: 2rem; }

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-tag {
  background: var(--teal-dim);
  color: var(--teal-glow);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: capitalize;
}

.profile-tag--gold {
  background: rgba(212, 168, 67, 0.15);
  color: var(--gold-light);
}

.profile-tag--sponsor {
  background: var(--base-lighter);
  color: var(--white-dim);
}

.profile-socials {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.profile-social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--base-light);
  border: 1px solid var(--glass-border);
  color: var(--white-dim);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.profile-social-link:hover {
  background: var(--teal);
  color: var(--base-deep);
  border-color: var(--teal);
  transform: translateY(-2px);
}

.profile-social-link svg { width: 18px; height: 18px; flex-shrink: 0; }

@media (max-width: 720px) {
  .profile-socials {
    flex-direction: column;
    gap: 8px;
  }
  .profile-social-link {
    justify-content: center;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 0.95rem;
  }
}

/* Profile body */
.profile-content {
  padding: 60px 0 0;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 60px;
}

.profile-bio {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--white-dim);
  font-weight: 300;
  margin-bottom: 40px;
}

.profile-section + .profile-section { margin-top: 48px; }

.profile-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
}

.moves-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.move-pill {
  background: var(--base-light);
  border: 1px solid var(--glass-border);
  color: var(--white);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.move-pill:hover {
  border-color: var(--teal);
  background: var(--base-lighter);
  transform: translateY(-1px);
}

.profile-aside {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.info-card {
  background: var(--base-light);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 20px 22px;
}

.info-card-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 10px;
}

.info-card-value {
  font-size: 1rem;
  color: var(--white);
  font-weight: 500;
  line-height: 1.5;
}

.video-embed {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 860px) {
  .profile-hero-grid { grid-template-columns: 1fr; text-align: center; }
  .profile-photo-wrap { margin: 0 auto; width: 140px; height: 140px; }
  .profile-name-row { justify-content: center; }
  .profile-tags { justify-content: center; }
  .profile-socials { align-items: stretch; }
  .profile-grid { grid-template-columns: 1fr; gap: 40px; }
}

.error-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--gray);
}

.error-state h2 { margin-bottom: 1rem; color: var(--white); }

/* ─── IG GALLERY ─── */
.ig-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ig-section-head .profile-section-title { margin: 0; }

.ig-section-link {
  font-size: 0.85rem;
  color: var(--teal);
  text-decoration: none;
}
.ig-section-link:hover { text-decoration: underline; }

.ig-mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
@media (max-width: 720px) {
  .ig-mosaic { grid-template-columns: repeat(2, 1fr); gap: 4px; }
}

.ig-tile {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  display: block;
  background: var(--base-light);
  text-decoration: none;
  color: inherit;
}

.ig-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.ig-tile:hover img,
.ig-tile:focus-visible img { transform: scale(1.06); }

.ig-tile-video {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  line-height: 1;
  padding-left: 2px;
}

.ig-tile-overlay {
  position: absolute;
  inset: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.45) 40%, rgba(0,0,0,0) 70%);
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.ig-tile:hover .ig-tile-overlay,
.ig-tile:focus-visible .ig-tile-overlay { opacity: 1; }

.ig-tile-caption {
  font-size: 0.78rem;
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ig-tile-hashtags {
  font-size: 0.72rem;
  color: var(--teal);
  font-weight: 500;
  word-break: break-word;
}

.ig-meta {
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--gray);
  letter-spacing: 0.4px;
}

/* Touch devices: no hover — always show a faint bottom gradient to hint at overlay */
@media (hover: none) {
  .ig-tile-overlay { opacity: 1; background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 35%); }
  .ig-tile-caption, .ig-tile-hashtags { display: none; }
}

/* ─── FOOTER ─── */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--glass-border);
  background: var(--base-deep);
  text-align: center;
  font-size: 0.88rem;
}

.site-footer p { color: var(--gray); }
.site-footer .sep { color: var(--gray-dark); margin: 0 8px; }
