/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #fff;
    background-color: #000;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    line-height: 1.2;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 300;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title span {
    font-style: italic;
    opacity: 0.7;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.98);
    box-shadow: 0 2px 20px rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.nav-logo span {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: #fff;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #fff;
    font-weight: 300;
    font-size: 0.9rem;
    letter-spacing: 1px;
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -5px;
    left: 0;
    background-color: #fff;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background: #fff;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, rgba(0,0,0,0.40) 0%, rgba(0,0,0,0.55) 100%), url('../images/mario.jpg') center center / cover no-repeat;
    overflow: hidden;
    min-height: 600px;
}
.main-hero-img {
    width: 340px;
    max-width: 80vw;
    height: auto;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
    object-fit: cover;
    background: #222;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    background: none;
}

/* Canvas particles and dev elements layering */
#dev-particles {
    z-index: 1; /* behind text */
}
.dev-elements {
    z-index: 2; /* above canvas, below hero text */
}
.hero-text {
    z-index: 3;
    color: #fff;
    text-align: left;
    padding-left: 15vw;
    padding-right: 20px;
    max-width: 1000px;
    align-self: flex-start;
    margin-top: 350px; /* Añade espacio superior para bajar el texto */
}
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.5));
    z-index: 0;
    pointer-events: none;
}

.hero-image {
    flex: 1;
    max-width: 500px;
}

.image-placeholder {
    width: 100%;
    height: 600px;
    background: linear-gradient(45deg, #222, #333);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.image-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Sin logo ni background por defecto */
    opacity: 0;
}

.hero-text {
    flex: 1;
    text-align: left;
}

.hero-greeting {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 300;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.hero-name {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 400;
    margin-bottom: 1rem;
    line-height: 1;
}

.hero-subtitle {
    font-size: clamp(0.8rem, 2vw, 1rem);
    letter-spacing: 3px;
    font-weight: 300;
    opacity: 0.7;
    margin-top: 4.5rem;
}
.hero-subtitle2 {
    font-size: clamp(0.8rem, 2vw, 1rem);
    letter-spacing: 3px;
    font-weight: 300;
    opacity: 0.7;
    margin-top: 1rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    right: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.6;
    animation: fadeInUp 1s ease-out 2s both;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: #fff;
    animation: scrollMove 2s ease-in-out infinite;
}

.scroll-indicator span {
    writing-mode: vertical-rl;
    font-size: 0.8rem;
    letter-spacing: 2px;
    font-weight: 300;
}

@keyframes scrollMove {
    0%, 100% { transform: translateY(-100%); }
    50% { transform: translateY(200%); }
}

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

/* Portfolio Section */
.portfolio {
    padding: 100px 0;
    background: #1a1a1a;
    position: relative;
}

.portfolio-header {
    text-align: center;
    margin-bottom: 1rem;
}

.portfolio-filters {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border-radius: 25px;
}

.filter-btn:hover,
.filter-btn.active {
    background: #fff;
    color: #000;
}

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

.portfolio-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 10px;
    transition: all 0.5s ease;
    background: #222;
    margin-bottom: 120px;
}

.portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.portfolio-image {
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.portfolio-item .image-placeholder {
    height: 100%;
    transition: transform 0.5s ease;
}

.portfolio-item:hover .image-placeholder {
    transform: scale(1.1);
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    color: #fff;
    padding: 2rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
}

.portfolio-overlay h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.portfolio-overlay p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Resume Section */
.resume {
    padding: 100px 0;
    background: #000;
}

.resume-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.resume-column h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.resume-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: #fff;
}

.resume-item {
    margin-bottom: 2.5rem;
    position: relative;
    padding-left: 2rem;
}

.resume-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.resume-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.company {
    display: block;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.period {
    display: block;
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 0.8rem;
}

.resume-item p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #ccc;
}

/* About Section */
.about {
    padding: 100px 0;
    background: #1a1a1a;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

/* Si la columna de imagen está vacía, ocultarla y usar una sola columna */
.about-image:empty {
    display: none;
}

.about-content.one-column {
    grid-template-columns: 1fr;
    align-items: start;
}

.about-text h2 {
    margin-bottom: 2rem;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #ccc;
}

.skills {
    margin-top: 3rem;
}

.skills h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.skill-list span {
    background: #333;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.skill-list span:hover {
    background: #fff;
    color: #000;
}

.about-image .image-placeholder {
    height: 400px;
}

/* Contact Section */
.contact {
    padding: 100px 0;
    background: #000;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-item {
    margin-bottom: 2rem;
}

.contact-item h3 {
    color: #fff;
}

.contact-item p {
    color: #ccc;
}

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

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    background: #111;
    color: #fff;
    border: 1px solid #333;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #fff;
}

.contact-form button {
    width: 100%;
    padding: 1rem;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.contact-form button:hover {
    background: #ccc;
}

/* Footer */
.footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid #333;
    background: #111;
    color: #aaa;
}

.footer p {
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    gap: 2rem;
}

.social-links a {
    color: #aaa;
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #fff;
}

/* Parallax Effects */
.parallax-element {
    will-change: transform;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
        backdrop-filter: blur(10px);
    }

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

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

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

    .hero-text {
        order: -1;
        text-align: center;
        padding-left: 0;
        padding-right: 0;
        margin-top: 160px;
    }

    /* Menú móvil: enlaces legibles sobre fondo claro */
    .nav-menu .nav-link {
        color: #000;
        display: block;
        padding: 12px 0;
        font-size: 1rem;
    }
    .nav-menu .nav-link::after {
        background-color: #000;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    /* Reducir espacios verticales en móvil */
    .portfolio-item {
        margin-bottom: 40px;
    }

    .resume-content,
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

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

    .scroll-indicator {
        bottom: 20px;
        right: 20px;
    }

    .section-title {
        font-size: 2.5rem;
    }
    /* Reducir padding vertical de secciones en móvil */
    .portfolio,
    .resume,
    .about,
    .contact {
        padding: 60px 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 0 15px;
    }

    .hero-text {
        margin-top: 120px;
    }

    .portfolio-filters {
        gap: 1rem;
    }

    /* Ocultar indicador de scroll en pantallas muy pequeñas */
    .scroll-indicator {
        display: none;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

/* Smooth Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.active {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
}

.slide-in-left.active {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease;
}

.slide-in-right.active {
    opacity: 1;
    transform: translateX(0);
}