:root {
  --navy: #052b3d;
  --navy-deep: #031d2a;
  --lime: #c8ff00;
  --orange: #f04b19;
  --paper: #f4f1e9;
  --white: #fff;
  --ink-muted: #53646b;
  --line: rgba(5, 43, 61, .16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--navy); font-family: Montserrat, sans-serif; }
button, input, select { font: inherit; }
a { color: inherit; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 99; padding: .8rem 1rem; background: var(--lime); font-weight: 800; }
.skip-link:focus { top: 1rem; }

.site-header { min-height: 86px; padding: .8rem clamp(1.25rem, 5vw, 5rem); display: flex; align-items: center; justify-content: space-between; gap: 2rem; background: var(--navy-deep); color: white; border-bottom: 1px solid rgba(255,255,255,.14); }
.brand { display: flex; align-items: center; gap: 1rem; text-decoration: none; }
.brand img { width: 112px; height: 56px; object-fit: contain; }
.brand span { padding-left: 1rem; border-left: 1px solid rgba(255,255,255,.3); color: var(--lime); font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.site-header nav { display: flex; gap: clamp(1.1rem, 3vw, 2.8rem); }
.site-header nav a { padding: .45rem 0; color: rgba(255,255,255,.68); text-decoration: none; font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.site-header nav a:hover, .site-header nav a:focus-visible, .site-header nav .active { color: var(--lime); }

.results-hero { position: relative; overflow: hidden; padding: clamp(4rem, 8vw, 8rem) clamp(1.25rem, 7vw, 7.5rem) clamp(5rem, 9vw, 8.5rem); background: var(--navy); color: white; }
.results-hero::after { content: ""; position: absolute; width: 58vw; height: 58vw; right: -17vw; top: -28vw; border: 2px solid rgba(200,255,0,.25); border-radius: 46% 54% 54% 46%; transform: rotate(24deg); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(3rem, 8vw, 9rem); align-items: end; }
.eyebrow, .kicker { margin: 0 0 1.1rem; font-size: .72rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow { color: var(--lime); }
.eyebrow span { display: inline-block; width: 28px; height: 4px; margin-right: .6rem; background: var(--orange); vertical-align: middle; }
h1, h2 { margin: 0; font-family: "Barlow Condensed", sans-serif; font-weight: 900; letter-spacing: -.035em; line-height: .82; text-transform: uppercase; }
h1 { max-width: 720px; font-size: clamp(5.4rem, 13vw, 11rem); }
h1 em, .closing-cta em { color: transparent; font-style: italic; -webkit-text-stroke: 2px var(--lime); }
.hero-lead { max-width: 650px; margin: 2rem 0 0; color: rgba(255,255,255,.75); font-size: clamp(1rem, 2vw, 1.25rem); line-height: 1.65; }
.hero-stats { display: grid; gap: 1px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.13); }
.hero-stats div { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.4rem; background: rgba(3,29,42,.66); }
.hero-stats strong { font-family: "Barlow Condensed", sans-serif; color: var(--lime); font-size: clamp(1.7rem, 3vw, 2.55rem); font-weight: 900; text-transform: uppercase; }
.hero-stats span { color: rgba(255,255,255,.6); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-align: right; text-transform: uppercase; }
.hero-tape { position: absolute; z-index: 2; left: -2%; right: -2%; bottom: 1.25rem; padding: .55rem 0; overflow: hidden; background: var(--orange); color: white; font-family: "Barlow Condensed", sans-serif; font-size: clamp(1.3rem, 3vw, 2.1rem); font-weight: 900; letter-spacing: .08em; text-align: center; white-space: nowrap; transform: rotate(-1.2deg); }

.results-section { padding: clamp(5rem, 9vw, 9rem) clamp(1.25rem, 7vw, 7.5rem); }
.section-heading { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: end; margin-bottom: 3rem; }
.kicker { color: var(--orange); }
h2 { font-size: clamp(3.8rem, 8vw, 7.2rem); }
h2 span { color: transparent; -webkit-text-stroke: 2px var(--navy); }
.section-heading > p { max-width: 520px; margin: 0 0 .55rem; color: var(--ink-muted); line-height: 1.75; }

.filters { padding: clamp(1.25rem, 3vw, 2.2rem); background: white; border: 1px solid var(--line); box-shadow: 10px 10px 0 var(--navy); }
.filters label > span:first-child { display: block; margin-bottom: .55rem; font-size: .68rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.search-field { display: block; margin-bottom: 1.35rem; }
.search-control { position: relative; display: block; }
.search-control svg { position: absolute; left: 1rem; top: 50%; width: 22px; height: 22px; fill: none; stroke: var(--navy); stroke-linecap: round; stroke-width: 2; transform: translateY(-50%); }
input, select { width: 100%; min-height: 52px; border: 1px solid var(--line); border-radius: 0; background: #fbfaf6; color: var(--navy); }
input { padding: 0 1rem 0 3.25rem; font-size: 1rem; }
select { padding: 0 2.7rem 0 .9rem; cursor: pointer; }
input:focus, select:focus { outline: 3px solid rgba(200,255,0,.8); border-color: var(--navy); }
.filter-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 1rem; }
.filter-footer { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-top: 1.2rem; }
.filter-footer p { margin: 0; color: var(--ink-muted); font-size: .72rem; }
.filter-footer button, .empty-state button { padding: 0; border: 0; border-bottom: 2px solid var(--orange); background: none; color: var(--navy); cursor: pointer; font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }

.results-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 3.5rem 0 1rem; }
.results-toolbar p { margin: 0; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.results-toolbar strong { color: var(--orange); font-family: "Barlow Condensed", sans-serif; font-size: 1.8rem; }
.distance-pills { display: flex; gap: .4rem; }
.distance-pills button { min-width: 58px; padding: .65rem .9rem; border: 1px solid var(--navy); background: transparent; color: var(--navy); cursor: pointer; font-size: .72rem; font-weight: 900; }
.distance-pills button.active { background: var(--navy); color: var(--lime); }

.table-wrap { overflow-x: auto; border-top: 4px solid var(--navy); background: white; }
table { width: 100%; min-width: 980px; border-collapse: collapse; }
th { padding: 1rem .85rem; background: var(--navy); color: rgba(255,255,255,.7); font-size: .62rem; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 1rem .85rem; border-bottom: 1px solid var(--line); font-size: .78rem; }
tbody tr:hover { background: rgba(200,255,0,.13); }
.place { width: 78px; font-family: "Barlow Condensed", sans-serif; font-size: 1.55rem; font-weight: 900; }
.bib { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.runner-name { min-width: 230px; font-weight: 900; text-transform: capitalize; }
.distance-badge { display: inline-block; min-width: 42px; padding: .32rem .45rem; background: var(--lime); font-weight: 900; text-align: center; }
.gender-label, .category-label { white-space: nowrap; }
.pace { color: var(--ink-muted); white-space: nowrap; }
.time-heading, .result-time { text-align: right; }
.result-time { color: var(--orange); font-family: "Barlow Condensed", sans-serif; font-size: 1.45rem; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.medal { display: inline-grid; width: 28px; height: 28px; place-items: center; margin-right: .25rem; border-radius: 50%; background: var(--lime); font-size: .85rem; }
.empty-state { padding: 5rem 1.5rem; text-align: center; }
.empty-state strong { font-family: "Barlow Condensed", sans-serif; font-size: 2.5rem; text-transform: uppercase; }
.empty-state p { color: var(--ink-muted); }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-top: 2rem; }
.pagination button { min-width: 42px; height: 42px; border: 1px solid var(--line); background: white; color: var(--navy); cursor: pointer; font-size: .75rem; font-weight: 900; }
.pagination button[aria-current="page"] { background: var(--navy); color: var(--lime); }

.source-section { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(3rem, 8vw, 8rem); padding: clamp(5rem, 9vw, 9rem) clamp(1.25rem, 7vw, 7.5rem); background: #e8e4d9; }
.source-section > div > p:last-child { max-width: 540px; color: var(--ink-muted); line-height: 1.7; }
.pdf-groups { align-self: center; }
details { border-top: 1px solid rgba(5,43,61,.35); }
details:last-child { border-bottom: 1px solid rgba(5,43,61,.35); }
summary { display: flex; justify-content: space-between; gap: 1rem; padding: 1.35rem 0; cursor: pointer; font-family: "Barlow Condensed", sans-serif; font-size: 1.7rem; font-weight: 900; text-transform: uppercase; }
summary span { color: var(--orange); font-family: Montserrat, sans-serif; font-size: .64rem; letter-spacing: .08em; }
.pdf-links { display: grid; padding-bottom: 1.25rem; }
.pdf-links a { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.5); text-decoration: none; font-size: .8rem; font-weight: 700; }
.pdf-links a:hover { background: var(--lime); }
.pdf-links a span { font-size: .65rem; font-weight: 900; }

.closing-cta { padding: clamp(5rem, 10vw, 10rem) clamp(1.25rem, 7vw, 7.5rem); background: var(--orange); color: white; text-align: center; }
.closing-cta .eyebrow { color: var(--navy); }
.closing-cta h2 { font-size: clamp(5rem, 13vw, 11rem); }
.closing-actions { display: flex; justify-content: center; align-items: center; gap: 2rem; margin-top: 2.5rem; }
.button { display: inline-flex; min-height: 54px; align-items: center; padding: 0 1.4rem; background: var(--navy); color: white; box-shadow: 6px 6px 0 var(--lime); text-decoration: none; font-size: .75rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.text-link { color: white; font-size: .75rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
footer { padding: 2.2rem clamp(1.25rem, 5vw, 5rem); display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; gap: 2rem; background: var(--navy-deep); color: rgba(255,255,255,.62); font-size: .72rem; }
footer img { width: 110px; }
footer p { text-align: center; }
footer a { justify-self: end; color: var(--lime); font-weight: 800; text-decoration: none; text-transform: uppercase; }

@media (max-width: 980px) {
  .hero-grid, .section-heading, .source-section { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-stats { max-width: 620px; }
  .source-section { gap: 3rem; }
}

@media (max-width: 680px) {
  .site-header { min-height: 72px; padding: .5rem 1rem; }
  .brand img { width: 88px; height: 48px; }
  .brand span { display: none; }
  .site-header nav { gap: 1rem; }
  .site-header nav a:first-child { display: none; }
  .results-hero { padding-top: 4.5rem; }
  h1 { font-size: clamp(4.7rem, 24vw, 7rem); }
  .hero-grid { gap: 2.5rem; }
  .hero-stats div { padding: 1rem; }
  .hero-stats strong { font-size: 1.65rem; }
  .filter-grid { grid-template-columns: 1fr; }
  .filter-footer, .results-toolbar { align-items: flex-start; flex-direction: column; }
  .filters { box-shadow: 6px 6px 0 var(--navy); }
  .table-wrap { overflow: visible; background: transparent; }
  table { min-width: 0; }
  thead { display: none; }
  tbody { display: grid; gap: .8rem; }
  tbody tr { position: relative; display: grid; grid-template-columns: 72px 1fr auto; padding: 1rem; background: white; border: 1px solid var(--line); }
  td { padding: .25rem 0; border: 0; }
  td::before { display: block; color: var(--ink-muted); font-size: .56rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
  .place { grid-row: 1 / span 4; width: auto; font-size: 2rem; }
  .place::before { content: "Puesto"; }
  .runner-name { grid-column: 2 / 4; min-width: 0; font-size: .9rem; }
  .bib { grid-column: 2; }
  .bib::before { content: "Dorsal"; }
  .distance-cell { grid-column: 3; grid-row: 2; justify-self: end; }
  .gender-cell { grid-column: 2; }
  .gender-cell::before { content: "Rama"; }
  .category-cell { grid-column: 2 / 4; }
  .category-cell::before { content: "Categoría"; }
  .category-place { grid-column: 2; }
  .category-place::before { content: "Puesto cat."; }
  .pace { grid-column: 2; }
  .pace::before { content: "Ritmo"; }
  .result-time { grid-column: 3; grid-row: 3 / span 3; align-self: end; font-size: 1.35rem; }
  .result-time::before { content: "Tiempo"; text-align: right; }
  .closing-actions { flex-direction: column; }
  footer { grid-template-columns: 1fr; text-align: center; }
  footer img, footer a { justify-self: center; }
  footer p { margin: 0; }
}
