@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&display=swap');

:root {
    --primary-blue: #002f6c;
    --dark-blue: #011b40;
    --bright-blue: #0253b8;
    --accent-red: #d32f2f;
    --bright-red: #e63946;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-muted: #5a6673;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --box-shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.12);
    --transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--primary-blue); margin-bottom: 1rem; }
p { font-size: 1rem; line-height: 1.6; color: var(--text-muted); }

/* NAVBAR */
.navbar {
    background-color: var(--primary-blue) !important;
    box-shadow: 0 2px 15px rgba(0,0,0,0.15);
    padding: 12px 0;
    z-index: 1030;
}
.navbar-brand img { border-radius: 4px; }
.navbar-nav .nav-item { margin: 0 5px; }
.navbar-nav .nav-link {
    color: var(--white) !important;
    font-size: 15px; font-weight: 600;
    position: relative; padding: 8px 15px !important;
    transition: var(--transition); letter-spacing: 0.3px;
}
.navbar-nav .nav-link:hover { color: var(--white) !important; opacity: 0.9; }
.navbar-nav .nav-link::after {
    content: ''; position: absolute; bottom: 5px; left: 15px; right: 15px;
    height: 2px; background-color: var(--bright-red);
    transform: scaleX(0); transition: transform 0.3s cubic-bezier(0.86, 0, 0.07, 1);
    border-radius: 2px;
}
.navbar-nav .nav-link:hover::after { transform: scaleX(1); }
.navbar-nav img { filter: brightness(0) invert(1); opacity: 0.8; }

/* TITLES / HERO BANNER PARA PROYECTOS */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--primary-blue) 100%);
    color: var(--white);
    padding: 80px 20px;
    text-align: center;
    margin-bottom: 40px;
}
.hero-title {
    font-size: 3rem; font-weight: 800; color: var(--white);
    margin-bottom: 15px; text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.hero-subtitle {
    font-size: 1.15rem; color: #e2e8f0; max-width: 600px;
    margin: 0 auto; line-height: 1.6; text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.titulo-container {
    text-align: center; margin-bottom: 3.5rem;
    position: relative; padding-top: 2rem;
}
.titulo {
    font-size: 2.2rem; color: var(--primary-blue); font-weight: 800;
    display: inline-block; position: relative; padding-bottom: 15px; margin: 0;
}
.titulo::after {
    content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 70px; height: 4px; background-color: var(--accent-red); border-radius: 4px;
}

/* CARDS RE-DESIGN (PROJECTS) */
.card {
    background-color: var(--white);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
    height: 100%;
    cursor: pointer;
}
.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-hover);
}
.card-body {
    padding: 1.5rem; display: flex; flex-direction: column; align-items: center; text-align: center;
    justify-content: center;
}
.card-title {
    font-size: 1.05rem; font-weight: 700; color: var(--primary-blue);
    margin: 0; transition: color 0.3s;
}
.card:hover .card-title { color: var(--accent-red); }

.card-img-top {
    height: 220px; object-fit: cover;
    border-bottom: 4px solid var(--primary-blue);
    transition: var(--transition);
}
.card:hover .card-img-top { transform: scale(1.05); border-bottom-color: var(--accent-red); }
.img-wrapper { overflow: hidden; }

/* MODAL PREMIUM REDESIGN */
.modal {
    display: none; position: fixed; z-index: 1050; left: 0; top: 0;
    width: 100%; height: 100%; overflow: auto;
    background-color: rgba(1, 27, 64, 0.85); /* Azul profundo translúcido */
    backdrop-filter: blur(5px);
    opacity: 0; transition: opacity 0.3s ease;
}
.modal.show { opacity: 1; }

.modal-content {
    background-color: var(--light-bg); margin: 5% auto;
    padding: 0; border: none; border-radius: 16px; width: 85%; max-width: 1000px;
    display: flex; flex-direction: row; gap: 0; overflow: hidden;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    transform: translateY(-20px); transition: transform 0.3s ease;
}
.modal.show .modal-content { transform: translateY(0); }

.close {
    color: var(--text-muted); font-size: 32px; font-weight: 300;
    position: absolute; right: 20px; top: 15px; cursor: pointer;
    transition: color 0.2s; z-index: 10; line-height: 1;
}
.close:hover { color: var(--accent-red); }

.modal-text {
    flex: 1; padding: 40px; background: var(--white);
    display: flex; flex-direction: column; justify-content: flex-start;
    max-height: 600px; overflow-y: auto;
}
.modal-text::-webkit-scrollbar { width: 6px; }
.modal-text::-webkit-scrollbar-thumb { background-color: var(--primary-blue); border-radius: 10px; }

.modal-text h2 { font-size: 1.6rem; margin-bottom: 20px; color: var(--primary-blue); border-bottom: 2px solid var(--accent-red); padding-bottom: 10px; display: inline-block; }
.modal-text h5 { font-size: 1.05rem; color: var(--text-dark); margin-bottom: 15px; font-weight: 600; }
.modal-year { font-size: 1rem; color: var(--primary-blue); font-weight: 700; margin-bottom: 10px; padding-left: 5px; border-left: 3px solid var(--accent-red); }
.modal-text ul { padding-left: 20px; }
.modal-text li { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 8px; position: relative; list-style: none; }
.modal-text li::before { content: '✓'; color: var(--accent-red); font-weight: bold; position: absolute; left: -20px; }

.modal-images {
    flex: 1; padding: 30px; background: var(--light-bg);
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px; align-content: center;
}
.modal-images img {
    width: 100%; height: 180px; object-fit: cover;
    border-radius: var(--border-radius); box-shadow: var(--box-shadow);
    transition: transform 0.3s;
}
.modal-images img:hover { transform: scale(1.05); }

/* FOOTER */
.footer {
    background-color: var(--dark-blue) !important; padding: 70px 0 30px 0;
    margin-top: 60px; font-size: 0.9rem; border-top: 4px solid var(--accent-red);
}
.footer h5 {
    color: var(--white); font-weight: 700; margin-bottom: 25px; position: relative;
    display: inline-block; padding-bottom: 8px;
}
.footer h5::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 45px; height: 3px;
    background-color: var(--accent-red); border-radius: 2px;
}
.footer p, .footer ul li { color: #a0aec0; margin-bottom: 12px; line-height: 1.6; }
.footer a { color: #cbd5e1; text-decoration: none; transition: var(--transition); }
.footer a:hover { color: var(--bright-red); text-decoration: none; }

/* LAYOUT / GENERIC */
.section-padding { padding: 60px 0; }
.bg-light-alt { background-color: #ffffff; }

/* ANIMACIONES (Intersection Observer) */
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.9s cubic-bezier(0.25, 1, 0.5, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.1s; } .delay-2 { transition-delay: 0.2s; } .delay-3 { transition-delay: 0.3s; } .delay-4 { transition-delay: 0.4s; } .delay-5 { transition-delay: 0.5s; }

/* Mobile fixes */
@media (max-width: 991px) {
    .navbar-nav .nav-link { color: white !important; }
    .collapse.show { background-color: var(--dark-blue); padding: 15px; border-radius: 8px; margin-top: 10px;}
    .modal-content { flex-direction: column; }
    .modal-text { overflow: visible;}
    .modal-text, .modal-images { padding: 25px; }
}