@view-transition { navigation: auto; }

/* Paginas legales: terminos y privacidad. Mismo lenguaje visual del sitio, sin scripts. */
@font-face { font-family: "Shoulders"; src: url("../fonts/bigshoulders-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Shoulders"; src: url("../fonts/bigshoulders-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Shoulders"; src: url("../fonts/bigshoulders-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Shoulders"; src: url("../fonts/bigshoulders-700.woff2") format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-700.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-400.woff2") format("woff2"); font-weight: 300; font-display: swap; }

:root {
  --night: #141922;      /* noche de cancha, gris azulado, igual que la portada */
  --deep: #0e1219;
  --chalk: #f1eee5;
  --muted: rgba(241, 238, 229, .62);
  --soft: rgba(241, 238, 229, .84);
  --line: rgba(241, 238, 229, .13);
  --clay: #dcef45;       /* un solo acento en todo el sitio: el amarillo de la pelota */
  --gold: #dcef45;
  --ball: #dcef45;
  --blue: #13140f;       /* texto oscuro sobre la pelota */
  --display: "Shoulders", "Arial Narrow", sans-serif;
  --text: "Bricolage", system-ui, sans-serif;
  --gut: clamp(16px, 4vw, 56px);
  --max: 1180px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--night); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; min-height: 100vh; overflow-x: clip; background: var(--night); color: var(--chalk);
  font: 400 17px/1.65 var(--text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ball); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--ball); color: var(--blue); }

main { overflow-x: clip; }
.wrap { width: min(100% - var(--gut) * 2, var(--max)); margin-inline: auto; }

.skip { position: absolute; z-index: 10; left: var(--gut); top: 12px; padding: 10px 16px; border-radius: 999px; background: var(--ball); color: var(--blue);
  font: 800 16px/1 var(--display); text-transform: uppercase; letter-spacing: .04em; text-decoration: none; transform: translateY(-160%); }
.skip:focus-visible { transform: none; }

/* ---------- barra superior ---------- */
.top { padding: max(18px, env(safe-area-inset-top)) 0 18px; border-bottom: 1px solid var(--line); }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top__logo { flex: none; border-radius: 8px; }
.top__logo img { width: 110px; }
.top__back { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px 0 14px; border-radius: 999px; text-decoration: none;
  font: 800 17px/1 var(--display); text-transform: uppercase; letter-spacing: .05em; color: var(--chalk);
  box-shadow: inset 0 0 0 1.5px rgba(251, 249, 244, .4); transition: background-color .2s ease, color .2s ease, box-shadow .2s ease; }
.top__back svg { width: 16px; height: 16px; flex: none; transition: transform .2s ease; }
.top__back:hover { background: var(--chalk); color: var(--blue); box-shadow: inset 0 0 0 1.5px var(--chalk); }
.top__back:hover svg { transform: translateX(-3px); }

/* ---------- cabecera del documento ---------- */
.head { position: relative; padding: clamp(48px, 8vw, 104px) 0 clamp(36px, 5vw, 56px); }
.head::after { content: ""; position: absolute; z-index: -1; right: -6%; top: -30%; width: min(62vw, 640px); aspect-ratio: 1097 / 2377;
  background: url("../media/lines.svg") center / contain no-repeat; opacity: .06; transform: rotate(-24deg); pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 25%, transparent 80%); mask-image: radial-gradient(closest-side, #000 25%, transparent 80%); }
.head { isolation: isolate; }
.kicker { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 800 16px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.kicker::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--ball); box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .22); }
.head h1 { margin: 0; max-width: 16ch; font: 900 clamp(48px, 9.4vw, 128px)/.9 var(--display); text-transform: uppercase; letter-spacing: -.005em; text-wrap: balance; }
.head h1 span { color: var(--clay); }
.updated { margin: 24px 0 0; font-size: 15px; color: var(--muted); }
.updated time { color: var(--chalk); font-weight: 600; }
.lead { margin: 18px 0 0; max-width: 62ch; font-size: clamp(17px, 1.6vw, 19px); color: var(--soft); text-wrap: pretty; }

/* ---------- layout: indice + texto ---------- */
.doc { display: grid; grid-template-columns: minmax(0, 270px) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: start;
  padding-bottom: clamp(72px, 10vw, 128px); }

.toc { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.toc summary { list-style: none; font: 800 15px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 4px 0 14px; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; border-left: 1px solid var(--line); }
.toc li { counter-increment: toc; }
.toc a { display: grid; grid-template-columns: 26px 1fr; gap: 6px; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent;
  font-size: 14.5px; line-height: 1.35; color: var(--muted); text-decoration: none; transition: color .2s ease, border-color .2s ease; }
.toc a::before { content: counter(toc, decimal-leading-zero); font: 700 13px/1.5 var(--display); letter-spacing: .04em; color: rgba(227, 184, 78, .7); }
.toc a:hover { color: var(--chalk); border-left-color: var(--gold); }
.toc a:focus-visible { outline-offset: -2px; }

/* En escritorio el indice siempre esta abierto aunque el details este cerrado. */
@media (min-width: 961px) {
  .toc summary { pointer-events: none; }
  @supports selector(::details-content) {
    .toc details::details-content { content-visibility: visible; display: block; }
  }
}

/* ---------- cuerpo legal ---------- */
.body { max-width: 70ch; min-width: 0; counter-reset: sec; }
.body section { counter-increment: sec; padding-top: 8px; margin-bottom: clamp(40px, 5vw, 56px); scroll-margin-top: 24px; }
.body section:target h2::before { color: var(--ball); }
.body h2 { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 14px; margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
  font: 800 clamp(26px, 3vw, 34px)/1.02 var(--display); text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; }
.body h2::before { content: counter(sec, decimal-leading-zero); font: 800 .7em/1 var(--display); color: var(--gold); letter-spacing: .04em; transition: color .3s ease; }
.body h3 { margin: 26px 0 8px; font: 800 20px/1.15 var(--display); text-transform: uppercase; letter-spacing: .03em; color: var(--chalk); }
.body p, .body li { color: var(--soft); text-wrap: pretty; }
.body p { margin: 0 0 16px; }
.body ul { margin: 0 0 18px; padding: 0; list-style: none; }
.body ul li { position: relative; padding-left: 26px; margin-bottom: 9px; }
.body ul li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--clay); }
.body strong { color: var(--chalk); font-weight: 650; }
.body a { color: var(--chalk); text-decoration-color: var(--gold); text-decoration-thickness: 1.5px; text-underline-offset: 3px; overflow-wrap: anywhere;
  transition: color .2s ease, text-decoration-color .2s ease; }
.body a:hover { color: var(--ball); text-decoration-color: var(--ball); }
.body mark { background: rgba(225, 245, 74, .16); color: var(--ball); padding: 1px 6px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(225, 245, 74, .45);
  font-weight: 600; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

.note { margin: 6px 0 22px; padding: 18px 20px; border-radius: 16px; background: rgba(251, 249, 244, .045); box-shadow: inset 0 0 0 1px var(--line);
  border-left: 3px solid var(--gold); }
.note p:last-child { margin-bottom: 0; }

.facts { margin: 0 0 18px; padding: 4px 20px; border-radius: 16px; background: rgba(241, 238, 229, .04); box-shadow: inset 0 0 0 1px var(--line); }
.facts div { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr); gap: 4px 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { font: 800 15px/1.5 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; color: var(--chalk); min-width: 0; }

/* ---------- pie ---------- */
.foot { background: var(--deep); padding: clamp(40px, 6vw, 64px) 0 calc(28px + env(safe-area-inset-bottom)); }
.foot__grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px 40px; }
.foot__logo img { width: 120px; }
.foot__links { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0; padding: 0; list-style: none; }
.foot__links a { font: 800 17px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--soft); text-decoration: none; padding: 8px 0; display: inline-block; }
.foot__links a:hover { color: var(--ball); }
.foot__links a[aria-current="page"] { color: var(--gold); }
.foot__meta { flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding-top: 24px;
  border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.foot__meta p { margin: 0; }
.foot__meta a { color: var(--chalk); overflow-wrap: anywhere; }
.credit { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); text-decoration: none; }
.foot__meta .credit { color: var(--muted); }
.credit img { width: 58px; opacity: .85; transition: opacity .2s ease; }
.credit:hover img { opacity: 1; }

/* ---------- tablet y movil ---------- */
@media (max-width: 960px) {
  .doc { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .toc { position: static; max-height: none; overflow: visible; }
  .toc details { border-radius: 18px; background: rgba(241, 238, 229, .04); box-shadow: inset 0 0 0 1px var(--line); }
  .toc summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 20px; cursor: pointer; color: var(--chalk); font-size: 17px; }
  .toc summary::after { content: ""; width: 10px; height: 10px; margin-top: -4px; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(45deg); transition: transform .25s ease; }
  .toc details[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
  .toc summary:focus-visible { outline-offset: -3px; border-radius: 18px; }
  .toc ol { margin: 0 20px 16px; }
  .body { max-width: none; }
}
@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .top__logo img { width: 96px; }
  .top__back { padding: 0 14px 0 12px; font-size: 16px; }
  .facts { padding: 2px 16px; }
  .facts div { grid-template-columns: minmax(0, 1fr); }
  .note { padding: 16px; }
  .foot__meta { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
