
/* Variables y reset */
:root {
    --primary: #3a86ff;
    --primary-dark: #2667cc;
    --secondary: #ff006e;
    --dark: #0c0c1d;
    --light: #f8f9fa;
    --gray: #6c757d;
    --success: #00b4d8;
    --dev-purple: #8b5cf6;
    --dev-cyan: #06b6d4;
    --gradient-primary: linear-gradient(135deg, var(--primary), #5e60ce);
    --gradient-accent: linear-gradient(135deg, var(--secondary), #fb5607);
    --font-main: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 8px 30px rgba(0, 0, 0, 0.2);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

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

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

button {
    cursor: pointer;
    font-family: inherit;
}

/* Utilities */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    border-radius: 50px;
    border: none;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: var(--gradient-accent);
    transition: var(--transition);
    z-index: -1;
}

.btn:hover::before {
    width: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-strong);
}

.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
    font-weight: 700;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    height: 5px;
    width: 80px;
    background: var(--gradient-primary);
    margin: 20px auto;
    border-radius: 5px;
}

.grid {
    display: grid;
    gap: 30px;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: var(--dev-purple);
    animation: spin 1s linear infinite;
    position: relative;
}

.loader::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border: 5px solid transparent;
    border-left-color: var(--dev-cyan);
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

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

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(58, 134, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(58, 134, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(58, 134, 255, 0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease forwards;
    opacity: 0;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 15px 0;
    transition: var(--transition);
    background-color: rgba(12, 12, 29, 0.95);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--light);
    display: flex;
    align-items: center;
}

.logo span {
    color: var(--secondary);
    animation: float 3s ease-in-out infinite;
}

.logo-icon {
    width: 35px;
    height: 35px;
    margin-right: 10px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    box-shadow: var(--shadow);
}

.navbar .nav-links {
    display: flex;
    gap: 30px;
}

.navbar .nav-links a {
    color: var(--light);
    font-weight: 500;
    font-size: 1rem;
    transition: var(--transition);
    position: relative;
}

.navbar .nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient-accent);
    transition: var(--transition);
    border-radius: 5px;
}

.navbar .nav-links a:hover::after {
    width: 100%;
}

.navbar .nav-links a:hover {
    color: var(--secondary);
}

.hamburger {
    display: none;
    cursor: pointer;
    color: var(--light);
    font-size: 1.5rem;
}

/* Hero Section Desarrollo Web */
.hero-dev {
    height: 100vh;
    background: linear-gradient(rgba(12, 12, 29, 0.9), rgba(12, 12, 29, 0.8)), 
                radial-gradient(circle at 30% 50%, rgba(58, 134, 255, 0.2) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(255, 0, 110, 0.2) 0%, transparent 50%);
    color: var(--light);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.code-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--primary);
    overflow: hidden;
    pointer-events: none;
}

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

.hero-dev-subtitle {
    color: var(--secondary);
    font-size: 1.2rem;
    margin-bottom: 20px;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 600;
    animation: fadeIn 0.8s ease 0.2s forwards;
    opacity: 0;
}

.hero-dev-title {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 30px;
    font-weight: 700;
    animation: fadeIn 0.8s ease 0.5s forwards;
    opacity: 0;
}

.hero-dev-description {
    font-size: 1.1rem;
    margin-bottom: 40px;
    max-width: 600px;
    color: rgba(248, 249, 250, 0.8);
    animation: fadeIn 0.8s ease 0.8s forwards;
    opacity: 0;
}

.hero-dev-buttons {
    display: flex;
    gap: 20px;
    animation: fadeIn 0.8s ease 1.1s forwards;
    opacity: 0;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--light);
}

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

/* Floating Code Elements */
.code-element {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    padding: 15px;
    box-shadow: var(--shadow);
    color: var(--light);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    animation: float 6s ease-in-out infinite;
}

.code-element:nth-child(1) {
    top: 20%;
    right: 10%;
    animation-delay: 0.5s;
}

.code-element:nth-child(2) {
    bottom: 30%;
    right: 15%;
    animation-delay: 1.2s;
}

.code-element:nth-child(3) {
    top: 60%;
    left: 10%;
    animation-delay: 2s;
}

/* Services Section */
.services {
    background-color: white;
    position: relative;
    overflow: hidden;
}

.services::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(58, 134, 255, 0.1), rgba(94, 96, 206, 0.1));
    top: -150px;
    left: -150px;
    z-index: 0;
}

.services-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    position: relative;
    z-index: 2;
}

.service-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-strong);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 5px;
    width: 100%;
    background: var(--gradient-primary);
}

.service-icon {
    width: 70px;
    height: 70px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
    background-color: rgba(58, 134, 255, 0.1);
    border-radius: 50%;
}

.service-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.service-description {
    color: var(--gray);
    margin-bottom: 20px;
    flex-grow: 1;
}

.service-features {
    list-style: none;
    margin-bottom: 20px;
}

.service-features li {
    margin-bottom: 8px;
    color: var(--gray);
    position: relative;
    padding-left: 20px;
}

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

/* Portfolio Section */
.portfolio {
    background-color: var(--light);
    position: relative;
}

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

.portfolio-item {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    opacity: 0;
    transform: scale(0.9);
}

.portfolio-item.visible {
    opacity: 1;
    transform: scale(1);
}

.portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-strong);
}

.portfolio-image {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(58, 134, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

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

.portfolio-overlay-content {
    text-align: center;
    color: white;
}

.portfolio-content {
    padding: 25px;
}

.portfolio-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.portfolio-description {
    color: var(--gray);
    margin-bottom: 15px;
}

.portfolio-tech {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.tech-tag {
    background: rgba(58, 134, 255, 0.1);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.portfolio-links {
    display: flex;
    gap: 15px;
}

.portfolio-link {
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.portfolio-link:hover {
    color: var(--secondary);
}

/* Technologies Section */
.technologies {
    background-color: var(--dark);
    color: var(--light);
    position: relative;
    overflow: hidden;
}

.tech-intro {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 60px;
}

.tech-intro p {
    color: rgba(248, 249, 250, 0.8);
    font-size: 1.1rem;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 25px;
    max-width: 800px;
    margin: 0 auto;
}

.tech-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 25px 15px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
}

.tech-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.tech-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-10px);
}

.tech-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.tech-name {
    font-weight: 600;
    font-size: 1rem;
}

/* HTML5 */
.tech-item:nth-child(1) .tech-icon {
    color: #e34f26;
}

/* CSS3 */
.tech-item:nth-child(2) .tech-icon {
    color: #1572b6;
}

/* JavaScript */
.tech-item:nth-child(3) .tech-icon {
    color: #f7df1e;
}

/* React */
.tech-item:nth-child(4) .tech-icon {
    color: #61dafb;
}

/* Node.js */
.tech-item:nth-child(5) .tech-icon {
    color: #339933;
}

/* WordPress */
.tech-item:nth-child(6) .tech-icon {
    color: #21759b;
}

/* Docker */
.tech-item:nth-child(7) .tech-icon {
    color: #2496ed;
}

/* Git */
.tech-item:nth-child(8) .tech-icon {
    color: #f05032;
}

/* Process Section */
.process {
    background-color: white;
    position: relative;
}

.process-timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.process-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.process-step {
    display: flex;
    align-items: center;
    margin-bottom: 50px;
    opacity: 0;
    transform: translateX(-50px);
}

.process-step.visible {
    opacity: 1;
    transform: translateX(0);
}

.process-step:nth-child(even) {
    flex-direction: row-reverse;
    transform: translateX(50px);
}

.process-step:nth-child(even).visible {
    transform: translateX(0);
}

.process-content {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 45%;
    position: relative;
}

.process-number {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    z-index: 2;
}

.process-step:nth-child(even) .process-number {
    left: -5%;
}

.process-step:nth-child(odd) .process-number {
    right: -22%;
    left: auto;
}

.process-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark);
}

.process-description {
    color: var(--gray);
}

/* CTA Section */
.cta {
    background: linear-gradient(rgba(12, 12, 29, 0.9), rgba(12, 12, 29, 0.8)), 
                radial-gradient(circle at 80% 10%, rgba(255, 0, 110, 0.3), transparent 30%),
                radial-gradient(circle at 20% 80%, rgba(58, 134, 255, 0.3), transparent 30%);
    color: var(--light);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.cta-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
}

.cta-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.cta-description {
    margin-bottom: 40px;
    font-size: 1.1rem;
    opacity: 0;
    transform: translateY(20px);
}

.cta-description.visible {
    opacity: 1;
    transform: translateY(0);
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
}

.cta-buttons.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
.footer {
    background-color: var(--dark);
    color: var(--light);
    padding: 60px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

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

.footer-about {
    max-width: 300px;
}

.footer-about p {
    color: rgba(248, 249, 250, 0.7);
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 3px;
    background: var(--secondary);
    border-radius: 5px;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(248, 249, 250, 0.7);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.footer-links a:hover {
    color: var(--light);
    padding-left: 5px;
}

.contact-info li {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    color: rgba(248, 249, 250, 0.7);
}

.contact-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(248, 249, 250, 0.6);
    font-size: 0.9rem;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong);
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero-dev-title {
        font-size: 2.8rem;
    }

    .process-timeline::before {
        left: 30px;
    }

    .process-step {
        flex-direction: row !important;
        margin-left: 60px;
    }

    .process-content {
        width: 100%;
    }

    .process-number {
        left: -30px !important;
        right: auto !important;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }

    .hero-dev-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .navbar .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 250px;
        background-color: var(--dark);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: var(--transition);
        z-index: 1001;
    }

    .navbar .nav-links.active {
        right: 0;
    }

    .hamburger {
        display: block;
        z-index: 1002;
    }

    .hero-dev-content {
        text-align: center;
        margin: 0 auto;
    }

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

    .footer-about {
        max-width: 100%;
    }

    .social-links {
        justify-content: center;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 576px) {
    .hero-dev-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .tech-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 15px;
    }

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