*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #080808;
  --white: #f4f2ef;
  --gray: #888;
  --accent: oklch(0.72 0.18 28);
}

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--white);
  font-family: "Barlow", sans-serif;
  font-weight: 400;
  overflow-x: hidden;
}

a {
  color: inherit;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.4s;
}

nav.scrolled {
  background: rgba(8, 8, 8, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-logo {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 242, 239, 0.65);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--white); }

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.language-option {
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  text-decoration: none;
  opacity: 0.58;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.language-option:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.language-option.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.language-flag {
  font-size: 1rem;
  line-height: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

main {
  min-height: 100dvh;
}

#hero {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 7vh;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #080808;
}

.hero-bg picture {
  display: contents;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  will-change: transform;
}

.hero-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(8, 8, 8) 0%, rgba(8, 8, 8, 0.55) 30%, rgba(8, 8, 8, 0.15) 60%, rgba(8, 8, 8, 0.4) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hero-eyebrow {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(244, 242, 239, 0.5);
  margin-bottom: 0.75rem;
}

.hero-name {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: clamp(5rem, 14vw, 13rem);
  line-height: 0.9;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--white);
}

.hero-sub {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 400;
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: rgba(244, 242, 239, 0.55);
  margin-top: 0.5rem;
}

.hero-sponsorship-link {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.75rem 1.15rem;
  border: 1px solid rgba(244, 242, 239, 0.32);
  color: var(--white);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  background: rgba(8, 8, 8, 0.38);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.hero-sponsorship-link:hover {
  border-color: rgba(244, 242, 239, 0.72);
  background: rgba(244, 242, 239, 0.08);
  transform: translateY(-1px);
}

.content-page {
  min-height: 100dvh;
  padding: 9rem 3rem 4rem;
}

.content-page-shell {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.content-page-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 780px;
}

.content-page-title {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.94;
  text-transform: uppercase;
}

.content-page-intro {
  font-size: 1.1rem;
  line-height: 1.8;
  color: rgba(244, 242, 239, 0.72);
  max-width: 60ch;
}

.seo-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.seo-link-row a {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 242, 239, 0.72);
  text-decoration: none;
  border-bottom: 1px solid rgba(244, 242, 239, 0.18);
  padding-bottom: 0.25rem;
  transition: color 0.2s, border-color 0.2s;
}

.seo-link-row a:hover {
  color: var(--white);
  border-color: rgba(244, 242, 239, 0.55);
}

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.blog-list-item {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
}

.blog-list-item a {
  display: grid;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}

.blog-list-item h2 {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2rem;
  text-transform: uppercase;
}

.blog-list-item time,
.blog-post-date {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 242, 239, 0.45);
}

.blog-list-item p {
  max-width: 62ch;
  color: rgba(244, 242, 239, 0.68);
  line-height: 1.75;
}

.blog-featured-image {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  display: block;
}

.content-page-body {
  max-width: 70ch;
  font-size: 1.05rem;
  line-height: 1.9;
  color: rgba(244, 242, 239, 0.75);
}

.content-page-body p + p,
.content-page-body ul + p,
.content-page-body ol + p,
.content-page-body p + ul,
.content-page-body p + ol {
  margin-top: 1.2rem;
}

.content-page-body ul,
.content-page-body ol {
  padding-left: 1.4rem;
}

.palmares-page-shell {
  gap: 0;
}

.race-calendar-section {
  background: #080808;
  color: #f4f2ef;
  padding: 80px 0;
}

.race-calendar-section .container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 3rem;
}

.race-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 40px;
  gap: 1.5rem;
}

.race-calendar-title {
  font-size: 32px;
  font-weight: 700;
}

.race-calendar-season {
  font-size: 14px;
  color: rgba(244, 242, 239, 0.6);
  white-space: nowrap;
}

.race-timeline {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.race-item {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.race-date {
  min-width: 60px;
  text-align: center;
}

.race-day,
.race-month {
  display: block;
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
}

.race-day {
  font-size: 20px;
  font-weight: 700;
}

.race-month {
  font-size: 12px;
  opacity: 0.6;
}

.race-content {
  flex: 1;
  min-width: 0;
}

.race-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.race-type {
  font-size: 12px;
  opacity: 0.7;
}

.race-key-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 80, 80, 0.15);
  color: #ff6b6b;
}

.race-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.race-goals {
  font-size: 14px;
  opacity: 0.8;
  line-height: 1.6;
}

.race-item.is-key-race {
  border-left: 2px solid #ff6b6b;
  padding-left: 16px;
}

#palmares {
  padding: 8rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

.palmares-header {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  margin-bottom: 4rem;
  align-items: end;
}

.palmares-header-copy {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.palmares-title {
  font-size: clamp(3rem, 8vw, 6rem);
}

.palmares-intro {
  max-width: 60ch;
  font-size: 1.05rem;
  line-height: 1.8;
  color: rgba(244, 242, 239, 0.65);
}

.palmares-table-wrap {
  overflow-x: auto;
}

.palmares-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Barlow", sans-serif;
}

.palmares-table thead tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.palmares-table th {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(244, 242, 239, 0.35);
  padding: 0 1.5rem 1rem 0;
  text-align: left;
  font-weight: 400;
  white-space: nowrap;
}

.palmares-table th:last-child {
  padding-right: 0;
}

.palmares-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s;
}

.palmares-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.palmares-table td {
  padding: 1.4rem 1.5rem 1.4rem 0;
  font-size: 0.95rem;
  color: rgba(244, 242, 239, 0.8);
  vertical-align: middle;
  white-space: nowrap;
}

.palmares-table td:last-child {
  padding-right: 0;
}

.p-date {
  width: 8rem;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: rgba(244, 242, 239, 0.35) !important;
}

.p-race {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: 1.05rem !important;
  letter-spacing: 0.02em;
  color: var(--white) !important;
  white-space: normal !important;
}

.p-time {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 1.15rem !important;
  letter-spacing: 0.04em;
  color: var(--white) !important;
}

.p-ag,
.p-overall {
  font-size: 0.88rem !important;
  color: rgba(244, 242, 239, 0.55) !important;
}

.p-badges {
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
}

.badge.pr {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(244, 242, 239, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.badge.medal {
  background: rgba(212, 175, 55, 0.12);
  color: rgb(212, 175, 55);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.badge-icon {
  width: 0.85rem;
  height: 0.85rem;
  fill: currentColor;
}

.palmares-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
}

.pag-btn,
.pag-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--white);
  font-family: "Barlow Condensed", sans-serif;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, opacity 0.2s;
}

.pag-btn {
  font-size: 1rem;
}

.pag-page {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.pag-btn:hover,
.pag-page:hover {
  border-color: rgba(255, 255, 255, 0.55);
}

.pag-btn.is-disabled {
  opacity: 0.25;
  cursor: default;
}

.pag-pages {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.pag-page.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}

.pag-info {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 242, 239, 0.35);
}

.palmares-empty {
  padding: 3rem 0 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.palmares-empty-title {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.palmares-empty-copy {
  margin-top: 0.9rem;
  max-width: 44ch;
  color: rgba(244, 242, 239, 0.65);
  line-height: 1.8;
}

.p-num-head,
.p-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.p-race-name {
  display: block;
}

.p-race-subtitle {
  display: block;
  margin-top: 0.25rem;
  font-family: "Barlow", sans-serif;
  font-weight: 400;
  font-size: 0.8rem;
  font-style: italic;
  letter-spacing: 0.01em;
  color: rgba(244, 242, 239, 0.42);
  white-space: normal;
}

/* Palmares rows that link to a race detail page */
.palmares-row.is-linked {
  cursor: pointer;
}

.palmares-row.is-linked:hover {
  background: rgba(255, 255, 255, 0.03);
}

.p-race-link {
  display: block;
  color: var(--white);
  text-decoration: none;
  transition: color 0.2s;
}

.palmares-row.is-linked:hover .p-race-link,
.p-race-link:hover {
  color: rgba(244, 242, 239, 0.7);
}

.p-race-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 3px;
  border-radius: 2px;
}

.palmares-table td.p-go-cell {
  width: 2.5rem;
  text-align: right;
  /* Reserve room so the hover shift never pushes past the table edge (avoids an
     overflow scrollbar on the .palmares-table-wrap container). */
  padding-right: 6px;
}

.p-go {
  color: rgba(244, 242, 239, 0.35);
  text-decoration: none;
  font-size: 1.1rem;
  transition: transform 0.2s, color 0.2s;
  display: inline-block;
}

.palmares-row.is-linked:hover .p-go {
  color: var(--white);
  transform: translateX(3px);
}

/* ---- Race result detail page ---- */
.race-result {
  overflow-x: hidden;
}

.rr-hero {
  position: relative;
  width: 100%;
  height: 78vh;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.rr-hero--no-image {
  background: linear-gradient(160deg, #16161a 0%, var(--black, #0a0a0a) 70%);
}

.rr-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.rr-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

.rr-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(8, 8, 8, 1) 0%, rgba(8, 8, 8, 0.5) 35%, rgba(8, 8, 8, 0.1) 65%, rgba(8, 8, 8, 0.35) 100%);
  pointer-events: none;
}

.rr-hero-content {
  position: relative;
  z-index: 2;
  padding: 0 3rem 5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.rr-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 242, 239, 0.65);
  text-decoration: none;
  transition: color 0.2s;
}

.rr-back:hover {
  color: var(--white);
}

.rr-date {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(244, 242, 239, 0.5);
  margin-bottom: 0.75rem;
}

.rr-title {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  max-width: 16ch;
}

.rr-subtitle {
  margin-top: 1rem;
  font-style: italic;
  font-size: 1rem;
  color: rgba(244, 242, 239, 0.55);
}

.rr-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.rr-tag {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(244, 242, 239, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.rr-tag--pr {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.rr-splits {
  padding: 6rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

.rr-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2.5rem;
  padding-bottom: 3rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rr-total-time {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: clamp(3rem, 7vw, 5.5rem);
  letter-spacing: -0.01em;
  line-height: 1;
}

.rr-total-stats {
  display: flex;
  gap: 2.5rem;
}

.rr-total-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rr-stat-num {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
}

.rr-stat-label {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray, #888);
}

.rr-splits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.rr-card {
  background: var(--black, #0a0a0a);
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.rr-card-label {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(244, 242, 239, 0.4);
}

.rr-card-time {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 2.2rem;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.rr-card-positions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rr-pos-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: rgba(244, 242, 239, 0.55);
}

.rr-pos-row b {
  color: var(--white);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rr-gallery {
  padding: 2rem 3rem 8rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Justified gallery: JS sets each tile's width/height per row. The 12px gap here
   must match the GAP constant in site.js. */
.rr-gallery-justified {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.rr-gallery-item {
  position: relative;
  flex: 0 0 auto;
  height: 260px; /* pre-JS fallback; replaced once layout runs */
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  cursor: zoom-in;
}

.rr-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* tile box is computed to the image's aspect ratio, so nothing is cropped */
  display: block;
}

.rr-gallery-item:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

/* A failed image keeps its computed slot so the grid never collapses. */
.rr-gallery-item.is-failed img {
  display: none;
}

.rr-gallery-item.is-failed::after {
  content: "⚠";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(244, 242, 239, 0.4);
  font-size: 1.5rem;
}

/* Lightbox viewer */
body.rr-lb-open {
  overflow: hidden;
}

.rr-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(6, 6, 6, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rr-lightbox[hidden] {
  display: none;
}

.rr-lb-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.rr-lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

.rr-lightbox.is-zoomable .rr-lb-img {
  cursor: zoom-in;
}

.rr-lightbox.is-zoomed .rr-lb-img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  cursor: grab;
}

.rr-lightbox.is-zoomed .rr-lb-img:active {
  cursor: grabbing;
}

.rr-lb-close,
.rr-lb-nav {
  position: fixed;
  z-index: 2001;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--white);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.rr-lb-close:hover,
.rr-lb-nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.rr-lb-close:focus-visible,
.rr-lb-nav:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

.rr-lb-close {
  top: 1.25rem;
  right: 1.25rem;
}

.rr-lb-nav {
  top: 50%;
  transform: translateY(-50%);
}

.rr-lb-prev {
  left: 1.25rem;
}

.rr-lb-next {
  right: 1.25rem;
}

.rr-lb-counter {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  color: rgba(244, 242, 239, 0.7);
}

.rr-lb-error {
  color: rgba(244, 242, 239, 0.5);
  font-size: 3rem;
}

@media (max-width: 768px) {
  .rr-hero-content {
    padding: 0 1.5rem 3rem;
  }

  .rr-splits,
  .rr-gallery {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .rr-splits-grid {
    grid-template-columns: 1fr;
  }

  .rr-total-stats {
    gap: 1.5rem;
  }

  .rr-lb-nav {
    width: 40px;
    height: 40px;
  }
}

.section-divider {
  width: 100%;
  padding: 0 3rem;
}

.section-divider hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#about {
  padding: 8rem 3rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: start;
}

.section-label {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gray);
  padding-top: 0.4rem;
}

.about-aside {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.about-media {
  margin: 0;
}

.about-media img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
}

.section-label-top {
  padding-top: 0.5rem;
}

.about-body {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.about-headline {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.about-headline em,
.section-heading em,
.contact-heading em {
  font-style: normal;
  color: rgba(244, 242, 239, 0.35);
}

.about-text {
  font-size: 1.05rem;
  line-height: 1.85;
  color: rgba(244, 242, 239, 0.7);
  max-width: 68ch;
  text-wrap: pretty;
}

.about-text p + p { margin-top: 1.2rem; }

.about-stats {
  display: flex;
  gap: 3.5rem;
  padding-top: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-num {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: 0;
}

.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray);
}

#sponsors {
  padding: 6rem 3rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.sponsors-header {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  margin-bottom: 4rem;
  align-items: end;
}

.sponsors-header-copy {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sponsors-title {
  font-size: clamp(3rem, 8vw, 6rem);
}

.sponsors-intro {
  max-width: 60ch;
  font-size: 1.05rem;
  line-height: 1.8;
  color: rgba(244, 242, 239, 0.65);
}

/* Three per row. Flex rather than a 3-column grid so that an incomplete last row
   centres instead of hugging the left edge — with two or five sponsors a grid
   would leave a visible hole on the right. The basis is a third of the row minus
   the two column gaps. */
.sponsor-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3.5rem 4rem;
}

/* Fixed optical height with a free width: logos of any aspect ratio line up
   without being cropped, stretched or recoloured. */
.sponsor-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 110px;
  flex: 0 0 calc((100% - 8rem) / 3);
}

/* Primary sponsors get their own row above the rest: two per row instead of three,
   and a taller box. Same centring rule, so a single primary sits centred. */
.sponsor-grid-primary {
  gap: 4rem;
  margin-bottom: 4.5rem;
}

.sponsor-grid-primary .sponsor-item {
  height: 180px;
  flex: 0 0 calc((100% - 4rem) / 2);
}

.sponsor-item img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

a.sponsor-item { transition: opacity 0.3s ease; }

a.sponsor-item:hover { opacity: 0.55; }

.sponsors-cta-row {
  display: flex;
  margin-top: 3.5rem;
}

.sponsors-cta { margin-top: 0; }

.marquee-wrap {
  overflow: hidden;
  padding: 3rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.marquee-track {
  display: flex;
  gap: 0;
  animation: marquee 22s linear infinite;
  white-space: nowrap;
}

.marquee-track:hover { animation-play-state: paused; }

.marquee-item {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.5rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: rgba(244, 242, 239, 0.08);
  padding: 0 2.5rem;
  flex-shrink: 0;
}

.marquee-item.accent {
  color: rgba(244, 242, 239, 0.55);
}

#social {
  padding: 8rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

.social-header {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  margin-bottom: 5rem;
}

.social-intro {
  margin: 19.2px 0 48px;
  color: rgba(244, 242, 239, 0.55);
  font-size: 1rem;
  line-height: 1.8;
}

.section-heading {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.05;
}

.social-cards {
  display: flex;
  gap: 4rem;
  align-items: flex-start;
}

.social-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: var(--white);
  cursor: pointer;
  transition: opacity 0.2s;
}

.social-card:hover { opacity: 0.55; }

.social-card-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  transition: border-color 0.25s;
}

.social-card:hover .social-card-icon { border-color: rgba(255, 255, 255, 0.55); }

.social-card-icon svg {
  width: 22px;
  height: 22px;
  fill: var(--white);
}

.social-card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.social-platform {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(244, 242, 239, 0.38);
}

.social-handle {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

#contact,
.error-page {
  padding: 10rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2.5rem;
}

.contact-eyebrow {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gray);
}

.contact-heading {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: clamp(3.5rem, 9vw, 9rem);
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: 0;
}

.contact-email-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 242, 239, 0.55);
  text-decoration: none;
  border-bottom: 1px solid rgba(244, 242, 239, 0.15);
  padding-bottom: 0.3rem;
  transition: color 0.2s, border-color 0.2s;
}

.contact-email-link:hover {
  color: var(--white);
  border-color: rgba(244, 242, 239, 0.5);
}

footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
}

.footer-copy {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 242, 239, 0.3);
}

.footer-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.footer-links a {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 242, 239, 0.3);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: rgba(244, 242, 239, 0.7); }

.error-request-id {
  color: rgba(244, 242, 239, 0.65);
  font-size: 1rem;
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (max-width: 768px) {
  nav { padding: 1.2rem 1.5rem; }

  .nav-actions { gap: 0.8rem; }

  .nav-links { display: none; }

  .language-option {
    width: 2.2rem;
    height: 2.2rem;
  }

  #about {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 5rem 1.5rem 2rem;
  }

  #sponsors {
    padding: 4rem 1.5rem 2rem;
  }

  .sponsors-header {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
  }

  .sponsors-cta-row { margin-top: 2.5rem; }

  /* Three across is unreadable on a phone; two keeps the logos legible. */
  .sponsor-grid { gap: 2.5rem 2rem; }

  .sponsor-item {
    height: 72px;
    flex-basis: calc((100% - 2rem) / 2);
  }

  /* Two primaries still fit side by side at 375px, and stay clearly taller
     than the regular logos below them. */
  .sponsor-grid-primary {
    gap: 2rem;
    margin-bottom: 3rem;
  }

  .sponsor-grid-primary .sponsor-item { height: 104px; }

  .social-header {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
  }

  .palmares-header {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
  }

  .race-calendar-section {
    padding: 5rem 0;
  }

  .race-calendar-section .container {
    padding: 0 1.5rem;
  }

  .race-calendar-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 32px;
  }

  .race-item {
    gap: 18px;
  }

  .race-date {
    min-width: 48px;
  }

  #palmares {
    padding: 5rem 1.5rem;
  }

  .palmares-table th,
  .palmares-table td {
    padding-right: 1rem;
  }

  .palmares-pagination {
    gap: 0.85rem;
  }

  .pag-pages {
    width: 100%;
    order: 3;
    flex-wrap: wrap;
  }

  #social { padding: 5rem 1.5rem; }

  .social-cards {
    gap: 2.5rem;
    flex-wrap: wrap;
  }

  #contact,
  .error-page { padding: 6rem 1.5rem; }

  .content-page { padding: 8rem 1.5rem 3rem; }

  footer {
    padding: 2rem 1.5rem;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .about-stats { gap: 2rem; }
}
