:root {
    --accent: #1e293b;
    --bg: #0f172a;
    --border: #334155;
    --muted: #94a3b8;
    --primary: #e3d4b0;
    --text: #dae1f1;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --header-text: #e3d4b0;
    --header-bg: var(--bg);
    --card-bg: #1e293b;
    --white: #fff;
    --tooltip-text: #141414;
}

/* Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body,
main,
section {
    background: var(--bg);
}

body {
    color: var(--text);
    line-height: 1.5;
}

a,
.exp-title,
.exp-desc,
h2 {
    font-weight: 600;
}

button {
    font: inherit;
}

a {
    --link-size: 1em;
    color: var(--primary);
    text-decoration: none;
    display: inline-block;
    font-size: var(--link-size);
    transition: font-size 0.2s ease;
}

a:hover {
    font-size: calc(var(--link-size) * 1.1);
}

/* Shared transitions */
#main-header,
.profile-pic-container,
.skills-list li,
.blog-modal-container,
.blog-link {
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fix for picture source tags taking up ghost space */
picture source {
    display: none !important;
}

/* Header */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    contain: layout;
}

#main-header {
    background: var(--header-bg);
    color: var(--header-text);
    font-size: 1.15em;
    height: 332px;
    min-height: 332px;
    overflow: visible;
    padding: 0.5rem 0.5rem;
    z-index: 1000;
    text-align: center;
    transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1), font-size 0.2s,
        padding 0.2s;
}

#main-header.shrink {
    font-size: 0.95em;
    height: 56px;
    min-height: 56px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.3rem;
}

#hdr-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

#hdr-name {
    margin: 0;
    font-size: 2rem;
    line-height: 1.05;
}

#hdr-name-row .hdr-linkedin-inline {
    display: none;
    align-items: center;
}

#hdr-name-row .hdr-linkedin-inline img {
    margin: 0;
    display: block;
    height: 2rem;
    width: auto;
}

.contact p {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
}

.contact a {
    display: flex;
    align-items: center;
}

.contact img {
    margin: 0;
    display: block;
}

#hdr-name-row .hdr-linkedin-inline:hover,
.contact a:hover {
    font-size: inherit;
}

#main-header.shrink #hdr-tagline,
#main-header.shrink #hdr-subline {
    display: none;
}

#main-header.shrink #hdr-name {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1;
    white-space: nowrap;
}

#main-header.shrink .profile-pic-container {
    margin: 0;
    height: 42px;
    width: 42px;
    border-width: 2px;
}

#main-header.shrink .profile-pic-container img {
    width: 100%;
    height: 100%;
}

#main-header.shrink #hdr-name-row {
    gap: 0.3rem;
}

#main-header.shrink #hdr-name-row .hdr-linkedin-inline {
    display: inline-flex;
}

#main-header.shrink #hdr-name-row .hdr-linkedin-inline img {
    height: 1.25rem;
    width: auto;
}

#main-header.shrink .contact {
    display: none;
}

#main-header.shrink #profileImg {
    cursor: default !important;
    pointer-events: none;
}

#hdr-tagline {
    margin-bottom: 0.25rem;
}

#hdr-subline {
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 400;
    margin: 0;
}

.view-nav {
    display: inline-flex;
    gap: 0.35rem;
    margin: 0.7rem auto 0.4rem;
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.2rem;
}

.view-tab {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    padding: 0.25rem 0.8rem;
    border-radius: 999px;
    cursor: pointer;
}

.view-tab.is-active {
    background: var(--primary);
    color: var(--bg);
    font-weight: 700;
}

#main-header.shrink .view-nav {
    margin: 0;
    transform: scale(0.95);
}

.profile-pic-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    height: 150px;
    width: 150px;
    border: 4px solid var(--primary);
    border-radius: 50%;
    box-shadow: 0 2px 8px #0002;
    background: #eee;
    overflow: hidden;
    transition: opacity 0.2s, transform 0.2s;
    will-change: opacity, transform;
}

.profile-pic-container picture {
    display: block;
    width: 100%;
    height: 100%;
}

.profile-pic-container img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.profile-pic-container.hide {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.7);
}

/* Layout */
main {
    border-radius: 1rem;
    box-shadow: var(--shadow);
    margin: 386px auto 0;
    max-width: 900px;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

section {
    background: var(--card-bg);
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 2px;
    box-shadow: var(--shadow);
}

h2 {
    border-left: 4px solid var(--primary);
    font-size: 1.3rem;
    margin-bottom: 0.7rem;
    padding-left: 0.6rem;
    color: var(--primary);
}

.section-header-with-action {
    align-items: center;
    display: flex;
    gap: 0.8rem;
    justify-content: space-between;
    margin-bottom: 0.7rem;
}

.section-header-with-action h2 {
    margin: 0;
}

.section-action {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--primary);
    cursor: pointer;
    padding: 0.35rem 0.8rem;
    white-space: nowrap;
}

.section-action:hover {
    border-color: var(--primary);
}

#profile-text p,
#leadership-text p {
    margin-bottom: 1.1rem;
}

#profile-text p:last-child,
#leadership-text p:last-child {
    margin-bottom: 0;
}

/* Skills */
.skills-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skills-list li {
    background: var(--accent);
    border-radius: 999px;
    font-size: 1.15rem;
    font-weight: 500;
    padding: 0.45em 1em;
    color: var(--primary);
    transition: 0.2s;
    position: relative;
    cursor: pointer;
}

.skill-link {
    display: inline-block;
}

.skill-link:focus-visible {
    border-radius: 999px;
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}



/* Experience + Education */
.exp-list,
.edu-list {
    list-style: none;
    padding: 0;
}

#blog-page {
    min-height: 50vh;
}

.blog-page-intro {
    color: var(--muted);
}

.blog-filters {
    align-items: center;
    display: grid;
    gap: 0.6rem;
    grid-template-columns: auto minmax(170px, 1fr) auto minmax(170px, 1fr);
}

.blog-filters label {
    color: var(--muted);
}

.blog-filters select {
    background: var(--accent);
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    color: var(--text);
    padding: 0.45rem 0.55rem;
}

.blog-page-list {
    display: grid;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
}

.blog-post-card {
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.96));
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    padding: 0.85rem 0.95rem;
}

.blog-post-title-btn {
    --link-size: 1.08rem;
    background: none;
    border: 0;
    color: var(--primary);
    cursor: pointer;
    display: inline;
    font-size: var(--link-size);
    font-weight: 700;
    padding: 0;
    text-align: left;
}

.blog-post-title-btn:hover {
    text-decoration: underline;
}

.blog-post-meta {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.9rem;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.blog-post-category {
    background: rgba(227, 212, 176, 0.13);
    border: 1px solid rgba(227, 212, 176, 0.35);
    border-radius: 999px;
    color: var(--primary);
    padding: 0.05rem 0.5rem;
}

.blog-post-excerpt {
    margin-top: 0.4rem;
    color: var(--text);
}

.exp-meta,
.company-desc {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.exp-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.exp-meta span.sep {
    color: var(--border);
}

.exp-title {
    --link-size: 1.2rem;
    padding-top: 2rem;
    font-size: var(--link-size);
}

.exp-list li:first-child .exp-title,
.edu-list li:first-child .exp-title {
    padding-top: 0.5rem;
}

.exp-desc {
    font-size: 0.97rem;
    margin-top: 0.3rem;
}

.exp-bullets {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    list-style-type: disc;
}

.exp-bullets li {
    margin-bottom: 0.3rem;
    color: var(--text);
}

/* Image Modal */
.modal,
.skill-modal-overlay,
.blog-modal-overlay {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.modal {
    z-index: 2001;
    background: rgba(8, 13, 28, 0.98);
    padding: 2.5rem;
}

.modal-image-stage {
    position: relative;
}

.modal-content {
    display: block;
    max-width: min(92vw, 1100px);
    max-height: calc(100vh - 5rem);
    border-radius: 20px;
    border: none;
    animation: zoom 0.5s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.modal-connect-message {
    position: absolute;
    left: 50%;
    top: 76%;
    z-index: 2002;
    margin: 0;
    max-width: min(84%, 540px);
    transform: translate(-50%, -50%);
    pointer-events: none;
    color: #f8fafc;
    font-weight: 700;
    font-size: clamp(1rem, 2.2vw, 1.9rem);
    line-height: 1.2;
    text-align: center;
    letter-spacing: 0.02em;
    text-shadow:
        0 0 12px rgba(30, 41, 59, 0.95),
        0 0 22px rgba(15, 23, 42, 0.85),
        0 2px 4px rgba(0, 0, 0, 0.8);
    animation: modalConnectReveal 4.0s ease-out forwards;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--text);
    font-size: 3rem;
    cursor: pointer;
}

@keyframes zoom {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes modalConnectReveal {
    0% {
        transform: translate(-50%, -50%) scale(0.08);
        opacity: 0;
    }

    20% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    90% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* Competency Modal */
.skill-modal-overlay {
    z-index: 3100;
    background: rgba(0, 0, 0, 0.6);
    padding: 1rem;
}

.skill-modal-card {
    background: var(--white);
    color: var(--tooltip-text);
    width: min(92vw, 420px);
    border-radius: 10px;
    padding: 1rem 1rem 0.9rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    position: relative;
}

.skill-modal-close {
    position: absolute;
    top: 0.2rem;
    right: 0.55rem;
    border: 0;
    background: transparent;
    color: #1f2937;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

#skillModalTitle {
    margin: 0 1.5rem 0.45rem 0;
    font-size: 1.1rem;
    color: #111827;
}

#skillModalDescription {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
    color: #111827;
}

/* Blog Modal */
.blog-modal-overlay {
    z-index: 3000;
    background: rgba(0, 0, 0, 0.75);
}

.blog-modal-container {
    background: var(--bg);
    width: 75%;
    height: 75%;
    border-radius: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: zoom 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.blog-content {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem 2rem;
    color: var(--text);
    line-height: 1.6;
}

.blog-content h1 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-weight: 700;
}

.blog-content h2,
.blog-content h3 {
    border-left: 4px solid var(--primary);
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 0.7rem;
    padding-left: 0.6rem;
    color: var(--primary);
    font-weight: 600;
}

.blog-content p {
    margin-bottom: 1.1rem;
}

.blog-content ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1.1rem;
    list-style-type: disc;
}

.blog-content li {
    margin-bottom: 0;
    color: var(--text);
}

.blog-link {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 500;
}

.blog-link:hover {
    text-decoration: none;
}

#closeBlogModal {
    color: var(--muted);
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 2.5rem;
    z-index: 3001;
    transition: color 0.2s;
}

#closeBlogModal:hover {
    color: var(--primary);
}

/* Loading state */
.loading {
    text-align: center;
    padding: 4rem;
    margin-top: 386px;
    font-size: 1.2rem;
    color: var(--muted);
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 800px) {
    .modal {
        padding: 1.25rem;
    }

    .modal-content {
        max-width: calc(100vw - 2.5rem);
        max-height: calc(100vh - 2.5rem);
    }

    .modal-connect-message {
        top: 75%;
        max-width: 86%;
    }

    .blog-modal-container {
        width: 95%;
        height: 90%;
    }

    .blog-content {
        padding: 1.5rem;
    }

    .blog-filters {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .modal-connect-message {
        top: 74%;
        max-width: 88%;
        font-size: clamp(0.95rem, 4.7vw, 1.3rem);
    }

    .profile-pic-container {
        height: 100px;
        width: 100px;
        border-width: 3px;
    }

    #main-header {
        height: 268px;
        min-height: 268px;
    }

    #main-header.shrink {
        height: 56px;
    }

    #hdr-name-row .hdr-linkedin-inline {
        display: none;
    }

    #main-header .contact {
        display: block;
    }

    #main-header .contact p {
        margin-top: 0.35rem;
        margin-bottom: 0;
    }

    #main-header .contact img {
        width: 22px;
        height: 22px;
    }

    main {
        width: calc(100% - 14px);
        border-radius: 1rem;
        background: var(--bg);
        box-shadow: var(--shadow);
    }

    section {
        background: var(--card-bg);
        border: none;
        box-shadow: var(--shadow);
    }

    main,
    .loading {
        margin-top: 310px;
        padding: 1.5rem 1rem 3rem;
    }

    .skills-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }

    .skills-list li {
        font-size: 0.9rem;
        padding: 0.4rem;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        min-height: 48px;
        line-height: 1.2;
    }

    .view-nav {
        margin-top: 0.45rem;
    }

    .view-tab {
        padding: 0.2rem 0.55rem;
    }

    .section-header-with-action {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-action {
        align-self: flex-start;
    }

    .exp-meta {
        flex-direction: column;
        gap: 0.2rem;
        margin-top: 0.5rem;
    }

    .exp-meta span.sep {
        display: none;
    }

    .exp-meta span {
        display: block;
    }
}

@media (max-width: 430px) {
    .modal-connect-message {
        top: 73%;
    }
}
