/* Animated underline for navigation */
.wp-block-navigation a {
    position: relative;
    text-decoration: none;
}

.wp-block-navigation a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width .3s ease;
}

.wp-block-navigation a:hover::after,
.wp-block-navigation .current-menu-item > a::after,
.wp-block-navigation .current_page_item > a::after,
.wp-block-navigation .current-menu-ancestor > a::after {
    width: 100%;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 46px;
    height: 46px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    font-weight: 300;
    z-index: 9999;
    transition: all .25s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

#back-to-top:hover {
    background: #333;
    transform: translateY(-3px);
}


/* Increase spacing between consecutive paragraphs on mobile */
@media (max-width: 768px) {
    .wp-block-post-content p + p,
    .entry-content p + p {
        margin-top: 2rem !important;
    }
}


/* Add space between list items */
.wp-block-post-content li,
.entry-content li {
    margin-bottom: 0.75rem;
}


/* Increase H4 size on mobile */
@media (max-width: 768px) {
    h4,
    .wp-block-heading h4 {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }
}



.page .wp-block-post-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.page .wp-block-post-content > *:first-child {
    margin-top: 0 !important;
}


/* Hide visible page titles */
.page .wp-block-post-title,
.page .entry-title {
    display: none;
}


/* Homepage: hide title and remove its surrounding space */
.page-id-342 .wp-block-post-title {
    display: none !important;
}

.page-id-342 main > .wp-block-group > .wp-block-group {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Site title and navigation focus styles */
.wp-block-site-title a:focus:not(:focus-visible),
.wp-block-navigation a:focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
}

.wp-block-site-title a:focus-visible,
.wp-block-navigation a:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

/* -------------------------------------------------
   Clean keyboard focus styles
------------------------------------------------- */

.wp-block-site-title a:focus-visible,
.wp-block-navigation a:focus-visible,
.wp-block-button__link:focus-visible,
button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
input[type="reset"]:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}
Even cleaner for your portfolio

Since your portfolio has a very minimalist aesthetic, you could remove the underline from buttons entirely and leave it only for text links:

.wp-block-button__link:focus-visible,
button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
input[type="reset"]:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none;
}

That way:

Navigation links get a subtle underline when navigating with the keyboard.
Buttons simply don't flash the square outline after being clicked.
The experience stays clean and consistent with the rest of your design.