:root {
  --green: #73d12f;
  --green-dark: #0f4b2f;
  --forest: #06291f;
  --forest-2: #041a16;
  --yellow: #ffc629;
  --ink: #12231e;
  --muted: #66736f;
  --line: #dbe5e0;
  --bg: #f6f8f6;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(6, 41, 31, 0.13);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

img, svg {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button, a.btn {
  font: inherit;
}

.section-pad {
  padding: 72px max(24px, calc((100vw - 1180px) / 2));
}

.section-pad.compact {
  padding-top: 46px;
  padding-bottom: 46px;
}

.site-header {
  min-height: 720px;
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(4, 26, 22, 0.98) 0%, rgba(4, 26, 22, 0.78) 44%, rgba(4, 26, 22, 0.42) 100%),
    radial-gradient(circle at 74% 38%, rgba(115, 209, 47, 0.16), transparent 30%),
    url("assets/img/hero-largada.jpg") center center/cover no-repeat,
    linear-gradient(145deg, #163927, #0c2433 54%, #142518);
  position: relative;
  overflow: hidden;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 0 70%, rgba(4, 26, 22, 0.92) 100%),
    repeating-linear-gradient(-14deg, transparent 0 28px, rgba(255,255,255,0.025) 29px 30px);
  pointer-events: none;
}

.navbar {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.brand-logo {
  width: 82px;
  height: 82px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}

.site-header:not(.is-scrolled) .navbar .brand-logo {
  opacity: 0;
  transform: translateY(-8px);
}

.navbar .brand-logo {
  transition: opacity .2s ease, transform .2s ease;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.nav-links a {
  opacity: 0.86;
  transition: color .2s ease, opacity .2s ease;
}

.nav-links a:hover {
  color: var(--green);
  opacity: 1;
}

.menu-toggle {
  display: none;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  color: var(--white);
  padding: 8px 12px;
}

.hero {
  min-height: 620px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
  padding-top: 28px;
}

.hero-brand {
  position: absolute;
  right: max(24px, calc((100vw - 1180px) / 2));
  top: 50%;
  width: min(310px, 24vw);
  transform: translateY(-45%);
  pointer-events: none;
}

.hero-brand img {
  width: 100%;
  display: block;
  filter: drop-shadow(0 20px 34px rgba(0, 0, 0, 0.45));
}

.hero-content {
  width: min(760px, 100%);
}

.eyebrow, .section-kicker {
  margin: 0 0 18px;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 900;
  font-size: 0.8rem;
}

.hero h1 {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(4.8rem, 11vw, 9.4rem);
  line-height: 0.9;
  margin: 0;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-shadow: 0 8px 28px rgba(0,0,0,0.35);
}

.hero h1 span {
  display: block;
  color: var(--green);
  font-style: italic;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  font-weight: 800;
  text-transform: uppercase;
}

.hero-copy {
  max-width: 570px;
  line-height: 1.65;
  color: rgba(255,255,255,0.88);
  margin-bottom: 26px;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 22px;
  border-radius: 10px;
  border: 0;
  background: var(--green);
  color: #06291f;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(115, 209, 47, 0.25);
}

.btn-primary {
  min-width: 260px;
}

.btn-outline {
  background: transparent;
  border: 1px solid #9bacaa;
  color: var(--ink);
}

.btn-small {
  min-height: 38px;
  padding: 9px 14px;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

.hero-pills a {
  min-width: 148px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 14px;
  padding: 12px 20px;
  background: rgba(0,0,0,0.18);
  text-align: center;
  backdrop-filter: blur(8px);
}

.hero-pills strong {
  display: block;
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.1rem;
  line-height: 1;
}

.hero-pills small {
  display: block;
  text-transform: uppercase;
  font-weight: 900;
  font-size: 0.66rem;
}

.section-grid, .two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 42px;
}

.align-center {
  align-items: center;
}

h2 {
  margin: 0 0 16px;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(2.6rem, 5vw, 4rem);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--green-dark);
}

p {
  line-height: 1.65;
}

.race p:not(.section-kicker) {
  color: var(--muted);
  max-width: 600px;
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 30px;
}

.feature-row article {
  text-align: center;
}

.feature-row span {
  display: block;
  font-size: 2.3rem;
  margin-bottom: 8px;
}

.feature-row strong {
  font-size: 0.88rem;
}

.image-card,
.registration-image {
  border-radius: var(--radius);
  min-height: 330px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.scenic-card {
  background: url("assets/img/experiencia.jpg") center center/cover no-repeat;
  position: relative;
}

.registration-image {
  background: url("assets/img/reserva-tu-lugar.jpg") center center/cover no-repeat;
  position: relative;
}

.section-heading.center {
  text-align: center;
  margin-bottom: 26px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.distance-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  text-align: center;
}

.card-top {
  padding: 24px 18px 20px;
  background: linear-gradient(135deg, var(--green-dark), var(--forest-2));
  color: var(--white);
}

.card-top span {
  display: block;
  color: var(--green);
  font-family: "Bebas Neue", sans-serif;
  font-size: 3.5rem;
  line-height: 0.85;
}

.kids .card-top span {
  color: var(--yellow);
}

.card-top small {
  text-transform: uppercase;
  font-weight: 900;
}

.card-body {
  padding: 24px;
}

.card-body p {
  margin-top: 0;
  color: var(--muted);
}

.card-body strong {
  display: block;
  font-size: 1.55rem;
  margin: 12px 0 18px;
}

.card-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
}

.card-actions.single .btn {
  min-width: 160px;
}

.circuit-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 16px;
}

.circuit-tabs button {
  border: 1px solid #bdc9c5;
  background: var(--white);
  padding: 13px 24px;
  min-width: 230px;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: 900;
  color: var(--ink);
}

.circuit-tabs button:first-child {
  border-radius: 12px 0 0 12px;
}

.circuit-tabs button:last-child {
  border-radius: 0 12px 12px 0;
}

.circuit-tabs button.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--forest);
}

.circuit-panel {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 190px 1.25fr 1fr;
  gap: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.circuit-data {
  display: grid;
  gap: 12px;
  align-content: center;
}

.data-title {
  margin: 0;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--green-dark);
}

.circuit-data div {
  display: grid;
  gap: 3px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.circuit-data span {
  color: var(--muted);
  font-size: 0.82rem;
}

.map-area,
.elevation-area {
  min-height: 280px;
}

.map-placeholder {
  height: 100%;
  min-height: 280px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 48%, rgba(83, 164, 211, 0.88) 0 24%, transparent 25%),
    radial-gradient(circle at 61% 58%, rgba(83, 164, 211, 0.86) 0 19%, transparent 20%),
    linear-gradient(40deg, #d9c7a1 0 18%, #b8ad8d 19% 22%, #e5d6b8 23% 43%, #d0bb93 44% 48%, #f1e3c7 49% 100%);
  position: relative;
  overflow: hidden;
  border: 1px solid #c8d0ca;
}

.map-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(130deg, transparent 0 16px, rgba(61,76,67,0.1) 17px 18px);
  mix-blend-mode: multiply;
}

.route {
  position: absolute;
  inset: 18% 9% 22% 10%;
  border: 5px solid var(--green);
  border-left-color: transparent;
  border-bottom-color: #e4ff56;
  border-radius: 48% 42% 38% 52%;
  transform: rotate(-5deg);
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.34));
}

.route-secondary {
  inset: 37% 22% 30% 28%;
  transform: rotate(8deg);
  opacity: .8;
}

.map-placeholder[data-distance="9k"] .route-main {
  inset: 27% 18% 31% 19%;
}

.map-placeholder[data-distance="kids"] .route-main {
  inset: 42% 30% 36% 31%;
}

.map-placeholder strong {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 2;
  color: var(--green-dark);
  background: rgba(255,255,255,0.82);
  border-radius: 999px;
  padding: 8px 14px;
  text-transform: uppercase;
}

.elevation-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#elevation-chart {
  width: 100%;
  min-height: 220px;
}

.grid-lines line {
  stroke: #dbe5e0;
  stroke-width: 1;
}

#elevation-fill {
  fill: url(#chartFill);
  transition: d .25s ease;
}

#elevation-line {
  fill: none;
  stroke: var(--green-dark);
  stroke-width: 5;
  stroke-linecap: round;
  transition: d .25s ease;
}

#chart-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.circuit-video-panel {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr;
  gap: 28px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.circuit-video-copy {
  display: grid;
  align-content: center;
  gap: 12px;
}

.circuit-video-copy p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.video-shell {
  min-height: 360px;
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(6, 41, 31, 0.92), rgba(15, 75, 47, 0.76)),
    url("assets/img/hero-largada.jpg") center center/cover no-repeat;
  display: grid;
  place-items: center;
  border: 1px solid rgba(6, 41, 31, 0.18);
}

.video-load {
  width: min(320px, calc(100% - 36px));
  min-height: 158px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 14px;
  background: rgba(4, 26, 22, 0.72);
  color: var(--white);
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 22px;
  cursor: pointer;
  text-align: center;
  backdrop-filter: blur(8px);
}

.video-load span {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: var(--forest);
  font-size: 1.35rem;
  font-weight: 900;
}

.video-load strong {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.video-load small {
  color: rgba(255,255,255,0.78);
}

.circuit-video {
  width: 100%;
  height: 100%;
  min-height: 360px;
  display: block;
  background: #000;
  object-fit: contain;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: 0 12px 32px rgba(6, 41, 31, 0.08);
}

.timeline {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 22px;
  position: relative;
}

.timeline li {
  display: grid;
  gap: 5px;
  padding-left: 34px;
  position: relative;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(115,209,47,0.15);
}

.timeline time {
  font-weight: 900;
  color: var(--green-dark);
}

.timeline span {
  color: var(--muted);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.info-grid button {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdfb;
  padding: 18px;
  text-align: left;
  cursor: pointer;
  transition: transform .2s ease, border .2s ease;
}

.info-grid button:hover {
  transform: translateY(-2px);
  border-color: var(--green);
}

.info-grid strong,
.info-grid span {
  display: block;
}

.info-grid strong {
  margin: 8px 0 6px;
  text-transform: uppercase;
}

.info-grid span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.registration-card {
  display: grid;
  grid-template-columns: 300px 1fr 360px;
  gap: 26px;
  align-items: center;
  background: linear-gradient(135deg, var(--forest), var(--forest-2));
  color: var(--white);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.registration-image {
  min-height: 230px;
  box-shadow: none;
}

.registration-content h2 {
  color: var(--green);
}

.registration-content ul {
  margin: 0;
  padding-left: 18px;
  color: rgba(255,255,255,0.86);
  line-height: 1.8;
}

.registration-action {
  display: grid;
  gap: 18px;
}

.registration-action p {
  margin: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 18px;
  color: rgba(255,255,255,0.78);
  font-size: 0.88rem;
}

.awards {
  background:
    linear-gradient(180deg, rgba(246, 248, 246, 0), rgba(219, 229, 224, 0.5));
}

.award-gallery {
  display: grid;
  grid-template-columns: 1.15fr repeat(2, minmax(0, 0.92fr));
  gap: 18px;
  align-items: stretch;
}

.award-card {
  position: relative;
  min-height: 360px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--forest-2);
  box-shadow: var(--shadow);
  border: 1px solid rgba(6, 41, 31, 0.12);
}

.award-card img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  display: block;
  object-fit: cover;
}

.award-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 26, 22, 0.06) 30%, rgba(4, 26, 22, 0.84) 100%);
  pointer-events: none;
}

.award-card div {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  z-index: 1;
  color: var(--white);
}

.award-card strong {
  display: block;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 2.45rem;
  line-height: 0.95;
  text-transform: uppercase;
}

.award-card.first-place {
  min-height: 420px;
}

.award-card.first-place img {
  min-height: 420px;
}

.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.sponsor-grid article {
  min-height: 160px;
  border-radius: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  gap: 14px;
  text-align: center;
  padding: 22px;
}

.sponsor-grid span {
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.sponsor-grid img {
  max-width: min(260px, 82%);
  max-height: 92px;
  object-fit: contain;
}

.sponsor-strip {
  margin-top: 28px;
}

.sponsor-strip h3 {
  margin: 0 0 16px;
  color: var(--green-dark);
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 2.4rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
}

.sponsor-logo-grid {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 14px;
}

.sponsor-logo-grid article {
  min-height: 128px;
  grid-column: span 5;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  padding: 14px;
  box-shadow: 0 8px 22px rgba(6, 41, 31, 0.06);
}

.sponsor-logo-grid img {
  width: 100%;
  max-height: 104px;
  object-fit: contain;
  display: block;
}

.sponsor-logo-grid article.secondary {
  min-height: 104px;
  grid-column: span 4;
  padding: 12px;
}

.sponsor-logo-grid article.secondary img {
  max-height: 78px;
}

.site-footer {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 24px;
  padding: 36px max(24px, calc((100vw - 1180px) / 2));
  background: var(--forest-2);
  color: rgba(255,255,255,0.78);
}

.site-footer div {
  display: grid;
  gap: 6px;
}

.site-footer strong {
  color: var(--white);
  text-transform: uppercase;
}

.site-footer a:hover {
  color: var(--green);
}

.modal {
  width: min(520px, calc(100% - 32px));
  border: 0;
  border-radius: 20px;
  padding: 34px;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(4, 26, 22, 0.72);
}

.modal-close {
  position: absolute;
  right: 18px;
  top: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
  font-size: 1.3rem;
}

.modal h3 {
  margin: 0 0 12px;
  font-family: "Bebas Neue", sans-serif;
  color: var(--green-dark);
  font-size: 2.5rem;
}

.modal p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 760px) {
  .sponsor-logo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sponsor-logo-grid article,
  .sponsor-logo-grid article.secondary {
    grid-column: auto;
  }
}

@media (max-width: 980px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 94px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px;
    border-radius: 18px;
    background: rgba(4, 26, 22, 0.96);
    border: 1px solid rgba(255,255,255,0.16);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 14px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-header {
    min-height: auto;
  }

  .hero {
    min-height: 650px;
  }

  .hero-brand {
    opacity: 0.22;
    right: 18px;
    top: 48%;
    width: 230px;
  }

  .section-grid,
  .two-cols,
  .cards,
  .award-gallery,
  .registration-card,
  .site-footer,
  .sponsor-grid,
  .sponsor-logo-grid {
    grid-template-columns: 1fr;
  }

  .circuit-panel,
  .circuit-video-panel {
    grid-template-columns: 1fr;
  }

  .circuit-data {
    grid-template-columns: repeat(2, 1fr);
  }

  .data-title,
  .circuit-data .btn {
    grid-column: 1 / -1;
  }

  .circuit-tabs {
    flex-direction: column;
  }

  .video-shell,
  .circuit-video {
    min-height: 260px;
  }

  .circuit-tabs button,
  .circuit-tabs button:first-child,
  .circuit-tabs button:last-child {
    border-radius: 12px;
    margin-bottom: 8px;
  }

  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .section-pad {
    padding-left: 18px;
    padding-right: 18px;
  }

  .navbar {
    width: calc(100% - 32px);
  }

  .brand-logo {
    width: 64px;
    height: 64px;
  }

  .brand span {
    display: none;
  }

  .hero-brand {
    display: none;
  }

  .hero h1 {
    font-size: 4.8rem;
  }

  .hero-pills,
  .hero-meta,
  .card-actions,
  .feature-row,
  .info-grid,
  .circuit-data {
    grid-template-columns: 1fr;
  }

  .hero-pills {
    display: grid;
  }

  .btn-primary {
    width: 100%;
    min-width: 0;
  }

  .panel,
  .registration-card {
    padding: 22px;
  }
}
