/* ==========================================================================
   CSS Variables & Reset
   ========================================================================== */
   :root {
    /* Colors */
    --bg-color: #050505;
    --text-main: #EDEDED;
    --text-muted: #888888;
    --border-color: rgba(255, 255, 255, 0.1);
    --accent: #E5FF45; /* Neon yellow-green accent for subtle highlights */
    
    /* Typography */
    --font-sans: 'Outfit', sans-serif;
    --font-serif: 'Playfair Display', serif;
    
    /* Spacing */
    --space-md: 2rem;
    --space-lg: 5rem;
    --space-xl: 10rem;
    
    /* Transitions */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    /* Hide native cursor on desktop to use the custom one */
    cursor: none; 
}

/* ==========================================================================
   Custom Cursor
   ========================================================================== */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background-color: var(--text-main);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
}

.custom-cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bg-color);
    margin-top: -20px;
    margin-left: -20px;
    transition: width 0.3s var(--ease-out-expo), 
                height 0.3s var(--ease-out-expo), 
                background-color 0.3s, 
                border-color 0.3s;
}

.cursor-hover {
    width: 60px;
    height: 60px;
    margin-top: -30px;
    margin-left: -30px;
    border-color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.cursor-view {
    width: 80px;
    height: 80px;
    margin-top: -40px;
    margin-left: -40px;
    background-color: var(--text-main);
    border-color: var(--text-main);
}

/* Fallback for native cursors on links just in case */
a {
    cursor: none;
    text-decoration: none;
    color: inherit;
}

.magnetic {
    display: inline-block;
    transition: transform 0.3s ease-out;
}

/* ==========================================================================
   Typography Classes
   ========================================================================== */
h1, h2, h3 {
    font-family: var(--font-sans);
    font-weight: 600;
}

.italic-serif {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 500;
}

.highlight {
    color: var(--accent);
}

.highlight-subtle {
    color: var(--text-muted);
}

/* ==========================================================================
   Layout & Navigation
   ========================================================================== */
[data-scroll-container] {
    width: 100%;
}

.site-nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2rem 4vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    mix-blend-mode: difference;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.links {
    display: flex;
    gap: 3rem;
}

.links a {
    font-size: 0.9rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    padding: 0.5rem;
}

/* ==========================================================================
   Hero Section (Split Layout)
   ========================================================================== */
.hero {
    min-height: 100vh;
    padding: 0 4vw;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center the split content vertically */
    padding-top: 10vh;
}

.hero-content-split {
    display: grid;
    grid-template-columns: 1fr auto; 
    gap: 3rem; 
    align-items: center;
    padding-right: 8vw; /* Más margen a la derecha */
}

/* Left side text */
.hero-left {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.hero-title {
    font-size: clamp(3rem, 7vw, 7rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero-bottom-text {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: flex-start;
}

.hero-bio {
    max-width: 500px;
    font-size: 1.25rem;
    color: var(--text-muted);
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-height: 52px;
    padding: 0 1.35rem;
    border-radius: 999px;
    background: var(--accent);
    color: #050505;
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: 0 18px 42px rgba(200, 230, 0, 0.22);
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.hero-download:hover {
    box-shadow: 0 22px 56px rgba(200, 230, 0, 0.34);
    filter: brightness(1.05);
}

.scroll-down {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    padding: 1rem 0;
}

/* Right side photo */
.hero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Alineado a la izquierda para acercarse al texto */
    gap: 2rem;
}

.avatar-wrapper {
    position: relative;
    width: 320px;
    height: 420px;
    border-radius: 200px 200px 20px 20px;
}

.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 200px 200px 20px 20px;
    filter: grayscale(100%);
    transition: filter 0.5s;
}

.avatar-wrapper:hover .avatar {
    filter: grayscale(0%);
}

.rotating-badge {
    position: absolute;
    top: 20px;
    left: -40px; /* Moved badge to the left so it doesn't clip screen edge */
    width: 120px;
    height: 120px;
    animation: rotateText 10s linear infinite;
    pointer-events: none;
    background: var(--bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.rotating-badge svg {
    fill: var(--text-main);
    letter-spacing: 2px;
}

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

.hero-location {
    text-align: right;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    width: 320px; /* Match avatar width for alignment */
}

/* ==========================================================================
   Marquee
   ========================================================================== */
.marquee-container {
    padding: 5rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    white-space: nowrap;
}

.marquee {
    display: inline-block;
    animation: marqueeScroll 25s linear infinite;
}

.marquee span {
    font-size: clamp(2rem, 4vw, 4rem); /* Tamaño reducido */
    font-weight: 800;
    letter-spacing: -0.02em;
    padding-right: 2rem;
}

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ==========================================================================
   Work / Projects - TARJETAS VISIBLES
   ========================================================================== */
.work-section {
    padding: var(--space-xl) 4vw;
}

.section-heading {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

.project-cards {
    display: flex;
    flex-direction: column;
    gap: 5rem;
}

.project-card {
    display: flex;
    align-items: center;
    gap: 4rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 32px;
    padding: 2.5rem;
    position: relative;
    transition: transform 0.6s var(--ease-out-expo), background 0.6s, box-shadow 0.6s;
}

.project-card:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.project-card.reverse {
    flex-direction: row-reverse;
}

.project-card-image {
    flex: 1.2;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/10;
    position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    background: #000;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Clean Image Display */
.project-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s var(--ease-out-expo);
}

.project-card-image:hover img {
    transform: scale(1.05);
}

.project-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.project-card-info h3 {
    font-size: clamp(2rem, 3vw, 3rem);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.project-tags {
    color: var(--accent);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

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

.tech-chip {
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    letter-spacing: 0.05em;
    position: relative;
    padding-right: 1rem;
    opacity: 0.8;
}

.tech-chip:not(:last-child)::after {
    content: '/';
    position: absolute;
    right: 0.3rem;
    color: var(--accent);
}

.project-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    max-width: 500px;
}

.project-impact {
    list-style: none;
    display: grid;
    gap: 0.65rem;
    margin-bottom: 2.5rem;
    max-width: 520px;
}

.project-impact li {
    position: relative;
    padding-left: 1.4rem;
    color: var(--text-main);
    font-size: 0.98rem;
    opacity: 0.9;
}

.project-impact li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 0.55rem;
    height: 1px;
    background: var(--accent);
}

.project-link {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--text-main);
    padding-bottom: 0.5rem;
}

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

/* ==========================================================================
   Stack Section
   ========================================================================== */
.stack-section {
    padding: 0 4vw var(--space-xl);
}

.stack-header {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 560px);
    gap: 4rem;
    align-items: end;
    margin-bottom: var(--space-lg);
}

.stack-header .section-heading {
    margin-bottom: 0;
}

.stack-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 560px;
}

.stack-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.stack-category {
    min-height: 100%;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.025);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
    transition: transform 0.45s var(--ease-out-expo), background 0.45s, border-color 0.45s;
}

.stack-category:hover {
    transform: translateY(-6px);
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(229, 255, 69, 0.24);
}

.stack-category.wide {
    grid-column: 1 / -1;
}

.stack-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.stack-category-header h3 {
    font-size: clamp(1.35rem, 2vw, 2rem);
    letter-spacing: -0.02em;
}

.stack-number {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

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

.services-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stack-tech {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 54px;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
    transition: transform 0.35s var(--ease-out-expo), border-color 0.35s, background 0.35s;
}

.stack-tech:hover {
    transform: translateY(-3px);
    border-color: rgba(229, 255, 69, 0.38);
    background: rgba(229, 255, 69, 0.055);
}

.stack-tech img,
.tech-mark {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
}

.stack-tech img[src*="github"],
.stack-tech img[src*="express"] {
    filter: invert(1);
}

.tech-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(229, 255, 69, 0.42);
    border-radius: 50%;
    color: var(--accent);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0;
}

.stack-projects {
    margin-top: 1.25rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.018);
}

.stack-projects h3 {
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    margin-bottom: 1.25rem;
}

.stack-project-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.stack-project-list article {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.stack-project-list span {
    display: block;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
}

.stack-project-list p {
    color: var(--text-muted);
    font-size: 0.95rem;
}


/* ==========================================================================
   About Section
   ========================================================================== */
.about-section {
    padding: var(--space-xl) 4vw var(--space-lg);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
}

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

.large-text {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* ==========================================================================
   Contact / Footer
   ========================================================================== */
.contact-section {
    padding: var(--space-xl) 4vw 2rem 4vw;
    background-color: var(--text-main);
    color: var(--bg-color);
    margin-top: var(--space-xl);
}

.contact-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.contact-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 2rem;
}

.big-email {
    font-size: clamp(3rem, 8vw, 8rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    border-bottom: 2px solid var(--bg-color);
}

.contact-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 2rem;
    font-size: 0.9rem;
}

.socials {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.social-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 48px;
    padding: 0 1.15rem;
    border: 1px solid rgba(5, 5, 5, 0.25);
    border-radius: 999px;
    color: var(--bg-color);
    font-size: 0.88rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.social-button.primary {
    background: var(--bg-color);
    color: var(--text-main);
    border-color: var(--bg-color);
    box-shadow: 0 14px 34px rgba(5, 5, 5, 0.24);
}

.social-button:hover {
    background: var(--bg-color);
    color: var(--text-main);
    box-shadow: 0 14px 34px rgba(5, 5, 5, 0.2);
}

.social-button.primary:hover {
    background: #1a1a1a;
}

.manifesto {
    font-weight: 500;
}

/* ==========================================================================
   Animations
   ========================================================================== */
.fade-up-section {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s var(--ease-out-expo), transform 1s var(--ease-out-expo);
}

.fade-up-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 900px) {
    /* Desactivar cursor personalizado en móviles para usar touch normal */
    body, a { cursor: auto; }
    .custom-cursor, .custom-cursor-follower { display: none; }

    .site-nav {
        align-items: flex-start;
        gap: 1rem;
    }

    .links {
        gap: 0.75rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .links a {
        font-size: 0.78rem;
    }
    
    .hero-content-split {
        grid-template-columns: 1fr;
        gap: 4rem;
        margin-top: 4rem;
    }
    
    .hero-left, .hero-right {
        align-items: center;
        text-align: center;
    }
    
    .hero-bottom-text {
        align-items: center;
    }

    .hero-actions {
        justify-content: center;
    }
    
    .hero-location {
        text-align: center;
    }
    
    .avatar-wrapper {
        width: 100%;
        max-width: 400px;
    }
    
    .project-card, .project-card.reverse {
        flex-direction: column;
        gap: 2rem;
    }
    
    .project-card-image {
        width: 100%;
    }

    .stack-header {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        align-items: start;
    }

    .stack-grid,
    .stack-project-list {
        grid-template-columns: 1fr;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-footer {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
}

@media (max-width: 560px) {
    .site-nav {
        padding: 1.25rem 4vw;
    }

    .links {
        max-width: 220px;
    }

    .stack-section {
        padding-bottom: var(--space-lg);
    }

    .stack-category,
    .stack-projects {
        border-radius: 18px;
        padding: 1rem;
    }

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

    .stack-tech {
        min-height: 50px;
    }
}
