:root {
    --primary: #17112a;
    --secondary: #004a94;
    --secondary-light: #005eb8;
    --accent: #ff7600;
    --accent-hover: #e06800;
    --light: #f5f7fa;
    --white: #ffffff;
    --gray-text: #666666;
    --dark-text: #333333;
    
    --font-head: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --shadow-sm: 0 5px 15px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.15);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    font-weight: 800;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

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

/* ---------------- Loader ---------------- */
.loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader.hidden {
    opacity: 0;
    visibility: hidden;
}
.loader-content {
    text-align: center;
    width: 250px;
}
.loader-content img {
    width: 100%;
    filter: brightness(0) invert(1);
    margin-bottom: 30px;
    animation: pulse 2s infinite ease-in-out;
}
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
}
.progress {
    width: 0%;
    height: 100%;
    background: var(--accent);
    animation: progressAnim 1.5s ease forwards;
}

@keyframes pulse { 0%, 100% { opacity: 0.7; transform: scale(0.95); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes progressAnim { 0% { width: 0%; } 100% { width: 100%; } }

/* ---------------- Navbar ---------------- */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    padding: 20px 0;
    z-index: 1000;
    transition: var(--transition);
    background: transparent;
}
.navbar.scrolled {
    background: var(--white);
    padding: 10px 0;
    box-shadow: var(--shadow-sm);
}

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

.logo {
    background: var(--white);
    padding: 8px 20px;
    border-radius: 6px;
    display: inline-flex;
    transition: var(--transition);
}
.logo img {
    height: 45px;
}

.navbar.scrolled .logo {
    background: transparent;
    padding: 0;
}

.nav-menu ul {
    display: flex;
    align-items: center;
    gap: 35px;
}

.nav-link {
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--white);
    font-size: 0.95rem;
    text-transform: uppercase;
    position: relative;
}
.navbar.scrolled .nav-link {
    color: var(--primary);
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px; left: 0;
    width: 0; height: 2px;
    background: var(--accent);
    transition: var(--transition);
}
.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.btn-quote {
    background: var(--accent);
    color: var(--white) !important;
    font-family: var(--font-head);
    font-weight: 700;
    padding: 12px 25px;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.9rem;
}
.btn-quote:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.menu-icon {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}
.menu-icon span {
    width: 30px; height: 3px;
    background: var(--white);
    transition: 0.3s;
}
.navbar.scrolled .menu-icon span {
    background: var(--primary);
}

/* ---------------- Hero Section ---------------- */
.hero {
    position: relative;
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-slider {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}
.slide {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease;
    transform: scale(1.1);
}
.slide.active {
    opacity: 1;
    animation: kenburns 15s infinite alternate ease-in-out;
}
@keyframes kenburns {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(23, 17, 42, 0.9) 0%, rgba(0, 74, 148, 0.7) 100%);
    z-index: 2;
}

.hero-particles {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 3;
    pointer-events: none;
}
.particle {
    position: absolute;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    animation: floatUp linear infinite;
}
@keyframes floatUp {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(-100px) scale(1); opacity: 0; }
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 900px;
    padding: 0 20px;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 118, 0, 0.2);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 6px 20px;
    border-radius: 50px;
    font-family: var(--font-head);
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 25px;
}

.hero h1 {
    font-size: 5rem;
    color: var(--white);
    margin-bottom: 25px;
    text-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
.hero h1 span {
    color: var(--accent);
}

.hero p {
    font-size: 1.3rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto; margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 35px;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    border-radius: 4px;
}
.btn-primary {
    background: var(--accent);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--white);
    color: var(--accent);
}
.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}
.btn-secondary:hover {
    background: var(--white);
    color: var(--primary);
}

.scroll-down {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--white);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.mouse {
    width: 26px; height: 40px;
    border: 2px solid var(--white);
    border-radius: 20px;
    margin-bottom: 10px;
    position: relative;
}
.wheel {
    width: 4px; height: 8px;
    background: var(--accent);
    border-radius: 2px;
    position: absolute;
    top: 6px; left: 50%;
    transform: translateX(-50%);
    animation: mouseWheel 1.5s infinite;
}
@keyframes mouseWheel {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 15px); opacity: 0; }
}

/* ---------------- AOS Animation base ---------------- */
[data-aos] {
    opacity: 0;
    transition-duration: 0.8s;
    transition-property: opacity, transform;
}
[data-aos="fade-up"] { transform: translateY(40px); }
[data-aos="fade-down"] { transform: translateY(-40px); }
[data-aos="fade-right"] { transform: translateX(-40px); }
[data-aos="fade-left"] { transform: translateX(40px); }
[data-aos="zoom-in"] { transform: scale(0.9); }

[data-aos].aos-animate {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* ---------------- Secciones Generales ---------------- */
.section-heading {
    margin-bottom: 40px;
}
.section-heading .subtitle {
    display: block;
    color: var(--accent);
    font-family: var(--font-head);
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 10px;
}
.section-heading h2 {
    font-size: 2.8rem;
    color: var(--primary);
}
.section-heading h2 span {
    color: var(--secondary);
}

/* ---------------- Nosotros ---------------- */
.about {
    padding: 120px 0;
    background: var(--white);
}
.about-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 40px;
}
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}
.about-images {
    position: relative;
    height: 600px;
}
.img-back {
    position: absolute;
    top: 0; right: 0;
    width: 80%; height: 80%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
}
.img-front {
    position: absolute;
    bottom: 0; left: 0;
    width: 65%; height: 60%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    border: 10px solid var(--white);
}
.experience-badge {
    position: absolute;
    bottom: 40px; right: 10%;
    background: var(--accent);
    color: var(--white);
    padding: 30px;
    border-radius: 50%;
    width: 160px; height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-md);
    animation: float 4s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

.exp-number {
    font-size: 3rem;
    font-family: var(--font-head);
    font-weight: 900;
    line-height: 1;
}
.exp-text {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 5px;
}

.about-text .lead {
    font-size: 1.25rem;
    color: var(--secondary);
    margin-bottom: 20px;
}
.about-text p {
    color: var(--gray-text);
    margin-bottom: 30px;
}

.about-features li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary);
}
.icon-box {
    width: 50px; height: 50px;
    background: rgba(0, 74, 148, 0.1);
    color: var(--secondary);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ---------------- Cifras Parallax ---------------- */
.stats {
    position: relative;
    padding: 100px 0;
    background: url('https://loremflickr.com/1920/600/bridge,steel/all') center/cover fixed;
}
.stats-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(23, 17, 42, 0.95);
}
.stats-container {
    position: relative;
    z-index: 2;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}
.stat-item {
    color: var(--white);
}
.stat-icon {
    color: var(--accent);
    margin-bottom: 20px;
}
.stat-count {
    display: inline-block;
    font-size: 4rem;
    font-family: var(--font-head);
    font-weight: 900;
    line-height: 1;
}
.stat-plus {
    font-size: 3rem;
    font-family: var(--font-head);
    font-weight: 900;
    color: var(--accent);
    vertical-align: top;
}
.stat-name {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-top: 10px;
}

/* ---------------- Servicios Flip Cards ---------------- */
.services {
    padding: 120px 0;
    background: var(--light);
}
.services-header {
    margin-bottom: 60px;
}
.services-header .divider {
    width: 80px; height: 4px;
    background: var(--accent);
    margin: 20px auto 0;
}

.services-grid {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.service-card {
    height: 380px;
    perspective: 1000px;
    cursor: pointer;
}
.card-inner {
    position: relative;
    width: 100%; height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}
.service-card:hover .card-inner {
    transform: rotateY(180deg);
}
.card-front, .card-back {
    position: absolute;
    width: 100%; height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.card-front {
    background: var(--white);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: var(--shadow-sm);
}
.s-icon {
    width: 70px; height: 70px;
    background: var(--light);
    color: var(--secondary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    transition: var(--transition);
}
.service-card:hover .s-icon {
    background: var(--secondary);
    color: var(--white);
}
.card-front h3 {
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 15px;
}
.card-front p {
    color: var(--gray-text);
}

.card-back {
    background-size: cover;
    background-position: center;
    transform: rotateY(180deg);
    position: relative;
    overflow: hidden;
}
.card-back::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 74, 148, 0.85); /* Secondary color transparent */
}
.back-content {
    position: relative;
    z-index: 2;
    color: var(--white);
    text-align: center;
}
.back-content h3 {
    font-size: 1.6rem;
    margin-bottom: 15px;
}
.back-content p {
    margin-bottom: 25px;
}
.btn-link {
    display: inline-block;
    padding: 10px 25px;
    border: 2px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-head);
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
}
.btn-link:hover {
    background: var(--accent);
    color: var(--white);
}

/* ---------------- Marquesina ---------------- */
.partners {
    background: var(--primary);
    padding: 40px 0;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.partners-title {
    color: var(--white);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.2rem;
    white-space: nowrap;
    padding: 0 40px;
    border-right: 2px solid rgba(255,255,255,0.2);
    z-index: 2;
}
.marquee-container {
    width: 100%;
    overflow: hidden;
}
.marquee-content {
    display: flex;
    white-space: nowrap;
    animation: marquee 20s linear infinite;
}
.marquee-content span {
    color: rgba(255,255,255,0.6);
    font-size: 1.2rem;
    font-family: var(--font-head);
    font-weight: 600;
    padding: 0 30px;
    text-transform: uppercase;
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ---------------- Proyectos ---------------- */
.portfolio {
    padding: 120px 0;
    background: var(--white);
}
.portfolio-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 40px;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 300px;
    gap: 20px;
}
.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}
.gallery-item.large {
    grid-column: span 2;
    grid-row: span 2;
}
.gallery-item.wide {
    grid-column: span 2;
}
.gallery-item img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
}
.gallery-item:hover img {
    transform: scale(1.1);
}
.g-overlay {
    position: absolute;
    bottom: -100%; left: 0;
    width: 100%;
    padding: 30px;
    background: linear-gradient(to top, rgba(23,17,42,1) 0%, rgba(23,17,42,0) 100%);
    color: var(--white);
    transition: var(--transition);
}
.gallery-item:hover .g-overlay {
    bottom: 0;
}
.g-overlay h4 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}
.g-overlay p {
    color: var(--accent);
    font-weight: 600;
    font-family: var(--font-head);
}

/* ---------------- Contacto ---------------- */
.contact-section {
    background: var(--light);
}
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 600px;
}
.contact-info {
    padding: 100px 80px;
    background: var(--primary);
    color: var(--white);
}
.contact-info h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}
.contact-info p {
    opacity: 0.8;
    margin-bottom: 50px;
    font-size: 1.1rem;
}
.info-blocks {
    display: flex;
    flex-direction: column;
    gap: 30px;
}
.info-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.i-icon {
    width: 50px; height: 50px;
    background: rgba(255,255,255,0.1);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}
.i-text strong {
    display: block;
    font-family: var(--font-head);
    font-size: 1.2rem;
    margin-bottom: 5px;
}
.i-text span {
    opacity: 0.8;
    line-height: 1.8;
}
.contact-map {
    width: 100%; height: 100%;
}

/* ---------------- Footer ---------------- */
.footer {
    background: #0d091a;
    color: var(--white);
}
.footer-top {
    padding: 80px 0;
}
.f-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
}
.f-brand img {
    height: 60px;
    margin-bottom: 20px;
}
.f-brand p {
    opacity: 0.6;
}
.f-links h4, .f-social h4 {
    font-family: var(--font-head);
    font-size: 1.3rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}
.f-links h4::after, .f-social h4::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 30px; height: 2px;
    background: var(--accent);
}
.f-links ul li {
    margin-bottom: 15px;
}
.f-links ul a {
    opacity: 0.7;
}
.f-links ul a:hover {
    opacity: 1;
    color: var(--accent);
    padding-left: 5px;
}
.footer-bottom {
    background: #080512;
    padding: 25px 0;
    text-align: center;
    opacity: 0.5;
    font-size: 0.9rem;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
    .hero h1 { font-size: 4rem; }
    .about-grid { grid-template-columns: 1fr; }
    .about-images { height: 500px; }
    .stats-container { grid-template-columns: repeat(2, 1fr); gap: 50px; }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-container { grid-template-columns: 1fr; }
    .contact-map { height: 400px; }
    .f-container { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .nav-menu {
        position: absolute;
        top: 100%; left: 0; width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 20px 0;
        box-shadow: var(--shadow-md);
        display: none;
    }
    .nav-menu.active { display: block; }
    .nav-menu ul { flex-direction: column; gap: 20px; }
    .nav-link { color: var(--primary); }
    .menu-icon { display: flex; }
    
    .hero h1 { font-size: 3rem; }
    .services-grid { grid-template-columns: 1fr; }
    .stats-container { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: 1fr; }
    .gallery-item.large, .gallery-item.wide { grid-column: span 1; }
    .f-container { grid-template-columns: 1fr; }
    .partners { flex-direction: column; gap: 20px; }
    .partners-title { border-right: none; border-bottom: 2px solid rgba(255,255,255,0.2); padding-bottom: 10px; }
}
