/* =========================================================
   Juan Manuel Cavallo — estilos del sitio
   Requiere tokens.css. Cada sección elige un tema:
   .theme-night / .theme-day / .theme-day-sunk / .theme-accent
   ========================================================= */

/* ================= BASE ================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + var(--space-sm));
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    min-height: 100svh;
    font-family: var(--font-text);
    font-size: var(--text-body);
    line-height: 1.6;
    background: var(--night);
    color: var(--on-day);
    font-kerning: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg,
picture,
iframe {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

button {
    font: inherit;
    color: inherit;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

h1,
h2,
h3 {
    line-height: 1.05;
    text-wrap: balance;
}

p,
li,
dd {
    text-wrap: pretty;
}

[role="list"] {
    list-style: none;
    padding: 0;
}

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

/* ================= TEMAS POR SECCIÓN ================= */
.theme-night {
    --bg: var(--night);
    --fg: var(--on-night);
    --muted: var(--on-night-muted);
    --line: var(--night-line);
    --accent-text: var(--accent);
    --focus: var(--accent);
    background: var(--bg);
    color: var(--fg);
    line-height: 1.65;
}

.theme-day,
.theme-day-sunk {
    --bg: var(--day);
    --fg: var(--on-day);
    --muted: var(--on-day-muted);
    --line: var(--day-line);
    --accent-text: var(--accent-ink);
    --focus: var(--accent-ink);
    background: var(--bg);
    color: var(--fg);
}

.theme-day-sunk {
    --bg: var(--day-sunk);
    --line: var(--day-sunk-line);
}

.theme-accent {
    --bg: var(--accent);
    --fg: var(--on-accent);
    --muted: var(--on-accent-muted);
    --line: var(--accent-line);
    --accent-text: var(--on-accent);
    --focus: var(--on-accent);
    background: var(--bg);
    color: var(--fg);
}

/* ================= UTILIDADES ================= */
.wrap {
    width: min(100% - 2 * var(--gutter), var(--content-max));
    margin-inline: auto;
}

.section {
    padding-block: var(--section-y);
}

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

.skip-link {
    position: fixed;
    top: var(--space-xs);
    left: var(--space-xs);
    z-index: var(--z-skip);
    padding: 0.75rem 1rem;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius);
    transform: translateY(-160%);
    transition: transform var(--dur) var(--ease-out);
}

.skip-link:focus-visible {
    transform: none;
    outline-color: var(--on-night);
}

/* ================= TIPOGRAFÍA ================= */
.display {
    font-family: var(--font-display);
    font-size: var(--text-display);
    font-weight: 800;
    font-stretch: 62%;
    line-height: 0.88;
    letter-spacing: -0.005em;
    text-transform: uppercase;
}

.h2 {
    font-family: var(--font-display);
    font-size: var(--text-h2);
    font-weight: 800;
    font-stretch: 66%;
    line-height: 0.95;
    text-transform: uppercase;
}

.h3 {
    font-size: var(--text-h3);
    font-weight: 700;
    font-stretch: 88%;
    line-height: 1.15;
}

.lead {
    max-width: 58ch;
    font-size: var(--text-lead);
    line-height: 1.5;
    color: var(--muted);
}

.prose {
    max-width: 65ch;
    font-size: 1.1875rem;
    line-height: 1.65;
}

.prose p + p {
    margin-top: var(--space-md);
}

/* ================= ENCABEZADOS DE SECCIÓN ================= */
.section-head {
    display: grid;
    gap: var(--space-sm);
    margin-block-end: var(--space-xl);
}

.section-head > .btn,
.section-head > .link-arrow {
    justify-self: start;
    margin-top: var(--space-2xs);
}

.split {
    display: grid;
    gap: var(--space-xl);
}

.split > .section-head {
    margin-block-end: 0;
}

@media (min-width: 60rem) {
    .section-head--row {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        column-gap: var(--space-xl);
    }

    .section-head--row > .link-arrow {
        margin-top: 0;
    }

    .split {
        grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
        column-gap: var(--space-2xl);
        align-items: start;
    }

    .split > .section-head {
        position: sticky;
        top: calc(var(--header-h) + var(--space-lg));
    }
}

/* ================= BOTONES Y LINKS ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: 3rem;
    padding: 0.75rem 1.375rem;
    font-size: 1rem;
    font-weight: 700;
    font-stretch: 88%;
    line-height: 1.2;
    letter-spacing: 0.01em;
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition:
        background-color var(--dur-fast) var(--ease-out),
        border-color var(--dur-fast) var(--ease-out),
        color var(--dur-fast) var(--ease-out),
        transform var(--dur-fast) var(--ease-out);
}

.btn:active {
    transform: scale(0.97);
}

.btn svg {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
}

.btn--accent {
    background: var(--accent);
    color: var(--on-accent);
}

.btn--accent:hover {
    background: var(--accent-strong);
}

.btn--line {
    border-color: color-mix(in oklch, currentColor 55%, transparent);
    color: var(--fg, inherit);
}

.btn--line:hover {
    border-color: currentColor;
    background: color-mix(in oklch, currentColor 8%, transparent);
}

.btn--sm {
    min-height: 2.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    font-weight: 700;
    font-stretch: 90%;
    color: var(--accent-text);
    text-decoration: underline;
    text-decoration-color: color-mix(in oklch, currentColor 40%, transparent);
    text-underline-offset: 0.3em;
    transition: text-decoration-color var(--dur-fast) var(--ease-out);
}

.link-arrow svg {
    flex: none;
    width: 1.125rem;
    height: 1.125rem;
    transition: transform var(--dur) var(--ease-out);
}

.link-arrow:hover {
    text-decoration-color: currentColor;
}

@media (hover: hover) and (pointer: fine) {
    .link-arrow:hover svg {
        transform: translateX(4px);
    }
}

/* ================= HEADER Y NAVEGACIÓN ================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: var(--night);
    color: var(--on-night);
    border-bottom: 1px solid var(--night-line);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-height: var(--header-h);
}

.brand {
    display: grid;
    margin-inline-end: auto;
    padding-block: var(--space-2xs);
    line-height: 1;
    text-decoration: none;
}

.brand__name {
    font-family: var(--font-display);
    font-size: 1.625rem;
    font-weight: 800;
    font-stretch: 66%;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.brand__role {
    margin-top: 0.3rem;
    font-size: var(--text-xs);
    font-weight: 600;
    font-stretch: 90%;
    letter-spacing: 0.04em;
    color: var(--on-night-muted);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.site-nav__list {
    display: flex;
    gap: var(--space-3xs);
}

.site-nav__list a {
    position: relative;
    display: block;
    padding: 0.625rem 0.75rem;
    font-weight: 600;
    font-stretch: 90%;
    color: var(--on-night-muted);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-out);
}

.site-nav__list a:hover,
.site-nav__list a[aria-current="page"] {
    color: var(--on-night);
}

.site-nav__list a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.3rem;
    height: 2px;
    background: var(--accent);
}

.site-nav__tools {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.lang-toggle,
.menu-btn {
    align-items: center;
    gap: 0.5rem;
    min-height: 2.5rem;
    padding: 0.5rem 0.875rem;
    background: none;
    border: 1px solid var(--night-line);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 600;
    font-stretch: 90%;
    cursor: pointer;
    transition:
        border-color var(--dur-fast) var(--ease-out),
        transform var(--dur-fast) var(--ease-out);
}

.lang-toggle:hover,
.menu-btn:hover {
    border-color: var(--on-night-muted);
}

.lang-toggle:active,
.menu-btn:active {
    transform: scale(0.97);
}

.lang-toggle svg,
.menu-btn svg {
    width: 1.125rem;
    height: 1.125rem;
}

.lang-toggle,
.menu-btn {
    display: none;
}

.js .lang-toggle {
    display: inline-flex;
}

.menu-btn__icon line {
    transform-box: fill-box;
    transform-origin: center;
    transition:
        transform 200ms var(--ease-out),
        opacity var(--dur-fast) var(--ease-out);
}

.menu-btn[aria-expanded="true"] .menu-btn__icon .l1 {
    transform: translateY(6px) rotate(45deg);
}

.menu-btn[aria-expanded="true"] .menu-btn__icon .l2 {
    opacity: 0;
}

.menu-btn[aria-expanded="true"] .menu-btn__icon .l3 {
    transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 55.99rem) {
    html:not(.js) .site-header {
        position: static;
    }

    .site-header__inner {
        flex-wrap: wrap;
        column-gap: var(--space-sm);
    }

    .js .menu-btn {
        display: inline-flex;
        min-height: 2.75rem;
    }

    .site-nav {
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
        padding-block: var(--space-2xs) var(--space-lg);
    }

    .js .site-nav {
        display: none;
        opacity: 0;
        transform: translateY(-0.5rem);
    }

    .js .site-header[data-open] .site-nav {
        display: flex;
        opacity: 1;
        transform: none;
    }

    .site-nav__list {
        flex-direction: column;
        gap: 0;
        border-top: 1px solid var(--night-line);
    }

    .site-nav__list a {
        display: flex;
        align-items: center;
        min-height: 3.25rem;
        padding: 0.75rem 0;
        font-size: 1.25rem;
        border-bottom: 1px solid var(--night-line);
    }

    .site-nav__list a[aria-current="page"]::after {
        left: auto;
        right: 0;
        top: 50%;
        bottom: auto;
        width: 0.5rem;
        height: 0.5rem;
        transform: translateY(-50%);
    }

    .site-nav__tools {
        gap: var(--space-xs);
    }

    .site-nav__tools .btn {
        flex: 1;
        min-height: 3rem;
    }

    .site-nav__tools .lang-toggle {
        min-height: 3rem;
    }

    /* Transición (no keyframes): se puede abrir y cerrar rápido sin que salte */
    @media (prefers-reduced-motion: no-preference) {
        .js .site-nav {
            transition:
                opacity 150ms var(--ease-out),
                transform 150ms var(--ease-out),
                display 150ms allow-discrete;
        }

        .js .site-header[data-open] .site-nav {
            transition:
                opacity 200ms var(--ease-out),
                transform 200ms var(--ease-out),
                display 200ms allow-discrete;

            @starting-style {
                opacity: 0;
                transform: translateY(-0.5rem);
            }
        }
    }
}

/* ================= HERO (PORTADA) ================= */
.hero {
    position: relative;
    isolation: isolate;
    overflow: clip;
}

.hero__media {
    position: relative;
}

.hero__media img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: 78% 40%;
}

.hero__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            var(--night) 0%,
            oklch(0.17 0.018 255 / 0.8) 20%,
            oklch(0.17 0.018 255 / 0) 50%);
}

.hero__content {
    position: relative;
    display: grid;
    justify-items: start;
    gap: var(--space-md);
    margin-top: -4.5rem;
    padding-block-end: var(--space-2xl);
}

.hero__kicker {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: var(--text-sm);
    font-weight: 700;
    font-stretch: 90%;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

.hero__kicker img {
    width: 1.5rem;
    height: auto;
    border-radius: 2px;
}

.hero__title .line {
    display: block;
    overflow: clip;
    padding-block-end: 0.04em;
}

.hero__title .line > span {
    display: block;
}

.hero__creds {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs) var(--space-md);
    max-width: 40rem;
    font-size: 1.0625rem;
    font-weight: 500;
}

.hero__creds li {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.hero__creds li::before {
    content: "";
    flex: none;
    width: 0.4375rem;
    height: 0.4375rem;
    background: var(--accent);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    width: 100%;
    margin-top: var(--space-2xs);
}

.hero__actions .btn {
    flex: 1 1 auto;
}

@media (min-width: 37.5rem) {
    .hero__media img {
        aspect-ratio: 16 / 10;
    }

    .hero__actions {
        width: auto;
    }

    .hero__actions .btn {
        flex: 0 0 auto;
    }
}

@media (min-width: 64rem) {
    .hero {
        display: grid;
        align-items: end;
        min-height: clamp(36rem, calc(100svh - var(--header-h)), 54rem);
    }

    .hero__media {
        position: absolute;
        inset: 0;
        z-index: -1;
    }

    .hero__media img {
        height: 100%;
        aspect-ratio: auto;
        object-position: 60% 42%;
    }

    .hero__media::after {
        background:
            linear-gradient(90deg,
                oklch(0.17 0.018 255 / 0.94) 0%,
                oklch(0.17 0.018 255 / 0.8) 32%,
                oklch(0.17 0.018 255 / 0.2) 60%,
                oklch(0.17 0.018 255 / 0) 78%),
            linear-gradient(to top, oklch(0.17 0.018 255 / 0.75), transparent 30%);
    }

    .hero__content {
        margin-top: 0;
        padding-block: var(--space-3xl) var(--space-2xl);
    }

    .hero__creds {
        display: grid;
        font-size: 1.1875rem;
    }
}

@media (min-width: 80rem) {
    .hero__creds {
        grid-template-columns: repeat(2, max-content);
        column-gap: var(--space-lg);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .hero__media img {
        animation: hero-settle 1.6s var(--ease-out) both;
    }

    .hero__title .line > span {
        animation: line-up 0.9s var(--ease-out) both;
        animation-delay: calc(80ms + var(--i, 0) * 90ms);
    }

    .hero__kicker,
    .hero__creds li,
    .hero__actions {
        animation: fade-up 0.7s var(--ease-out) both;
    }

    .hero__creds li {
        animation-delay: calc(360ms + var(--i, 0) * 60ms);
    }

    .hero__actions {
        animation-delay: 640ms;
    }
}

/* Al hacer scroll, la foto se desplaza más lento que la página y se oscurece.
   Solo escritorio: en móvil la foto queda debajo del texto y le quitaría legibilidad. */
@supports (animation-timeline: view()) {
    @media (min-width: 64rem) and (prefers-reduced-motion: no-preference) {
        .hero__media {
            animation: hero-drift linear both;
            animation-timeline: view();
            animation-range: exit 0% exit 100%;
        }
    }
}

@keyframes hero-drift {
    to {
        transform: translateY(18%);
        opacity: 0.4;
    }
}

@keyframes hero-settle {
    from {
        transform: scale(1.06);
        filter: brightness(0.55);
    }
}

@keyframes line-up {
    from {
        transform: translateY(105%);
    }
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(0.75rem);
    }
}

/* ================= HERO DE PÁGINAS INTERNAS ================= */
.page-hero {
    display: grid;
    container-type: inline-size;
}

.page-hero__media {
    order: -1;
    margin: 0;
}

.page-hero__media img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.page-hero__text {
    display: grid;
    align-content: end;
    justify-items: start;
    gap: var(--space-md);
    padding: var(--space-lg) var(--gutter) var(--space-2xl);
}

.page-hero__crumb {
    font-size: var(--text-sm);
    font-weight: 700;
    font-stretch: 90%;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

@media (min-width: 56rem) {
    .page-hero {
        grid-template-columns: minmax(0, 1fr) min(50%, 45rem);
        min-height: 32rem;
    }

    .page-hero__media {
        position: relative;
        order: 0;
    }

    .page-hero__media img {
        position: absolute;
        inset: 0;
        height: 100%;
        aspect-ratio: auto;
    }

    .page-hero__text {
        align-content: center;
        padding-block: var(--space-2xl);
        padding-inline: max(var(--gutter), calc((100cqi - var(--content-max)) / 2)) var(--space-2xl);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .page-hero__text > * {
        animation: fade-up 0.7s var(--ease-out) both;
        animation-delay: calc(60ms + var(--i, 0) * 90ms);
    }

    .page-hero__media img {
        animation: media-in 1.1s var(--ease-out) both;
    }
}

@keyframes media-in {
    from {
        clip-path: inset(0 0 0 100%);
    }
}

/* ================= FICHA TÉCNICA ================= */
.facts {
    border-top: 1px solid var(--line);
}

.facts__row {
    display: grid;
    gap: 0.125rem var(--space-lg);
    padding-block: var(--space-sm);
    border-bottom: 1px solid var(--line);
}

.facts dt {
    font-size: var(--text-sm);
    font-weight: 650;
    font-stretch: 90%;
    color: var(--muted);
}

.facts dd {
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.45;
}

@media (min-width: 40rem) {
    .facts__row {
        grid-template-columns: 10rem minmax(0, 1fr);
        align-items: baseline;
        padding-block: var(--space-md);
    }
}

/* ================= MISIÓN ================= */
.mission__grid {
    display: grid;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.mission__item {
    position: relative;
    display: grid;
    align-content: start;
    gap: var(--space-xs);
    padding-top: var(--space-md);
}

/* Línea superior como pseudo-elemento para poder dibujarla con transform */
.mission__item::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: var(--fg);
    transform-origin: left;
}

.mission__item h3 {
    font-size: 1.0625rem;
    font-weight: 800;
    font-stretch: 75%;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.mission__item p {
    font-size: var(--text-lead);
    font-weight: 500;
    line-height: 1.4;
}

@media (min-width: 56rem) {
    .mission__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ================= LÍNEA DE TIEMPO (ENTRENADOR) ================= */
.timeline {
    border-top: 1px solid var(--line);
}

.stint {
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr);
    grid-template-areas:
        "crest season"
        "crest body";
    column-gap: var(--space-sm);
    row-gap: var(--space-3xs);
    padding-block: var(--space-lg);
    border-bottom: 1px solid var(--line);
}

.stint__season {
    grid-area: season;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    font-stretch: 62%;
    line-height: 1;
    color: var(--accent-text);
    font-variant-numeric: tabular-nums;
}

.stint__crest {
    grid-area: crest;
    width: 3.5rem;
    height: 3.5rem;
    object-fit: contain;
}

.stint__body {
    grid-area: body;
    display: grid;
    gap: var(--space-3xs);
}

.stint__club {
    font-size: var(--text-h3);
    font-weight: 750;
    font-stretch: 88%;
    line-height: 1.2;
}

.stint__meta {
    color: var(--muted);
}

.stint__role {
    font-weight: 600;
}

.ticks {
    display: grid;
    gap: 0.375rem;
    margin-top: var(--space-xs);
}

.ticks li {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.ticks li::before {
    content: "";
    flex: none;
    width: 0.4375rem;
    height: 0.4375rem;
    background: var(--accent-text, var(--accent));
    transform: translateY(-0.2em);
}

@media (min-width: 48rem) {
    .stint {
        grid-template-columns: 8rem 4rem minmax(0, 1fr);
        grid-template-areas: "season crest body";
        column-gap: var(--space-lg);
        align-items: start;
    }

    .stint__season {
        font-size: 2.75rem;
        line-height: 0.9;
    }

    .stint__crest {
        width: 4rem;
        height: 4rem;
    }
}

/* ================= FUTBOLISTA: RESUMEN, ESCUDOS, PALMARÉS ================= */
.crest-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(4.25rem, 1fr));
    gap: var(--space-xs);
}

.crest-wall li {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    padding: 0.625rem;
    background: var(--day);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.crest-wall img {
    width: auto;
    max-width: 100%;
    max-height: 3rem;
    object-fit: contain;
}

@media (min-width: 60rem) {
    .crest-wall {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: var(--space-sm);
    }

    .crest-wall img {
        max-height: 3.75rem;
    }
}

.mini-honours {
    margin-block: var(--space-sm) var(--space-2xs);
}

.honours {
    border-top: 1px solid var(--line);
}

.honour {
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr);
    align-items: baseline;
    gap: var(--space-sm);
    padding-block: var(--space-md);
    border-bottom: 1px solid var(--line);
}

.honour__count {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 800;
    font-stretch: 62%;
    line-height: 0.8;
    color: var(--accent-text);
    font-variant-numeric: tabular-nums;
}

.honour__text {
    font-size: 1.1875rem;
    font-weight: 650;
    line-height: 1.3;
}

.honour__detail {
    display: block;
    margin-top: 0.125rem;
    font-size: 1rem;
    font-weight: 400;
    color: var(--muted);
}

.comps {
    border-top: 1px solid var(--line);
}

.comps li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-md);
    padding-block: var(--space-sm);
    border-bottom: 1px solid var(--line);
    font-size: 1.125rem;
    font-weight: 600;
}

.comps .year {
    flex: none;
    font-weight: 600;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.honours-layout {
    display: grid;
    gap: var(--space-2xl);
}

.honours-layout h3 {
    margin-bottom: var(--space-sm);
}

@media (min-width: 60rem) {
    .honours-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--space-2xl);
    }
}

.country-tally {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
}

.country-tally li {
    padding: 0.375rem 0.75rem;
    font-size: var(--text-sm);
    font-weight: 600;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.clubs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
    column-gap: var(--space-md);
    border-top: 1px solid var(--line);
}

.club {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr);
    align-items: center;
    gap: var(--space-sm);
    padding-block: var(--space-sm);
    border-bottom: 1px solid var(--line);
}

.club img {
    width: 2.75rem;
    height: 3.25rem;
    object-fit: contain;
}

.club__name {
    font-weight: 700;
    font-stretch: 88%;
    line-height: 1.2;
}

.club__country {
    font-size: var(--text-sm);
    color: var(--muted);
}

@media (min-width: 48rem) {
    .clubs {
        grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
        column-gap: var(--space-lg);
    }
}

.roster {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    column-gap: var(--space-lg);
    border-top: 1px solid var(--line);
}

.person {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-block: var(--space-sm);
    border-bottom: 1px solid var(--line);
}

.person img {
    flex: none;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    object-fit: cover;
}

.person__name {
    font-weight: 700;
    font-stretch: 88%;
    line-height: 1.2;
}

.person__country {
    font-size: var(--text-sm);
    color: var(--muted);
}

/* ================= FORMACIÓN ================= */
.creds {
    border-top: 1px solid var(--line);
}

.cred {
    display: grid;
    gap: 0.125rem;
    padding-block: var(--space-md);
    border-bottom: 1px solid var(--line);
}

.cred__title {
    font-size: 1.1875rem;
    font-weight: 700;
    font-stretch: 92%;
    line-height: 1.3;
}

.cred__meta {
    color: var(--muted);
}

.skills {
    display: grid;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.skills h3 {
    margin-bottom: var(--space-xs);
    font-size: var(--text-sm);
    font-weight: 650;
    font-stretch: 90%;
    color: var(--muted);
}

@media (min-width: 40rem) {
    .skills {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
}

.chips li {
    padding: 0.375rem 0.875rem;
    font-weight: 600;
    background: var(--day);
    border: 1px solid var(--line);
    border-radius: 999px;
}

/* ================= METODOLOGÍA ================= */
.steps {
    display: grid;
    gap: var(--space-lg);
}

.step {
    display: grid;
    align-content: start;
    gap: var(--space-2xs);
    padding-top: var(--space-md);
    border-top: 1px solid var(--line);
}

.step__num {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 800;
    font-stretch: 62%;
    line-height: 0.85;
    color: var(--accent-text);
    font-variant-numeric: tabular-nums;
}

.step h3 {
    font-size: 1.25rem;
    font-weight: 700;
    font-stretch: 88%;
    line-height: 1.2;
}

.step p {
    color: var(--muted);
}

@media (min-width: 40rem) {
    .steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--space-lg);
    }
}

@media (min-width: 72rem) {
    .steps {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.steps + .link-arrow {
    margin-top: var(--space-xl);
}

.session {
    display: grid;
    gap: var(--space-2xl);
}

.session-step {
    display: grid;
    gap: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--line);
}

.session-step__head {
    display: grid;
    align-content: start;
    gap: var(--space-xs);
}

.session-step__head .step__num {
    font-size: clamp(3.5rem, 2.5rem + 3vw, 5.5rem);
}

.session-step__head p {
    max-width: 40ch;
    font-size: 1.125rem;
    color: var(--muted);
}

@media (min-width: 60rem) {
    .session-step {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        column-gap: var(--space-2xl);
    }

    .session-step__head {
        position: sticky;
        top: calc(var(--header-h) + var(--space-lg));
    }
}

.videos {
    display: grid;
    gap: var(--space-sm);
}

@media (min-width: 40rem) {
    .videos[data-count="2"],
    .videos[data-count="3"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .videos[data-count="3"] > :first-child {
        grid-column: 1 / -1;
    }
}

.video {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    color: var(--on-night);
    background: var(--night-raised);
    border-radius: var(--radius);
}

.video img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.78);
    transition:
        transform var(--dur-slow) var(--ease-out),
        filter var(--dur) var(--ease-out);
}

.video:hover img {
    filter: brightness(0.95);
}

@media (hover: hover) and (pointer: fine) {
    .video:hover img {
        transform: scale(1.04);
    }
}

.video__play {
    position: absolute;
    left: var(--space-xs);
    bottom: var(--space-xs);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem 0.5rem 0.625rem;
    font-size: var(--text-sm);
    font-weight: 700;
    font-stretch: 90%;
    color: var(--on-accent);
    background: var(--accent);
    border-radius: var(--radius);
}

.video__play svg {
    width: 1rem;
    height: 1rem;
}

.video:focus-visible {
    outline-color: var(--accent);
}

.video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    transition: opacity 300ms var(--ease-out);
}

/* Mientras carga YouTube queda la miniatura con un indicador, en vez de una caja negra */
.video.is-loading iframe {
    opacity: 0;
}

.video.is-loading::after {
    content: "";
    position: absolute;
    top: calc(50% - 1.25rem);
    left: calc(50% - 1.25rem);
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid oklch(1 0 0 / 0.35);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(1turn);
    }
}

@media (prefers-reduced-motion: reduce) {
    .video.is-loading::after {
        animation-duration: 2.4s;
    }
}

.quote {
    display: grid;
    gap: var(--space-md);
    max-width: 54rem;
}

.quote blockquote p {
    font-size: clamp(1.375rem, 1.05rem + 1.2vw, 2.125rem);
    font-weight: 500;
    font-stretch: 94%;
    line-height: 1.32;
    letter-spacing: -0.01em;
}

.quote figcaption {
    font-weight: 650;
    color: var(--muted);
}

/* ================= CONTACTO Y FOOTER ================= */
.contact {
    padding-block: var(--section-y) var(--space-2xl);
}

.contact__inner {
    display: grid;
    gap: var(--space-lg);
}

.contact__text {
    display: grid;
    gap: var(--space-sm);
}

.contact__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.contact__actions .btn {
    flex: 1 1 auto;
}

@media (min-width: 60rem) {
    .contact__inner {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        column-gap: var(--space-2xl);
    }

    .contact__actions {
        flex-direction: column;
        align-items: stretch;
        min-width: 20rem;
    }

    .contact__actions .btn {
        justify-content: flex-start;
    }
}

.site-footer {
    padding-block: var(--space-md);
    font-size: var(--text-sm);
    color: var(--on-night-muted);
    border-top: 1px solid var(--night-line);
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0 var(--space-lg);
}

.site-footer ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--space-md);
}

.site-footer a {
    display: inline-block;
    padding-block: 0.75rem;
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--on-night);
    text-decoration: underline;
}

/* ================= APARICIÓN AL HACER SCROLL =================
   Todo depende de .reveal-ready, que pone main.js solo si hay IntersectionObserver
   y no se pidió movimiento reducido. Sin eso, el contenido se ve directamente. */
@media (prefers-reduced-motion: no-preference) {
    /* Listas: los ítems suben escalonados */
    .reveal-ready [data-reveal]:not(.is-in) > * {
        opacity: 0;
        transform: translateY(1rem);
    }

    .reveal-ready [data-reveal] > * {
        transition:
            opacity 0.6s var(--ease-out),
            transform 0.7s var(--ease-out);
        transition-delay: calc(var(--i, 0) * 55ms);
    }

    /* Títulos de sección: suben desde una línea, como el nombre de la portada */
    .reveal-ready :is(.section .h2, .contact .display):not(.is-in) {
        clip-path: inset(100% 0 0 0);
        transform: translateY(0.35em);
    }

    :is(.section .h2, .contact .display).is-in {
        animation: heading-in 700ms var(--ease-out);
    }

    /* Misión: cada línea se dibuja de izquierda a derecha y después aparece su texto */
    .reveal-ready [data-reveal="lines"]:not(.is-in) > * {
        opacity: 1;
        transform: none;
    }

    .reveal-ready [data-reveal="lines"]:not(.is-in) > *::before {
        transform: scaleX(0);
    }

    .reveal-ready [data-reveal="lines"]:not(.is-in) > * > * {
        opacity: 0;
        transform: translateY(0.5rem);
    }

    .reveal-ready [data-reveal="lines"] > *::before {
        transition: transform 700ms var(--ease-out);
        transition-delay: calc(var(--i, 0) * 90ms);
    }

    .reveal-ready [data-reveal="lines"] > * > * {
        transition:
            opacity 500ms var(--ease-out),
            transform 600ms var(--ease-out);
        transition-delay: calc(var(--i, 0) * 90ms + 250ms);
    }
}

@keyframes heading-in {
    from {
        clip-path: inset(100% 0 0 0);
        transform: translateY(0.35em);
    }

    to {
        clip-path: inset(-0.3em -0.2em);
        transform: none;
    }
}

/* ================= TRANSICIÓN ENTRE PÁGINAS =================
   View Transitions entre documentos (Chrome, Edge, Safari). Firefox navega sin transición.
   El header queda quieto; el contenido cambia con un fundido. */
@view-transition {
    navigation: auto;
}

.site-header {
    view-transition-name: site-header;
}

@media (prefers-reduced-motion: no-preference) {
    ::view-transition-old(root) {
        animation: page-out 150ms var(--ease-out) both;
    }

    ::view-transition-new(root) {
        animation: page-in 300ms var(--ease-out) both;
    }
}

@keyframes page-out {
    to {
        opacity: 0;
    }
}

@keyframes page-in {
    from {
        opacity: 0;
        transform: translateY(0.75rem);
    }
}

/* ================= GOOGLE TRANSLATE ================= */
#google_translate_element {
    display: none;
}

body {
    top: 0 !important;
}

.skiptranslate > iframe,
.goog-te-banner-frame,
.goog-te-balloon-frame,
#goog-gt-tt,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf {
    display: none !important;
}

.goog-text-highlight {
    background: none !important;
    box-shadow: none !important;
}
