:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --accent: #2997ff;
    --glass-bg: rgba(0, 0, 0, 0.72);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    cursor: none;
}
a, button { cursor: none; text-decoration: none; }

/* Overlays */
.noise-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none; z-index: 99999; opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

/* Custom Cursor */
.cursor {
    position: fixed; top: 0; left: 0; width: 8px; height: 8px;
    background-color: #fff; border-radius: 50%;
    transform: translate(-50%, -50%); pointer-events: none; z-index: 100000;
    transition: width 0.3s, height 0.3s, background-color 0.3s;
}
.cursor-follower {
    position: fixed; top: 0; left: 0; width: 40px; height: 40px;
    border: 1px solid rgba(255,255,255, 0.3); border-radius: 50%;
    transform: translate(-50%, -50%); pointer-events: none; z-index: 99999;
    transition: transform 0.1s, width 0.3s, height 0.3s;
}
.cursor.hover-active {
    width: 80px; height: 80px; background-color: rgba(255, 255, 255, 1);
    mix-blend-mode: difference;
}
.cursor-follower.hover-active { opacity: 0; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }
.lenis.lenis-stopped { overflow: hidden; }

/* Nav */
.global-nav {
    position: fixed; top: 0; left: 0; right: 0; height: 80px;
    background: transparent; z-index: 9999;
    display: flex; justify-content: center;
    transition: background 0.3s, backdrop-filter 0.3s;
}
.global-nav.scrolled {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
}
.nav-content {
    width: 100%; max-width: 1200px; padding: 0 40px;
    display: flex; justify-content: space-between; align-items: center; height: 100%;
}
.logo { font-weight: 800; font-size: 1.5rem; color: var(--text-primary); }
.nav-links { display: flex; list-style: none; gap: 40px; }
.nav-links a { font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); transition: color 0.3s; }
.nav-links a:hover { color: var(--text-primary); }

/* Hero */
.hero {
    height: 100vh; display: flex; align-items: center; justify-content: center;
    text-align: center; position: relative;
}
.hero-name {
    font-size: 8vw; font-weight: 900; letter-spacing: -0.05em; line-height: 1;
    background: linear-gradient(180deg, #ffffff 0%, #86868b 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    will-change: transform;
}
.hero-role {
    font-size: 2rem; font-weight: 500; color: var(--accent); margin-top: 1rem;
    will-change: transform, opacity;
}

/* About */
.about-section { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 10vh 20px; }
.about-container { max-width: 900px; }
.about-text {
    font-size: 3rem; font-weight: 600; line-height: 1.3; color: var(--text-secondary);
    letter-spacing: -0.02em; text-align: center;
}
/* Animaciones Text Clip Reveal */
.clip-reveal {
    overflow: hidden;
}
.clip-reveal h2, .clip-reveal p {
    transform: translateY(110%);
    opacity: 0;
}

/* Timeline (Trayectoria & Educación) */
.timeline-section {
    max-width: 900px; margin: 0 auto 15vh; padding: 0 20px;
    position: relative;
}
.timeline-container {
    position: relative; padding-left: 40px; margin-top: 50px;
}
.timeline-line {
    position: absolute; left: 0; top: 0; width: 2px; height: 100%;
    background: rgba(255,255,255,0.1);
}
.timeline-line-glow {
    position: absolute; left: 0; top: 0; width: 100%; height: 0%;
    background: var(--text-primary);
    box-shadow: 0 0 15px 2px rgba(255,255,255,0.8);
    transition: height 0.1s ease;
}
.timeline-item {
    position: relative; margin-bottom: 60px;
}
.timeline-dot {
    position: absolute; left: -45px; top: 5px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--bg-primary);
    border: 2px solid rgba(255,255,255,0.2); z-index: 2;
    transition: all 0.4s ease;
}
.timeline-dot.active {
    background: var(--text-primary);
    border-color: var(--text-primary);
    box-shadow: 0 0 15px rgba(255,255,255,0.8);
    transform: scale(1.3);
}
.timeline-content {
    background: #111; padding: 30px; border-radius: 24px;
    box-shadow: inset 0 0 0 1px var(--glass-border);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    opacity: 0.5; /* Para animar entrada */
    transform: translateX(20px);
}
.timeline-item.active .timeline-content {
    opacity: 1; transform: translateX(0);
}
.timeline-content:hover {
    transform: translateX(5px) !important;
    box-shadow: inset 0 0 0 1px var(--accent);
}
.timeline-date {
    display: inline-block; padding: 5px 12px; background: rgba(255,255,255,0.05);
    border-radius: 12px; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
    margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px;
}
.timeline-content h3 { font-size: 1.8rem; margin-bottom: 10px; }
.timeline-content p { font-size: 1rem; color: var(--text-secondary); line-height: 1.6; }

/* Bento Skills */
.skills-section { max-width: 1200px; margin: 0 auto 15vh; padding: 0 20px; }
.section-header { margin-bottom: 60px; text-align: center; }
.section-header h2 { font-size: 4rem; font-weight: 800; letter-spacing: -0.03em; }

.bento-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
.bento-box {
    background: #111; padding: 50px; border-radius: 32px;
    box-shadow: inset 0 0 0 1px var(--glass-border);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.bento-box:hover { transform: translateY(-5px); box-shadow: inset 0 0 0 1px var(--accent); }
.bento-wide { grid-column: span 2; }
.bento-box h3 { font-size: 2rem; margin-bottom: 15px; }
.bento-box p { font-size: 1.1rem; color: var(--text-secondary); line-height: 1.6; }

/* Horizontal Projects */
.projects-section { background: var(--bg-secondary); overflow: hidden; padding-top: 10vh; }
.projects-header { text-align: center; margin-bottom: 5vh; }
.projects-header h2 { font-size: 4rem; font-weight: 800; letter-spacing: -0.03em; }
.projects-header p { color: var(--text-secondary); font-size: 1.2rem; }

.horizontal-scroll-wrapper {
    height: 100vh; /* Se anclará (pin) durante este tiempo */
    display: flex; align-items: center;
}
.horizontal-track {
    display: flex; gap: 40px; padding: 0 50vw 0 10vw; /* Espacio extra al final para scroll */
    will-change: transform;
}
.project-card {
    min-width: 600px; height: 500px; background: var(--bg-primary);
    border-radius: 32px; overflow: hidden; display: flex; flex-direction: column;
    box-shadow: inset 0 0 0 1px var(--glass-border); transition: transform 0.3s ease;
}
.project-img-wrapper {
    width: 100%; height: 240px; background: #1a1a1a; overflow: hidden;
}
.project-img-wrapper img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease;
}
.project-card:hover .project-img-wrapper img {
    transform: scale(1.05);
}
.project-info {
    padding: 30px 40px; display: flex; flex-direction: column; flex: 1;
}
.project-info h3 { font-size: 2rem; margin-bottom: 15px; }
.project-info p { font-size: 1rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 20px; }
.tech-tag {
    display: inline-block; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--glass-border);
    font-size: 0.75rem; color: var(--text-secondary); margin-right: 8px;
}
.project-links {
    margin-top: auto;
}
.project-btn {
    display: inline-block; padding: 10px 24px; background: var(--text-primary); color: var(--bg-primary);
    border-radius: 20px; font-size: 0.9rem; font-weight: 600; transition: all 0.3s; cursor: none;
}
.project-btn:hover {
    transform: scale(1.05); box-shadow: 0 0 15px rgba(255,255,255,0.3);
}

/* Contact Footer */
.contact-section {
    padding: 100px 20px 50px; background: #050505; text-align: left;
}
.contact-content { max-width: 1200px; margin: 0 auto; }
.contact-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 50px;
    margin-bottom: 50px;
}
.contact-item h3 { font-size: 1.5rem; margin-bottom: 20px; color: var(--text-primary); }
.contact-link {
    display: block; font-size: 1.5rem; font-weight: 600; color: var(--text-primary);
    text-decoration: none; margin-bottom: 10px; transition: color 0.3s; width: max-content;
}
.contact-link:hover { color: var(--accent); }
.contact-location { font-size: 1rem; color: var(--text-secondary); margin-top: 20px; }
.contact-social a {
    display: block; font-size: 1.2rem; color: var(--text-secondary); margin-bottom: 10px;
    text-decoration: none; transition: color 0.3s; width: max-content;
}
.contact-social a:hover { color: var(--accent); }

/* Form Styles */
.contact-form-wrapper form { display: flex; flex-direction: column; gap: 15px; }
.input-wrapper { display: flex; gap: 15px; }
.form-input {
    width: 100%; background: #111; border: 1px solid var(--glass-border);
    padding: 15px 20px; border-radius: 12px; color: var(--text-primary);
    font-family: 'Inter', sans-serif; font-size: 1rem; outline: none;
    transition: border-color 0.3s;
}
.form-input:focus { border-color: var(--accent); }
textarea.form-input { min-height: 120px; resize: vertical; }

.footer-bottom {
    max-width: 1200px; margin: 0 auto; border-top: 1px solid var(--glass-border);
    padding-top: 30px; display: flex; justify-content: space-between;
    font-size: 0.9rem; color: var(--text-secondary);
}
