/* Design System & Tokens */
:root {
    --primary: #0f2c59; /* Deep Industrial Blue */
    --primary-light: #18417c;
    --accent: #f27b21; /* Safety Orange */
    --accent-light: #ff9340;
    --bg-dark: #091325; /* Midnight Navy */
    --bg-light: #f5f7fa; /* Ice Gray */
    --bg-card: #ffffff;
    --text-main: #1e2838;
    --text-muted: #5e6e85;
    --white: #ffffff;
    
    --font-header: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --shadow-sm: 0 4px 6px -1px rgba(15, 44, 89, 0.06), 0 2px 4px -1px rgba(15, 44, 89, 0.03);
    --shadow-md: 0 10px 25px -5px rgba(15, 44, 89, 0.08), 0 8px 10px -6px rgba(15, 44, 89, 0.05);
    --shadow-lg: 0 20px 40px -15px rgba(15, 44, 89, 0.12);
    
    --transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    --header-height: 80px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

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

/* Utility Layout classes */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: 100px 0;
}

.text-center {
    text-align: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Section Headers */
.section-header {
    margin-bottom: 60px;
    max-width: 650px;
}

.section-header.text-center {
    margin-left: auto;
    margin-right: auto;
}

.section-header .subtitle {
    display: inline-block;
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.section-header .section-title {
    font-family: var(--font-header);
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.section-header .divider {
    width: 60px;
    height: 4px;
    background-color: var(--accent);
    margin-top: 15px;
    border-radius: 2px;
}

.section-header .divider.center {
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-family: var(--font-header);
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(242, 123, 33, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--primary);
    transform: translateY(-2px);
}

/* Main Navigation / Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.main-header.scrolled {
    height: 70px;
    background-color: rgba(255, 255, 255, 0.98);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-family: var(--font-header);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--primary);
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.logo-subtitle {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 1px;
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    padding: 8px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--accent);
}

.btn-contact {
    background-color: var(--primary);
    color: var(--white) !important;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
}

.btn-contact::after {
    display: none;
}

.btn-contact:hover {
    background-color: var(--accent);
    transform: translateY(-1px);
}

/* Mobile Toggle */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.hamburger {
    width: 25px;
    height: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2.5px;
    background-color: var(--primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 0;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-bg .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(9, 19, 37, 0.95) 0%, rgba(15, 44, 89, 0.8) 100%);
    z-index: 3;
}

.hero-carousel {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.hero-container {
    position: relative;
    z-index: 5;
    color: var(--white);
    padding-top: var(--header-height);
}

.hero-content {
    max-width: 700px;
}

.hero-content .badge {
    display: inline-block;
    background-color: rgba(242, 123, 33, 0.2);
    color: var(--accent-light);
    border: 1px solid var(--accent);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.hero-title {
    font-family: var(--font-header);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
}

.hero-description {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 20px;
}

.hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
    z-index: 6;
}

.hero-wave svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.hero-wave .shape-fill {
    fill: var(--white);
}

/* Quiénes Somos / About */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.about-info .lead {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 20px;
}

.about-info p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.feature-item {
    display: flex;
    gap: 16px;
}

.feature-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background-color: rgba(15, 44, 89, 0.05);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.3rem;
}

.feature-text h3 {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: var(--primary);
}

.feature-text p {
    margin: 0;
    font-size: 0.95rem;
}

/* Image Stack */
.about-visual {
    position: relative;
    height: 450px;
}

.image-stack {
    position: relative;
    width: 100%;
    height: 100%;
}

.image-stack-item {
    position: absolute;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.image-stack-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-stack-item-top {
    width: 65%;
    height: 65%;
    top: 0;
    right: 0;
    z-index: 2;
}

.image-stack-item-bottom {
    width: 65%;
    height: 65%;
    bottom: 0;
    left: 0;
    z-index: 1;
    border: 5px solid var(--white);
}

/* Specialties Section */
.specialties-section {
    background-color: var(--bg-light);
}

.specialties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.specialty-card {
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(15, 44, 89, 0.03);
}

.specialty-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(242, 123, 33, 0.2);
}

.card-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(242, 123, 33, 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.8rem;
    margin-bottom: 24px;
}

.specialty-card h3 {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.specialty-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Portfolio Section */
.portfolio-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-btn {
    background: none;
    border: 1px solid rgba(15, 44, 89, 0.15);
    padding: 10px 24px;
    border-radius: 50px;
    font-family: var(--font-header);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--primary);
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.portfolio-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    opacity: 1;
    transform: scale(1);
    position: relative;
    z-index: 1;
}

.portfolio-item:hover {
    transform: translateY(-12px) scale(1.25);
    box-shadow: var(--shadow-lg);
    z-index: 2;
}

.portfolio-item.hidden {
    display: none;
}

.item-inner {
    position: relative;
    width: 100%;
    padding-top: 66.67%; /* 3:2 Aspect Ratio */
    overflow: hidden;
    cursor: pointer;
    background-color: var(--primary);
}

.item-inner img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.portfolio-item:hover .item-inner img {
    transform: scale(1.1);
    opacity: 0.4;
}

.item-overlay {
    position: absolute;
    inset: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(9, 19, 37, 0.95) 0%, rgba(9, 19, 37, 0.4) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    transition: var(--transition);
    color: var(--white);
}

.portfolio-item:hover .item-overlay {
    opacity: 1;
}

.item-overlay h3 {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.item-overlay p {
    font-size: 0.9rem;
    color: var(--accent-light);
    font-weight: 600;
}

.btn-view-project {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Clients Section */
.clients-section {
    background-color: var(--bg-light);
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 30px;
    align-items: center;
}

.client-logo-wrapper {
    background-color: var(--white);
    padding: 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 90px;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.client-logo-wrapper:hover {
    transform: translateY(-8px) scale(1.35);
    box-shadow: var(--shadow-lg);
    z-index: 2;
}

.client-logo-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: var(--transition);
}

.client-logo-wrapper:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* Contact / Footer */
.contact-section {
    background-color: var(--bg-dark);
    color: var(--white);
    padding-bottom: 30px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 80px;
    margin-bottom: 60px;
}

.footer-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    margin-bottom: 24px;
    filter: brightness(0) invert(1);
}

.contact-info-block h3 {
    font-family: var(--font-header);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.contact-info-block .slogan {
    color: var(--accent-light);
    font-weight: 600;
    margin-bottom: 24px;
}

.about-short {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 35px;
}

.contact-details {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-details li {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.contact-details .icon {
    color: var(--accent);
}

.contact-form-block h4 {
    font-family: var(--font-header);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 28px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.form-group input,
.form-group textarea {
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--white);
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    background-color: rgba(255, 255, 255, 0.08);
}

.btn-submit {
    align-self: flex-start;
    border: none;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 30px;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Integrity Section (Programa de Integridad) */
.integrity-section {
    background-color: var(--bg-light);
    border-top: 1px solid rgba(15, 44, 89, 0.06);
    border-bottom: 1px solid rgba(15, 44, 89, 0.06);
    padding: 90px 0;
    position: relative;
    overflow: hidden;
}

.integrity-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 70px;
    align-items: center;
}

.integrity-content .subtitle {
    display: inline-block;
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.integrity-content .integrity-title {
    font-family: var(--font-header);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.integrity-content .divider {
    width: 60px;
    height: 4px;
    background-color: var(--accent);
    margin-top: 15px;
    margin-bottom: 25px;
    border-radius: 2px;
}

.integrity-description {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 35px;
}

.integrity-description strong {
    color: var(--primary);
    font-weight: 600;
}

.integrity-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.integrity-img-link {
    position: relative;
    display: block;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 8px solid var(--white);
    transition: var(--transition);
    max-width: 260px;
    background-color: var(--white);
}

.integrity-img-link:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 25px 50px -12px rgba(15, 44, 89, 0.25);
}

.integrity-img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
}

.integrity-img-link:hover .integrity-img {
    filter: brightness(0.9);
}

.integrity-badge {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: var(--primary);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 50px;
    font-family: var(--font-header);
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(15, 44, 89, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.integrity-img-link:hover .integrity-badge {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background-color: rgba(9, 19, 37, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-dialog {
    width: 100%;
    max-width: 850px;
    max-height: 90vh;
    background-color: var(--white);
    border-radius: var(--radius-md);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-dialog {
    transform: translateY(0);
}

.modal-content {
    position: relative;
    padding: 40px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2.2rem;
    cursor: pointer;
    color: var(--primary);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--accent);
}

/* Modal Internal Layout */
.modal-project h2 {
    font-family: var(--font-header);
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 24px;
}

.modal-slider {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 24px;
}

.modal-slider img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.modal-slider img:hover {
    transform: scale(1.02);
}

.modal-desc {
    color: var(--text-main);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    section {
        padding: 80px 0;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    .about-visual {
        height: 380px;
    }
    
    .clients-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .integrity-section {
        padding: 60px 0;
    }

    .integrity-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .integrity-content .divider {
        margin-left: auto;
        margin-right: auto;
    }

    .integrity-img-link {
        margin: 0 auto;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    /* Hide text logo on mobile since the image already contains the text */
    .logo-text {
        display: none;
    }

    .logo-img {
        height: 35px;
        max-width: 160px;
        width: auto;
    }

    /* Mobile Toggle Navigation */
    .mobile-nav-toggle {
        display: block;
    }
    
    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: var(--white);
        flex-direction: column;
        padding: 40px 24px;
        transform: translateX(100%);
        transition: var(--transition);
        box-shadow: 0 10px 15px rgba(0,0,0,0.05);
    }
    
    .main-nav.active {
        transform: translateX(0);
    }
    
    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 24px;
    }
    
    .nav-list li {
        width: 100%;
        text-align: center;
    }
    
    .nav-link {
        font-size: 1.2rem;
        display: block;
    }
    
    .btn-contact {
        width: 100%;
    }
}

@media (max-width: 767px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .clients-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
}
