/* =========================================================
   Michael Jordan · 23 — estilos
   Orden: variables → base → componentes → secciones → utilidades
   Mobile-first: los estilos base son para celular y los
   @media (min-width) agregan cambios para pantallas grandes.
   ========================================================= */

:root {
  --bg: #0b0b0c;
  --bg-2: #141416;
  --bg-3: #1d1d21;
  --line: #2a2a2f;
  --text: #f2efe9;
  --muted: #9b968e;
  --red: #ce1141;
  --red-2: #ff3d6a;
  --blue: #3a6fd8;
  --gold: #e8b64a;

  --display: 'Anton', 'Impact', sans-serif;
  --sans: 'Inter', system-ui, sans-serif;

  --pad: clamp(16px, 4vw, 48px);
  --max: 1180px;
  --radius: 10px;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .01em; line-height: 1; }
:focus-visible { outline: 3px solid var(--red-2); outline-offset: 3px; }

.muted { color: var(--muted); }
.kicker { font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--red-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 100; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 6px; }
.skip:focus { top: 16px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--red); color: #fff; border: 0; border-radius: 999px;
  padding: 14px 24px; font-weight: 600; text-decoration: none;
  transition: background .2s, transform .2s;
}
.btn:hover { background: var(--red-2); transform: translateY(-2px); }

/* ===== Navegación ===== */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  transition: background .3s, padding .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav--solid { background: rgb(11 11 12 / .85); backdrop-filter: blur(12px); padding-block: 12px; border-color: var(--line); }
.nav__logo { font-family: var(--display); font-size: 1.6rem; text-decoration: none; letter-spacing: .04em; }
.nav__logo span { color: var(--red); }

.nav__toggle { position: relative; z-index: 2; width: 44px; height: 44px; background: none; border: 0; }
.nav__burger, .nav__burger::before, .nav__burger::after {
  position: absolute; left: 10px; width: 24px; height: 2px; background: currentColor; transition: transform .3s, opacity .3s;
}
.nav__burger { top: 21px; }
.nav__burger::before { content: ''; left: 0; top: -7px; }
.nav__burger::after { content: ''; left: 0; top: 7px; }
/* El ícono reacciona al atributo aria-expanded: el estado se guarda en un solo lugar */
[aria-expanded="true"] .nav__burger { background: transparent; }
[aria-expanded="true"] .nav__burger::before { transform: translateY(7px) rotate(45deg); }
[aria-expanded="true"] .nav__burger::after { transform: translateY(-7px) rotate(-45deg); }

.nav__menu {
  position: fixed; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 28px;
  padding: var(--pad); background: var(--bg);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.menu-open .nav__menu { opacity: 1; visibility: visible; }
.menu-open { overflow: hidden; }
.nav__menu a { font-family: var(--display); font-size: 2.6rem; text-transform: uppercase; text-decoration: none; }
.nav__menu a[aria-current] { color: var(--red); }

@media (min-width: 800px) {
  .nav__toggle { display: none; }
  .nav__menu { position: static; flex-direction: row; gap: 28px; padding: 0; background: none; opacity: 1; visibility: visible; }
  .nav__menu a { font-family: var(--sans); font-size: .9rem; font-weight: 500; text-transform: none; color: var(--muted); transition: color .2s; }
  .nav__menu a:hover, .nav__menu a[aria-current] { color: var(--text); }
  .nav__menu a[aria-current] { box-shadow: 0 2px 0 var(--red); }
}

/* ===== Portada ===== */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 100svh; display: grid; align-content: end; gap: 48px;
  padding: 120px var(--pad) 56px;
  background:
    radial-gradient(60% 50% at 80% 30%, rgb(206 17 65 / .25), transparent 70%),
    var(--bg);
}
/* El "23" gigante es solo texto con contorno: cero imágenes */
.hero__num {
  position: absolute; z-index: -1; right: -4vw; top: 50%; translate: 0 -55%;
  font-family: var(--display); font-size: clamp(16rem, 52vw, 44rem); line-height: .8;
  color: transparent; -webkit-text-stroke: 2px var(--red);
  opacity: .55; user-select: none;
}
.hero__title { font-size: clamp(4rem, 15vw, 11rem); line-height: .86; margin: 14px 0 22px; }
.hero__lead { max-width: 34ch; font-size: clamp(1.05rem, 2vw, 1.3rem); color: #cfcac2; margin-bottom: 30px; }
.hero__quote { max-width: 46ch; border-left: 3px solid var(--red); padding-left: 18px; color: var(--muted); font-style: italic; }

@media (min-width: 900px) {
  .hero { grid-template-columns: 1.4fr 1fr; align-items: end; }
}

/* ===== Secciones (estructura común) ===== */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(64px, 10vw, 120px) var(--pad); }
.section__head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 40px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.section__num { font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }
.section__head h2 { font-size: clamp(2.2rem, 6vw, 4rem); }

/* ===== 01 Números ===== */
.totals { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.total { background: var(--bg); padding: 28px 22px; display: flex; flex-direction: column; gap: 6px; }
.total strong { font-family: var(--display); font-weight: 400; font-size: clamp(2.8rem, 7vw, 4.4rem); line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.total span { color: var(--muted); font-size: .92rem; }
@media (min-width: 800px) { .totals { grid-template-columns: repeat(3, 1fr); } }

/* ===== 02 Gráfico ===== */
.chart-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.segmented { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.segmented button { border: 0; background: none; padding: 8px 14px; border-radius: 999px; font-size: .88rem; font-weight: 500; color: var(--muted); transition: background .2s, color .2s; }
.segmented button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.legend { list-style: none; padding: 0; display: flex; gap: 18px; font-size: .85rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 8px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw--chi { background: var(--red); }
.sw--was { background: var(--blue); }
.sw--ring { border: 2px solid var(--gold); border-radius: 50%; }

.chart-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 1000px) { .chart-layout { grid-template-columns: minmax(0, 1fr) 300px; } }

/* min-width: 0 → sin esto, un ítem de grid no puede ser más angosto que su contenido
   (el SVG mide 680px mínimo) y la página entera se desborda en el celular */
.chart { min-width: 0; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.chart__scroll { overflow-x: auto; }
.chart svg { display: block; width: 100%; min-width: 680px; height: auto; }
.chart figcaption { font-size: .85rem; color: var(--muted); margin-top: 10px; }

.chart .grid { stroke: var(--line); }
.chart .axis { fill: var(--muted); font-size: 13px; font-family: var(--sans); }
.chart .avg line { stroke: var(--text); stroke-dasharray: 6 6; opacity: .5; }
.chart .avg text { fill: var(--text); font-size: 13px; font-weight: 600; }
.chart .gap line { stroke: var(--muted); stroke-dasharray: 3 5; }
.chart .gap text { fill: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }

.bar { cursor: pointer; outline: none; }
.bar__hit { fill: transparent; }
.bar__fill {
  fill: var(--red); opacity: .55; transition: opacity .2s;
  /* las barras crecen desde abajo cada vez que se redibuja el gráfico */
  transform-box: fill-box; transform-origin: bottom;
  animation: grow .6s cubic-bezier(.2, .8, .2, 1) both;
}
.bar--was .bar__fill { fill: var(--blue); }
.bar__value { fill: var(--text); font-size: 12px; font-weight: 600; opacity: 0; transition: opacity .2s; }
.bar__ring { fill: none; stroke: var(--gold); stroke-width: 2.5; }
.bar:hover .bar__fill, .bar:focus-visible .bar__fill, .bar.is-selected .bar__fill { opacity: 1; }
.bar:hover .bar__value, .bar:focus-visible .bar__value, .bar.is-selected .bar__value { opacity: 1; }
.bar:focus-visible .bar__hit { fill: rgb(255 255 255 / .05); }
.bar.is-selected .bar__hit { fill: rgb(255 255 255 / .04); }
@keyframes grow { from { transform: scaleY(0); } }

/* Panel de detalle */
.detail { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; align-self: start; }
.detail__title { font-size: 3rem; margin: 6px 0 4px; }
.detail__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 20px 0; }
.detail__stats div { background: var(--bg-3); border-radius: 8px; padding: 10px; text-align: center; border: 1px solid transparent; }
.detail__stats div.is-active { border-color: var(--red); }
.detail__stats dt { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.detail__stats dd { font-family: var(--display); font-size: 1.6rem; }
.detail__note { margin-top: 16px; color: #cfcac2; font-size: .92rem; border-left: 2px solid var(--red); padding-left: 12px; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .78rem; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; color: #cfcac2; }
.chip--gold { border-color: var(--gold); color: var(--gold); }
@media (min-width: 600px) and (max-width: 999px) { .detail__stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ===== 03 Trayectoria ===== */
.timeline { list-style: none; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline__item { position: relative; display: grid; gap: 4px; padding: 0 0 36px 40px; }
.timeline__item::before { content: ''; position: absolute; left: 0; top: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--red); }
.timeline__year { font-family: var(--display); font-size: 1.6rem; color: var(--red-2); line-height: 1.1; }
.timeline__item h3 { font-size: 1.5rem; margin-bottom: 4px; }
.timeline__item p { color: var(--muted); max-width: 60ch; }
@media (min-width: 800px) {
  .timeline::before { left: 127px; }
  .timeline__item { grid-template-columns: 100px 1fr; gap: 56px; padding-left: 0; }
  .timeline__item::before { left: 120px; }
  .timeline__year { text-align: right; }
}

/* ===== 04 Momentos ===== */
.moments { display: grid; gap: 20px; }
@media (min-width: 800px) { .moments { grid-template-columns: repeat(3, 1fr); } }
.moment { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.moment__thumb { position: relative; display: block; padding: 0; border: 0; background: var(--bg-3); aspect-ratio: 16 / 9; overflow: hidden; }
.moment__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s, opacity .3s; opacity: .75; }
.moment__thumb:hover img, .moment__thumb:focus-visible img { transform: scale(1.05); opacity: 1; }
.moment__play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; background: var(--red); }
.moment__play::after { content: ''; position: absolute; left: 26px; top: 20px; border-left: 18px solid #fff; border-block: 12px solid transparent; }
.moment__body { padding: 20px; }
.moment__body h3 { font-size: 1.7rem; margin: 6px 0 8px; }
.moment__body p:last-child { color: var(--muted); font-size: .95rem; }

.video { width: min(960px, 92vw); padding: 0; border: 0; border-radius: var(--radius); background: #000; overflow: visible; }
.video::backdrop { background: rgb(0 0 0 / .85); }
.video__frame { aspect-ratio: 16 / 9; }
.video__frame iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.video__close { position: absolute; right: 0; top: -48px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--text); color: var(--bg); font-size: 1.6rem; line-height: 1; }

/* ===== 05 Trivia ===== */
.trivia { max-width: 720px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 40px); }
.trivia__top { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); }
.progress { height: 4px; background: var(--bg-3); border-radius: 4px; margin: 12px 0 28px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--red); transition: width .4s; }
.trivia__q { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.1; margin-bottom: 24px; }
.trivia__options { display: grid; gap: 10px; }
@media (min-width: 600px) { .trivia__options { grid-template-columns: 1fr 1fr; } }
.trivia__option { text-align: left; background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; font-weight: 500; transition: border-color .2s, background .2s; }
.trivia__option:hover:not(:disabled) { border-color: var(--text); }
.trivia__option:disabled { cursor: default; opacity: .6; }
.trivia__option.is-correct { background: rgb(46 160 90 / .2); border-color: #2ea05a; opacity: 1; }
.trivia__option.is-wrong { background: rgb(206 17 65 / .2); border-color: var(--red); opacity: 1; }
.trivia__feedback { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; color: #cfcac2; }
.trivia__feedback p { flex: 1 1 280px; }
.trivia__score { font-family: var(--display); font-size: 6rem; line-height: 1; margin: 8px 0; }
.trivia > .btn { margin-top: 24px; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--line); padding: 32px var(--pad); text-align: center; font-size: .9rem; display: grid; gap: 6px; }
.footer a { color: var(--red-2); }

.error { margin-top: 16px; padding: 14px; border: 1px solid var(--red); border-radius: 8px; }

/* ===== Animación de aparición ===== */
[data-reveal] { opacity: 0; translate: 0 24px; transition: opacity .7s, translate .7s; }
[data-reveal].is-visible { opacity: 1; translate: 0 0; }

/* Respeta la preferencia del sistema de "reducir movimiento" */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; translate: none; }
}
