/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Estilos para el header con parallax */
.parallax-header {
    /* Imagen de fondo - mountains */
    --bg: url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1920');
    background-image: var(--bg);

    /* Configuración parallax */
    min-height: 100vh;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    will-change: background-position;

    /* Estilos de texto */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.parallax-header h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    letter-spacing: 3px;
}

.parallax-header p {
    font-size: 1.5rem;
    opacity: 0.9;
}

/* Secciones de contenido */
.content {
    padding: 80px 20px;
    background-color: #f5f5f5;
    text-align: center;
}

.content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.content p {
    max-width: 800px;
    margin: 0 auto 1rem;
    font-size: 1.1rem;
    text-align: justify;
    text-align-last: center;
}

.content ul, .content ol {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

.content li {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.content code {
    background-color: #e8e8e8;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #e74c3c;
}

/* Imágenes parallax intermedias */
.parallax-image-1,
.parallax-image-2,
.parallax-image-3 {
    min-height: 400px;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    will-change: background-position;
}

.parallax-image-1 {
    /* Imagen de naturaleza/agua */
    --bg: url('https://images.unsplash.com/photo-1433086966358-54859d0ed716?w=1920');
    background-image: var(--bg);
}

.parallax-image-2 {
    /* Imagen de bosque */
    --bg: url('https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=1920');
    background-image: var(--bg);
}

.parallax-image-3 {
    /* Imagen de aurora boreal */
    --bg: url('https://images.unsplash.com/photo-1531366936337-7c912a4589a7?w=1920');
    background-image: var(--bg);
}

/* Footer */
.parallax-footer {
    background-color: #2c3e50;
    color: white;
    padding: 40px 20px;
    text-align: center;
}

.parallax-footer p {
    font-size: 1rem;
}

/* En dispositivos sin soporte real de background-attachment: fixed
   (iOS Safari, la mayoría de navegadores móviles) movemos el fondo
   a un pseudo-elemento más alto que el contenedor y lo trasladamos
   por GPU vía la variable --py (la setea el JS). Así se mantiene
   `cover` y nunca se ve el fondo blanco al desplazar. */
@media (hover: none), (max-width: 1024px) {
    .parallax-header,
    .parallax-image-1,
    .parallax-image-2,
    .parallax-image-3 {
        position: relative;
        overflow: hidden;
        isolation: isolate;
        background-image: none;
        background-attachment: scroll;
        --py: 0px;
    }

    .parallax-header::before,
    .parallax-image-1::before,
    .parallax-image-2::before,
    .parallax-image-3::before {
        content: '';
        position: absolute;
        inset: -25% 0;
        background-image: var(--bg);
        background-position: center;
        background-repeat: no-repeat;
        background-size: cover;
        transform: translate3d(0, var(--py, 0px), 0);
        will-change: transform;
        z-index: -1;
        pointer-events: none;
    }
}

/* Diseño responsivo */
@media (max-width: 768px) {
    .parallax-header h1 {
        font-size: 2.5rem;
    }

    .parallax-header p {
        font-size: 1.2rem;
    }

    .content h2 {
        font-size: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .parallax-header,
    .parallax-image-1,
    .parallax-image-2,
    .parallax-image-3 {
        background-position: center !important;
    }
}
