/* =========================================
   VARIABLES & GLOBALS
========================================= */
:root {
    /* Color Palette */
    --usil-blue: #0033a0;
    --dark-blue: #0a192f;
    --navy: #061121;
    --accent-gold: #cfaa36;
    --accent-light: #4cc9f0;
    --text-main: #2b2d42;
    --text-muted: #6c757d;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* =========================================
   TYPOGRAPHY
========================================= */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

.section-title {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    color: var(--dark-blue);
    position: relative;
    line-height: 1.3;
}

/* Utilities overrides */
.text-gradient {
    background: linear-gradient(90deg, var(--accent-light), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2.text-white, .text-white { color: var(--white) !important; }
.text-accent { color: var(--accent-light); }
.text-light { color: rgba(255, 255, 255, 0.8) !important; }
.text-muted { color: var(--text-muted); }
.text-usil { color: var(--usil-blue) !important; }
.text-dark { color: var(--dark-blue) !important; }
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

/* =========================================
   LAYOUT UTILS
========================================= */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-padding { padding: 6rem 0; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-column { flex-direction: column; }

/* Backgrounds unified */
.bg-light { background-color: var(--light-bg); }
.bg-white { background-color: var(--white); }
.bg-dark { background-color: var(--dark-blue); }
.bg-brand { background-color: var(--usil-blue); }

.bg-gradient {
    background: linear-gradient(135deg, var(--navy) 0%, var(--usil-blue) 100%);
    position: relative;
    overflow: hidden;
}

/* =========================================
   BUTTONS & BADGES
========================================= */
.badge {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background-color: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 30px;
    color: var(--white);
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-bottom: 2rem;
    text-transform: uppercase;
    font-weight: 600;
}

.btn-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: var(--accent-gold);
    color: var(--dark-blue);
    font-weight: 600;
    font-family: var(--font-heading);
    text-decoration: none;
    border-radius: 40px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(207, 170, 54, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(207, 170, 54, 0.5);
    background-color: #dfbd4b;
}

.btn-primary i { margin-left: 10px; }

/* =========================================
   HEADER / NAVBAR
========================================= */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.4s ease;
    padding: 1.2rem 0;
}

header.scrolled {
    background-color: rgba(6, 17, 33, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.8rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.nav-container {
    width: 90%;
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo-wrapper {
    display: inline-block;
    background-color: var(--white);
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.header-logo-wrapper img {
    height: 55px; /* Moderately sized logo */
    display: block;
}

header.scrolled .header-logo-wrapper img { height: 45px; }

/* Mobile Menu Button */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1001;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.3s;
    position: relative;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.nav-links a:hover {
    color: var(--accent-gold);
}

/* =========================================
   1. HERO SECTION
========================================= */
.hero-section {
    position: relative;
    min-height: 100vh;
    padding: 140px 20px 60px;
    text-align: center;
    color: var(--white);
    background: url('https://images.unsplash.com/photo-1586528116311-ad8ed7c8d9c8?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(0,51,160,0.85), rgba(6,17,33,1));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.hero-title {
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    margin-bottom: 1.5rem;
    text-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

.hero-subtitle {
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: rgba(255,255,255,0.9);
    margin-bottom: 3rem;
    font-weight: 300;
}

/* =========================================
   2. CONTEXTO
========================================= */
.contexto-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.lead-text {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

.question-box {
    margin-top: 2rem;
    padding: 2.5rem;
    background: var(--white);
    border-radius: 12px;
    border-left: 6px solid var(--accent-gold);
    box-shadow: 0 15px 35px rgba(0,51,160,0.06);
    position: relative;
    overflow: hidden;
}

.question-box h3 {
    font-size: 1.3rem;
    color: var(--dark-blue);
    line-height: 1.4;
    position: relative;
    z-index: 2;
}

.icon-bg {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 6rem;
    color: rgba(0, 51, 160, 0.04);
    z-index: 1;
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 25px 45px rgba(0,0,0,0.08);
    text-align: center;
}

.icon-large {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.float-anim {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

/* =========================================
   3. PROBLEMA Y OBJETIVOS
========================================= */
.objetivos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.obj-card {
    background-color: rgba(255,255,255,0.05); /* Slight white tint over USIL blue */
    border: 1px solid rgba(255,255,255,0.15);
    padding: 2.5rem;
    border-radius: 16px;
    backdrop-filter: blur(8px);
    transition: transform 0.3s;
}

.obj-card:hover {
    transform: translateY(-8px);
    background-color: rgba(255,255,255,0.1);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--white);
    margin-bottom: 1.5rem;
}

.obj-card h3 {
    margin-bottom: 1.5rem;
    color: var(--accent-gold);
    font-size: 1.3rem;
}

.obj-card p {
    color: rgba(255,255,255,0.9);
}

.obj-card ul {
    list-style: none;
    padding: 0;
}

.obj-card ul li {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    color: rgba(255,255,255,0.9);
    line-height: 1.4;
}

.li-icon {
    flex-shrink: 0;
    width: 25px;
    padding-top: 2px; /* Visual alignment fix */
}

.li-text {
    flex-grow: 1;
}

.obj-card ul li i {
    font-size: 0.9rem;
    color: var(--accent-light);
}

/* =========================================
   4. STORYTELLING
========================================= */
.story-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.story-title {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 4rem;
}

.story-content {
    position: relative;
    padding-left: 50px;
}

.story-line {
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--usil-blue), var(--accent-gold));
    border-radius: 2px;
}

.story-step {
    position: relative;
    margin-bottom: 3rem;
}

.step-dot {
    position: absolute;
    left: -40px;
    top: 10px;
    width: 20px;
    height: 20px;
    background: var(--white);
    border: 4px solid var(--accent-gold);
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(207, 170, 54, 0.2);
    z-index: 2;
}

.step-card {
    background: var(--light-bg);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid #eaeaea;
    box-shadow: 0 10px 25px rgba(0,0,0,0.03);
    border-left: 6px solid var(--usil-blue);
    transition: all 0.3s;
}

.step-card:hover {
    transform: translateX(5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.06);
}

.step-card h4 {
    color: var(--usil-blue);
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

/* =========================================
   5. IMPORTANCIA GEOPOLÍTICA
========================================= */
.pattern-bg {
    background-color: var(--white);
    background-image: radial-gradient(rgba(0, 51, 160, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
}

.geo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.geo-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,51,160,0.05);
    border: 1px solid #f1f1f1;
    border-bottom: 4px solid transparent;
    transition: all 0.3s;
}

.geo-card:hover {
    border-bottom: 4px solid var(--usil-blue);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,51,160,0.1);
}

.geo-icon {
    font-size: 2.5rem;
    color: var(--usil-blue);
    margin-bottom: 1.5rem;
}

.geo-card h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: var(--dark-blue);
}

.geo-card p {
    color: var(--text-muted);
}

/* =========================================
   6. IMPACTO ECONÓMICO
========================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.outline-card {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: rgba(255,255,255,0.03);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
}

.stat-value {
    font-size: 4rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--accent-gold);
    line-height: 1;
}

.d-inline { display: inline-block; }

.stat-symbol {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 1rem;
}

.stat-label {
    font-size: 1rem;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    line-height: 1.4;
}

/* =========================================
   7. IMPACTO EN HUARAL
========================================= */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.image-wrapper {
    position: relative;
    height: 550px;
    width: 100%;
}

.rounded-img {
    border-radius: 20px;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shadow-lg {
    box-shadow: 0 25px 50px -12px rgba(0, 51, 160, 0.15);
}

.huaral-badge {
    position: absolute;
    bottom: -20px;
    right: -20px;
    background: var(--accent-gold);
    color: var(--dark-blue);
    padding: 1.2rem 2rem;
    font-weight: bold;
    font-family: var(--font-heading);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.benefits-list {
    list-style: none;
    margin-top: 2.5rem;
}

.benefits-list li {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.icon-circle {
    font-size: 1.8rem;
    background: var(--light-bg);
    color: var(--usil-blue);
    width: 65px; height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(0,51,160,0.05);
}

.li-content strong {
    display: block;
    font-size: 1.25rem;
    color: var(--dark-blue);
    margin-bottom: 0.3rem;
    font-family: var(--font-heading);
}

.li-content span {
    color: var(--text-muted);
}

/* =========================================
   8. FUTURO
========================================= */
.hero-like {
    padding: 10rem 0;
    min-height: 60vh;
}

.futuro-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--white);
    margin-bottom: 2rem;
    text-shadow: 0 5px 10px rgba(0,0,0,0.2);
}

.futuro-text {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    max-width: 800px;
    margin: 0 auto;
    font-weight: 300;
}

/* =========================================
   9. AUTORES
========================================= */
.autores-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.autor-card {
    background: var(--white);
    padding: 2.5rem 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,51,160,0.06);
    width: 250px;
    text-align: center;
    transition: transform 0.3s;
    border: 1px solid #f9f9f9;
}

.autor-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,51,160,0.1);
}

.autor-avatar {
    width: 75px;
    height: 75px;
    background: var(--light-bg);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--usil-blue);
    border: 3px solid var(--accent-gold);
}

.autor-card h4 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--dark-blue);
    line-height: 1.3;
}

.autor-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.docente-info {
    background: var(--white);
    display: inline-block;
    padding: 1.5rem 3rem;
    border-radius: 40px;
    box-shadow: 0 10px 25px rgba(0,51,160,0.05);
    border: 1px solid #f5f5f5;
}

/* =========================================
   10. REFERENCIAS
========================================= */
.references-list {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--light-bg);
    border-left: 4px solid var(--dark-blue);
    border-radius: 8px;
}

.references-list p {
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.95rem;
    color: var(--text-muted);
}

.references-list p:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.references-list strong {
    color: var(--dark-blue);
}

.ref-link {
    color: var(--accent-light);
    margin-left: 8px;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.ref-link:hover {
    color: var(--usil-blue);
    transform: translateY(-2px);
    display: inline-block;
}

/* =========================================
   11. FOOTER
========================================= */
footer {
    background: var(--navy);
    color: var(--white);
    padding: 5rem 0 2rem;
}

.logo-wrapper {
    display: inline-block;
    background-color: var(--white);
    padding: 15px 25px;
    border-radius: 12px;
}

.logo-wrapper img {
    max-height: 80px;
    display: block;
    /* Removed the filter so it displays with native original colors on a white background block */
}

.footer-title {
    color: var(--white);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.footer-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 2rem auto;
    width: 60%;
    max-width: 600px;
}

.copyright {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}

/* =========================================
   ANIMATIONS (Triggered via JS)
========================================= */
.reveal {
    opacity: 0;
    visibility: hidden;
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(0, 0);
}

.fade-up { transform: translateY(50px); }
.fade-left { transform: translateX(-50px); }
.fade-right { transform: translateX(50px); }

/* =========================================
   RESPONSIVE DESIGN
========================================= */
@media (max-width: 992px) {
    .contexto-grid, .grid-2-col {
        grid-template-columns: 1fr;
    }
    
    .story-content {
        padding-left: 30px;
    }
    
    .story-line {
        left: 10px;
    }
    
    .step-dot {
        left: -30px;
    }
    
    /* MOBILE NAVIGATION */
    .mobile-toggle {
        display: block;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(6, 17, 33, 0.98);
        flex-direction: column;
        padding: 2rem 0;
        gap: 1.5rem;
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
        
        /* Hidden by default on mobile */
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.4s ease-in-out;
    }
    
    .nav-links.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    .image-wrapper {
        height: 350px;
    }
}
