/* ===== VARIABLES Y RESET ===== */
:root {
    --color-fondo: #faf7f2;    /* Color crema claro */
    --color-texto: #3e3a36;
    --color-acento: #b7a99a;    /* Café neutro */
    --color-acento-oscuro: #8b7a6b;
    --sombra: 0 4px 12px rgba(0, 0, 0, 0.15); /* Sombra negra */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
    background-color: var(--color-fondo);
    color: var(--color-texto);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER STICKY ===== */
.sticky-header {
    position: sticky;
    top: 0;
    background-color: #d9cdbc; /* Café claro neutro */
    padding: 1rem 0;
    box-shadow: var(--sombra);
    z-index: 100;
}

.sticky-header nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 2rem;
}

.sticky-header nav a {
    text-decoration: none;
    color: #2d2a26;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    transition: background-color 0.2s;
}

.sticky-header nav a:hover {
    background-color: #bfb0a0;
}

/* ===== MAIN Y SECCIONES ===== */
main {
    flex: 1;
    max-width: 1200px;
    width: 90%;
    margin: 2rem auto;
}

h1 {
    font-size: 2.5rem;
    font-weight: 300;
    color: #4a4139;
    margin-bottom: 2rem;
    text-align: center;
    border-bottom: 2px solid var(--color-acento);
    padding-bottom: 0.5rem;
}

/* ===== PÁGINA PRINCIPAL ===== */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.portada {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: var(--sombra);
    margin-bottom: 2rem;
}

.intro {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    color: #5e554b;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin: 3rem 0;
}

.btn-neutral {
    display: inline-block;
    background-color: #d6ccbf;
    color: #3a342e;
    text-decoration: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 500;
    box-shadow: var(--sombra);
    transition: transform 0.2s, background-color 0.2s;
}

.btn-neutral:hover {
    background-color: #c5b8a8;
    transform: translateY(-3px);
}

/* ===== LÍNEA DEL TIEMPO ===== */
.timeline-container {
    background: rgba(255, 250, 240, 0.7);
    border-radius: 30px;
    padding: 2rem;
    box-shadow: var(--sombra);
}

.timeline {
    position: relative;
    list-style: none;
    padding-left: 0;
}

/* Línea vertical */
.timeline::before {
    content: '';
    position: absolute;
    left: 120px; /* Espacio para la imagen (80px) + más margen */
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #a39484, #d6ccbf, #a39484);
    border-radius: 4px;
    box-shadow: 0 0 0 1px #8b7a6b, 0 4px 8px rgba(0, 0, 0, 0.3); /* Sombra negra */
    z-index: 1;
}

/* Subtítulos */
.timeline-subtitle {
    position: relative;
    margin: 2.5rem 0 1.5rem 140px;
    font-size: 2rem;
    font-weight: 400;
    color: #5d4e3f;
    background: linear-gradient(90deg, #e5dbd0, transparent);
    padding: 0.5rem 2rem;
    border-radius: 0 50px 50px 0;
    border-left: 8px solid #b7a99a;
    width: fit-content;
    z-index: 2;
}

/* Items de la línea */
.timeline-item {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

/* Columna de la imagen */
.timeline-image {
    width: 100px;
    flex-shrink: 0;
    margin-right: 20px;
    position: relative;
    z-index: 3;
}

.image-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #b7a99a;
    box-shadow: var(--sombra);
    background-color: #fff;
    margin-top: 5px;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Uniformiza todas las imágenes */
    display: block;
}

/* Punto de la versión (sobre la línea) */
.timeline-dot {
    position: absolute;
    left: 140px; /* 120px de línea + 20px de margen */
    top: 40px;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    background-color: #faf7f2;
    border: 3px solid #7f6e5d;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); /* Sombra negra */
    z-index: 5;
    cursor: pointer;
    transition: transform 0.1s;
}

.timeline-item:hover .timeline-dot {
    transform: translateX(-50%) scale(1.2);
    background-color: #e5dbd0;
}

/* Tarjeta de versión (clickeable) */
.timeline-content {
    flex: 1;
    margin-left: 40px; /* Espacio para la línea horizontal */
    background: #fffbf5;
    border-radius: 20px 20px 20px 0;
    padding: 1rem 2rem;
    box-shadow: var(--sombra);
    border: 1px solid #d9cdbc;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 250px;
    position: relative;
    z-index: 4;
}

.timeline-content:hover {
    background: #ffffff;
    border-color: #b7a99a;
    transform: translateX(5px);
}

.version-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #5d4e3f;
    line-height: 1.2;
}

.version-name {
    font-size: 1.2rem;
    color: #7f6e5d;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.version-api {
    background: #e5dbd0;
    padding: 0.2rem 1.2rem;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #3e3a36;
}

/* Línea horizontal que conecta punto con tarjeta */
.timeline-horizontal-line {
    position: absolute;
    left: 120px; /* desde la línea vertical */
    top: 48px;
    width: 40px;
    height: 4px;
    background-color: #b7a99a;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 3;
}

/* Área expandible */
.expandable-wrapper {
    width: 100%;
    margin-left: 140px;
    overflow: hidden;
    transition: max-height 0.4s ease;
    max-height: 0;
}

.timeline-item.expanded .expandable-wrapper {
    max-height: 300px; /* Ajustable */
    margin-top: 10px;
    margin-bottom: 10px;
}

.expandable-content {
    background: #f2ebe2;
    border-left: 6px solid #b7a99a;
    border-radius: 0 20px 20px 0;
    padding: 1.2rem 2rem;
    color: #3e3a36;
    box-shadow: inset 0 2px 6px #e5dbd0, 0 4px 8px rgba(0,0,0,0.1);
    margin-right: 20px;
}

.expandable-content strong {
    color: #5d4e3f;
    font-size: 1.2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.expandable-content p {
    margin: 0.3rem 0;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 2rem;
    background-color: #e5dbd0;
    color: #4a4139;
    margin-top: 2rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
    .timeline::before {
        left: 70px;
    }
    .timeline-image {
        width: 70px;
    }
    .image-container {
        width: 60px;
        height: 60px;
    }
    .timeline-dot {
        left: 90px;
    }
    .timeline-content {
        margin-left: 20px;
    }
    .expandable-wrapper {
        margin-left: 90px;
    }
    .timeline-subtitle {
        margin-left: 90px;
    }
}