/* ============================================================
   SCRUM — Sistema de diseño
   Dirección: "Luz de reflector sobre pasto mojado"
   Verde botella dominante · granate puntual · cal de línea
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wdth,wght@0,62..125,300..900;1,62..125,300..900&family=Newsreader:ital,opsz,wght@0,6..72,300..800;1,6..72,300..800&display=swap');

:root {
  /* — Materiales del rugby — */
  --pitch:        #12291F;   /* verde botella: el "negro" de la marca */
  --pitch-deep:   #0B1A13;   /* fondo nocturno */
  --pitch-soft:   #1C3A2A;   /* elevación sobre pitch */
  --oxblood:      #8B1F2B;   /* granate de camiseta — único acento */
  --oxblood-lit:  #A82836;   /* hover del acento */
  --brass:        #B98B3C;   /* placa de club — solo ediciones limitadas */
  --brass-soft:   #D4AA61;

  /* — Neutros sesgados a verde (elegidos, no heredados) — */
  --chalk:        #F2EFE9;   /* línea de cal: fondo de compra */
  --chalk-warm:   #EDE8DE;
  --bone:         #DBD5C8;   /* bordes, divisores */
  --bone-deep:    #C4BDAC;
  --slate:        #6B7570;   /* gris verdoso: texto secundario */
  --slate-deep:   #48524D;
  --ink:          #131614;   /* texto sobre cal */

  /* — Roles semánticos (tema claro = default) — */
  --bg:           var(--chalk);
  --bg-raised:    #FFFFFF;
  --bg-sunken:    var(--chalk-warm);
  --fg:           var(--ink);
  --fg-muted:     var(--slate);
  --fg-faint:     var(--bone-deep);
  --line:         var(--bone);
  --line-strong:  var(--bone-deep);
  --accent:       var(--oxblood);
  --accent-fg:    #FFFFFF;

  /* — Tipografía — */
  --font-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-body:    'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-serif:   'Newsreader', Georgia, 'Times New Roman', serif;

  /* Escala fluida — razón 1.24 en móvil, 1.32 en desktop */
  --t-2xs:  0.6875rem;
  --t-xs:   0.75rem;
  --t-sm:   0.8125rem;
  --t-base: 0.9375rem;
  --t-md:   clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --t-lg:   clamp(1.18rem, 1.08rem + 0.5vw, 1.5rem);
  --t-xl:   clamp(1.5rem, 1.28rem + 1.1vw, 2.25rem);
  --t-2xl:  clamp(2rem, 1.5rem + 2.4vw, 3.5rem);
  --t-3xl:  clamp(2.6rem, 1.6rem + 4.6vw, 5.5rem);
  --t-4xl:  clamp(2.7rem, 1rem + 7.6vw, 10rem);

  /* — Espaciado: escala estricta base 4 — */
  --s-1:  0.25rem;  --s-2:  0.5rem;   --s-3:  0.75rem;  --s-4:  1rem;
  --s-5:  1.5rem;   --s-6:  2rem;     --s-7:  2.5rem;   --s-8:  3rem;
  --s-9:  4rem;     --s-10: 5rem;     --s-11: 6.5rem;   --s-12: 8rem;
  --s-13: 10rem;

  --section-y: clamp(4.5rem, 3rem + 6vw, 9rem);
  --gutter:    clamp(1.25rem, 0.6rem + 2.6vw, 3.5rem);
  --maxw:      88rem;
  --maxw-text: 34rem;

  /* — Forma — */
  --r-sm: 2px;
  --r-md: 3px;
  --r-lg: 4px;
  --hoop: 6px;             /* grosor de la franja estructural */

  /* — Sombras: sutiles, nunca genéricas — */
  --sh-sm: 0 1px 2px rgba(19, 22, 20, .06);
  --sh-md: 0 4px 16px -4px rgba(19, 22, 20, .10);
  --sh-lg: 0 24px 60px -20px rgba(19, 22, 20, .22);

  /* — Motion — */
  --ease:      cubic-bezier(.22, .61, .36, 1);
  --ease-out:  cubic-bezier(.16, 1, .3, 1);
  --ease-in:   cubic-bezier(.55, 0, .55, .2);
  --dur-fast:  160ms;
  --dur:       320ms;
  --dur-slow:  620ms;

  --nav-h: 68px;
}

/* Secciones invertidas: el mundo oscuro de la marca */
.invert {
  --bg:          var(--pitch);
  --bg-raised:   var(--pitch-soft);
  --bg-sunken:   var(--pitch-deep);
  --fg:          var(--chalk);
  --fg-muted:    #9FB0A6;
  --fg-faint:    #5E7268;
  --line:        rgba(242, 239, 233, .16);
  --line-strong: rgba(242, 239, 233, .32);
  --accent:      var(--brass);
  --accent-fg:   var(--pitch-deep);
  color: var(--fg);
  background: var(--bg);
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
  overflow-x: hidden;
}

img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; background: var(--bg-sunken); }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
table { border-collapse: collapse; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--oxblood); color: #fff; }
.invert ::selection { background: var(--brass); color: var(--pitch-deep); }

/* ============================================================
   Tipografía
   ============================================================ */

/* Display atlético: Archivo expandido. Energía de número de camiseta. */
.d1, .d2, .d3, .d4 {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 118;
  font-weight: 800;
  line-height: .86;
  letter-spacing: -.025em;
  word-spacing: .1em; /* la tracking negativa del display en mayúsculas puede pegar palabras cortas ("y") a la anterior */
  text-transform: uppercase;
  text-wrap: balance;
  max-width: 100%;
  overflow-wrap: break-word;
}
.d1 { font-size: var(--t-4xl); font-variation-settings: 'wdth' 122; letter-spacing: -.035em; }
@media (max-width: 480px) {
  .d1 { font-variation-settings: 'wdth' 100; letter-spacing: -.02em; }
}
.d2 { font-size: var(--t-3xl); }
.d3 { font-size: var(--t-2xl); letter-spacing: -.02em; }
.d4 { font-size: var(--t-xl); font-variation-settings: 'wdth' 112; letter-spacing: -.015em; }

/* Editorial: Newsreader. Solo storytelling, Journal, Historia. */
.serif {
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 72;
  font-weight: 400;
  letter-spacing: -.012em;
  line-height: 1.14;
  text-wrap: balance;
}
.serif-lg { font-size: var(--t-2xl); }
.serif-md { font-size: var(--t-xl); }
.serif-sm { font-size: var(--t-lg); line-height: 1.28; }

.lead {
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 20;
  font-size: var(--t-lg);
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: -.008em;
  color: var(--fg-muted);
  max-width: 42ch;
}

/* Etiqueta utilitaria: versalitas espaciadas */
.label {
  font-family: var(--font-display);
  font-size: var(--t-2xs);
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--fg-muted);
  font-variation-settings: 'wdth' 100;
}
.label--accent { color: var(--accent); }

.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

p { text-wrap: pretty; }
.prose { max-width: var(--maxw-text); }
.prose p + p { margin-top: 1.1em; }

/* ============================================================
   Layout
   ============================================================ */
.wrap {
  width: 100%;
  min-width: 0; /* evita que un .wrap dentro de grid/flex crezca por el min-content de su contenido */
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--wide { max-width: 104rem; }
.wrap--narrow { max-width: 62rem; }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * .6); }
.section--flush-top { padding-top: 0; }

.stack { display: flex; flex-direction: column; }
.stack-2 { gap: var(--s-2); } .stack-3 { gap: var(--s-3); }
.stack-4 { gap: var(--s-4); } .stack-5 { gap: var(--s-5); }
.stack-6 { gap: var(--s-6); } .stack-8 { gap: var(--s-8); }

.row { display: flex; align-items: center; }
.row-2 { gap: var(--s-2); } .row-3 { gap: var(--s-3); }
.row-4 { gap: var(--s-4); } .row-6 { gap: var(--s-6); }

.grid { display: grid; gap: var(--s-5); }

/* Cabecera de sección con la franja estructural */
.sec-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  padding-bottom: var(--s-6);
  margin-bottom: var(--s-8);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.sec-head::after {
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  width: clamp(64px, 12vw, 148px);
  height: var(--hoop);
  background: var(--accent);
  transform: translateY(50%);
}
.sec-head__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
}
.sec-head p { color: var(--fg-muted); max-width: 46ch; font-size: var(--t-md); }

@media (min-width: 900px) {
  .sec-head--split {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: end;
    gap: var(--s-8);
  }
}

/* ============================================================
   Utilidades
   ============================================================ */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: 200;
  background: var(--oxblood); color: #fff;
  padding: var(--s-3) var(--s-5);
  font-size: var(--t-xs); font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  transition: transform var(--dur) var(--ease-out);
}
.skip-link:focus { transform: translate(-50%, 0); }

.muted { color: var(--fg-muted); }
.center { text-align: center; }
.rule { height: 1px; background: var(--line); border: 0; }

/* Franja: el dispositivo estructural de la marca */
.hoop-bar {
  height: var(--hoop);
  background: var(--accent);
  width: 100%;
}
.hoops {
  height: 26px;
  background: repeating-linear-gradient(
    to bottom,
    var(--oxblood) 0 6px,
    transparent 6px 12px
  );
  opacity: .9;
}

/* Grano sutil — atmósfera, no ruido */
.grain::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Imagen: proporción fija para evitar layout shift */
.ratio { position: relative; overflow: hidden; background: var(--bg-sunken); }
.ratio > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ratio--portrait { aspect-ratio: 3 / 4; }
.ratio--tall     { aspect-ratio: 4 / 6; }
.ratio--square   { aspect-ratio: 1 / 1; }
.ratio--land     { aspect-ratio: 4 / 3; }
.ratio--wide     { aspect-ratio: 16 / 10; }
.ratio--cine     { aspect-ratio: 21 / 9; }

/* ============================================================
   Reveal al scroll — un gesto, no diez
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
