/* Global Styles */
:root {
    --primary-color: #4f46e5; /* Menghapus duplikasi */
    --primary-dark-color: #3a87f9;
    --text-light: #1f2937;
    --text-dark: #e5e7eb;
    --bg-light: #f9fafb;
    --bg-dark: #1e293b;
    --bg-darker: #111827;
    --gray-light: #2a2a2a;
    --gray-dark: #e9ecf1;
    --transition: 0.3s ease;
    --border-color: #ccc;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --user-msg-bg: #dcf8c6;
    --bot-msg-bg: #f1f0f0;
}

body.dark {
    --text-light: #e5e7eb;
    --bg-light: #1e293b;
    --border-color: #4b5563;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --user-msg-bg: #2f855a;
    --bot-msg-bg: #374151;
    --primary-color: #60a5fa;
    --gray-light: #e9ecf1;
    --gray-dark: #2a2a2a;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Poppins", sans-serif;
    background: var(--bg-light);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
    touch-action: pan-y;
    overscroll-behavior: none;
}

body.dark {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* Accessibility: Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Scroll Progress */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--primary-dark-color);
    width: 0;
    z-index: 2000;
    transition: width 0.2s;
}

/* Loading Screen */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    transition: opacity 0.5s;
}

#loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--primary-dark-color);
    border-top: 5px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Navbar */
.navbar {
    background: rgba(30, 41, 59, 0.9);
    padding: 1rem 2rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(8px);
    transition: background var(--transition);
}

body.dark .navbar {
    background: rgba(17, 24, 39, 0.9);
}

.navbar .logo {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    text-decoration: none;
    border: white 2px solid;
    padding: 10px;
    border-radius: 10px;
}

.navbar .nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin: 0;
}

.navbar .nav-links a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color var(--transition), transform var(--transition);
}

.navbar .nav-links a:hover,
.navbar .nav-links a:focus {
    color: var(--primary-dark-color);
    transform: translateY(-2px);
    outline: none;
}

.navbar .nav-links a.active {
    color: var(--primary-dark-color);
    font-weight: 600;
}

/* Navbar scrolled: stronger shadow */
.navbar.scrolled {
    background: rgba(30, 41, 59, 0.98);
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

body.dark .navbar.scrolled {
    background: rgba(17, 24, 39, 0.98);
}

.navbar .nav-links a i {
    font-size: 1.2rem;
}

.theme-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform var(--transition);
    padding: 0.5rem;
}

.theme-toggle:hover,
.theme-toggle:focus {
    transform: scale(1.1);
    outline: none;
}

.menu-toggle {
    display: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding: 2rem;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    max-width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, var(--primary-color), var(--bg-dark));
    touch-action: none;
}

body.dark #hero-canvas {
    background: linear-gradient(135deg, #1e40af, var(--bg-darker));
}

.hero-content {
    z-index: 1;
    max-width: 800px;
    padding: 0 1rem;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    margin-bottom: 2rem;
    color: #e5e7eb;
    min-height: 1.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.hero-typewriter {
    font-weight: 400;
}

.typewriter-cursor {
    display: inline-block;
    font-weight: 300;
    animation: cursor-blink 0.9s step-end infinite;
    color: var(--primary-dark-color);
    margin-left: 1px;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.hero-content .btn {
    background: var(--primary-dark-color);
    color: var(--text-light);
    padding: 0.8rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform var(--transition), box-shadow var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    margin: 0.5rem;
}

.hero-content .btn:hover,
.hero-content .btn:focus {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.5);
    outline: none;
    color: var(--bg-light);
}

.hero-content .btn i {
    font-size: 1rem;
    transition: transform var(--transition);
}

.hero-content .btn:hover i,
.hero-content .btn:focus i {
    transform: translateX(5px);
}

.hero-content .btn.download {
    background: #10b981;
}

.hero-content .btn.download:hover,
.hero-content .btn.download:focus {
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
    color: var(--bg-light);
}

/* Sections Common Styles */
.section {
    padding: 6rem 2rem;
    text-align: center;
}

.section h2 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.section h2 i {
    font-size: 2rem;
    color: var(--primary-color);
}

body.dark .section h2 i {
    color: var(--primary-dark-color);
}

/* About Section */
.about {
    background: var(--bg-light);
}

body.dark .about {
    background: var(--bg-dark);
}

/* About — 2-column grid */
.about-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 3rem;
    max-width: 960px;
    margin: 0 auto;
    text-align: left;
    align-items: start;
}

.about-photo-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.about .profile-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 8px 24px rgba(79,70,229,0.2);
}

body.dark .about .profile-img {
    border-color: var(--primary-dark-color);
    box-shadow: 0 8px 24px rgba(58,135,249,0.2);
}

.about .profile-img:hover {
    transform: scale(1.04);
    box-shadow: 0 12px 32px rgba(79,70,229,0.3);
}

.about-social {
    display: flex;
    gap: 1rem;
}

.about-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-dark);
    color: #fff;
    font-size: 1.1rem;
    transition: transform var(--transition), background var(--transition);
    text-decoration: none;
}

body.dark .about-social a {
    background: #243147;
}

.about-social a:hover {
    transform: scale(1.15);
    background: var(--primary-color);
}

.about-text-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-bio {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-light);
}

body.dark .about-bio {
    color: var(--text-dark);
}

/* Stats row */
.about-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem 0.75rem;
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
}

body.dark .stat-card {
    background: #243147;
    border-color: rgba(255,255,255,0.08);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(79,70,229,0.15);
}

.stat-num {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1.1;
}

body.dark .stat-num {
    color: var(--primary-dark-color);
}

.stat-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-top: 0.35rem;
    line-height: 1.3;
}

body.dark .stat-label {
    color: #9ca3af;
}

/* About responsive */
@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    .about-text-col { align-items: center; }
    .about-bio { text-align: center; }
    .about-stats { grid-template-columns: repeat(2, 1fr); }
}

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

/* Career Section (Stepper) */
.career {
    background: #f3f4f6;
}

body.dark .career {
    background: var(--bg-darker);
}

.career-timeline {
    max-width: 800px;
    margin: 2rem auto;
    position: relative;
    padding: 1rem 0;
}

.career-timeline::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    z-index: 0;
}

body.dark .career-timeline::before {
    background: var(--primary-dark-color);
}

.career-step {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    cursor: pointer;
    transition: transform var(--transition);
}

.career-step:hover,
.career-step:focus {
    transform: scale(1.02);
}

.career-step.left {
    justify-content: flex-end;
}

.career-step.right {
    justify-content: flex-start;
}

.career-step-content {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    width: 45%;
    position: relative;
    z-index: 1;
    transition: background var(--transition);
}

body.dark .career-step-content {
    background: #243147;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.career-step-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

body.dark .career-step-content h3 {
    color: var(--text-dark);
}

.career-step-content p {
    color: var(--gray-light);
    font-size: 1rem;
}

.career-step-content .year {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

body.dark .career-step-content .year {
    color: var(--primary-dark-color);
}

.career-step .step-marker {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    border: 3px solid var(--bg-light);
    transition: background var(--transition);
}

body.dark .career-step .step-marker {
    background: var(--primary-dark-color);
    border-color: var(--bg-dark);
}

.career-step.active .step-marker {
    background: #10b981;
    transform: translateX(-50%) scale(1.2);
}

@media (max-width: 768px) {
    .career-timeline::before {
        left: 15px;
        transform: none;
    }

    .career-step {
        flex-direction: column;
        align-items: flex-start;
        margin-left: 30px;
    }

    .career-step.left,
    .career-step.right {
        justify-content: flex-start;
    }

    .career-step-content {
        width: 100%;
        max-width: calc(100% - 40px); /* Mencegah overflow */
    }

    .career-step .step-marker {
        left: 15px;
        transform: translateX(-50%);
    }
}

@media (max-width: 480px) {
    .career-step {
        margin-left: 25px;
    }

    .career-timeline::before {
        left: 10px;
    }

    .career-step .step-marker {
        left: 10px;
    }
}

/* Skills Section */
.skills {
    background: var(--bg-dark);
    color: var(--text-dark);
}

body.dark .skills {
    background: var(--bg-dark);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1.25rem;
    max-width: 1000px;
    margin: 0 auto;
}

.skill-item {
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

body.dark .skill-item {
    background: #243147;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.skill-item:hover,
.skill-item:focus {
    transform: translateY(-5px);
}

.skill-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    transition: transform var(--transition);
}

body.dark .skill-item i {
    color: var(--primary-dark-color);
}

.skill-item:hover i,
.skill-item:focus i {
    transform: scale(1.2);
}

.skill-item p {
    color: var(--gray-light);
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.2;
    margin: 0;
}

.skill-item .skill-icon-img {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
    margin-bottom: 0.5rem;
    transition: transform var(--transition), filter var(--transition);
}

body.dark .skill-item .skill-icon-img {
    filter: brightness(1.5);
}

.skill-item:hover .skill-icon-img,
.skill-item:focus .skill-icon-img {
    transform: scale(1.2);
}

/* Portfolio Section */
.portfolio {
    background: #f3f4f6;
}

body.dark .portfolio {
    background: var(--bg-darker);
}

/* Portfolio Filter Tabs */
.portfolio-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 2.5rem;
}

.filter-btn {
    padding: 0.5rem 1.4rem;
    border-radius: 999px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: "Poppins", sans-serif;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}

.filter-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary-color);
    color: #fff;
}

body.dark .filter-btn {
    border-color: var(--primary-dark-color);
    color: var(--primary-dark-color);
}

body.dark .filter-btn:hover,
body.dark .filter-btn.active {
    background: var(--primary-dark-color);
    color: #1e293b;
}

/* Portfolio item hidden by filter */
.portfolio-item.hidden-filter {
    display: none;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.portfolio-item {
    background: #fff;
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark .portfolio-item {
    background: #243147;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.portfolio-item:hover,
.portfolio-item:focus {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    outline: none;
}

.portfolio-img-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    background: #f1f5f9;
    margin-bottom: 1.25rem;
    position: relative;
}

body.dark .portfolio-img-wrapper {
    background: #1e293b;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    margin-top:20px;
}

.portfolio-item:hover img,
.portfolio-item:focus img {
    transform: scale(1.05);
}

.portfolio-item h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--text-light);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em; /* Fixed height for 2 lines */
}

.portfolio-item p {
    color: var(--gray-light);
    font-size: 0.875rem;
    margin-top: 0;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.6;
    min-height: 4.8em; /* Fixed height for 3 lines */
}

body.dark .portfolio-item h3 {
    color: var(--text-dark);
}

.portfolio-item .view-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--primary-color);
    opacity: 0;
    transition: opacity var(--transition), transform var(--transition);
}

body.dark .portfolio-item .view-icon {
    color: var(--primary-dark-color);
}

.portfolio-item:hover .view-icon,
.portfolio-item:focus .view-icon {
    opacity: 1;
    transform: scale(1.2);
}

/* Portfolio Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    overflow-y: auto;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    position: relative;
    animation: modalIn 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

body.dark .modal-content {
    background: var(--bg-dark);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.modal-img-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9; /* Strictly 16:9 like the grid thumbnails */
    background: #f1f5f9;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    cursor: zoom-in; /* Indicate interactive image */
}

body.dark .modal-img-wrapper {
    background: #0f172a;
}

.modal-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform var(--transition);
}

.modal-body {
    text-align: left;
    width: 100%;
}

@media (min-width: 992px) {
    .modal-content {
        max-width: 900px;
        display: flex;
        gap: 2rem;
        align-items: flex-start;
    }

    .modal-img-wrapper {
        width: 50%;
        margin-bottom: 0;
        aspect-ratio: 16 / 9;
        height: auto;
    }

    .modal-body {
        width: 50%;
    }
}

.modal-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.modal-content p {
    font-size: 1rem;
    color: var(--gray-light);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: transform var(--transition);
}

body.dark .modal-close {
    color: var(--text-dark);
}

.modal-close:hover,
.modal-close:focus {
    transform: scale(1.2);
    outline: none;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Contact Section */
.contact {
    background: var(--bg-dark);
    color: var(--text-dark);
}

body.dark .contact {
    background: var(--bg-darker);
}

.contact form {
    max-width: 520px;
    margin: 2rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact .form-group {
    position: relative;
}

.contact input,
.contact textarea {
    padding: 0.85rem 0.85rem 0.85rem 2.6rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    font-size: 1rem;
    background: #475569;
    color: #f1f5f9;
    transition: background var(--transition), box-shadow var(--transition), border-color var(--transition);
    width: 100%;
    font-family: "Poppins", sans-serif;
}

body.dark .contact input,
body.dark .contact textarea {
    background: var(--bg-dark);
    border-color: rgba(255, 255, 255, 0.1);
}

.contact input:focus,
.contact textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(58, 135, 249, 0.25);
    border-color: var(--primary-dark-color);
}

.contact input::placeholder,
.contact textarea::placeholder {
    color: #cbd5e1;
    opacity: 0.8;
}

.contact .form-group i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--primary-dark-color);
    pointer-events: none;
}

/* Textarea icon fix — pin to top not center */
.contact .textarea-group i {
    top: 1rem;
    transform: none;
}

.contact .contact-submit-btn {
    background: var(--primary-dark-color);
    color: var(--text-light);
    padding: 0.85rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform var(--transition), box-shadow var(--transition);
    font-weight: 600;
    font-family: "Poppins", sans-serif;
}

.contact .contact-submit-btn:hover,
.contact .contact-submit-btn:focus {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(58, 135, 249, 0.4);
    outline: none;
}

.contact .contact-submit-btn i {
    position: static;
    transform: none;
    top: auto;
    font-size: 1rem;
    transition: transform var(--transition);
}

.contact .contact-submit-btn:hover i {
    transform: translateX(4px);
}

.contact button {
    background: var(--primary-dark-color);
    color: var(--text-light);
    padding: 0.8rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform var(--transition), box-shadow var(--transition);
    font-weight: 600;
}

.contact button:hover,
.contact button:focus {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.5);
    outline: none;
}

.contact button i {
    font-size: 1rem;
    transition: transform var(--transition);
}

.contact button:hover i,
.contact button:focus i {
    transform: translateX(5px);
}

.contact .btn.download {
    background: #10b981;
    margin: 1rem auto;
    width: fit-content;
}

.contact .btn.download:hover,
.contact .btn.download:focus {
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
}

/* Footer */
footer {
    background: var(--bg-dark);
    color: var(--text-dark);
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}

body.dark footer {
    background: var(--bg-darker);
}

.social-links {
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-links a {
    color: var(--text-dark);
    font-size: 1.5rem;
    transition: color var(--transition), transform var(--transition);
}

.social-links a:hover,
.social-links a:focus {
    color: var(--primary-dark-color);
    transform: scale(1.2);
    outline: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        touch-action: pan-y;
    }

    .navbar {
        padding: 1rem;
    }

    .navbar .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--bg-dark);
        padding: 1rem;
        text-align: center;
        gap: 1rem;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    body.dark .navbar .nav-links {
        background: var(--bg-darker);
    }

    .navbar .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .hero {
        padding: 1rem;
    }

    .hero-content .btn {
        margin: 0.5rem 0;
    }

    .about .profile-img {
        width: 150px;
        height: 150px;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

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

    .section {
        padding: 4rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .navbar .logo {
        font-size: 1.2rem;
    }

    .hero-content .btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

    .navbar .nav-links a i {
        font-size: 1rem;
    }

    .social-links a {
        font-size: 1.2rem;
    }

    .section h2 {
        font-size: 1.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }

    .hero-content .btn:hover i,
    .hero-content .btn:focus i,
    .contact button:hover i,
    .contact button:focus i {
        transform: none;
    }
}

/* Language Switch */
.language-switch {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.language-switch input {
    display: none;
}

.language-switch .slider {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 60px;
    height: 30px;
    background-color: #ccc;
    border-radius: 15px;
    padding: 0 5px;
    font-size: 14px;
    color: #fff;
    transition: background-color 0.3s;
}

.language-switch input:checked + .slider {
    background-color: #4f46e5;
}

.language-switch .slider::before {
    content: "";
    position: absolute;
    width: 26px;
    height: 26px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
    left: 2px;
}

.language-switch input:checked + .slider::before {
    transform: translateX(30px);
}

.language-switch .slider span {
    position: absolute;
    width: 100%;
    text-align: center;
}

.language-switch input:checked + .slider span {
    content: "EN";
}

.language-switch input:not(:checked) + .slider span {
    content: "ID";
}

/* Chatbot button */
.chatbot-button {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background-color: var(--primary-color);
    color: var(--text-dark);
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    transition: transform var(--transition), background-color var(--transition);
}

.chatbot-button:hover {
    transform: scale(1.1);
    background-color: var(--primary-dark-color);
}

/* Chat container */
.chat-container {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    width: min(90vw, 22rem);
    height: 28rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
    border-radius: 0.75rem;
    display: none;
    flex-direction: column;
    z-index: 999;
    color: var(--text-light);
}

/* Chat messages */
.chat-messages {
    flex: 1;
    padding: 0.75rem;
    overflow-y: auto;
    font-size: 0.9rem;
}

/* Chat input */
.chat-input {
    display: flex;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}

.chat-input input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    outline: none;
    font-size: 0.9rem;
    background: var(--bg-light);
    color: var(--text-light);
}

.chat-input button {
    background: var(--primary-color);
    color: var(--text-dark);
    border: none;
    border-radius: 200px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color var(--transition);
}

.chat-input button:hover {
    background: var(--primary-dark-color);
}

.chat-input input:disabled,
.chat-input button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Messages */
.message {
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    max-width: 80%;
    word-break: break-word;
    line-height: 1.55;
    white-space: pre-line;
}

.user-message {
    background: var(--user-msg-bg);
    margin-left: auto;
    color: var(--text-light);
}

.bot-message {
    background: var(--bot-msg-bg);
    margin-right: auto;
    color: var(--text-light);
}

.bot-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
}

.loading-dots {
    display: inline-flex;
    min-width: 1.4rem;
}

.loading-dots span {
    display: inline-block;
    opacity: 0.2;
    animation: chat-typing 1.1s infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

/* Responsive design */
@media (max-width: 600px) {
    .content {
        padding: 1.5rem;
    }

    .chat-container {
        width: 90vw;
        height: auto;
        max-height: 80vh; /* Mencegah terlalu tinggi */
    }
}

/* Current / latest career step pulse */
.career-timeline .career-step:first-child .step-marker {
    width: 22px;
    height: 22px;
    animation: pulse-dot 2s ease-in-out infinite;
    background-color: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
}

@keyframes pulse-dot {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

@keyframes chat-typing {
    0%,
    80%,
    100% {
        opacity: 0.2;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-1px);
    }
}

/* ===================================================
   PORTFOLIO PROFESSIONAL ENHANCEMENTS
   =================================================== */

/* --- Informational Banner --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-banner {
    max-width: 760px;
    margin: -1.5rem auto 2.5rem;
    padding: 14px 20px;
    border-radius: 12px;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: #92400e;
    font-size: 0.875rem;
    line-height: 1.65;
    text-align: left;
    animation: fadeInUp 0.55s ease both;
}

body.dark .portfolio-banner {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.25);
    color: #fcd34d;
}

/* --- Project Status Badges --- */
.project-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.4;
    pointer-events: none;
}

/* Private — amber */
.badge-private {
    background: rgba(251, 191, 36, 0.18);
    color: #92400e;
    border: 1px solid rgba(251, 191, 36, 0.5);
}

body.dark .badge-private {
    background: rgba(251, 191, 36, 0.12);
    color: #fcd34d;
    border-color: rgba(251, 191, 36, 0.35);
}

/* In Development — blue */
.badge-development {
    background: rgba(59, 130, 246, 0.14);
    color: #1e40af;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

body.dark .badge-development {
    background: rgba(96, 165, 250, 0.12);
    color: #93c5fd;
    border-color: rgba(96, 165, 250, 0.35);
}

/* Preview Only — green */
.badge-preview {
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

body.dark .badge-preview {
    background: rgba(52, 211, 153, 0.1);
    color: #6ee7b7;
    border-color: rgba(52, 211, 153, 0.3);
}

/* Live Version — emerald */
.badge-live {
    background: rgba(16, 185, 129, 0.2);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.6);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

body.dark .badge-live {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.45);
}

/* --- Enhanced Modal --- */
.modal-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.modal-status-badge,
.modal-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* Modal status colours mirror card badges */
.modal-status-badge.badge-private {
    background: rgba(251, 191, 36, 0.15);
    color: #92400e;
    border: 1px solid rgba(251, 191, 36, 0.45);
}
body.dark .modal-status-badge.badge-private {
    background: rgba(251, 191, 36, 0.1);
    color: #fcd34d;
    border-color: rgba(251, 191, 36, 0.3);
}

.modal-status-badge.badge-development {
    background: rgba(59, 130, 246, 0.12);
    color: #1e40af;
    border: 1px solid rgba(59, 130, 246, 0.38);
}
body.dark .modal-status-badge.badge-development {
    background: rgba(96, 165, 250, 0.1);
    color: #93c5fd;
    border-color: rgba(96, 165, 250, 0.3);
}

.modal-status-badge.badge-preview {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.38);
}
body.dark .modal-status-badge.badge-preview {
    background: rgba(52, 211, 153, 0.08);
    color: #6ee7b7;
    border-color: rgba(52, 211, 153, 0.28);
}

.modal-status-badge.badge-live {
    background: rgba(16, 185, 129, 0.15);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.5);
}

body.dark .modal-status-badge.badge-live {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
}

/* Role badge — neutral indigo */
.modal-role-badge {
    background: rgba(79, 70, 229, 0.1);
    color: #3730a3;
    border: 1px solid rgba(79, 70, 229, 0.3);
}
body.dark .modal-role-badge {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.28);
}

/* Tech Stack Section */
.modal-tech-section {
    margin-top: 1rem;
}

.modal-tech-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}
body.dark .modal-tech-label {
    color: var(--primary-dark-color);
}

.modal-tech-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tech-chip {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(79, 70, 229, 0.08);
    color: #3730a3;
    border: 1px solid rgba(79, 70, 229, 0.2);
    transition: background 0.2s;
}
body.dark .tech-chip {
    background: rgba(99, 102, 241, 0.12);
    color: #c7d2fe;
    border-color: rgba(99, 102, 241, 0.22);
}

/* Modal Live Link Button */
.modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: #fff !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

body.dark .modal-btn {
    background: var(--primary-dark-color);
    color: #1e293b !important;
    box-shadow: 0 4px 6px rgba(58, 135, 249, 0.2);
}

.modal-btn:hover,
.modal-btn:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.4);
    outline: none;
    background: #4338ca;
}

body.dark .modal-btn:hover,
body.dark .modal-btn:focus {
    box-shadow: 0 6px 15px rgba(58, 135, 249, 0.4);
    background: #60a5fa;
}

.modal-btn i {
    font-size: 0.9rem;
    transition: transform var(--transition);
}

.modal-btn:hover i,
.modal-btn:focus i {
    transform: translateX(3px) translateY(-1px);
}

/* No-link Notice */
.modal-no-link {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 1rem;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #92400e;
    font-size: 0.82rem;
    line-height: 1.5;
}
body.dark .modal-no-link {
    background: rgba(251, 191, 36, 0.07);
    border-color: rgba(251, 191, 36, 0.22);
    color: #fcd34d;
}
.modal-no-link i {
    margin-top: 2px;
    flex-shrink: 0;
    font-size: 0.85rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .portfolio-banner {
        font-size: 0.815rem;
        padding: 12px 16px;
        margin-bottom: 2rem;
    }
    .project-badge {
        font-size: 0.68rem;
        padding: 2px 8px;
    }
}

/* --- Project Image Lightbox --- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 10000; /* Higher than modal */
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: zoom-out;
}

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

.lightbox-content {
    margin: auto;
    display: block;
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    animation: zoom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
}

@keyframes zoom {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10001;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
    transform: scale(1.1);
}

@media only screen and (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 70vh;
    }
}
