/* ----- RESET & BASE ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background: #0b0d10;
    font-family: 'Inter', sans-serif;
    color: #e8edf2;
    line-height: 1.6;
    scroll-behavior: smooth;
}
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #181c22; }
::-webkit-scrollbar-thumb { background: #3b4b5e; border-radius: 12px; }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 28px 20px;
}

/* ----- GLASS CARDS ----- */
.card {
    background: rgba(22, 28, 36, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 20px 40px -18px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.03);
    transition: all 0.25s ease;
    cursor: default;
}
.card:hover {
    background: rgba(28, 36, 48, 0.75);
    border-color: rgba(100, 180, 255, 0.12);
    box-shadow: 0 28px 48px -20px #0a0e14, inset 0 1px 0 rgba(255,255,255,0.06);
}

/* ----- ANIMATIONS ----- */
@keyframes fadeSlideUp {
    0% { opacity: 0; transform: translateY(28px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.animate-in {
    animation: fadeSlideUp 0.8s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
    opacity: 0;
}
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }

/* ----- HEADER ----- */
header {
    padding: 24px 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    color: #e8edf2;
    text-decoration: none;
}
.logo img {
    height: 42px;
    width: auto;
    border-radius: 8px;
}
.logo span {
    background: linear-gradient(145deg, #b0d4ff, #7aa9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nav-links {
    display: flex;
    gap: 28px;
    font-weight: 500;
    font-size: 0.95rem;
    color: #9aaec9;
}
.nav-links a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
    border-bottom: 2px solid transparent;
    padding-bottom: 4px;
}
.nav-links a:hover {
    color: #d6e5ff;
    border-bottom-color: #4d8eff;
}

/* ----- PROFILE (centered) ----- */
.profile-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 48px 0 56px;
    gap: 20px;
}
.profile-pic {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #1f2a3a, #2a384c);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 28px -8px #00000080, inset 0 2px 0 #4a5f7a;
    transition: transform 0.2s ease;
    overflow: hidden;
}
.profile-pic:hover {
    transform: scale(1.02);
}
.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.profile-pic span {
    font-size: 4.6rem;
    font-weight: 300;
    color: #aac3f0;
    letter-spacing: 2px;
    opacity: 0.9;
}
.profile-text h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}
.profile-text .badge {
    background: #1f3144;
    padding: 4px 18px;
    border-radius: 60px;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;
    color: #b6d0f0;
    border: 1px solid #2d4057;
    backdrop-filter: blur(4px);
    margin-top: 4px;
}
.profile-text p {
    max-width: 560px;
    margin: 14px auto 0;
    color: #b6c9e2;
    font-size: 1.05rem;
}

/* ----- SECTION TITLE ----- */
.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin: 56px 0 28px;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 12px;
}
.section-title .material-icons-round {
    font-size: 2.2rem;
    color: #6d8fc9;
}
.sub-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 40px 0 20px;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #b6cbe5;
}
.sub-section-title .material-icons-round {
    font-size: 1.8rem;
    color: #6d8fc9;
}

/* ----- PROJECT GRID ----- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 24px;
}

/* ----- PROJECT CARD - Always visible with skeleton inside ----- */
.project-card {
    padding: 24px 22px 22px;
    border-radius: 28px;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    opacity: 1;
    animation: fadeSlideUp 0.6s ease forwards;
}

/* ----- PREVIEW IMAGE - Shows skeleton while loading ----- */
.project-card .preview-img {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #6b85aa;
    border: 1px solid #2d3c4e;
    transition: 0.2s;
    font-weight: 500;
    overflow: hidden;
    position: relative;
    background: #1a2330;
    min-height: 180px;
}

/* Skeleton shimmer on the image container while loading */
.project-card .preview-img.skeleton {
    background: linear-gradient(90deg, #1a2330 25%, #2a3a4a 50%, #1a2330 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

/* Hide the actual image while loading */
.project-card .preview-img.skeleton img {
    opacity: 0;
}

/* Show image when loaded */
.project-card .preview-img.loaded img {
    opacity: 1;
    transition: opacity 0.4s ease;
}

.project-card .preview-img.loaded {
    background: #1d2633;
    animation: none;
}

.project-card .preview-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-card .preview-img i {
    font-size: 2.2rem;
    margin-right: 8px;
    opacity: 0.7;
}
.project-card .preview-img span {
    background: #0f1620;
    padding: 4px 14px;
    border-radius: 60px;
    color: #9bb4d9;
}

.project-card h3 {
    font-weight: 600;
    font-size: 1.3rem;
    margin-bottom: 6px;
}
.project-card p {
    color: #b1c5df;
    font-size: 0.95rem;
    flex: 1;
    margin: 6px 0 16px;
}
.project-card .meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #26313f;
    padding-top: 16px;
    margin-top: 6px;
    gap: 8px;
}
.project-card .meta .tech {
    color: #829fc9;
    font-size: 0.8rem;
    background: #19222f;
    padding: 4px 12px;
    border-radius: 40px;
    display: inline-block;
    white-space: nowrap;
}
.project-card .meta .tech-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

/* Skeleton text placeholders inside card while loading */
.project-card.skeleton-mode h3 {
    height: 24px;
    width: 70%;
    border-radius: 6px;
    background: linear-gradient(90deg, #1a2330 25%, #2a3a4a 50%, #1a2330 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    color: transparent;
}
.project-card.skeleton-mode p {
    height: 16px;
    width: 90%;
    border-radius: 4px;
    background: linear-gradient(90deg, #1a2330 25%, #2a3a4a 50%, #1a2330 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    color: transparent;
}
.project-card.skeleton-mode p.short {
    width: 60%;
}
.project-card.skeleton-mode .meta .tech-wrapper .tech {
    height: 28px;
    width: 60px;
    border-radius: 40px;
    background: linear-gradient(90deg, #1a2330 25%, #2a3a4a 50%, #1a2330 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    color: transparent;
    padding: 0;
}
.project-card.skeleton-mode .meta .tech-wrapper .tech.wide {
    width: 80px;
}

/* Hide actual text content in skeleton mode */
.project-card.skeleton-mode h3,
.project-card.skeleton-mode p,
.project-card.skeleton-mode .meta .tech-wrapper .tech {
    color: transparent !important;
    pointer-events: none;
}

/* Show actual content when loaded */
.project-card.loaded h3,
.project-card.loaded p,
.project-card.loaded .meta .tech-wrapper .tech {
    color: inherit;
    height: auto;
    width: auto;
    background: none;
    animation: none;
    padding: 4px 12px;
}

.project-card.loaded .meta .tech-wrapper .tech {
    background: #19222f;
}

/* Hide skeleton text when loaded */
.project-card.loaded .meta .tech-wrapper .tech.wide {
    width: auto;
}

@media (max-width: 1024px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
    .profile-text h1 { font-size: 2.2rem; }
    .nav-links { gap: 14px; font-size: 0.85rem; flex-wrap: wrap; }
}

/* ----- MODAL ----- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-overlay.active {
    display: flex;
}
.modal-box {
    background: #141b24;
    max-width: 720px;
    width: 100%;
    max-height: 85vh;
    height: 85vh;
    border-radius: 36px;
    border: 1px solid #2c3d53;
    box-shadow: 0 40px 80px #000000cc;
    position: relative;
    animation: fadeSlideUp 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 28px 24px;
    padding-top: 20px;
    scroll-behavior: smooth;
}
.modal-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content::-webkit-scrollbar-track {
    background: transparent;
}
.modal-content::-webkit-scrollbar-thumb {
    background: #3b5a7a;
    border-radius: 12px;
}
.modal-close {
    position: sticky;
    top: 12px;
    float: right;
    background: #1f2d3d;
    border: none;
    color: #c0d6f0;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 60px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    margin-left: 12px;
    flex-shrink: 0;
}
.modal-close:hover {
    background: #334a63;
    color: white;
    transform: scale(1.05);
}
.modal-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    padding-right: 4px;
}
.modal-title {
    font-weight: 600;
    font-size: 1.6rem;
    line-height: 1.3;
}
.modal-gallery {
    position: relative;
    margin: 12px 0 18px;
    border-radius: 24px;
    overflow: hidden;
    background: #0d141e;
    flex-shrink: 0;
    clear: both;
}
.modal-gallery img {
    width: 100%;
    height: auto;
    max-height: 380px;
    object-fit: contain;
    display: block;
    background: #0b111a;
}
.modal-gallery .placeholder-img {
    width: 100%;
    aspect-ratio: 16/9;
    background: radial-gradient(circle at 30% 40%, #1f3147, #0b121d);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6883ad;
    font-size: 1rem;
    font-weight: 500;
    gap: 12px;
}
.modal-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    gap: 12px;
    flex-shrink: 0;
}
.modal-nav button {
    background: #1f2f42;
    border: 1px solid #314a63;
    color: #c6dcff;
    padding: 8px 20px;
    border-radius: 60px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
    flex: 1;
    justify-content: center;
}
.modal-nav button:hover {
    background: #2b405a;
    border-color: #5b84c7;
}
.modal-desc {
    margin-top: 18px;
    padding: 16px 18px;
    background: #0f1925;
    border-radius: 20px;
    border-left: 4px solid #4d7ed9;
    color: #c7daf5;
    font-size: 0.98rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    flex-shrink: 0;
}
.modal-desc strong {
    color: #aac4f0;
}
.modal-footer {
    margin-top: 16px;
    text-align: right;
    flex-shrink: 0;
    padding-bottom: 4px;
}
.modal-footer a {
    color: #7aa9ff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1f2f42;
    padding: 6px 18px;
    border-radius: 40px;
    border: 1px solid #314a63;
    transition: 0.2s;
}
.modal-footer a:hover {
    background: #2b405a;
    border-color: #5b84c7;
}

/* ----- CONTACT ----- */
.contact-section {
    margin: 56px 0 40px;
    padding: 32px 32px 28px;
    border-radius: 40px;
    background: rgba(14, 20, 30, 0.6);
    backdrop-filter: blur(6px);
    border: 1px solid #293848;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.contact-section .info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 32px;
    align-items: center;
    justify-content: center;
}
.contact-section .info a {
    color: #b8d0f0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: 0.2s;
    padding: 6px 12px;
    border-radius: 60px;
    white-space: nowrap;
}
.contact-section .info a:hover {
    background: #1f3147;
    color: #e2edff;
}
.contact-section .info .contact-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: #7ba2f0;
    display: inline-block;
}
.contact-section .info a:hover .contact-icon {
    fill: #b8d0f0;
}

@media (max-width: 768px) {
    .contact-section {
        padding: 24px 20px 20px;
    }
    .contact-section .info {
        gap: 12px 16px;
    }
    .contact-section .info a {
        white-space: normal;
        word-break: break-all;
        justify-content: center;
    }
}

.footer-note {
    text-align: center;
    font-size: 0.9rem;
    color: #58708f;
    padding: 32px 0 24px;
    border-top: 1px solid #1f2b39;
    margin-top: 20px;
}

.loading-text {
    color: #829fc9;
    text-align: center;
    padding: 40px 0;
    font-size: 1.1rem;
}