/* ===========================
   RESET Y BASE
   =========================== */

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

:root {
    /* Colores principales */
    --purple-900: #0a0214;
    --purple-800: #1a0b2e;
    --purple-700: #2d1b4e;
    --purple-600: #4a2f6d;
    --purple-500: #6b46c1;
    --purple-400: #8b5cf6;
    --purple-300: #a78bfa;
    --purple-200: #c4b5fd;
    --purple-100: #e9d5ff;
    
    /* Grises y negros */
    --black: #000000;
    --gray-900: #0f0f0f;
    --gray-800: #1a1a1a;
    --gray-700: #2a2a2a;
    --gray-600: #3a3a3a;
    --gray-500: #6b6b6b;
    --gray-400: #9b9b9b;
    --gray-300: #d4d4d4;

   /* Verde ok*/
   --green-400: #53a654;
    
    /* Efectos */
    --glow-purple: 0 0 20px rgba(139, 92, 246, 0.3);
    --glow-purple-strong: 0 0 40px rgba(139, 92, 246, 0.6);
    
    /* Tipografía */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

html {
    scroll-behavior: smooth;
    cursor: none;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    background: var(--purple-900);
    color: var(--gray-300);
    line-height: 1.6;
    cursor: none;
}

/* ===========================
   CURSOR PERSONALIZADO
   =========================== */

.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--purple-400);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, border-color 0.2s;
    box-shadow: var(--glow-purple);
    opacity: 0;
}

.custom-cursor-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--purple-400);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease-out;
    box-shadow: var(--glow-purple);
    opacity: 0;
}

a:hover ~ .custom-cursor,
button:hover ~ .custom-cursor {
    width: 40px;
    height: 40px;
    border-color: var(--purple-300);
    box-shadow: var(--glow-purple-strong);
}

/* ===========================
   FONDO Y GRID
   =========================== */

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(107, 70, 193, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, var(--purple-900) 0%, var(--black) 100%);
    z-index: -2;
    pointer-events: none;
}

.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.4;
    pointer-events: none;
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
}

@keyframes gridMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(50px); }
}

/* ===========================
   CONTENEDOR
   =========================== */

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

/* ===========================
   NAVEGACIÓN
   =========================== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: all 0.3s ease;
}

.nav.scrolled {
    background: rgba(10, 2, 20, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.logo-bracket {
    color: var(--purple-400);
}

.logo-text {
    color: var(--gray-300);
    margin: 0 0.25rem;
}

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

.nav-links a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    position: relative;
    font-weight: 500;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--purple-400);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--purple-300);
}

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

/* ===========================
   HERO SECTION
   =========================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 4rem;
}

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

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--purple-300);
    margin-bottom: 2rem;
}

.tag-icon {
    color: var(--green-400);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--gray-300);
}

.gradient-text {
    background: linear-gradient(135deg, var(--purple-300), var(--purple-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--gray-400);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: 1rem;
}

/* ===========================
   BOTONES
   =========================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-size: 1rem;
}

.btn-primary {
    background: var(--purple-500);
    color: white;
    box-shadow: var(--glow-purple);
}

.btn-primary:hover {
    background: var(--purple-400);
    box-shadow: var(--glow-purple-strong);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--purple-300);
    border-color: var(--purple-500);
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--purple-400);
}

.btn-arrow {
    transition: transform 0.3s ease;
}

.btn:hover .btn-arrow {
    transform: translateX(5px);
}

/* ===========================
   CODE WINDOW (HERO VISUAL)
   =========================== */

.hero-visual {
    position: relative;
}

.code-window {
    background: rgba(26, 11, 46, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.window-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(15, 15, 15, 0.8);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.window-dots {
    display: flex;
    gap: 0.5rem;
}

.window-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray-600);
}

.window-dots span:nth-child(1) { background: #ff5f56; }
.window-dots span:nth-child(2) { background: #ffbd2e; }
.window-dots span:nth-child(3) { background: #27c93f; }

.window-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--gray-400);
}

.window-content {
    padding: 2rem;
}

.window-content pre {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
}

.code-keyword { color: var(--purple-400); }
.code-var { color: var(--purple-300); }
.code-prop { color: #8be9fd; }
.code-string { color: #50fa7b; }

/* ===========================
   SECTIONS
   =========================== */

.section {
    padding: 6rem 0;
}

.section-header {
    margin-bottom: 4rem;
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--purple-400);
    display: block;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-300);
}

/* ===========================
   ABOUT SECTION
   =========================== */

.about-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    align-items: start;
}

.about-profile {
    position: sticky;
    top: 120px;
}

.profile-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
}

.profile-image {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    object-fit: cover;
    border: 3px solid var(--purple-500);
    box-shadow: var(--glow-purple-strong);
    transition: all 0.3s ease;
}

.profile-image:hover {
    transform: scale(1.05);
    box-shadow: 0 0 60px rgba(139, 92, 246, 0.8);
}

.profile-border {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 24px;
    border: 2px solid var(--purple-400);
    opacity: 0.3;
    pointer-events: none;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--gray-400);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-text em {
    color: var(--purple-300);
    font-style: italic;
}

.about-text strong {
    color: var(--purple-300);
}

.about-highlights {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.highlight-card {
    background: rgba(26, 11, 46, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.highlight-card:hover {
    border-color: var(--purple-400);
    box-shadow: var(--glow-purple);
    transform: translateY(-5px);
}

.highlight-icon {
    width: 40px;
    height: 40px;
    color: var(--purple-400);
    margin-bottom: 1rem;
    stroke-width: 2;
}

.highlight-card h3 {
    font-size: 1.25rem;
    color: var(--gray-300);
    margin-bottom: 0.75rem;
}

.highlight-card p {
    color: var(--gray-400);
    font-size: 0.95rem;
}

/* ===========================
   STACK SECTION
   =========================== */

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

.stack-category {
    background: rgba(26, 11, 46, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.stack-category:hover {
    border-color: var(--purple-400);
    box-shadow: var(--glow-purple);
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    color: var(--gray-300);
    margin-bottom: 1.5rem;
}

.category-icon {
    width: 24px;
    height: 24px;
    color: var(--purple-400);
}

.tech-list {
    list-style: none;
}

.tech-list li {
    padding: 0.5rem 0;
    color: var(--gray-400);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tech-bullet {
    color: var(--purple-400);
}

/* ===========================
   PROJECTS SECTION
   =========================== */

.projects-grid {
    display: grid;
    gap: 2rem;
}

.project-card {
    background: rgba(26, 11, 46, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--purple-400), var(--purple-600));
}

.project-card:hover {
    border-color: var(--purple-400);
    box-shadow: var(--glow-purple);
    transform: translateX(5px);
}

.project-number {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 700;
    color: rgba(139, 92, 246, 0.2);
    position: absolute;
    top: 1rem;
    right: 2rem;
}

.project-title {
    font-size: 1.5rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.project-description {
    color: var(--gray-400);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

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

.tech-tag {
    padding: 0.35rem 0.75rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--purple-300);
    font-family: var(--font-mono);
}

.project-value {
    color: var(--gray-500);
    font-size: 0.9rem;
    font-style: italic;
}

.project-value strong {
    color: var(--purple-400);
}

/* ===========================
   CONTACT SECTION
   =========================== */

.contact {
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.contact-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.contact-description {
    font-size: 1.15rem;
    color: var(--gray-400);
    margin-bottom: 3rem;
    line-height: 1.8;
}

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

.contact-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(26, 11, 46, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    text-decoration: none;
    color: var(--gray-300);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.contact-link:hover {
    border-color: var(--purple-400);
    box-shadow: var(--glow-purple);
    transform: translateY(-3px);
}

.contact-icon {
    width: 24px;
    height: 24px;
    color: var(--purple-400);
}

.contact-tagline {
    padding: 2rem;
    background: rgba(139, 92, 246, 0.05);
    border-left: 3px solid var(--purple-400);
    border-radius: 8px;
}

.contact-tagline p {
    color: var(--gray-400);
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ===========================
   FOOTER
   =========================== */

.footer {
    padding: 2rem 0;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
    text-align: center;
    color: var(--gray-500);
    font-size: 0.9rem;
    position: relative;
}

.kuromi-easter-egg {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.kuromi-easter-egg.aos-animate {
    opacity: 1;
}

.kuromi-easter-egg img {
    width: 80px;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(139, 92, 246, 0.3));
    transition: transform 0.3s ease;
}

.kuromi-easter-egg:hover img {
    transform: scale(1.1) rotate(-5deg);
    filter: drop-shadow(0 6px 30px rgba(139, 92, 246, 0.5));
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 768px) {
    html,
    body {
        cursor: auto;
    }

    .custom-cursor,
    .custom-cursor-trail {
        display: none;
    }

    .hero {
        padding: 6rem 0 3rem;
    }

    .hero .container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.3;
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-cta {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
        justify-content: center;
    }
    
    .hero-visual {
        order: -1;
    }

    .code-window {
        transform: scale(0.95);
    }

    .window-content {
        padding: 1.25rem;
    }

    .window-content pre {
        font-size: 0.75rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-profile {
        position: static;
        max-width: 250px;
        margin: 0 auto;
    }
    
    .about-highlights,
    .stack-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 1.5rem;
    }

    .kuromi-easter-egg {
        bottom: 15px;
        right: 15px;
    }

    .kuromi-easter-egg img {
        width: 60px;
    }
}

/* ===========================
   ANIMACIONES AOS
   =========================== */

[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
}

[data-aos].aos-animate {
    opacity: 1;
}
