/* Local refinement layer. The published bundle remains untouched underneath. */

:root {
  --sec: clamp(42px, 4.5vw, 72px);
}

.hero {
  min-height: min(820px, calc(100dvh - var(--nav-h)));
}

.hero h1 {
  font-size: clamp(3.35rem, 7.6vw, 6.5rem);
}

.hero-bg .hero-photo-new {
  object-position: 50% 32%;
}

.hero-bg::after {
  background:
    linear-gradient(90deg, rgb(3 13 8 / .82) 0%, rgb(3 13 8 / .58) 34%, rgb(3 13 8 / .18) 72%, rgb(3 13 8 / .06)),
    linear-gradient(
      180deg,
      transparent 38%,
      rgb(3 13 8 / .2) 58%,
      rgb(19 61 35 / .68) 82%,
      var(--green-900) 100%
    );
}

.hero-content {
  background: transparent;
  padding-top: clamp(20px, 3vh, 38px);
  padding-bottom: clamp(16px, 2vh, 24px);
}

.race-facts-enhanced {
  background: var(--green-950);
  border-left-color: rgb(255 255 255 / .12);
  color: var(--paper);
}

.railbar .race-facts-enhanced .fact {
  position: relative;
  display: grid;
  align-content: center;
  gap: 8px;
  overflow: hidden;
  border-color: rgb(255 255 255 / .12);
  background: linear-gradient(145deg, rgb(255 255 255 / .08), transparent 58%);
  opacity: 0;
  transform: translateY(10px);
  animation: race-fact-in 520ms cubic-bezier(.16, 1, .3, 1) forwards;
  animation-delay: calc(180ms + var(--fact-index) * 90ms);
}

.railbar .race-facts-enhanced .fact::after {
  position: absolute;
  inset: auto 16px 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  content: '';
  opacity: .85;
}

.race-facts-enhanced .fact span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--gold);
}

.race-facts-enhanced .fact span svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.race-facts-enhanced .fact b {
  margin-top: 0;
  color: var(--paper);
  font-size: clamp(.95rem, 1.15vw, 1.12rem);
  line-height: 1.2;
}

@keyframes race-fact-in {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .railbar .race-facts-enhanced .fact {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

.head {
  margin-bottom: clamp(26px, 3vw, 44px);
}

.head h2 + .lead {
  margin-top: 14px;
}

.rb-split-text__word,
.rb-blur-text__word,
.rb-scroll-reveal__word {
  display: inline-block;
}

.rb-split-text__word {
  opacity: 0;
  transform: translateY(.72em) rotate(2deg);
  clip-path: inset(0 0 100%);
}

.rb-split-text.is-visible .rb-split-text__word {
  animation: rb-split-in 720ms cubic-bezier(.16, 1, .3, 1) forwards;
  animation-delay: calc(90ms + var(--word-index) * 82ms);
}

.rb-blur-text__word {
  opacity: .12;
  filter: blur(12px);
  transform: translateY(.28em);
}

.rb-blur-text.is-visible .rb-blur-text__word {
  animation: rb-blur-in 680ms cubic-bezier(.16, 1, .3, 1) forwards;
  animation-delay: calc(var(--word-index) * 72ms);
}

.rb-scroll-reveal__word {
  opacity: .16;
  filter: blur(7px);
  transform: translateY(.25em);
}

.rb-scroll-reveal.is-visible .rb-scroll-reveal__word {
  animation: rb-scroll-word 560ms cubic-bezier(.16, 1, .3, 1) forwards;
  animation-delay: calc(var(--word-index) * 58ms);
}

.rb-shiny-text {
  background: linear-gradient(105deg, var(--paper) 35%, var(--gold) 48%, var(--paper) 61%);
  background-size: 240% 100%;
  background-clip: text;
  color: transparent;
  animation: rb-shine 4.8s ease-in-out infinite;
}

@keyframes rb-split-in {
  to { opacity: 1; transform: none; clip-path: inset(0); }
}

@keyframes rb-blur-in {
  to { opacity: 1; filter: blur(0); transform: none; }
}

@keyframes rb-scroll-word {
  to { opacity: 1; filter: blur(0); transform: none; }
}

@keyframes rb-shine {
  0%, 22% { background-position: 110% 0; }
  58%, 100% { background-position: -110% 0; }
}

#recorrido {
  overflow: hidden;
}

#recorrido .route {
  align-items: stretch;
  gap: clamp(22px, 3vw, 42px);
}

#recorrido .map[data-figma-route="true"] {
  position: relative;
  min-height: clamp(420px, 54vw, 650px);
  overflow: hidden;
  border: 1px solid rgb(210 169 58 / .42);
  border-radius: var(--r-panel);
  background: radial-gradient(circle at 18% 12%, rgb(210 169 58 / .18), transparent 34%), #07170e;
  box-shadow: 0 24px 70px rgb(3 13 8 / .24);
}

#recorrido .map[data-figma-route="true"] img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: contain;
  object-position: center;
  filter: saturate(.72) sepia(.12) hue-rotate(4deg) brightness(.86);
}

.route-map__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 8px 12px;
  border: 1px solid rgb(255 255 255 / .18);
  border-radius: 999px;
  background: rgb(7 23 14 / .86);
  color: #fff;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

#recorrido .route-copy {
  align-self: center;
}

#recorrido .streets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  list-style: none;
}

#recorrido .streets li {
  padding: 8px 11px;
  border: 1px solid rgb(19 61 35 / .14);
  border-radius: 999px;
  background: rgb(232 243 236 / .72);
  color: var(--green-900);
  font-size: .86rem;
  line-height: 1.15;
}

#recorrido .streets li::before {
  content: counter(list-item, decimal-leading-zero);
  margin-right: 6px;
  color: #9a7620;
  font-size: .7rem;
  font-weight: 800;
}

#la-noche {
  overflow: hidden;
  padding-bottom: 0;
}

#hero-velocity-root.curved-loop-shell {
  position: relative;
  width: calc(100% + (var(--gut) * 2));
  height: clamp(102px, 10vw, 138px);
  margin: 0 calc(var(--gut) * -1) clamp(28px, 3vw, 42px);
  padding: 0;
  padding-block: 0;
  overflow: hidden;
  border-block: 0;
  background: transparent;
  color: var(--green-100);
}

#la-noche > #hero-velocity-root.curved-loop-shell {
  height: clamp(84px, 8vw, 112px);
  margin: clamp(10px, 1.5vw, 20px) calc(var(--gut) * -1) 0;
}

#la-noche .night-top {
  margin-bottom: clamp(12px, 1.6vw, 22px);
}

#la-noche .night-top .tl {
  margin-top: clamp(22px, 2.8vw, 38px);
}

#scroll-expand-largada-root .scroll-expand {
  height: 88svh;
  padding-top: 0;
}

#scroll-expand-largada-root .scroll-expand figure {
  height: min(70svh, 660px);
}

.curved-loop {
  position: absolute;
  inset: 50% auto auto 50%;
  width: max(100%, 1120px);
  height: auto;
  overflow: visible;
  transform: translate(-50%, -50%);
}

.curved-loop__text {
  fill: currentColor;
  font-family: Captain, Expose, sans-serif;
  font-size: 58px;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.curved-loop-shell::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--green-950), transparent 9% 91%, var(--green-950));
  content: '';
  pointer-events: none;
}

#galeria {
  padding-inline: 0;
  background: var(--paper);
}

#galeria > .head {
  padding-inline: var(--gut);
}

#flex-gallery-root {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding-inline: clamp(10px, 1.4vw, 20px);
}

.horizontal-gallery {
  display: grid;
  width: 100%;
  max-width: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 20px);
}

@media (max-width: 900px) {
  .horizontal-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.horizontal-gallery__item {
  position: relative;
  aspect-ratio: 16 / 10;
  margin: 0;
  overflow: hidden;
  border-radius: var(--r-panel);
  background: var(--green-950);
}

.horizontal-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(.16, 1, .3, 1);
}

.horizontal-gallery__item:hover img,
.horizontal-gallery__item:focus-within img {
  transform: scale(1.025);
}

#kit-oficial .kit-grid figure img {
  width: 100%;
  height: clamp(240px, 30vw, 430px);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.scroll-expand {
  height: 96svh;
  padding-top: 0;
}

.scroll-expand figure {
  height: min(66svh, 660px);
}

#scroll-expand-recorrido-root.route-banner-shell .scroll-expand {
  height: auto;
  padding-block: clamp(28px, 4vw, 52px);
}

#scroll-expand-recorrido-root.route-banner-shell .scroll-expand figure {
  position: relative;
  top: auto;
  width: 100%;
  max-width: none;
  height: clamp(230px, 30vw, 390px);
  margin: 0;
  clip-path: none !important;
  border-radius: var(--r-panel);
}

#scroll-expand-recorrido-root.route-banner-shell .scroll-expand img {
  transform: none !important;
}

.stats {
  grid-template-columns: repeat(3, 1fr);
}

.classification {
  background: var(--cream);
}

.classification + .final {
  box-shadow:
    0 0 0 100vmax var(--cream),
    var(--shadow-ambient);
  clip-path: inset(-80px -100vmax);
}

.classification-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: clamp(20px, 3vw, 48px);
  margin-bottom: clamp(24px, 3vw, 38px);
}

.classification-head .lead {
  margin-top: 10px;
}

.classification-head .btn {
  flex: none;
}

.classification-frame {
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--paper);
  box-shadow: var(--shadow-ambient);
}

.classification-frame .RRPublish {
  min-height: 560px;
  padding: clamp(18px, 2.4vw, 32px);
}

.classification-loading {
  color: var(--muted);
}

.classification-fallback {
  margin-top: 14px;
  color: var(--muted);
  font-size: var(--t-label);
}

.classification-fallback a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--green-800);
  font-weight: 700;
  text-underline-offset: 3px;
}

#pill-nav-root .pill,
#pill-nav-root .pill-logo,
#pill-nav-root .mobile-menu-button {
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
}

#pill-nav-root .pill-logo {
  width: 58px;
  padding: 4px 10px;
  background: var(--paper);
  border-color: rgb(19 61 35 / .24);
}

#pill-nav-root .pill-logo__club {
  width: 36px;
  height: 38px;
}

.classification-frame :is(button, input[type='button'], input[type='submit']) {
  min-width: 44px !important;
  min-height: 44px !important;
  height: 44px !important;
  touch-action: manipulation;
}

.classification-frame :is(.aShowAll, .showMore, .showAll, [class*='showMore'], [class*='showAll']) {
  display: inline-flex !important;
  align-items: center;
  min-height: 44px !important;
}

.actions__grid.tilted-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  perspective: 1200px;
}

#action-cards-root {
  width: calc(100% - (var(--gut) * 2));
  max-width: none;
}

.tilted-action-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --light-x: 50%;
  --light-y: 50%;
  position: relative;
  min-width: 0;
  aspect-ratio: 4 / 5;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: var(--green-950);
  color: var(--paper);
  box-shadow: 0 18px 34px rgb(11 38 22 / .16);
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transform-style: preserve-3d;
  transition: transform 160ms ease-out, box-shadow 200ms ease;
  will-change: transform;
}

.kit-benefits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  margin-top: clamp(18px, 2.4vw, 32px);
}

.kit-benefits figure {
  position: relative;
  height: clamp(140px, 15vw, 210px);
  margin: 0;
  overflow: hidden;
  border-radius: var(--r-card);
  background: var(--green-950);
}

.kit-benefits img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kit-benefits figure::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 22%, rgb(11 38 22 / .9));
  content: '';
}

.kit-benefits figcaption {
  position: absolute;
  z-index: 1;
  right: 14px;
  bottom: 14px;
  left: 14px;
  color: var(--paper);
}

.kit-benefits h3 {
  color: var(--paper);
  font-size: clamp(1.45rem, 2.1vw, 2.15rem);
  text-shadow: 0 2px 16px rgb(0 0 0 / .55);
}

.kit-benefits p {
  margin-top: 4px;
  font-size: .8rem;
  line-height: 1.25;
}

.tilted-action-card:hover {
  z-index: 2;
  color: var(--paper);
  box-shadow: 0 28px 52px rgb(11 38 22 / .25);
}

.tilted-action-card__photo,
.tilted-action-card__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tilted-action-card__photo {
  object-fit: cover;
  transform: scale(1.035);
  transition: transform 220ms ease-out;
}

.tilted-action-card:hover .tilted-action-card__photo {
  transform: scale(1.075);
}

.tilted-action-card__shade {
  background:
    radial-gradient(circle 120px at var(--light-x) var(--light-y), rgb(255 255 255 / .2), transparent 62%),
    linear-gradient(180deg, rgb(11 38 22 / .03) 30%, rgb(11 38 22 / .94) 100%);
}

.tilted-action-card__copy {
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 50px 16px 16px;
  color: var(--paper);
  transform: translateZ(28px);
}

.tilted-action-card__copy strong {
  font: 400 1.72rem/.9 Captain, Expose, sans-serif;
  text-transform: uppercase;
}

.tilted-action-card__copy small {
  margin-top: 4px;
  color: rgb(255 255 255 / .78);
  line-height: 1.25;
}

.tilted-action-card .action-card__action {
  margin-top: 14px;
  color: #c8ead2;
}

.tilted-action-card.action-card--disabled .tilted-action-card__photo {
  filter: saturate(.45);
}

@media (width <= 900px) {
  :root {
    --sec: clamp(38px, 10vw, 58px);
  }

  .hero-bg .hero-photo-new {
    object-position: 58% 28%;
  }

  .hero-bg::after {
    background:
      linear-gradient(90deg, rgb(3 13 8 / .72), rgb(3 13 8 / .26) 78%),
      linear-gradient(180deg, transparent 34%, rgb(3 13 8 / .42) 62%, var(--green-900) 100%);
  }

  .head {
    margin-bottom: 28px;
  }

  #scroll-expand-recorrido-root.route-banner-shell .scroll-expand {
    padding-block: 28px;
  }

  #scroll-expand-recorrido-root.route-banner-shell .scroll-expand figure {
    height: 170px;
    border-radius: var(--r-card);
  }

  #scroll-expand-recorrido-root.route-banner-shell .scroll-expand figcaption {
    max-width: 11ch;
    font-size: 2rem;
  }

  #hero-velocity-root.curved-loop-shell {
    height: 104px;
    margin-bottom: 22px;
  }

  #la-noche > #hero-velocity-root.curved-loop-shell {
    margin-top: 18px;
    margin-bottom: 20px;
  }

  .curved-loop {
    width: 920px;
  }

  .curved-loop__text {
    font-size: 48px;
  }

  .horizontal-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .horizontal-gallery__item {
    aspect-ratio: 4 / 3;
  }

  .scroll-expand {
    height: 88svh;
  }

  .scroll-expand figure {
    height: 64svh;
  }

  #kit-oficial .kit-grid figure img {
    height: clamp(220px, 72vw, 380px);
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .stats .stat:last-child {
    grid-column: 1 / -1;
  }

  .classification-head {
    align-items: start;
    flex-direction: column;
  }

  .classification-frame {
    min-height: 540px;
    margin-inline: calc(var(--gut) * -1);
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .classification-frame .RRPublish {
    min-height: 540px;
    padding: 16px 13px;
  }

  .actions__grid.tilted-actions {
    grid-template-columns: repeat(6, 210px);
    overflow-x: auto;
    padding: 4px 4px 20px;
    scroll-snap-type: x mandatory;
  }

  #action-cards-root {
    width: calc(100% - (var(--gut) * 2));
  }

  .tilted-action-card {
    scroll-snap-align: start;
  }

  .kit-benefits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .tilted-action-card {
    transform: none !important;
    transition: none;
  }

  .tilted-action-card__photo {
    transition: none;
  }
}

@media (width <= 560px) {
  #recorrido .route {
    gap: 18px;
  }

  #recorrido .map[data-figma-route="true"] {
    min-height: 430px;
    border-radius: var(--r-card);
  }

  .route-map__badge {
    top: 10px;
    left: 10px;
    font-size: .62rem;
  }

  #recorrido .streets {
    gap: 6px;
  }

  #recorrido .streets li {
    padding: 7px 9px;
    font-size: .78rem;
  }

  #la-noche .tl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 14px;
  }

  #la-noche .tl li {
    min-width: 0;
    padding-top: 26px;
  }

  #la-noche .tl time {
    font-size: clamp(1.8rem, 10vw, 2.5rem);
  }

  #la-noche .tl span {
    font-size: .88rem;
    line-height: 1.35;
  }

  #la-noche > #hero-velocity-root.curved-loop-shell {
    height: 76px;
  }

  #scroll-expand-largada-root .scroll-expand {
    height: 82svh;
  }
}

@media (width <= 560px) {
  .kit-grid {
    display: flex;
    gap: 12px;
    margin-inline: calc(var(--gut) * -1);
    padding-inline: var(--gut);
    padding-bottom: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .kit-grid figure {
    flex: 0 0 min(82vw, 330px);
    scroll-snap-align: start;
  }

  #kit-oficial .kit-grid figure img {
    height: 290px;
  }

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

  .wall li {
    min-height: 48px;
    padding: 4px;
  }

  .wall img {
    max-width: 86px;
    height: 30px;
  }

  .sponsor-panel {
    padding: 20px 16px;
  }

  .scroll-expand {
    height: 82svh;
  }

  .scroll-expand figure {
    height: 60svh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rb-split-text__word,
  .rb-blur-text__word,
  .rb-scroll-reveal__word {
    opacity: 1;
    filter: none;
    transform: none;
    clip-path: none;
    animation: none !important;
  }

  .rb-shiny-text {
    background: none;
    color: inherit;
    animation: none;
  }

  .curved-loop animate {
    display: none;
  }

}
