/* ==========================================
   1. VARIABLES Y RESET (Arquitectura CSS)
   ========================================== */
:root {
    --primary-color: #1e3a8a;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --text-main: #1e293b;
    --text-muted: #94a3b8;
    --bg-color: #eef2ff;
    --white: #ffffff;
    --yellow: #facc15;
    --dark-blue: #1e40af;
    --skin-color: #fcd34d; /* Color piel para los constructores */
    --vest-color: #f97316; /* Chaleco naranja de seguridad */
    
    --font-main: 'Poppins', sans-serif;
    --transition-smooth: all 0.3s ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    padding: 20px;
}

/* ==========================================
   2. CONTENEDOR PRINCIPAL (Efecto Ventana)
   ========================================== */
.window-container {
    background-color: var(--white);
    width: 100%;
    max-width: 1200px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    padding: 40px 60px;
    position: relative;
    overflow: hidden;
}

/* ==========================================
   3. HEADER (Logo y Navegación)
   ========================================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.logo-dot {
    width: 12px;
    height: 12px;
    background-color: var(--accent-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

nav a:hover, nav a.active {
    color: var(--primary-color);
}

/* ==========================================
   4. CONTENIDO PRINCIPAL (Texto + Imagen)
   ========================================== */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

/* Columna de Texto */
.text-content h1 {
    font-size: 4rem;
    color: var(--primary-color);
    line-height: 1.1;
    margin-bottom: 10px;
}

.text-content h2 {
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 20px;
}

.text-content p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 35px;
    max-width: 400px;
}

.btn-primary {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--white);
    text-decoration: none;
    padding: 14px 35px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: var(--transition-smooth);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

/* ==========================================
   5. ILUSTRACIÓN (CSS Puro)
   ========================================== */
.illustration-container {
    position: relative;
    height: 350px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.blob-bg {
    position: absolute;
    width: 350px;
    height: 350px;
    background-color: #e0e7ff;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    top: 0;
    right: 0;
    z-index: 1;
    animation: morph 8s ease-in-out infinite;
}

/* Grúa */
.crane {
    position: absolute;
    right: 20px;
    bottom: 0;
    width: 150px;
    height: 250px;
    z-index: 2;
}

.crane-mast {
    position: absolute;
    right: 30px;
    bottom: 0;
    width: 15px;
    height: 100%;
    background-color: var(--dark-blue);
    border-radius: 2px;
}

.crane-arm {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 15px;
    background-color: var(--dark-blue);
    border-radius: 2px;
    transform-origin: right center;
    animation: craneSwing 4s ease-in-out infinite alternate;
}

.crane-cable {
    position: absolute;
    top: 15px;
    left: 20px;
    width: 2px;
    height: 60px;
    background-color: var(--dark-blue);
}

.warning-sign {
    position: absolute;
    top: 60px;
    left: 0px;
    width: 50px;
    height: 50px;
    background-color: var(--yellow);
    border: 3px solid var(--dark-blue);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: var(--dark-blue);
    animation: swing 3s ease-in-out infinite;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Edificio */
.building {
    position: absolute;
    left: 20px;
    bottom: 0;
    width: 200px;
    height: 180px;
    background-color: var(--primary-color);
    border-radius: 5px;
    z-index: 2;
    overflow: hidden;
}

.building-stripe {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 30px;
    background: repeating-linear-gradient(
        45deg,
        var(--yellow),
        var(--yellow) 10px,
        var(--dark-blue) 10px,
        var(--dark-blue) 20px
    );
    transform: translateY(-50%);
}

.window {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

/* Suelo */
.ground {
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 10px;
    background-color: var(--text-main);
    border-radius: 5px;
    z-index: 3;
}

/* ==========================================
   6. CONSTRUCTORES (Trabajadores)
   ========================================== */
.worker {
    position: absolute;
    z-index: 4;
}

/* --- Constructor 1: Subido en la estructura --- */
.worker-climbing {
    left: 140px;
    bottom: 120px;
    animation: climb 3s ease-in-out infinite alternate;
}

.worker-climbing .head {
    width: 16px;
    height: 16px;
    background-color: var(--skin-color);
    border-radius: 50%;
    border: 2px solid var(--yellow); /* Casco */
    margin: 0 auto 2px auto;
}

.worker-climbing .body {
    width: 18px;
    height: 22px;
    background-color: var(--vest-color);
    border-radius: 4px;
    position: relative;
}

/* Brazos y piernas del constructor 1 */
.worker-climbing .arm {
    position: absolute;
    top: 5px;
    left: -8px;
    width: 6px;
    height: 15px;
    background-color: var(--skin-color);
    border-radius: 3px;
    transform: rotate(-30deg);
}

.worker-climbing .leg {
    position: absolute;
    bottom: -12px;
    left: 6px;
    width: 6px;
    height: 14px;
    background-color: var(--dark-blue);
    border-radius: 3px;
    transform: rotate(15deg);
}

/* --- Constructor 2: Caminando en el suelo --- */
.worker-walking {
    left: 220px;
    bottom: 0px;
    animation: walk 4s linear infinite;
}

.worker-walking .head {
    width: 16px;
    height: 16px;
    background-color: var(--skin-color);
    border-radius: 50%;
    border: 2px solid var(--yellow);
    margin: 0 auto 2px auto;
}

.worker-walking .body {
    width: 18px;
    height: 22px;
    background-color: var(--vest-color);
    border-radius: 4px;
    position: relative;
}

.worker-walking .leg {
    position: absolute;
    bottom: -14px;
    width: 6px;
    height: 16px;
    background-color: var(--dark-blue);
    border-radius: 3px;
    transform-origin: top center;
}

.worker-walking .leg-front {
    left: 10px;
    animation: legSwing 0.6s ease-in-out infinite alternate;
}

.worker-walking .leg-back {
    left: 2px;
    animation: legSwing 0.6s ease-in-out infinite alternate-reverse;
}

/* ==========================================
   7. ANIMACIONES (Keyframes)
   ========================================== */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes morph {
    0% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
    50% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
}

@keyframes craneSwing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-5deg); }
}

@keyframes swing {
    0% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
    100% { transform: rotate(-10deg); }
}

/* Animación del trabajador subiendo */
@keyframes climb {
    0% { transform: translateY(0); }
    100% { transform: translateY(-15px); }
}

/* Animación del trabajador caminando */
@keyframes walk {
    0% { transform: translateX(0); }
    50% { transform: translateX(30px); }
    100% { transform: translateX(0); }
}

/* Animación de las piernas al caminar */
@keyframes legSwing {
    0% { transform: rotate(-20deg); }
    100% { transform: rotate(20deg); }
}

/* Efecto de aparición */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   8. RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 992px) {
    .window-container { padding: 30px; }
    .main-content {
        grid-template-columns: 1fr;
        text-align: center;
		
    }
    .text-content h1 { font-size: 3rem; }
    .text-content p { margin: 0 auto 30px auto; }
    .illustration-container {
        margin-top: 40px;
        height: 300px;
    }
    .blob-bg {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 576px) {
    .window-container { padding: 20px; border-radius: 15px; }
    header {
        flex-direction: column;
        gap: 20px;
        margin-bottom: 40px;
    }
	
    nav ul { gap: 15px; font-size: 0.8rem; }
    .text-content h1 { font-size: 1.4rem; }
    .text-content h2 { font-size: 1.0rem; }
    .illustration-container { height: 250px; }
    .building { width: 150px; height: 140px; }
    .crane { width: 100px; height: 180px; }
    .worker-walking { left: 160px; }
    .worker-climbing { left: 100px; bottom: 100px; }
}