/* =========================================================================
   CORE VARIABLES & THEME
   ========================================================================= */
:root {
    /* Color Palette - Cyberpunk / Dark Glassmorphism */
    --bg-base: #060913;
    --bg-glass: rgba(15, 20, 35, 0.4);
    --bg-glass-hover: rgba(25, 30, 50, 0.6);
    --border-glass: rgba(255, 255, 255, 0.08);
    
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #00f2fe;
    --accent-secondary: #4facfe;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    --accent-glow: rgba(0, 242, 254, 0.4);
    
    --nav-bg: rgba(10, 15, 30, 0.85);
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Spacings */
    --s-xs: 0.5rem;
    --s-sm: 1rem;
    --s-md: 1.5rem;
    --s-lg: 2.5rem;
    --s-xl: 4rem;
    
    /* Transitions & Radii */
    --t-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --t-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --r-md: 16px;
    --r-lg: 24px;
    --r-pill: 9999px;
}

/* =========================================================================
   RESET & FOUNDATION
   ========================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    /* Prevent iOS overscroll bounce background color issues */
    overscroll-behavior-y: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--t-fast);
}

ul {
    list-style: none;
}

/* =========================================================================
   DYNAMIC BACKGROUND (MESH / BLOBS)
   ========================================================================= */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-base);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    width: 40vw;
    height: 40vw;
    background: #004ee9;
    top: -10vw;
    left: -10vw;
    animation-delay: 0s;
}

.blob-2 {
    width: 35vw;
    height: 35vw;
    background: #00f2fe;
    bottom: -10vw;
    right: -5vw;
    animation-delay: -5s;
}

.blob-3 {
    width: 30vw;
    height: 30vw;
    background: #4facfe;
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10vw, 10vh) scale(1.1); }
}

/* =========================================================================
   GLASSMORPHISM UTILITIES
   ========================================================================= */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--r-lg);
    padding: var(--s-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: transform var(--t-smooth), background var(--t-fast), border-color var(--t-fast);
}

.glass-card:hover {
    background: var(--bg-glass-hover);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* =========================================================================
   APP SHELL & LAYOUT
   ========================================================================= */
.app-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--s-xl) var(--s-md);
    position: relative;
    z-index: 1;
}

.section {
    margin-bottom: var(--s-xl);
    scroll-margin-top: var(--s-xl); /* For anchor linking */
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--s-lg);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: var(--r-pill);
}

/* =========================================================================
   NAVIGATION (MOBILE BOTTOM APP BAR / DESKTOP SIDEBAR)
   ========================================================================= */
.app-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-top: 1px solid var(--border-glass);
    z-index: 100;
    padding: var(--s-xs) var(--s-sm);
    /* Safe area padding for iPhones */
    padding-bottom: calc(var(--s-xs) + env(safe-area-inset-bottom, 0px));
}

.app-nav ul {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    padding: var(--s-xs);
    border-radius: var(--r-md);
    transition: all var(--t-fast);
}

.nav-item a i {
    font-size: 1.5rem;
}

.nav-text {
    font-size: 0.7rem;
    font-weight: 500;
}

.nav-item.active a {
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.nav-spacer {
    height: 80px; /* Space for bottom nav */
}

/* =========================================================================
   HERO PROFILE
   ========================================================================= */
.hero-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--s-md);
    position: relative;
    overflow: hidden;
}

.profile-container {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 0 auto;
}

.profile-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.6;
    animation: pulse 4s infinite alternate;
}

.profile-img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
}

.hero-content .tagline {
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.name {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
}

.title {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: var(--s-md);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: var(--s-md);
}

.contact-info li {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.contact-info a:hover {
    color: var(--accent-primary);
}

.social-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-sm);
    flex-wrap: wrap;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 var(--s-md);
    border-radius: var(--r-pill);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-weight: 500;
    transition: all var(--t-fast);
}

.social-btn i {
    font-size: 1.2rem;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

.primary-btn {
    background: var(--accent-gradient);
    border: none;
    color: #000;
    font-weight: 600;
}

.primary-btn:hover {
    background: var(--accent-gradient);
    box-shadow: 0 8px 20px var(--accent-glow);
}

/* =========================================================================
   LOGROS / GRID CARDS
   ========================================================================= */
.grid-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-md);
}

.info-card {
    padding: var(--s-md);
}

.card-icon {
    font-size: 2.5rem;
    color: var(--accent-primary);
    margin-bottom: var(--s-sm);
    display: inline-block;
    padding: 12px;
    background: rgba(0, 242, 254, 0.1);
    border-radius: 12px;
}

.info-card h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* =========================================================================
   ANIMATIONS
   ========================================================================= */
@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    100% { transform: scale(1.05); opacity: 0.8; }
}

/* Reveal classes for intersection observer */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================================

/* =========================================================================
   TIMELINE (EXPERIENCE)
   ========================================================================= */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--s-md) 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 2px;
    background: var(--border-glass);
}

.timeline-item {
    position: relative;
    padding-left: 50px;
    padding-bottom: var(--s-lg);
    width: 100%;
}

.timeline-dot {
    position: absolute;
    left: 12px;
    top: 24px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-glow);
    z-index: 10;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.timeline-header h4 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin: 0;
}

.badge {
    background: rgba(0, 242, 254, 0.1);
    color: var(--accent-primary);
    padding: 4px 12px;
    border-radius: var(--r-pill);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(0, 242, 254, 0.2);
}

.company {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

/* =========================================================================
   TAGS & SKILLS
   ========================================================================= */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-md);
}

.skill-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skill-title {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-title i {
    font-size: 1.5rem;
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-tags.large {
    gap: 10px;
}

.tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: var(--r-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--t-fast);
}

.tech-tags.large .tag {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.tag:hover {
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* =========================================================================
   EDUCATION
   ========================================================================= */
.edu-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-lg);
}

.column-title {
    font-size: 1.3rem;
    margin-bottom: var(--s-md);
    color: var(--accent-secondary);
    font-weight: 600;
}

.edu-card {
    margin-bottom: var(--s-md);
    padding: var(--s-md);
    position: relative;
    overflow: hidden;
}

.edu-year {
    font-size: 2.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.05);
    position: absolute;
    right: 10px;
    top: 5px;
    line-height: 1;
    z-index: 0;
}

.edu-card h5 {
    font-size: 1.2rem;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.edu-school {
    color: var(--text-muted);
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

.course-list {
    padding: var(--s-md);
}

.course-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.course-list li:last-child {
    margin-bottom: 0;
}

.course-list li i {
    color: var(--accent-primary);
    font-size: 1.2rem;
    margin-top: 2px;
}

/* =========================================================================
   FLOATING WHATSAPP BUTTON (MOBILE FIRST)
   ========================================================================= */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 100px; /* Sits comfortably above the mobile bottom nav */
    right: 20px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50%;
    font-size: 35px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.whatsapp-float:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
    color: #FFF;
}
/* =========================================================================
   DESKTOP RESPONSIVE
   ========================================================================= */
@media (min-width: 768px) {
    .app-wrapper {
        padding-left: 120px; /* Space for sidebar */
    }

    .app-nav {
        top: 0;
        left: 0;
        width: 80px;
        height: 100vh;
        border-top: none;
        border-right: 1px solid var(--border-glass);
        padding: var(--s-lg) 0;
    }

    .app-nav ul {
        flex-direction: column;
        height: 100%;
        justify-content: center;
        gap: var(--s-lg);
    }

    .nav-spacer {
        display: none;
    }

    .hero-card {
        flex-direction: row;
        text-align: left;
        padding: var(--s-xl);
    }

    .profile-container {
        width: 200px;
        height: 200px;
        flex-shrink: 0;
    }

    .contact-info {
        flex-direction: row;
        gap: var(--s-md);
        justify-content: flex-start;
    }

    .contact-info li {
        justify-content: flex-start;
    }

    .social-links {
        justify-content: flex-start;
    }

    .grid-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .timeline::before {
        left: 50%;
        transform: translateX(-50%);
    }

    .timeline-item, .timeline-item:nth-child(even) {
        width: 50%;
        padding: 0 40px;
    }

    .timeline-item {
        left: 0;
        text-align: right;
    }

    .timeline-item:nth-child(even) {
        left: 50%;
        text-align: left;
    }

    .timeline-item .timeline-dot {
        right: -9px;
        left: auto;
    }

    .timeline-item:nth-child(even) .timeline-dot {
        left: -9px;
        right: auto;
    }

    .timeline-item .timeline-header,
    .timeline-item .tech-tags {
        justify-content: flex-end;
    }

    .timeline-item:nth-child(even) .timeline-header,
    .timeline-item:nth-child(even) .tech-tags {
        justify-content: flex-start;
    }

    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .edu-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Restore Desktop Positioning for WhatsApp */
    .whatsapp-float {
        bottom: 40px;
        right: 40px;
    }
}

@media (min-width: 1024px) {
    .app-wrapper {
        padding-left: 140px;
    }
    
    .nav-text {
        font-size: 0.8rem;
    }
}
