:root {
    --bg-dark: #05080f;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --accent-primary: #0ea5e9;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #ec4899;
    --glass-bg: rgba(15, 23, 42, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    font-size: 0.95rem; /* Reduced base font size slightly */
}

/* Animated Background Orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -2;
    animation: float 20s infinite alternate;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(14,165,233,0.3) 0%, rgba(0,0,0,0) 70%);
}

.orb-2 {
    bottom: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139,92,246,0.3) 0%, rgba(0,0,0,0) 70%);
    animation-delay: -10s;
}

h1, h2, h3, .logo {
    font-family: 'Outfit', sans-serif;
}

/* Glassmorphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 5%; /* Reduced padding */
    display: flex;
    justify-content: space-between;
    align-items: center; /* This ensures perfect vertical alignment */
    z-index: 1000;
    background: rgba(10, 15, 22, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.6));
}

.logo span {
    color: var(--accent-primary);
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center; /* Vertically align items in the list */
    gap: 1.5rem; /* Reduced gap */
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

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

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 250px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 1001;
}

.dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a {
    display: block;
    padding: 0.8rem 1.5rem;
    color: var(--text-light) !important;
    font-weight: 400;
}

.dropdown-menu a:hover {
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent-primary) !important;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1002;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-light);
    border-radius: 3px;
    transition: var(--transition);
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 0.6rem 1.4rem; /* Reduced padding */
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem; /* Reduced font size */
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
    background-size: 200% 200%;
    color: white;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
    animation: gradientFlow 5s ease infinite;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-light);
    border: 1px solid var(--accent-primary);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(14, 165, 233, 0.2);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.4);
}

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

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/hero_bg.png');
    background-size: cover;
    background-position: center;
    opacity: 0.5;
    z-index: -1;
}

.hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(10,15,22,0.2) 0%, var(--bg-dark) 100%);
}

.hero-content {
    max-width: 800px; /* Reduced width */
    padding: 3rem; /* Reduced padding */
    text-align: center;
    animation: fadeInUp 1s ease forwards;
    background: rgba(5, 8, 15, 0.7);
    border: 1px solid rgba(14, 165, 233, 0.2);
    box-shadow: 0 0 40px rgba(14, 165, 233, 0.1);
    border-radius: 20px;
}

.hero-content h1 {
    font-size: 3rem; /* Reduced font size significantly */
    margin-bottom: 1rem;
    line-height: 1.1;
    font-weight: 800;
}

.hero-content h1 span {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary), var(--accent-secondary));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientFlow 5s ease infinite;
}

.hero-content p {
    font-size: 1.15rem; /* Reduced font size */
    color: var(--text-light);
    margin-bottom: 2rem;
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

/* Services */
.services {
    padding: 4rem 5%; /* Reduced vertical padding */
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem; /* Reduced margin */
}

.section-title h2 {
    font-size: 2.2rem; /* Reduced size */
    margin-bottom: 0.5rem;
}

.section-title p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

.service-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 0; /* Changed from 2.5rem */
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.service-img {
    height: 160px; /* Reduced image height */
    width: 100%;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: var(--transition);
}

.service-card:hover .service-img {
    transform: scale(1.05);
}

.service-card .icon {
    font-size: 2.2rem; /* Reduced icon size */
    margin: 1rem 1.2rem 0.5rem;
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 10px rgba(14,165,233,0.3));
}

.service-card h3 {
    font-size: 1.3rem; /* Reduced size */
    margin: 0 1.2rem 0.8rem;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0 1.2rem 1.5rem;
    flex-grow: 1;
}

/* About Me Section */
.about {
    padding: 6rem 5%;
    background: var(--bg-dark);
    position: relative;
}

.about-container {
    max-width: 900px; /* Reduced width */
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 3rem; /* Reduced gap */
}

.about-profile {
    flex: 0 0 280px; /* Reduced width */
    display: flex;
    justify-content: center;
}

.profile-img {
    width: 250px; /* Reduced size */
    height: 330px; /* Rectangular aspect ratio */
    border-radius: 16px; /* Rectangular with rounded corners */
    background-size: cover;
    background-position: center top; /* Focus on the face */
    background-color: rgba(14, 165, 233, 0.1);
    border: 3px solid var(--accent-primary);
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.6), inset 0 0 20px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-img:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(14, 165, 233, 0.8), inset 0 0 20px rgba(0,0,0,0.5);
}

.about-content {
    flex: 1;
    padding: 3rem;
    text-align: left;
}

.about-content h3 {
    font-size: 2rem; /* Reduced */
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.about-content h4 {
    font-size: 1.1rem; /* Reduced */
    color: var(--accent-primary);
    margin-bottom: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.about-content p {
    color: var(--text-muted);
    font-size: 1.05rem; /* Reduced */
    line-height: 1.7;
}

@keyframes rotateGradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Portfolio / Nuestros Sistemas */
.portfolio-section {
    padding: 4rem 5%;
    position: relative;
    background: linear-gradient(180deg, var(--bg-dark) 0%, #060910 100%);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.portfolio-card {
    border-radius: 16px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.portfolio-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.3);
}

.portfolio-icon-bg {
    height: 180px;
    width: 100%;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(15, 23, 42, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid var(--accent-primary);
    transition: var(--transition);
}

.portfolio-card:hover .portfolio-icon-bg {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(15, 23, 42, 0.9));
}

.portfolio-icon-bg .sys-icon {
    font-size: 5rem;
    filter: drop-shadow(0 0 15px rgba(14, 165, 233, 0.5));
    transition: var(--transition);
}

.portfolio-card:hover .sys-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 25px rgba(14, 165, 233, 0.8));
}

.portfolio-content {
    padding: 1.8rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(14, 165, 233, 0.15);
    color: var(--accent-primary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    align-self: flex-start;
}

.portfolio-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    color: var(--text-light);
}

.portfolio-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Contact Section & Form */
.contact-section {
    padding: 4rem 5%;
    position: relative;
}

.contact-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2.5rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group {
    margin-bottom: 1.2rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 8px;
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.2);
}

/* WhatsApp Button */
.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: var(--transition);
}

.whatsapp-btn svg {
    width: 35px;
    height: 35px;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    background-color: #1ebe57;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.6);
}

/* Footer */
footer {
    background: rgba(0,0,0,0.5);
    padding: 4rem 5% 2rem;
    border-top: 1px solid var(--glass-border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 3rem;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-logo span {
    color: var(--accent-primary);
}

.social-links {
    margin-top: 1.5rem;
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 30px); }
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 80%;
        max-width: 300px;
        background: rgba(10, 15, 22, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s ease;
        padding: 2rem;
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }
    
    .nav-links.active {
        right: 0;
    }

    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        background: rgba(255,255,255,0.05);
        border: none;
        width: 100%;
        text-align: center;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }

    .hero-content {
        padding: 2rem;
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .hero-buttons {
        flex-direction: column;
    }

    .about-container {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .about-content {
        text-align: center;
        padding: 2rem;
    }
}
