/* ======================================================
   1 VARIABLES GLOBALES
====================================================== */
:root {
    --color-primary: #00c3ff;
    --color-primary-dark: #008ecf;
    --color-accent: #1e90ff;

    --color-bg-main: #0d1117;
    --color-bg-alt: #161b22;
    --color-surface: #1f2630;

    --color-text: #e6edf3;
    --color-text-muted: #9da7b3;
    --color-text-soft: #c9d1d9;
    --color-white: #ffffff;

    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --spacing-section: 100px;

    --shadow-soft: 0 15px 40px rgba(0,0,0,0.35);
    --shadow-hover: 0 20px 50px rgba(0,0,0,0.55);

    --transition: 0.3s ease;
}

/* ======================================================
   2 RESET + BASE
====================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--color-bg-main);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ======================================================
   3 CONTENEDOR GLOBAL
====================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ======================================================
   4 HEADER & NAV
====================================================== */
.header {
    /* Fondo con fallback para Firefox */
    background: rgba(13, 17, 23, 0.85); 
    background: linear-gradient(to right, rgba(13, 17, 23, 0.9), rgba(17, 24, 39, 0.9));
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    /* Compatibilidad para desenfoque */
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
    display: block;
}

.nav ul {
    display: flex;
    list-style: none;
}

.nav ul li {
    margin-left: 30px;
}

.nav ul li a {
    color: var(--color-white);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.nav ul li a:hover {
    color: var(--color-primary);
}

/* Menu Hamburguesa */
#menu-toggle {
    display: none;
}

.menu-icon {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-icon span {
    height: 3px;
    width: 28px;
    background: var(--color-white);
    margin: 4px 0;
}

/* ======================================================
   5 HERO / PERFIL
====================================================== */
.hero {
    padding: 160px 0 100px;
    overflow: hidden;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 10px;
}

.hero-text p {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    margin: 20px 0;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hero-image img {
    width: clamp(200px, 25vw, 300px);
    max-width: 100%;
    height: auto;
    /* Compatibilidad clip-path */
    -webkit-clip-path: polygon(10% 15%, 85% 8%, 95% 40%, 90% 85%, 60% 95%, 18% 88%, 5% 55%);
    clip-path: polygon(10% 15%, 85% 8%, 95% 40%, 90% 85%, 60% 95%, 18% 88%, 5% 55%);
    box-shadow: var(--shadow-soft);
    transition: transform 0.4s ease;
    background-color: var(--color-surface);
}

.hero-image img:hover {
    transform: scale(1.05) rotate(2deg);
}

/* ======================================================
   6 BOTONES
====================================================== */
.btn {
    display: inline-block;
    padding: 12px 35px;
    background: var(--color-primary);
    color: var(--color-white);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
}

.btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 195, 255, 0.3);
}

/* ======================================================
   7 SECCIONES GENERALES
====================================================== */
.section {
    padding: var(--spacing-section) 0;
    text-align: center;
}

.section h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 25px;
}

.alt {
    background: var(--color-bg-alt);
}

/* ======================================================
   8 ABOUT
====================================================== */
.about-section {
    position: relative;
    padding: 120px 0;
    background: linear-gradient(rgba(13, 17, 23, 0.8), rgba(13, 17, 23, 0.8)), url("../assets/2.webp") center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.about-content {
    max-width: 850px;
    padding: 0 20px;
}

.about-content h2 {
    font-size: 2.8rem;
    margin-bottom: 25px;
    color: var(--color-accent);
}

.about-content p {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--color-text-soft);
}

/* ======================================================
   9 SERVICIOS
====================================================== */
#servicios {
    position: relative;
    padding: var(--spacing-section) 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.service-card {
    background: rgba(255, 255, 255, 0.03);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 15px;
    text-align: left;
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.05);
}

.service-card h3 {
    margin-bottom: 15px;
    color: var(--color-primary);
    font-size: 1.4rem;
}

.skill-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    width: 0; /* Controlado por inline style en JS */
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 10px;
    transition: width 1.5s cubic-bezier(0.1, 0.5, 0.5, 1);
}

/* ======================================================
   10 CONTACTO
====================================================== */
.contact-section {
    padding: var(--spacing-section) 0;
}

.contact-header {
    text-align: center;
    margin-bottom: 50px;
}

.contact-form {
    max-width: 650px;
    margin: 0 auto;
    background: var(--color-bg-alt);
    padding: 40px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.form-group input,
.form-group textarea {
    background: #0d1117;
    border: 1px solid #30363d;
    padding: 14px;
    border-radius: 10px;
    color: var(--color-white);
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 195, 255, 0.1);
}

.btn-contact {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-contact:hover {
    background: var(--color-primary-dark);
    transform: scale(1.02);
}

/* ======================================================
   11 FOOTER
====================================================== */
.footer {
    background: #07090d;
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid #161b22;
}

.footer a.footer-btn {
    color: var(--color-white);
    text-decoration: none;
    font-weight: 700;
    background: var(--color-primary);
    padding: 5px 12px;
    border-radius: 6px;
    margin: 0 5px;
    transition: var(--transition);
}

.footer a.footer-btn:hover {
    background: var(--color-accent);
}

/* ======================================================
   12 ANIMACIÓN TYPING (Mejorada para Firefox)
====================================================== */
.typing {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--color-primary);
    max-width: fit-content;
    animation: typing 3.5s steps(40, end) forwards, blink 0.8s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* ======================================================
   13 RESPONSIVE
====================================================== */
@media (max-width: 768px) {
    .menu-icon {
        display: flex;
    }

    .nav {
        position: absolute;
        top: 70px;
        left: -100%;
        width: 100%;
        background: var(--color-bg-alt);
        padding: 30px;
        transition: 0.4s ease;
    }

    #menu-toggle:checked ~ .nav {
        left: 0;
    }

    .nav ul {
        flex-direction: column;
        align-items: center;
    }

    .nav ul li {
        margin: 15px 0;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }
}