* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: #000000;
    color: #f4f4f4;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

/* === LAYOUT: dos columnas === */
.project {
    display: grid;
    grid-template-columns: 40% 60%;
    min-height: 100vh;
}

/* === COLUMNA IZQUIERDA (texto, fija) === */
.project-info {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    padding: 6rem 4rem 3rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #1c1c1c;
    border: 1px solid #2e2e2e;
    text-decoration: none;
    font-size: 1.2rem;
    color: #f4f4f4;
    margin-bottom: 3rem;
    transition: background 0.25s ease, transform 0.25s ease;
}

.back-link:hover {
    background: #2a2a2a;
    transform: translateX(-2px);
}

.project-title {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -1px;
    line-height: 1.1;
    margin: 0;
}

.project-year {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    letter-spacing: 3px;
    color: #888;
    font-weight: 400;
}

.project-tags {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.project-tags li {
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #cfcfcf;
    background: #1c1c1c;
    border: 1px solid #2e2e2e;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
}

.project-description {
    margin-top: 2.5rem;
    max-width: 58ch;
}

.project-description p {
    font-size: 1.15rem;
    line-height: 1.7;
    color: #c9c9c9;
    margin: 0 0 1.2rem;
}

/* === Metadatos === */
.project-meta {
    margin: auto 0 0;
    padding-top: 2.5rem;
    border-top: 1px solid #262626;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0;
}

.meta-row dt {
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #777;
    font-weight: 600;
}

.meta-row dd {
    margin: 0;
    font-size: 0.85rem;
    text-align: right;
    color: #f4f4f4;
    font-weight: 600;
}

/* === COLUMNA DERECHA (galería scrolleable) === */
.project-gallery {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-gallery img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

/* === ZONA "Scroll to next project" (espacio real de scroll bajo la galería) === */
.next-project-zone {
    width: 100%;
    min-height: 32vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;   /* mismo negro que el resto de la página */
}

.next-project-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.next-project-inner.revealed {
    opacity: 1;
    transform: translateY(0);
}

.next-project-label {
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #9a9a9a;
    transition: color 0.25s ease;
}

.next-project-inner.charging .next-project-label {
    color: #f4f4f4;
}

/* Círculo de carga */
.next-project-ring {
    position: relative;
    width: 56px;
    height: 56px;
}

.next-project-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);   /* empieza a cargar desde arriba */
}

.next-project-ring circle {
    fill: none;
    stroke-width: 3;
}

.ring-track {
    stroke: #2a2a2a;
}

.ring-progress {
    stroke: #f4f4f4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.08s linear;
}

.ring-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    color: #9a9a9a;
    transition: color 0.25s ease;
}

.next-project-inner.charging .ring-arrow {
    color: #f4f4f4;
}

/* === TRANSICIÓN DE ENTRADA === */
/* Overlay negro que cubre la pantalla al cargar y se desvanece,
   dando continuidad con el fundido a negro del home. */
.page-enter-overlay {
    position: fixed;
    inset: 0;
    background: #0d0d0d;
    z-index: 9999;
    pointer-events: none;
    animation: enterFade 0.6s ease forwards;
}

@keyframes enterFade {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* Overlay negro que se funde al salir (volver al home) */
.page-leave-overlay {
    position: fixed;
    inset: 0;
    background: #0d0d0d;
    opacity: 0;
    pointer-events: none;
    z-index: 10000;
    transition: opacity 0.6s ease;
}

body.page-leaving .page-leave-overlay {
    opacity: 1;
    pointer-events: all;
}

/* Contenido que aparece con un leve desplazamiento hacia arriba */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.project-info {
    animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.project-gallery img {
    animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Escalonado de las imágenes de la galería */
.project-gallery img:nth-child(1) { animation-delay: 0.25s; }
.project-gallery img:nth-child(2) { animation-delay: 0.35s; }
.project-gallery img:nth-child(3) { animation-delay: 0.45s; }
.project-gallery img:nth-child(4) { animation-delay: 0.55s; }
.project-gallery img:nth-child(5) { animation-delay: 0.65s; }
.project-gallery img:nth-child(6) { animation-delay: 0.75s; }
.project-gallery img:nth-child(7) { animation-delay: 0.85s; }
.project-gallery img:nth-child(8) { animation-delay: 0.95s; }

@media (prefers-reduced-motion: reduce) {
    .page-enter-overlay,
    .project-info,
    .project-gallery img {
        animation: none;
    }

    .next-project-inner {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* === Responsive: una sola columna en mobile === */
@media (max-width: 768px) {
    .project {
        grid-template-columns: 1fr;
    }

    .project-info {
        position: static;
        height: auto;
        padding: 5rem 1.5rem 2rem;
    }

    .project-title {
        font-size: 3rem;
    }

    .project-gallery {
        padding: 1.5rem;
    }
}
