:root {
    --primary-color: #9333ea;
    --secondary-color: #bb86fc;
    --text-color: white;
    --bg-dark: rgba(0, 0, 0, 0.5);
    --card-bg: rgba(255, 255, 255, 0.1);
    --card-hover-bg: rgba(255, 255, 255, 0.15);
    --card-border: rgba(255, 255, 255, 0.15);
    --card-hover-border: rgba(255, 255, 255, 0.25);
    --blur-amount: 16px;
}

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

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Particles */
.particles {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

/* Main Container */
.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 10;
}

/* Avatar */
.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 30px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: float 4s ease-in-out infinite;
    position: relative;
    transition: transform 0.4s ease;
}

.avatar:hover {
    transform: scale(1.05) translateY(-10px);
}

.avatar::before {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--secondary-color), #ec4899);
    opacity: 0.6;
    filter: blur(20px);
    animation: pulse 2s ease-in-out infinite alternate;
}

/* Title & Description */
.title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.title-text {
    position: relative;
    z-index: 10;
    background: linear-gradient(45deg, var(--secondary-color), #ec4899);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradient 3s ease infinite;
}

.title-shadow {
    position: absolute;
    inset: 0;
    color: rgba(187, 134, 252, 0.2);
    filter: blur(4px);
}

.description {
    text-align: center;
    margin-bottom: 40px;
    max-width: 600px;
}

.description-main {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
}

.description-sub {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Project Cards */
.projects {
    display: grid;
    gap: 20px;
    max-width: 1000px;
    width: 100%;
    margin-bottom: 40px;
    padding: 0 20px;
}

@media (min-width: 1024px) {
    .projects {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1023px) {
    .projects {
        grid-template-columns: repeat(2, 1fr);
    }
}

.project-card {
    background: linear-gradient(135deg, var(--card-bg), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(40px) perspective(1000px) rotateX(0) rotateY(0);
    animation: slideUp 0.6s ease-out forwards;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255, 255, 255, 0.2), transparent 70%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:hover {
    transform: perspective(1000px) scale(1.03) rotateX(var(--rotateX, 0)) rotateY(var(--rotateY, 0));
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-color: var(--card-hover-border);
    background: linear-gradient(135deg, var(--card-hover-bg), rgba(255, 255, 255, 0.1));
}

.project-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    display: block;
    transition: all 0.4s ease;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.project-card:hover .project-icon {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
}

.project-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.project-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

/* Footer */
.footer {
    position: relative;
    z-index: 10;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    padding: 15px;
    text-align: center;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    width: 95%;
    max-width: 1200px;
    height: 85vh;
    position: relative;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    background: linear-gradient(135deg, #9333ea, #6366f1);
    color: var(--text-color);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.visit-btn {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.visit-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-iframe {
    width: 100%;
    height: calc(100% - 80px);
    border: none;
    transition: opacity 0.5s ease;
}

.loading {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(147, 51, 234, 0.3);
    border-top: 4px solid #9333ea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    100% {
        opacity: 0.8;
    }
}

@keyframes gradient {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }

    .avatar {
        width: 100px;
        height: 100px;
    }

    .project-card {
        padding: 18px;
        min-height: 140px;
    }

    .project-icon {
        font-size: 2rem;
    }

    .project-title {
        font-size: 1.1rem;
    }

    .modal-content {
        width: 95%;
        height: 85vh;
    }

    .modal-actions {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }

    .project-card {
        padding: 16px;
        min-height: 120px;
    }

    .project-icon {
        font-size: 1.8rem;
        margin-bottom: 12px;
    }

    .project-title {
        font-size: 1rem;
    }

    .project-description {
        font-size: 0.8rem;
    }
}
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.container, .footer {
    position: relative;
    z-index: 1;
}
