/* =========================================
   RESET BÁSICO Y CONFIGURACIÓN GLOBAL
   ========================================= */

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

/* Variables de colores (fácil de cambiar) */
:root {
    --color-bg: #0f172a;
    --color-bg-light: #1e293b;
    --color-text: #f8fafc;
    --color-muted: #cbd5e1;
    --color-accent: #38bdf8;
    --color-accent-glow: rgba(56, 189, 248, 0.3);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Fondo animado con gradiente */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 50%, rgba(56, 189, 248, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(56, 189, 248, 0.03) 0%, transparent 50%);
    animation: gradientShift 20s ease infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(5%, 5%) rotate(180deg); }
}

/* =========================================
   ELEMENTOS GENERALES
   ========================================= */

section {
    padding: 100px 10%;
    position: relative;
    z-index: 1;
}

h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--color-text) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

p {
    color: var(--color-muted);
    max-width: 800px;
}

/* Enlaces y botones */
a {
    text-decoration: none;
    color: var(--color-text);
}

button {
    cursor: pointer;
    border: none;
}

/* =========================================
   HEADER / NAVBAR (desktop)
   ========================================= */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(23, 40, 82, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
    transition: all 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    max-width: 1400px;
    margin: 0 auto;
    height: 100px;
}

.logo-container {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo {
    height: 80px;
    width: auto;
    max-width: 380px;
    object-fit: contain;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 20px var(--color-accent-glow));
}

.logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 30px var(--color-accent-glow));
}

/* Menú desktop */
.nav-menu-desktop {
    display: block;
}

.nav-menu-desktop ul {
    list-style: none;
    display: flex;
    gap: 40px;
    margin: 0;
    padding: 0;
}

.nav-menu-desktop li a {
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.nav-menu-desktop li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

.nav-menu-desktop li a:hover {
    color: var(--color-accent);
}

.nav-menu-desktop li a:hover::after {
    width: 100%;
}

/* =========================================
   FAB HAMBURGUESA FLOTANTE (solo móvil)
   ========================================= */
.fab-hamburger {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 25px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), #0ea5e9);
    box-shadow: 0 8px 32px var(--color-accent-glow);
    border: none;
    cursor: pointer;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.fab-hamburger:hover {
    transform: scale(1.12);
    box-shadow: 0 12px 40px rgba(56, 189, 248, 0.55);
}

.fab-hamburger .hamburger-lines {
    width: 30px;
    height: 22px;
    position: relative;
}

.fab-hamburger span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: #000;
    border-radius: 2px;
    transition: all 0.35s ease;
}

.fab-hamburger span:nth-child(1) { top: 0; }
.fab-hamburger span:nth-child(2) { top: 9.5px; }
.fab-hamburger span:nth-child(3) { top: 19px; }

.fab-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}
.fab-hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(15px);
}
.fab-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Menú lateral desde izquierda */
.side-menu {
    position: fixed;
    top: 0;
    left: -320px;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: var(--color-bg-light);
    backdrop-filter: blur(12px);
    box-shadow: 6px 0 35px rgba(0,0,0,0.55);
    transition: left 0.45s cubic-bezier(0.32, 0.72, 0, 0.99);
    z-index: 9998;
    padding: 90px 30px 40px;
    overflow-y: auto;
}

.side-menu.active {
    left: 0;
}

.side-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-menu li {
    margin: 28px 0;
}

.side-menu a {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.side-menu a:hover,
.side-menu a:focus {
    color: var(--color-accent);
}

/* Botón cerrar */
.close-menu {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    font-size: 3rem;
    line-height: 1;
    color: var(--color-muted);
    cursor: pointer;
    transition: all 0.3s;
}

.close-menu:hover {
    color: var(--color-accent);
    transform: rotate(90deg);
}

/* Overlay */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.45s ease;
    z-index: 9997;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* =========================================
   RESPONSIVE - Ocultar menú desktop y mostrar FAB en móvil
   ========================================= */
@media (max-width: 768px) {
    .fab-hamburger {
        display: flex;
    }

    /* Ocultamos el menú horizontal del header en móvil */
    .nav-menu-desktop {
        display: none;
    }

    nav {
        justify-content: center;
    }

    .logo {
        height: 65px;
    }

    section {
        padding: 80px 6%;
    }

    #inicio {
        padding-top: 110px;
        min-height: calc(100vh - 80px);
    }

    #inicio h2 {
        font-size: 2.8rem;
    }

    h2 {
        font-size: 2.2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-item img {
        width: 100%;
    }

    .contact-container {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 16px;
    }
}

/* =========================================
   SECCIÓN HERO / INICIO
   ========================================= */

#inicio {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    padding-top: 120px;
    position: relative;
}

#inicio h2 {
    font-size: 3.5rem;
    max-width: 900px;
    line-height: 1.2;
    animation: fadeInUp 1s ease-out;
}

#inicio p {
    font-size: 1.2rem;
    color: var(--color-muted);
    max-width: 700px;
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    animation: fadeInUp 1s ease-out 0.4s backwards;
}

.cta-buttons a {
    display: inline-flex;
    align-items: center;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cta-buttons a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cta-buttons a:hover::before {
    width: 300px;
    height: 300px;
}

.cta-buttons a:first-child {
    background: linear-gradient(135deg, var(--color-accent) 0%, #0ea5e9 100%);
    color: #000;
    box-shadow: 0 10px 30px var(--color-accent-glow);
}

.cta-buttons a:first-child:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px var(--color-accent-glow);
}

.cta-buttons a:last-child {
    background: transparent;
    border: 2px solid var(--color-accent);
    color: var(--color-accent);
}

.cta-buttons a:last-child:hover {
    background: rgba(56, 189, 248, 0.1);
    transform: translateY(-3px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   SECCIÓN SOBRE NOSOTROS
   ========================================= */

#sobre {
    background: linear-gradient(135deg, var(--color-bg-light) 0%, rgba(30, 41, 59, 0.5) 100%);
    border-radius: 30px;
    margin: 0 5%;
    padding: 80px 60px;
    position: relative;
    overflow: hidden;
}

#sobre::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--color-accent-glow) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
}

#sobre p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

/* =========================================
   SECCIÓN SERVICIOS
   ========================================= */

#servicios {
    padding: 120px 10%;
}

#servicios > p {
    font-size: 1.2rem;
    margin-bottom: 50px;
    text-align: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.service-card {
    background: linear-gradient(135deg, var(--color-bg-light) 0%, rgba(30, 41, 59, 0.6) 100%);
    padding: 40px 30px;
    border-radius: 20px;
    border: 1px solid rgba(56, 189, 248, 0.1);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--color-accent-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-accent);
    box-shadow: 0 20px 50px rgba(56, 189, 248, 0.2);
}

.service-card:hover::before {
    opacity: 1;
}

.service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--color-accent) 0%, #0ea5e9 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
    font-size: 1.8rem;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--color-accent);
    position: relative;
    z-index: 1;
}

.service-card p {
    color: var(--color-muted);
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.service-includes {
    position: relative;
    z-index: 1;
}

.service-includes h4 {
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 12px;
    font-weight: 600;
}

.service-includes ul {
    list-style: none;
    padding: 0;
}

.service-includes ul li {
    color: var(--color-muted);
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    font-size: 0.95rem;
}

.service-includes ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: bold;
}

/* =========================================
   SECCIÓN PORTAFOLIO
   ========================================= */

#portafolio {
    padding: 120px 10%;
}

.portfolio-item {
    margin-top: 60px;
    background: linear-gradient(135deg, var(--color-bg-light) 0%, rgba(30, 41, 59, 0.6) 100%);
    padding: 50px;
    border-radius: 24px;
    border: 1px solid rgba(56, 189, 248, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.portfolio-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.05), transparent);
    transition: left 0.8s ease;
}

.portfolio-item:hover::before {
    left: 100%;
}

.portfolio-item:hover {
    transform: translateY(-8px);
    border-color: var(--color-accent);
    box-shadow: 0 20px 60px rgba(56, 189, 248, 0.2);
}

.portfolio-item h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--color-accent);
}

.portfolio-item img {
    width: 25%;
    max-width: 900px;
    border-radius: 16px;
    margin: 30px 0;
    border: 1px solid rgba(56, 189, 248, 0.2);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.portfolio-item img:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 25px 0;
}

.tech-tag {
    padding: 8px 16px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid var(--color-accent);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--color-accent);
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background: var(--color-accent);
    color: #000;
    transform: translateY(-2px);
}

.portfolio-item > a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--color-accent) 0%, #0ea5e9 100%);
    color: #000;
    border-radius: 10px;
    font-weight: 600;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.portfolio-item > a:hover {
    transform: translateX(5px);
    box-shadow: 0 10px 30px var(--color-accent-glow);
}

/* =========================================
   SECCIÓN EQUIPO
   ========================================= */

#equipo {
    padding: 120px 10%;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-top: 60px;
}

.team-member {
    background: linear-gradient(135deg, var(--color-bg-light) 0%, rgba(30, 41, 59, 0.6) 100%);
    padding: 40px 30px;
    border-radius: 20px;
    border: 1px solid rgba(56, 189, 248, 0.1);
    text-align: center;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.team-member::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--color-accent-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.team-member:hover {
    transform: translateY(-10px);
    border-color: var(--color-accent);
    box-shadow: 0 20px 50px rgba(56, 189, 248, 0.2);
}

.team-member:hover::before {
    opacity: 1;
}

.team-member img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 3px solid var(--color-accent);
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.team-member:hover img {
    transform: scale(1.1);
    box-shadow: 0 10px 30px var(--color-accent-glow);
}

.team-member h3 {
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.team-member p {
    color: var(--color-muted);
    position: relative;
    z-index: 1;
}

.team-member-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--color-accent) 0%, #0ea5e9 100%);
    color: #000;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.team-member-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--color-accent-glow);
}

/* =========================================
   SECCIÓN CONTACTO
   ========================================= */

#contacto {
    background: linear-gradient(135deg, var(--color-bg-light) 0%, rgba(30, 41, 59, 0.5) 100%);
    border-radius: 30px;
    margin: 0 5%;
    padding: 80px 60px;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    margin-top: 40px;
}

.contact-info {
    background: rgba(56, 189, 248, 0.05);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.contact-info p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-info strong {
    color: var(--color-accent);
}

form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 25px;
}

form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-accent);
}

form input,
form textarea {
    width: 100%;
    padding: 14px 18px;
    border-radius: 10px;
    border: 2px solid rgba(56, 189, 248, 0.2);
    background: rgba(15, 23, 42, 0.5);
    color: var(--color-text);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

form input:focus,
form textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px var(--color-accent-glow);
}

form textarea {
    resize: vertical;
    min-height: 150px;
}

.submit-btn {
    background: linear-gradient(135deg, var(--color-accent) 0%, #0ea5e9 100%);
    color: #000;
    padding: 16px 40px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px var(--color-accent-glow);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =========================================
   FOOTER
   ========================================= */

footer {
    text-align: center;
    padding: 40px;
    background: var(--color-bg);
    font-size: 0.95rem;
    color: var(--color-muted);
    border-top: 1px solid rgba(56, 189, 248, 0.1);
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 20px;
        padding: 20px 5%;
        height: auto;
    }

    .logo {
        height: 65px;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    section {
        padding: 80px 6%;

    }

    #inicio {
        padding-top: 150px;
        min-height: calc(100vh - 120px);
    }

    #inicio h2 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-item img {
        width: 100%;
    }

    .contact-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .cta-buttons a {
        text-align: center;
        justify-content: center;
    }
}
