:root {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --secondary: #3f37c9;
    --dark: #1a1a2e;
    --darker: #0d0d1a;
    --light: #f8f9fa;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --border-radius: 16px;
    --shadow: 0 10px 20px rgba(0,0,0,0.05);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 16px;
    gap: 24px;
    color: var(--dark);
    min-height: 100vh;
    transition: var(--transition);
}

.card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 24px;
    max-width: 430px;
    width: 100%;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* === CARD 1 === */
.profile {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid var(--primary-light);
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.2);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info {
    flex: 1;
}

.info h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--dark);
}

.info p {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.5;
}

.contact-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-light);
    border-radius: 12px;
    padding: 14px 20px;
    gap: 10px;
}

.contact-bar a {
    text-decoration: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.contact-bar a:hover {
    color: var(--secondary);
}

/* === CARD 2 === */
.social-section h2,
.links-section h2,
.projects-section h2 {
    font-size: 16px;
    color: var(--dark);
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-section h2::before,
.links-section h2::before,
.projects-section h2::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

.social-icons {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-top: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gray-light);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.icon::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: var(--transition);
    border-radius: 50%;
}

.icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(67, 97, 238, 0.2);
}

.icon:hover::before {
    opacity: 1;
}

.icon i {
    font-size: 20px;
    color: var(--gray);
    z-index: 1;
    transition: var(--transition);
}

.icon:hover i {
    color: white;
}

/* === CARD 3 === */
.links-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-item {
    display: flex;
    align-items: center;
    background: var(--gray-light);
    border-radius: 14px;
    padding: 16px;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid transparent;
    min-height: 72px;
}

.link-item:hover {
    background: #fff;
    border-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.1);
}

.link-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.2);
    margin-right: 14px;
}

.link-icon i {
    font-size: 16px;
    color: white;
}

.link-text {
    flex: 1;
    min-width: 0;
}

.link-text h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-text p {
    font-size: 13px;
    color: var(--gray);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-arrow {
    color: var(--primary);
    font-size: 14px;
    opacity: 0.7;
    transition: var(--transition);
    margin-left: 8px;
    flex-shrink: 0;
}

.link-item:hover .link-arrow {
    opacity: 1;
    transform: translateX(3px);
}

/* === CARD 4 === */
.projects-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-item {
    display: flex;
    flex-direction: column;
    background: var(--gray-light);
    border-radius: 16px;
    padding: 0;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid transparent;
    overflow: hidden;
    position: relative;
}

.project-item:hover {
    background: #fff;
    border-color: var(--primary-light);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.15);
}

.project-image {
    width: 100%;
    height: 160px;
    position: relative;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.3) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 12px;
    opacity: 0;
    transition: var(--transition);
}

.project-item:hover .project-overlay {
    opacity: 1;
}

.project-view {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    cursor: pointer;
}

.project-view:hover {
    background: var(--primary);
    color: white;
}

.project-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.project-info {
    flex: 1;
}

.project-info h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
    line-height: 1.3;
}

.project-info p {
    font-size: 13px;
    color: var(--gray);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--gray);
}

.stat i {
    font-size: 10px;
    color: var(--primary);
}

/* === FOOTER === */
.footer {
    max-width: 430px;
    width: 100%;
    text-align: center;
    padding: 20px 0;
    margin-top: 20px;
    border-top: 1px solid var(--gray-light);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.copyright {
    font-size: 12px;
    color: var(--gray);
    margin-top: 8px;
    opacity: 0.8;
}

/* === DARK MODE === */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
        color: var(--light);
    }
    .card {
        background: rgba(30, 30, 46, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(10px);
    }
    .info p,
    .link-text p,
    .project-info p {
        color: #aaa;
    }
    .info h1,
    .link-text h3,
    .project-info h3,
    .social-section h2,
    .links-section h2,
    .projects-section h2 {
        color: #fff;
    }
    .contact-bar {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    .contact-bar a {
        color: var(--primary-light);
    }
    .contact-bar a:hover {
        color: #fff;
    }
    .icon {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    .icon:hover {
        background: var(--primary);
    }
    .link-item,
    .project-item {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    .link-item:hover,
    .project-item:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: var(--primary);
    }
    .project-stats {
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    .project-view {
        background: rgba(255, 255, 255, 0.1);
        color: var(--primary-light);
    }
    .footer {
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    .copyright {
        color: #aaa;
    }
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
    body {
        padding: 20px 12px;
        gap: 18px;
    }
    .card {
        padding: 20px;
    }
    .avatar {
        width: 70px;
        height: 70px;
    }
    .info h1 {
        font-size: 18px;
    }
    .info p {
        font-size: 13px;
    }
    .contact-bar {
        padding: 12px 16px;
    }
    .contact-bar a {
        font-size: 13px;
    }
    .icon {
        width: 44px;
        height: 44px;
    }
    .social-icons {
        gap: 6px;
    }
    .link-item {
        padding: 14px;
        min-height: 68px;
    }
    .link-icon {
        width: 36px;
        height: 36px;
        margin-right: 12px;
    }
    .link-text h3 {
        font-size: 14px;
    }
    .link-text p {
        font-size: 12px;
    }
    .project-image {
        height: 140px;
    }
    .project-content {
        padding: 14px;
    }
    .project-info h3 {
        font-size: 15px;
    }
    .project-info p {
        font-size: 12px;
    }
    .footer {
        padding: 16px 0;
    }
    .copyright {
        font-size: 11px;
    }
}

/* === Animation === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }

.footer {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.5s;
    opacity: 0;
}
