/* Fichas de piloto (/piloto/). Mismos colores y tipografías que la home; temas noche (por defecto) y día (html.day). */
:root {
  --bg: #0b0b0d; --bg-2: #141418; --card: #1a1a1f; --text: #f4f1ea; --muted: #a39e94;
  --gold: #d4a94f; --gold-2: #f0d48a; --red: #e0362c;
  --line: rgba(212, 169, 79, .28); --line-soft: rgba(255, 255, 255, .08);
  --velo-1: rgba(11, 11, 13, .97); --velo-2: rgba(11, 11, 13, .72); --sobre: #0b0b0d;
}
html.day {
  --bg: #f6f3ec; --bg-2: #ece7dc; --card: #ffffff; --text: #18171a; --muted: #5d584f;
  --gold: #946b1d; --gold-2: #b88a33; --red: #c32a21;
  --line: rgba(148, 107, 29, .35); --line-soft: rgba(0, 0, 0, .09);
  --velo-1: rgba(246, 243, 236, .97); --velo-2: rgba(246, 243, 236, .8); --sobre: #ffffff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; font-size: 17px; line-height: 1.6; overflow-x: hidden; }
a { color: inherit; }
img { max-width: 100%; }
.container { padding: 0 clamp(16px, 3vw, 48px); }
.display { font-family: "Barlow Condensed", Impact, sans-serif; font-weight: 800; text-transform: uppercase; line-height: .95; letter-spacing: .01em; }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.gold { background: linear-gradient(90deg, var(--gold), var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; font-style: normal; }
h2.display { font-size: clamp(34px, 4.600vw, 62px); margin-top: 8px; }
svg { flex: none; }

/* Barra superior */
header.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
header.top .container { display: flex; align-items: center; height: 64px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 40px; height: 40px; flex: none; }
.brand b { font-family: "Barlow Condensed", sans-serif; font-size: 24px; font-weight: 800; font-style: italic; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.brand b span, .foot-brand b span { color: var(--gold); }
nav.links { display: flex; gap: 24px; font-size: 15px; font-weight: 500; margin-left: clamp(12px, 3vw, 48px); }
nav.links a { text-decoration: none; color: var(--muted); }
nav.links a:hover, nav.links a[aria-current] { color: var(--text); }
.btn-area { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: 15px; font-weight: 600; white-space: nowrap; }
.btn-area:hover { border-color: var(--gold); color: var(--gold); }
.btn-area svg { width: 18px; height: 18px; color: var(--gold); }
.theme { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--gold); cursor: pointer; display: grid; place-items: center; flex: none; }
.theme svg { width: 20px; height: 20px; }
.theme .sun, html.day .theme .moon { display: none; }
html.day .theme .sun { display: block; }

/* Botones y etiquetas */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 24px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 16px; transition: transform .2s, border-color .2s; }
.btn svg { width: 18px; height: 18px; }
.btn:hover { border-color: var(--gold); transform: translateY(-2px); }
.btn.primary { background: linear-gradient(90deg, var(--gold), var(--gold-2)); color: #17130a; border-color: transparent; }
html.day .btn.primary { background: linear-gradient(90deg, #946b1d, #7a5714); color: #fff; }
.tag { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; font-weight: 600; background: color-mix(in srgb, var(--card) 70%, transparent); }
.tag svg { width: 16px; height: 16px; color: var(--gold); }
.tag.oro { background: linear-gradient(90deg, var(--gold), var(--gold-2)); color: #17130a; border-color: transparent; }
.tag.oro svg { color: #17130a; }
html.day .tag.oro { background: #946b1d; color: #fff; }
html.day .tag.oro svg { color: #fff; }
.migas { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 22px; }
.migas a { text-decoration: none; color: var(--muted); padding: 6px 0; }
.migas a:hover { color: var(--gold); }
.migas b { color: var(--text); font-weight: 600; padding: 6px 0; }
.migas span { padding: 6px 0; opacity: .5; }

/* Portada de la ficha */
.p-hero, .p-lista-hero, .p-cta { position: relative; isolation: isolate; overflow: hidden; }
.p-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.p-hero::before, .p-lista-hero::before, .p-cta::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, var(--velo-1) 0%, var(--velo-2) 55%, var(--velo-1) 100%), linear-gradient(0deg, var(--bg) 0%, transparent 30%); }
.p-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--red), var(--gold), transparent 80%); }
.p-dorsal { position: absolute; z-index: -1; right: clamp(300px, 36vw, 640px); opacity: .8; top: 50%; transform: translateY(-52%) skewX(-8deg); font: italic 800 clamp(260px, 44vw, 720px)/.8 "Barlow Condensed", Impact, sans-serif; color: transparent; -webkit-text-stroke: 2px var(--line); pointer-events: none; user-select: none; }
.p-hero-in { display: grid; grid-template-columns: minmax(0, 1fr) clamp(260px, 30vw, 460px); gap: clamp(24px, 5vw, 80px); align-items: center; padding-top: clamp(28px, 5vw, 64px); padding-bottom: clamp(36px, 6vw, 80px); }
.p-hero h1 { font-size: clamp(58px, 10.500vw, 176px); margin: 10px 0 18px; }
.p-hero h1 em { display: block; }
.p-titular { font-size: clamp(18px, 1.700vw, 24px); max-width: 46ch; color: var(--text); }
.p-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.p-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 30px; max-width: 900px; }
.p-datos > div { background: color-mix(in srgb, var(--card) 78%, transparent); border: 1px solid var(--line-soft); border-left: 3px solid var(--gold); border-radius: 12px; padding: 12px 16px; backdrop-filter: blur(6px); }
.p-datos dt { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.p-datos dt svg { width: 16px; height: 16px; color: var(--gold); }
.p-datos dd { font-weight: 600; font-size: 17px; margin-top: 2px; }
.p-datos dd small { font-weight: 400; color: var(--muted); font-size: 14px; white-space: nowrap; }
.p-retrato { position: relative; justify-self: end; width: 100%; }
.p-retrato::before { content: ""; position: absolute; inset: 18px -18px -18px 18px; border: 2px solid var(--gold); border-radius: 22px; z-index: -1; }
.p-foto { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 22px; background: #141418; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.p-foto.sin { display: grid; place-items: center; font: italic 800 clamp(90px, 12vw, 170px)/1 "Barlow Condensed", sans-serif; color: var(--gold); background: linear-gradient(160deg, var(--card), var(--bg-2)); border: 1px solid var(--line); }
.p-retrato figcaption { position: absolute; left: -14px; bottom: 26px; background: var(--red); color: #fff; font: italic 800 clamp(22px, 2.200vw, 32px)/1 "Barlow Condensed", sans-serif; text-transform: uppercase; padding: 10px 18px; transform: skewX(-8deg); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }

/* Cifras destacadas */
.p-cifras { background: var(--bg-2); border-bottom: 1px solid var(--line-soft); }
.p-cifras .container { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.cifra { padding: clamp(22px, 3vw, 40px) 16px; text-align: center; border-right: 1px solid var(--line-soft); }
.cifra:last-child { border-right: 0; }
.cifra b { display: block; font: italic 800 clamp(54px, 6.500vw, 104px)/.9 "Barlow Condensed", sans-serif; color: var(--gold); font-variant-numeric: tabular-nums; }
.cifra span { display: block; margin-top: 8px; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Secciones */
.p-sec { padding: clamp(48px, 7vw, 100px) 0; }
.p-sec.alt { background: var(--bg-2); }
.p-dos { display: grid; grid-template-columns: minmax(0, 1.250fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.p-bio p { margin-top: 18px; font-size: clamp(17px, 1.250vw, 20px); color: var(--text); }
.p-bio h2 + p::first-letter { font: 800 3.400em/.8 "Barlow Condensed", sans-serif; float: left; padding: 6px 10px 0 0; color: var(--gold); }
.enlace { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--gold); font-weight: 600; text-decoration: none; }
.enlace:hover { text-decoration: underline; }
.enlace svg { width: 18px; height: 18px; }
.p-kike { background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; position: sticky; top: 88px; }
.p-kike img { display: block; width: 100%; aspect-ratio: 16 / 8; object-fit: cover; object-position: 50% 30%; }
.p-kike > div { padding: clamp(20px, 2.500vw, 34px); }
.p-kike h2.display { font-size: clamp(28px, 2.800vw, 42px); }
.p-kike p { margin-top: 12px; color: var(--muted); }
.p-kike p:first-of-type + h2 + p { color: var(--text); font-weight: 500; }
.p-kike .btn { margin-top: 20px; }

/* Hitos */
.p-hitos { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin-top: 36px; }
.p-hitos li { position: relative; background: var(--card); border: 1px solid var(--line-soft); border-radius: 16px; padding: 24px 22px 22px; overflow: hidden; transition: transform .25s, border-color .25s; }
.p-hitos li::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(var(--gold), var(--red)); }
.p-hitos li:hover { transform: translateY(-4px); border-color: var(--line); }
.p-hitos .anio { font: italic 800 58px/.9 "Barlow Condensed", sans-serif; color: transparent; -webkit-text-stroke: 1.500px var(--gold); display: block; }
.p-hitos h3 { font: 800 25px/1.050 "Barlow Condensed", sans-serif; text-transform: uppercase; margin: 12px 0 8px; }
.p-hitos p { color: var(--muted); font-size: 16px; }

/* Trayectoria */
.p-tabla { margin-top: 32px; overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 16px; background: var(--card); }
.p-tabla table { width: 100%; border-collapse: collapse; min-width: 720px; }
.p-tabla th, .p-tabla td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line-soft); font-size: 16px; }
.p-tabla thead th { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--bg-2); }
.p-tabla tbody th { font: 800 22px/1 "Barlow Condensed", sans-serif; color: var(--gold); }
.p-tabla tbody tr:last-child th, .p-tabla tbody tr:last-child td { border-bottom: 0; }
.p-tabla .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-tabla tbody tr:hover { background: color-mix(in srgb, var(--gold) 6%, transparent); }
.p-tabla tr.top { background: color-mix(in srgb, var(--gold) 13%, transparent); }
.p-tabla tr.top td:last-child b { color: var(--gold); font-size: 19px; }
.p-sub { font: 800 clamp(24px, 2.400vw, 34px)/1 "Barlow Condensed", sans-serif; text-transform: uppercase; margin-top: 44px; }
.p-camps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 18px; }
.camp { background: var(--card); border: 1px solid var(--line-soft); border-radius: 16px; padding: 22px; }
.camp h4 { font: 800 26px/1 "Barlow Condensed", sans-serif; text-transform: uppercase; }
.camp .anios { color: var(--muted); font-size: 14px; margin-top: 4px; }
.camp dl { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 16px; }
.camp dl div { text-align: center; background: var(--bg-2); border-radius: 10px; padding: 10px 2px; }
.camp dt { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.camp dd { font: 800 28px/1.100 "Barlow Condensed", sans-serif; color: var(--gold); font-variant-numeric: tabular-nums; }

/* Fuentes */
.p-fuentes { padding: 22px 0; border-top: 1px solid var(--line-soft); font-size: 14px; color: var(--muted); }
.p-fuentes p + p { margin-top: 6px; }
.p-fuentes a { color: var(--gold); }

/* Tarjetas de piloto (listado y «otros pilotos») */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 28px; }
.pcard { position: relative; display: block; text-decoration: none; border-radius: 16px; overflow: hidden; background: var(--card); border: 1px solid var(--line-soft); aspect-ratio: 4 / 5; transition: transform .25s, border-color .25s, box-shadow .25s; }
.pcard:hover, .pcard:focus-visible { transform: translateY(-5px); border-color: var(--gold); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.pcard.es-campeon { border-color: var(--line); }
.pcard-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; transition: transform .5s; }
.pcard:hover .pcard-foto { transform: scale(1.060); }
.pcard-foto.sin { display: grid; place-items: center; padding-bottom: 28%; font: italic 800 72px/1 "Barlow Condensed", sans-serif; color: rgba(212, 169, 79, .5); background: linear-gradient(160deg, #1d1d23, #101013); }
.pcard-txt { position: absolute; inset: auto 0 0 0; padding: 46px 14px 14px; background: linear-gradient(0deg, rgba(8, 8, 10, .96) 35%, transparent); color: #f4f1ea; display: block; }
.pcard-cat { display: block; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #f0d48a; }
.pcard h3 { font: 800 25px/1 "Barlow Condensed", sans-serif; text-transform: uppercase; margin: 4px 0 2px; }
.pcard-rel { display: block; font-size: 13px; color: #c9c4b8; }
.p-mas { margin-top: 30px; }
.p-pasa { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-soft); }
.p-pasa a { display: flex; align-items: center; gap: 14px; padding: clamp(18px, 3vw, 34px) clamp(16px, 3vw, 48px); text-decoration: none; min-height: 72px; }
.p-pasa a + a { justify-content: flex-end; text-align: right; border-left: 1px solid var(--line-soft); }
.p-pasa a:hover { background: var(--bg-2); }
.p-pasa svg { width: 22px; height: 22px; color: var(--gold); }
.p-pasa small { display: block; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.p-pasa b { font: 800 clamp(20px, 2.200vw, 32px)/1.050 "Barlow Condensed", sans-serif; text-transform: uppercase; }

/* Listado */
.p-lista-hero { padding: clamp(28px, 5vw, 64px) 0 clamp(36px, 5vw, 70px); }
.p-lista-hero h1 { font-size: clamp(44px, 7vw, 112px); margin: 10px 0 18px; max-width: 18ch; }
.p-lista-hero .p-titular { max-width: 70ch; }
.p-grupo { padding: clamp(28px, 4vw, 56px) 0; }
.p-grupo h2 small { font-size: .450em; color: var(--muted); font-style: italic; vertical-align: middle; margin-left: 8px; }
.p-vacio { text-align: center; }
.p-vacio h1 { font-size: clamp(44px, 7vw, 96px); margin: 10px 0 16px; }

/* Llamada final y pie */
.p-cta { padding: clamp(56px, 8vw, 120px) 0; text-align: center; border-top: 1px solid var(--line-soft); }
.p-cta p { max-width: 60ch; margin: 16px auto 26px; color: var(--text); }
footer { border-top: 1px solid var(--line-soft); padding: 34px 0 44px; color: var(--muted); font-size: 15px; }
footer .container { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.foot-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.foot-brand b { font: italic 800 22px "Barlow Condensed", sans-serif; text-transform: uppercase; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; flex: 1; }
.foot-links a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.foot-links a:hover { color: var(--gold); }

/* Aparición */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }
a:focus-visible, button:focus-visible, .p-tabla:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

@media (max-width: 1000px) {
  nav.links { display: none; }
  .p-dos { grid-template-columns: 1fr; }
  .p-kike { position: static; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .brand b { font-size: 20px; }
  .btn-area { padding: 0; width: 44px; justify-content: center; }
  .btn-area span { display: none; }
  .p-hero-in { grid-template-columns: 1fr; gap: 26px; padding-top: 18px; }
  .p-retrato { order: -1; width: min(72%, 300px); justify-self: start; margin-left: 4px; }
  .p-retrato::before { inset: 12px -12px -12px 12px; }
  .p-dorsal { right: -6vw; top: 150px; transform: skewX(-8deg); font-size: 300px; }
  .migas { margin-bottom: 12px; }
  .p-datos { grid-template-columns: 1fr 1fr; gap: 8px; }
  .p-datos > div { padding: 10px 12px; }
  .p-datos dd { font-size: 15px; }
  .p-cifras .container { grid-template-columns: 1fr 1fr; padding: 0; }
  .cifra { border-bottom: 1px solid var(--line-soft); }
  .cifra:nth-child(2n) { border-right: 0; }
  .p-hitos { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 28px -16px 0; padding: 0 16px 8px; scrollbar-width: none; }
  .p-hitos::-webkit-scrollbar, .carrusel::-webkit-scrollbar { display: none; }
  .p-hitos li { flex: 0 0 80%; scroll-snap-align: start; }
  .carrusel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 24px -16px 0; padding: 0 16px 8px; scrollbar-width: none; }
  .carrusel .pcard { flex: 0 0 46%; scroll-snap-align: start; }
  .pgrid:not(.carrusel) { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pcard h3 { font-size: 21px; }
  .camp dl { gap: 4px; }
  .camp dd { font-size: 23px; }
  /* Trayectoria en tarjetas, sin desplazamiento lateral */
  .p-tabla { border: 0; background: none; overflow: visible; }
  .p-tabla table { min-width: 0; display: block; }
  .p-tabla thead { display: none; }
  .p-tabla tbody { display: grid; gap: 10px; }
  .p-tabla tbody tr { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; align-items: center; background: var(--card); border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px 14px; }
  .p-tabla tbody th, .p-tabla tbody td { padding: 0; border: 0; }
  .p-tabla tbody th { grid-row: 1 / 3; font-size: 26px; }
  .p-tabla td:nth-child(2) { font-weight: 600; }
  .p-tabla td:nth-child(3) { grid-column: 2; grid-row: 2; color: var(--muted); font-size: 14px; }
  .p-tabla td:nth-child(4), .p-tabla td:nth-child(5), .p-tabla td:nth-child(6) { display: none; }
  .p-tabla td:nth-child(7) { grid-column: 3; grid-row: 1 / 3; font-size: 19px; }
  .p-pasa a { padding: 16px; gap: 8px; }
  /* Pie: marca arriba, enlaces en dos columnas y copyright debajo */
  footer { padding: 28px 0 calc(32px + env(safe-area-inset-bottom)); }
  footer .container { flex-direction: column; align-items: stretch; gap: 16px; }
  .foot-links { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 8px 0; }
  .foot-links a { min-height: 44px; line-height: 1.25; }
}
