* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #00ff9d;
    /* Verde cibernético */
    --secondary-color: #00c3ff;
    /* Azul brillante */
    --accent-color: #3d5afe;
    /* Azul índigo, reemplazando el rosa */
    --background-dark: #0a0a0a;
    --text-light: #ffffff;
    --text-gray: #e0e0e0;
    /* Lighter gray for better contrast */
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-hover-bg: rgba(255, 255, 255, 0.15);
    --glass-bg: rgba(10, 10, 10, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    --box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

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

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    animation: fadeIn 0.5s ease-out;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    animation: spin 1s linear infinite, fadeIn 0.5s ease-out;
    margin-bottom: 1rem;
}

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

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

/* Canvas */
canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
}

/* Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

nav {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-scrolled {
    padding: 1rem 2rem;
    background: rgba(10, 10, 10, 0.95);
    box-shadow: var(--box-shadow);
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: var(--transition-smooth);
    text-shadow: 0 0 20px rgba(0, 255, 157, 0.3);
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 1rem;
    transition: var(--transition-smooth);
    border-radius: 8px;
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition-smooth);
    opacity: 0;
}

.nav-links a:hover {
    color: var(--text-light);
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-links a.active {
    color: var(--background-dark);
    background: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.3);
}

.nav-links a:hover::before {
    width: 80%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.nav-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
    transform-origin: center;
}

.nav-toggle.active {
    background-color: rgba(255, 255, 255, 0.15);
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    transform: scaleX(0);
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Main Content */
section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 6rem 0;
}

.content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(135deg,
            rgba(0, 255, 157, 0.1) 0%,
            rgba(0, 195, 255, 0.1) 50%,
            rgba(61, 90, 254, 0.1) 100%);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(0, 255, 157, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 195, 255, 0.1) 0%, transparent 50%);
    z-index: 0;
}

.hero {
    max-width: 1200px;
    width: 90%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 2rem;
}

.hero-content {
    position: relative;
}

.glitch-text {
    font-size: 5.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 2rem;
    position: relative;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    color: var(--text-light);
    max-width: 600px;
    line-height: 1.6;
}

.hero p::after {
    content: '';
    display: block;
    width: 100px;
    height: 3px;
    background: var(--gradient-primary);
    margin-top: 1rem;
    border-radius: 2px;
}

.cta-container {
    display: flex;
    gap: 1.5rem;
}

.cta {
    padding: 1rem 2.5rem;
    text-decoration: none;
    font-weight: 700;
    border-radius: 50px;
    background: var(--gradient-primary);
    color: var(--background-dark);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: none;
}

.cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-secondary);
    transition: opacity 0.3s ease;
    opacity: 0;
    z-index: -1;
}

.cta:hover::before {
    opacity: 1;
}

.cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 255, 157, 0.2);
}

.cta-secondary {
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--primary-color);
}

.cta-secondary:hover {
    background: var(--primary-color);
    color: var(--background-dark);
}

.hero-image {
    width: 400px;
    height: 400px;
    background: var(--gradient-secondary);
    border-radius: 50%;
    position: relative;
    animation: morph 8s ease-in-out infinite;
}

.hero-image::before {
    content: '';
    position: absolute;
    inset: 10px;
    background: var(--background-dark);
    border-radius: 50%;
}

.hero-image img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 40px);
    /* Adjust to fit inside the 10px inset */
    height: calc(100% - 40px);
    border-radius: 50%;
    object-fit: cover;
    z-index: 10;
}

@keyframes morph {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }

    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

/* Section Titles */
.section-title {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 4rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-item {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
    background: var(--card-hover-bg);
}

.project-image {
    width: 100%;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    position: relative;
    overflow: hidden;
}

.project-image img,
.project-image video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-item:hover .project-image img,
.project-item:hover .project-image video {
    transform: scale(1.05);
}

.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(0deg, rgba(10, 10, 10, 0.95) 0%, rgba(10, 10, 10, 0.8) 40%, transparent 100%);
    transform: translateY(calc(100% - 110px));
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-item:hover .project-info {
    transform: translateY(0);
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.project-info h3 i {
    font-size: 1.7rem;
    color: var(--text-gray);
    transition: var(--transition-smooth);
}

.project-info p,
.project-info .project-tags,
.project-info .project-link {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.project-item:hover .project-info p,
.project-item:hover .project-info .project-tags,
.project-item:hover .project-info .project-link {
    opacity: 1;
    transition-delay: 0.25s;
}

.project-item:hover .project-info h3 i {
    color: var(--primary-color);
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 7px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.platform-badge i {
    font-size: 1.2em;
    transition: var(--transition-smooth);
}

.platform-badge.apple {
    background-color: #1c1c1e;
    border-color: #3a3a3c;
    color: #f5f5f7;
}

.platform-badge.apple i {
    color: #f5f5f7;
}

.platform-badge.google-play {
    background-color: #24292e;
    border-color: #444d56;
    color: #3ddc84;
}

.platform-badge.google-play i {
    color: #3ddc84;
}

.platform-badge.github {
    background-color: #24292e;
    border-color: #444d56;
    color: #f6f8fa;
}

.platform-badge.github i {
    color: #f6f8fa;
}

.project-item:hover .platform-badge {
    transform: translateY(-2px) scale(1.05);
}

.project-item:hover .platform-badge.apple {
    background-color: #f5f5f7;
    color: #1d1d1f;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(245, 245, 247, 0.2);
}

.project-item:hover .platform-badge.apple i {
    color: #1d1d1f;
}

.project-item:hover .platform-badge.google-play {
    background-color: #3ddc84;
    color: var(--background-dark);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(61, 220, 132, 0.3);
}

.project-item:hover .platform-badge.google-play i {
    color: var(--background-dark);
}

.project-item:hover .platform-badge.github {
    background-color: #f6f8fa;
    color: #24292e;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(246, 248, 250, 0.2);
}

.project-item:hover .platform-badge.github i {
    color: #24292e;
}

.project-info p {
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.project-tags span {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.project-tags span:hover {
    background: var(--primary-color);
    color: var(--background-dark);
}

.project-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
    position: relative;
}

.project-link::after {
    content: '→';
    margin-left: 0.5rem;
    transition: margin-left 0.3s ease;
}

.project-link:hover {
    color: var(--primary-color);
}

.project-link:hover::after {
    margin-left: 1rem;
}

/* About Section */
.about-section {
    background: rgba(0, 195, 255, 0.05);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--box-shadow);
}

.about-text p {
    margin-bottom: 1.5rem;
    max-width: 650px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 1.1rem;
}

.skills-container {
    margin: 2.5rem 0;
}

.skills-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.skill-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition-smooth);
}

.skill-card:hover {
    transform: translateY(-5px);
    background: var(--primary-color);
    color: var(--background-dark);
    border-color: var(--primary-color);
}

.skill-card:hover i {
    color: var(--background-dark);
}

.skill-card i {
    font-size: 1.8rem;
    color: var(--primary-color);
    transition: var(--transition-smooth);
}

.skill-card span {
    font-size: 1rem;
    font-weight: 500;
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.stat {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: var(--transition-smooth);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat:hover {
    transform: translateY(-5px);
    background: var(--card-hover-bg);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    display: block;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Contact Section */
.contact-section {
    background: rgba(61, 90, 254, 0.05);
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: flex-start;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 4rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--box-shadow);
}

.contact-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.contact-info p {
    margin-bottom: 2rem;
    color: var(--text-light);
    line-height: 1.7;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 1.1rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-light);
    text-decoration: none;
    padding: 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    transition: var(--transition-smooth);
}

.contact-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    color: var(--text-light);
}

.contact-link i {
    font-size: 1.8rem;
    color: var(--primary-color);
    transition: var(--transition-smooth);
}

.contact-link h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.contact-link span {
    font-size: 0.9rem;
    color: var(--text-gray);
}

.contact-link:hover i {
    transform: scale(1.1);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1.2rem 1rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.2);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: var(--text-gray);
    pointer-events: none;
    transition: all 0.2s ease-out;
}

.contact-form input:focus~label,
.contact-form input:not(:placeholder-shown)~label,
.contact-form textarea:focus~label,
.contact-form textarea:not(:placeholder-shown)~label {
    top: 0.4rem;
    font-size: 0.75rem;
    color: var(--primary-color);
}

.contact-form .cta {
    align-self: flex-start;
}

/* Footer */
footer {
    padding: 3rem 2rem;
    background: var(--background-dark);
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.footer-copyright {
    color: var(--text-gray);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: var(--transition-smooth);
}

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

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: bold;
}

/* Responsive Styles */
@media screen and (max-width: 1024px) {

    .about-content,
    .hero,
    .contact-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-text {
        text-align: left;
    }

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

    .hero-image {
        margin: 2rem auto 0;
        width: 350px;
        height: 350px;
    }

    .cta-container {
        justify-content: center;
    }

    .hero p::after {
        margin: 1rem auto;
    }

    .contact-container {
        padding: 3rem;
    }

    .contact-form .cta {
        align-self: center;
    }

    .about-stats {
        flex-direction: row;
        gap: 2rem;
    }

    .glitch-text {
        font-size: 4rem;
    }
}

@media screen and (max-width: 768px) {
    .hero-section {
        align-items: flex-start;
        padding-top: 120px;
        padding-bottom: 60px;
        min-height: auto;
    }

    .hero {
        gap: 2rem;
        padding: 0 1rem;
    }

    .hero-image {
        width: 300px;
        height: 300px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        height: calc(100vh - 80px);
        background: rgba(10, 10, 10, 0.98);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transform: translateY(-110%);
        transition: transform 0.4s ease-in-out;
    }

    .nav-links.active {
        transform: translateY(0);
    }

    .glitch-text {
        font-size: 3rem;
    }

    .hero p {
        font-size: 1.2rem;
    }

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

    .contact-container {
        padding: 2rem;
    }
}

@media screen and (max-width: 480px) {
    nav {
        padding: 1rem;
    }

    .glitch-text {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-image {
        width: 280px;
        height: 280px;
    }

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

    .about-stats {
        flex-direction: column;
    }

    .stat {
        flex-direction: row;
        gap: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
    }

    .contact-container {
        padding: 1.5rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.hero-section,
.portfolio-section,
.about-section,
.contact-section {
    animation: fadeIn 1s ease-out;
}

.project-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-image video:-webkit-loading {
    background-color: #333;
    /* Placeholder color */
}

.portfolio-section {
    padding-top: 100px;
    padding-bottom: 100px;
}