* {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

:root {
    --bg-color: #000000;
    --bg-color-second: #262626;
    --skills-bg: #262626;
    --text-color: #ffffff;
    --text-light-color: #b54769;
    --text-muted: #ababab;
    --primary-color: #ff004f;
    --second-color: #ffffff;
    --card-bg: #262626;
    --bar-bg: #250821;
    --nav-bg: rgba(0, 0, 0, 0.9);
    --nav-border: rgba(255, 255, 255, 0.1);
    --hover: #800404;
    --card-border: rgba(255, 255, 255, 0.08);
    --badge-primary-bg: rgba(255, 0, 79, 0.15);
    --badge-primary-color: #ff004f;
    --badge-primary-border: rgba(255, 0, 79, 0.3);
    --badge-sec-bg: rgba(255, 255, 255, 0.06);
    --badge-sec-color: #ababab;
    --tag-bg: #1a1a1a;
    --tag-color: #e5e5e5;
    --tag-border: rgba(255, 255, 255, 0.1);
    --link-color: #ff004f;
    --link-hover: #ff3366;
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --bg-color-second: #e2e8f0;
    --skills-bg: #f8fafc;
    --text-color: #0f172a;
    --text-light-color: #1d4ed8;
    --text-muted: #64748b;
    --primary-color: #0284c7;
    --second-color: #ffffff;
    --card-bg: #f1f5f9;
    --bar-bg: #e2e8f0;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --nav-border: rgba(0, 0, 0, 0.1);
    --hover: #0284c7;
    --card-border: #e2e8f0;
    --badge-primary-bg: rgba(2, 132, 199, 0.12);
    --badge-primary-color: #0284c7;
    --badge-primary-border: rgba(2, 132, 199, 0.25);
    --badge-sec-bg: #e2e8f0;
    --badge-sec-color: #64748b;
    --tag-bg: #ffffff;
    --tag-color: #334155;
    --tag-border: #cbd5e1;
    --link-color: #0284c7;
    --link-hover: #0369a1;
}

body {
    -ms-overflow-style: none;
    scrollbar-width: none;
    background: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
}

body::-webkit-scrollbar {
    display: none;
}


#about,
#experience,
#portfolio,
#contact {
    padding-top: 100px;
    padding-bottom: 50px;
    margin-top: 120px;
}

/* =========================================
   INFINITY CASTLE - INFINITE LOOP
========================================= */
body.loading-active,
body.doors-closing,
body.closing-doors,
body.loaded:not(.loader-finished) {
    overflow: hidden;
}

#infinity-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

.door-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
}

.door {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* --- Desain Pintu Tipe A (Kiri Kanan) --- */
.door-type-a {
    width: calc(50% + 1px);
    height: 100%;
    background-color: #e5d3b3;
    background-image:
        linear-gradient(#2a1610 8px, transparent 8px),
        linear-gradient(90deg, #2a1610 8px, transparent 8px);
    background-size: 80px 120px;
    border: 15px solid #2a1610;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6);
}

.door-type-a.door-left {
    border-right: 8px solid #2a1610;
    transform-origin: left;
}

.door-type-a.door-right {
    border-left: 8px solid #2a1610;
    transform-origin: right;
}

/* --- Desain Pintu Tipe B (Atas Bawah) --- */
.door-type-b {
    width: 100%;
    height: calc(50% + 1px);
    background-color: #d1bfae;
    background-image:
        linear-gradient(#1a0d08 6px, transparent 6px),
        linear-gradient(90deg, #1a0d08 6px, transparent 6px);
    background-size: 100px 100px;
    border: 15px solid #1a0d08;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.8);
}

.door-type-b.door-top {
    border-bottom: 8px solid #1a0d08;
    transform-origin: top;
}

.door-type-b.door-bottom {
    border-top: 8px solid #1a0d08;
    transform-origin: bottom;
}

/* Urutan Tumpukan Lapis */
.layer-1 {
    z-index: 3;
}

/* Depan */
.layer-2 {
    z-index: 2;
    flex-direction: column;
}

/* Tengah */
.layer-3 {
    z-index: 1;
}

/* Belakang (Pengecoh) */


/* =========================================
   ANIMASI LOOPING (BERJALAN TERUS)
========================================= */
/* Kunci dari ilusi optiknya ada di timing persentase ini */
@keyframes loopLeft {

    0%,
    15% {
        transform: translate3d(0, 0, 0);
    }

    40%,
    100% {
        transform: translate3d(-100%, 0, 0);
    }
}

@keyframes loopRight {

    0%,
    15% {
        transform: translate3d(0, 0, 0);
    }

    40%,
    100% {
        transform: translate3d(100%, 0, 0);
    }
}

@keyframes loopTop {

    0%,
    50% {
        transform: translate3d(0, 0, 0);
    }

    75%,
    100% {
        transform: translate3d(0, -100%, 0);
    }
}

@keyframes loopBottom {

    0%,
    50% {
        transform: translate3d(0, 0, 0);
    }

    75%,
    100% {
        transform: translate3d(0, 100%, 0);
    }
}

/* Mengaktifkan looping hanya saat masih loading */
body.loading-active .layer-1 .door-left {
    animation: loopLeft 0.821s infinite ease-in-out;
}

body.loading-active .layer-1 .door-right {
    animation: loopRight 0.821s infinite ease-in-out;
}

body.loading-active .layer-2 .door-top {
    animation: loopTop 0.821s infinite ease-in-out;
}

body.loading-active .layer-2 .door-bottom {
    animation: loopBottom 0.821s infinite ease-in-out;
}

/* =========================================
   STATE FINAL (SMOOTH & SEAMLESS TRANSITION)
========================================= */

/* FASE 1: Tahan Pintu Tertutup Secara Alami (Selesai Iterasi Loop) */
body.doors-closing #infinity-loader .layer-1 .door,
body.closing-doors #infinity-loader .layer-1 .door {
    animation: none !important;
    transform: translate3d(0, 0, 0) !important;
}

body.doors-closing #infinity-loader .layer-2,
body.doors-closing #infinity-loader .layer-3,
body.closing-doors #infinity-loader .layer-2,
body.closing-doors #infinity-loader .layer-3 {
    display: none !important;
}

body.doors-closing #infinity-loader,
body.closing-doors #infinity-loader {
    background-color: transparent !important;
}

/* FASE 2: Buka Pintu Utama Perlahan & Sangat Mulus */
body.loaded #infinity-loader {
    background-color: transparent !important;
    pointer-events: none;
}

body.loaded #infinity-loader .layer-2,
body.loaded #infinity-loader .layer-3 {
    display: none !important;
}

body.loaded #infinity-loader .layer-1 .door {
    animation: none !important;
    transition: transform 1.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
    will-change: transform;
}

body.loaded #infinity-loader .layer-1 .door-left {
    transform: translate3d(-100%, 0, 0) !important;
}

body.loaded #infinity-loader .layer-1 .door-right {
    transform: translate3d(100%, 0, 0) !important;
}

/* FASE 3: Sembunyikan Loader Penuh Setelah Pintu Terbuka */
body.loader-finished #infinity-loader {
    display: none !important;
}

/* Indikator Loading di Tengah */
.loading-center {
    position: absolute;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    transition: opacity 0.3s ease;
}

body.doors-closing .loading-center,
body.closing-doors .loading-center,
body.loaded .loading-center,
.loading-center.fade-out {
    opacity: 0 !important;
    pointer-events: none;
}

.loading-text {
    color: var(--primary-color);
    font-family: monospace;
    letter-spacing: 6px;
    font-size: 14px;
    font-weight: bold;
}

.progress-bar {
    width: 250px;
    height: 2px;
    background: rgba(229, 211, 179, 0.2);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
    transition: width 0.2s ease;
}

.container {
    padding: 10px 10%;
}

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

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    padding: 15px 10%;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--nav-border);
    transition: transform 0.3s ease-in-out, opacity 0.3s ease;
}

nav.nav-hidden {
    transform: translateX(-50%) translateY(-100%);
    opacity: 0;
}

nav.nav-shown {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

nav h1 {
    font-size: 20px;
    color: var(--primary-color);
    font-family: Arial, Helvetica, sans-serif;
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin: 0 20px;
}

nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

nav ul li a::after {
    content: '';
    width: 0;
    height: 3px;
    background: var(--primary-color);
    position: absolute;
    left: 0;
    bottom: -2px;
    transition: 0.5s;
}

nav ul li a:hover::after {
    width: 100%;
}

nav #menu-icon {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
    z-index: 1001;
}

nav #theme-toggle {
    display: block !important;
    font-size: 20px;
    color: var(--text-color);
    z-index: 1002;
    transition: color 0.3s ease;
}

nav #theme-toggle:hover {
    color: var(--primary-color);
}

[data-theme="light"] nav #theme-toggle {
    color: var(--text-color);
}


#home {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden !important;
}

section {
    scroll-margin-top: 80px;
}

#header {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 85px;
    box-sizing: border-box;
}

#bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: transparent;
}

.hero-content {
    flex-grow: 1;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 5%;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.hero-text-box {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    width: 50%;
}


.header-text {
    text-align: left;
    position: relative;
    z-index: 1;
}

.header-text hr {
    width: 17%;
    border: solid var(--primary-color);
    opacity: 70%;
    border-width: 2px;
    margin: 10px 0 1rem 0;
    animation: slideLeft 1.8s ease forwards;
}

.header-text p,
.header-text h1,
.header-text h2 {
    animation: slideTop 1.5s ease forwards;
    animation-delay: calc(.2s * var(--i));
    margin: 0;
}

.header-text h1 {
    font-size: 50px;
}

.header-text h1 span {
    color: var(--primary-color);
}

.header-text h2 {
    font-size: 36px;
    letter-spacing: 6px;
}

.header-text h2 span {
    color: var(--primary-color);
}

.change-text {
    display: flex;
    justify-content: flex-start;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 2.5rem;
    width: 100%;
    height: 50px;
    position: relative;
}

.change-text h3 {
    display: grid;
    margin: 0;
}

.change-text h3 .word {
    grid-area: 1 / 1;
    display: flex;
    opacity: 0;
}

.change-text h3 .word .letter {
    transform-origin: center center 25px;
}

.change-text h3 .word .letter.out {
    transform: rotateX(90deg);
    transition: 0.32s cubic-bezier(0.6, 0, 0.7, 0.2);
}

.change-text h3 .word .letter.in {
    transition: 0.38s ease;
}

.change-text h3 .word .letter.behind {
    transform: rotateX(-90deg);
}

.profile-container {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-container::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: conic-gradient(var(--primary-color) 0deg,
            transparent 60deg,
            transparent 180deg,
            var(--primary-color) 180deg,
            transparent 240deg,
            transparent 360deg);
    animation: rotateBorder 4s linear infinite;
    z-index: 0;
}

.profile-container::after {
    content: '';
    position: absolute;
    inset: 4px;
    background: var(--card-bg);
    border-radius: 14px;
    z-index: 1;
}

.profile img {
    position: relative;
    width: 290px;
    height: 290px;
    object-fit: cover;
    border-radius: 14px;
    z-index: 2;
}

#id-card {
    cursor: grab;
    transform-origin: top center;
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
    z-index: 99 !important;
    touch-action: none;
}

#id-card:active {
    cursor: grabbing;
}

#id-card img {
    pointer-events: none;
}

.hero-skills-bottom {
    width: 100%;
    padding-bottom: 30px;
    z-index: 2;
    position: relative;
}

.tech-stack-title {
    text-align: center;
    font-size: 12px;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 600;
}

.skills-marquee-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: transparent;
    margin-top: 0;
    padding: 0;
}

.marquee-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-track {
    display: flex;
    width: max-content;
    gap: 20px;
}

.badge-item {
    background: var(--badge-primary-bg);
    border: 1px solid var(--badge-primary-border);
    color: var(--badge-primary-color);
    padding: 10px 25px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
}

/* --- Animasi Marquee --- */
.track-left {
    animation: scrollLeft 25s linear infinite;
}

.track-right {
    animation: scrollRight 25s linear infinite;
}

@keyframes scrollLeft {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes scrollRight {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}

/* ------ About --------- */
#about {
    color: var(--text-muted);
    padding: 40px 0;
}

.row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.about1 {
    flex-basis: 35%;
    min-width: 250px;
    margin-bottom: 20px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 11%;
    overflow: hidden;
    padding: 4px;
}

.about1::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: conic-gradient(var(--primary-color) 0deg,
            transparent 60deg,
            transparent 180deg,
            var(--primary-color) 180deg,
            transparent 240deg,
            transparent 360deg);
    animation: rotateBorder 4s linear infinite;
    z-index: 0;
}

.about1::after {
    content: '';
    position: absolute;
    inset: 4px;
    background: var(--bg-color);
    border-radius: 9%;
    z-index: 1;
}

/* .about1 img {
    width: 100%;
    height: auto;
    border-radius: 9%;
    position: relative;
    z-index: 2;
    display: block;
} */


.sub {
    font-size: 40px;
    font-weight: 600;
    margin-top: 5px;
    line-height: 60px;
}

.sub span {
    color: var(--primary-color);
}

.tab-titles {
    display: flex;
    margin: 20px 0 40px;
}

.tab-links {
    margin-right: 50px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
}

.tab-links::after {
    content: '';
    width: 0;
    height: 3px;
    background: var(--primary-color);
    position: absolute;
    left: 0;
    bottom: -8px;
    transition: 0.5s;
}

.tab-links.active-link::after {
    width: 50%;
}

.tab-contents {
    display: none;
}

.tab-contents ul li {
    list-style: none;
    margin: 16px 0;
}

.tab-contents ul li span {
    color: var(--primary-color);
    font-size: 14px;
}

.tab-contents.active-tab {
    display: block;
}

/* =========================================
   SECTION EXPERIENCE (SCROLL-LINKED TIMELINE)
========================================= */
#experience {
    padding-top: 100px;
    padding-bottom: 70px;
    position: relative;
}

.experience-header {
    text-align: left;
    margin-bottom: 60px;
    position: relative;
}

.experience-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--primary-color);
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* Timeline Container */
.experience-timeline {
    position: relative;
    width: 100%;
    margin-top: 40px;
}

/* Center Spine Rail (Desktop) */
.timeline-rail {
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    z-index: 1;
}

.timeline-line-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

[data-theme="light"] .timeline-line-track {
    background: rgba(0, 0, 0, 0.08);
}

/* Dynamic Scroll-Linked Animated Line */
.timeline-line-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, rgba(255, 0, 79, 0.2) 0%, var(--primary-color) 40%, var(--primary-color) 100%);
    box-shadow: 0 0 12px var(--primary-color), 0 0 24px var(--primary-color);
    border-radius: 2px;
    will-change: height;
    transition: height 0.08s linear;
}

/* Glowing Runner Tip at the end of the line */
.timeline-glow-runner {
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translateX(-50%);
    background: #ffffff;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 14px 2px var(--primary-color);
    z-index: 4;
}

/* Timeline Items Grid (Desktop) */
.timeline-item {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    align-items: center;
    position: relative;
    margin-bottom: 85px;
    z-index: 2;
}

.timeline-item:last-child {
    margin-bottom: 20px;
}

/* Center Node & Marker */
.timeline-center-node {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    height: 100%;
}

.marker-square {
    width: 14px;
    height: 14px;
    background: var(--bg-color);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    transform: rotate(45deg);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 3;
}

[data-theme="light"] .marker-square {
    border-color: rgba(0, 0, 0, 0.25);
}

.timeline-item.timeline-active .marker-square {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 16px var(--primary-color);
    transform: rotate(45deg) scale(1.15);
}

/* Horizontal Arm Connector */
.marker-arm {
    position: absolute;
    top: 50%;
    width: 30px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%);
    transition: background 0.4s ease, box-shadow 0.4s ease;
    z-index: 2;
}

[data-theme="light"] .marker-arm {
    background: rgba(0, 0, 0, 0.1);
}

.marker-arm-right {
    left: 50%;
}

.marker-arm-left {
    right: 50%;
}

.timeline-item.timeline-active .marker-arm {
    background: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-color);
}

/* Stylized Split Numbers */
.timeline-side-number {
    display: flex;
    align-items: center;
}

.timeline-odd .timeline-side-number {
    justify-content: flex-end;
    padding-right: 40px;
}

.timeline-even .timeline-side-number {
    justify-content: flex-start;
    padding-left: 40px;
}

.timeline-huge-number {
    font-size: clamp(5.5rem, 8.5vw, 8.5rem);
    font-weight: 900;
    line-height: 0.85;
    letter-spacing: -2px;
    font-family: 'Poppins', sans-serif;
    user-select: none;
    display: inline-block;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-color) 35%, rgba(255, 255, 255, 0.16) 35%, rgba(255, 255, 255, 0.16) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.4s ease, filter 0.4s ease;
}

[data-theme="light"] .timeline-huge-number {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-color) 35%, rgba(15, 23, 42, 0.18) 35%, rgba(15, 23, 42, 0.18) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.timeline-item:hover .timeline-huge-number {
    transform: scale(1.03);
    filter: drop-shadow(0 0 18px rgba(255, 0, 79, 0.35));
}

[data-theme="light"] .timeline-item:hover .timeline-huge-number {
    filter: drop-shadow(0 0 16px rgba(2, 132, 199, 0.3));
}

/* Timeline Content & Card */
.timeline-side-content {
    display: flex;
}

.timeline-odd .timeline-side-content {
    justify-content: flex-start;
    padding-left: 30px;
}

.timeline-even .timeline-side-content {
    justify-content: flex-end;
    padding-right: 30px;
}

.timeline-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 32px 34px;
    width: 100%;
    max-width: 540px;
    position: relative;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.35s ease, box-shadow 0.35s ease;
}

.timeline-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 0, 79, 0.35);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .timeline-card:hover {
    border-color: rgba(2, 132, 199, 0.35);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.timeline-item.timeline-active .timeline-card {
    border-color: rgba(255, 0, 79, 0.3);
}

[data-theme="light"] .timeline-item.timeline-active .timeline-card {
    border-color: rgba(2, 132, 199, 0.3);
}

/* Meta: Date & glowing dot */
.timeline-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.timeline-node-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--primary-color);
    flex-shrink: 0;
}

.timeline-date {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--primary-color);
    text-transform: uppercase;
}

.timeline-title {
    font-size: clamp(20px, 2.2vw, 28px);
    font-weight: 700;
    color: var(--text-color);
    margin: 4px 0 14px;
    line-height: 1.3;
}

/* Badges */
.timeline-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.exp-badge {
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
}

.exp-badge-accent {
    background: var(--badge-primary-bg);
    border: 1px solid var(--badge-primary-border);
    color: var(--badge-primary-color);
}

.exp-badge-sub {
    background: var(--tag-bg);
    border: 1px solid var(--tag-border);
    color: var(--tag-color);
}

.timeline-desc {
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.7;
    margin: 0;
}

/* Tablet & Mobile Layout (< 992px) */
@media only screen and (max-width: 991px) {
    #experience {
        padding-top: 60px;
        padding-bottom: 40px;
    }

    .experience-header {
        margin-bottom: 40px;
    }

    .timeline-rail {
        left: 20px;
        transform: none;
    }

    .timeline-item {
        display: flex;
        flex-direction: column;
        padding-left: 55px;
        margin-bottom: 50px;
        align-items: flex-start;
    }

    .timeline-center-node {
        position: absolute;
        left: 20px;
        top: 32px;
        width: auto;
        height: auto;
        transform: translateX(-50%);
    }

    .marker-arm {
        display: none;
    }

    .timeline-side-number {
        order: 1;
        padding: 0 !important;
        justify-content: flex-start !important;
        margin-bottom: 10px;
    }

    .timeline-huge-number {
        font-size: clamp(3.5rem, 12vw, 4.8rem);
    }

    .timeline-side-content {
        order: 2;
        width: 100%;
        padding: 0 !important;
        justify-content: flex-start !important;
    }

    .timeline-card {
        max-width: 100%;
        padding: 24px 22px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .timeline-line-progress {
        height: 100% !important;
        transition: none !important;
    }

    .timeline-glow-runner {
        display: none !important;
    }

    .timeline-huge-number,
    .timeline-card,
    .marker-square {
        transition: none !important;
    }
}

/* --------- Portfolio --------- */
#portfolio,
#portfolio1 {
    padding: 60px 0;
}

.section-desc {
    text-align: center;
    color: #94a3b8;
    margin-bottom: 40px;
    font-size: 15px;
}

.work-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 35px;
    margin-top: 40px;
    padding: 0;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 26px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--badge-primary-color);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .project-card:hover {
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
}

/* Gambar Proyek di Paling Atas */
.project-img-wrapper {
    width: 100%;
    margin: 0 0 18px 0;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

[data-theme="light"] .project-img-wrapper {
    background: rgba(0, 0, 0, 0.04);
}

.project-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease;
}

.project-card:hover .project-img {
    transform: scale(1.02);
}

.img-fallback {
    aspect-ratio: 1901 / 884;
    width: 100%;
}

.img-fallback .project-img {
    display: none;
}

.project-img-fallback-text {
    display: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.img-fallback .project-img-fallback-text {
    display: block;
}

/* Title & Tahun Sejajar */
.project-title-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 15px;
    margin-bottom: 12px;
}

.project-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.25;
}

.project-year {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Category Badges di Bawah Title */
.project-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.badge {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    display: inline-block;
}

.primary-badge {
    background: var(--badge-primary-bg);
    color: var(--badge-primary-color);
    border: 1px solid var(--badge-primary-border);
}

.secondary-badge {
    background: var(--badge-sec-bg);
    color: var(--badge-sec-color);
    border: 1px solid var(--card-border);
}

/* Button Detail Project Menggantikan View Project */
.btn-detail-project {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--link-color);
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    margin-top: auto;
    font-family: inherit;
    transition: gap 0.2s ease, color 0.2s ease;
    align-self: flex-start;
}

.btn-detail-project:hover {
    color: var(--link-hover);
    gap: 10px;
}

.btn-detail-project:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
    border-radius: 4px;
}

/* =========================================
   PROJECT DETAIL MODAL
========================================= */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.project-modal.active {
    opacity: 1;
    visibility: visible;
}

.project-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

.project-modal-dialog {
    position: relative;
    z-index: 1;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    width: 100%;
    max-width: 620px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
    transform: scale(0.95) translateY(15px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-modal.active .project-modal-dialog {
    transform: scale(1) translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    color: var(--text-color);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
    z-index: 2;
}

[data-theme="light"] .modal-close-btn {
    background: rgba(0, 0, 0, 0.06);
}

.modal-close-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
    transform: rotate(90deg);
}

.modal-close-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.modal-img-wrapper {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    margin-bottom: 22px;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 15px;
    margin-bottom: 12px;
}

.modal-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.modal-year {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.modal-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.modal-body-section {
    margin-bottom: 22px;
}

.modal-section-heading {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.modal-desc {
    font-size: 14.5px;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

/* Tech Stack Badges di Dalam Modal */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tag {
    font-size: 12px;
    background: var(--tag-bg);
    color: var(--tag-color);
    border: 1px solid var(--tag-border);
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
}

.modal-footer-actions {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: flex-end;
}

.btn-modal-view-project {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.btn-modal-view-project:hover {
    background: var(--link-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 79, 0.35);
}

[data-theme="light"] .btn-modal-view-project:hover {
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.35);
}

.btn-modal-view-project:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

/* ===== Legacy Work Styles ===== */

.work {
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.work img {
    width: 100%;
    border-radius: 10px;
    display: block;
    transition: transform 0.5s;
}

.layer {
    width: 100%;
    height: 0%;
    background: linear-gradient(rgba(0, 0, 0, 0.6), var(--primary-color));
    border-radius: 10px;
    position: absolute;
    left: 0;
    bottom: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    font-size: 14px;
    transition: height 0.5s;
}

.layer h3 {
    font-weight: 500;
    margin-bottom: 20px;
    color: #fff;
}

.layer p {
    color: #fff;
}

.layer a i {
    margin-top: 20px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 18px;
    line-height: 60px;
    background: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    text-align: center;
}

.work:hover img {
    transform: scale(1.1);
}

.work:hover .layer {
    height: 100%;
}

.btn {
    display: block;
    margin: 40px auto;
    width: fit-content;
    border: 1px solid var(--primary-color);
    padding: 14px 45px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    transition: background 0.5s;
}

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

/* Slideshow container */
.photos {
    max-width: 330px;
    position: relative;
    margin: auto;
    max-height: 280px;
}

.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    margin-top: -30px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 25px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
}

.prev {
    left: -13%;
}

.next {
    right: -7%;
}

.prev:hover,
.next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.text {
    color: #f2f2f2;
    font-size: 15px;
    padding: 8px 12px;
    position: absolute;
    bottom: 8px;
    width: 100%;
    text-align: center;
}

.dot {
    cursor: pointer;
    height: 13px;
    width: 13px;
    margin: 0 2px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
}

.active,
.dot:hover {
    background-color: var(--primary-color);
}

.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}

@keyframes fade {
    from {
        opacity: .4
    }

    to {
        opacity: 1
    }
}

#contact {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    padding: 50px 0;
}

.contact-left {
    flex: 1 1 300px;
}

.contact-left p {
    margin-top: 30px;
}

.contact-left p i {
    color: var(--primary-color);
    margin-right: 15px;
    font-size: 25px;
}

.social {
    margin-top: 30px;
}

.social a i {
    text-decoration: none;
    font-size: 24px;
    margin-right: 15px;
    color: var(--text-muted);
    display: inline-block;
    transition: transform 0.5s;
}

.social a i:hover {
    color: var(--primary-color);
    transform: translateY(-5px);
}

.contact-right {
    flex: 2 1 400px;
}

form input,
form textarea {
    width: 100%;
    border: 0;
    outline: none;
    background: var(--skills-bg);
    padding: 15px;
    margin: 15px 0;
    color: var(--text-color);
    font-size: 18px;
    border-radius: 6px;
}

.btn.btn2 {
    display: inline-block;
    background: var(--primary-color);
    border: none;
    cursor: pointer;
    color: #fff;
}

.copyright {
    width: 100%;
    text-align: center;
    padding: 25px 0;
    background: var(--skills-bg);
    font-weight: 300;
    margin-top: 40px;
}

/* --------- Animations --------- */

@keyframes rotateBorder {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes slideTop {
    0% {
        transform: translateY(100px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideLeft {
    0% {
        transform: translateX(100px);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.scroll-animate {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}

.scroll-animate.show-animate {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 100ms;
}

.delay-2 {
    transition-delay: 200ms;
}

.delay-3 {
    transition-delay: 300ms;
}

/* --------- Media Queries (Mobile) --------- */
@media only screen and (max-width: 768px) {

    #header {
        height: auto !important;
        min-height: 100vh !important;
        padding: 85px 0 40px 0 !important;
        box-sizing: border-box !important;
    }

    #home,
    #about {
        height: auto !important;
        min-height: auto !important;
        padding: 0 0 40px 0 !important;
    }

    nav {
        padding: 15px 5% !important;
        width: 100% !important;
        left: 0 !important;
        transform: none !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    nav ul {
        position: absolute !important;
        top: 60px !important;
        left: 0 !important;
        width: 100% !important;
        max-height: 0 !important;
        overflow: hidden !important;
        background: var(--nav-bg) !important;
        flex-direction: column !important;
        align-items: center !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 0 8px 8px !important;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
        transition: max-height 0.4s ease-in-out !important;
        z-index: 999 !important;
    }

    nav ul.active {
        max-height: 350px !important;
        padding: 20px 0 !important;
    }

    nav ul li {
        margin: 15px 0 !important;
        display: block !important;
    }

    nav #menu-icon {
        display: block !important;
    }

    .hero-content {
        flex-direction: column-reverse;
        justify-content: center;
        gap: 30px;
        padding: 10px 5% !important;
    }

    .hero-text-box {
        margin-top: 0;
        width: 100%;
        align-items: center;
    }

    .header-text {
        text-align: center;
    }

    .header-text hr {
        margin: 10px auto 1rem auto;
    }

    .change-text {
        justify-content: center;
    }

    .header-text .btn {
        margin: 20px auto 0 auto !important;
        display: inline-block !important;
    }

    .hero-skills-bottom {
        margin-top: 60px;
    }

    .badge-item {
        padding: 12px 25px;
        font-size: 15px;
    }

    .track-left,
    .track-right {
        animation-duration: 15s;
    }

    .about-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 40px !important;
        width: 100% !important;
    }

    .about-col-1,
    .about-col-2 {
        width: 100% !important;
        flex-basis: 100% !important;
        float: none !important;
    }

    .about-col-1 {
        display: flex !important;
        justify-content: center !important;
    }

    .about-col-1 img {
        width: 80% !important;
        max-width: 280px !important;
        height: auto !important;
        display: block !important;
        margin: 0 auto !important;
        position: relative !important;
    }

    .about-col-2 {
        padding: 0 20px !important;
        text-align: left !important;
    }

    .about-col-2 .sub-title {
        text-align: center !important;
        font-size: 32px !important;
        margin-bottom: 20px !important;
    }

    .work-list {
        grid-template-columns: 1fr !important;
        padding: 0 10px !important;
    }

    .project-card {
        padding: 20px !important;
    }
}