@import "https://unpkg.com/open-props/easings.min.css";
@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400&display=swap');

@font-face {
    font-family: 'Gelica';
    src: url('fonts/Gelica-Medium.woff2') format('woff2');
    font-weight: 500;
}

:root {
    --bg-color: #F5F2ED;
    --text-color: #000000cb;
    --text-color-opaque: rgba(51, 51, 51, 0.8);
    --link-color: #666666;
    --link-hover-color: #000000;
    --icon-fill: #333333;
    --icon-fill-hover: #000000;
    --emphasis-color: #333333;
    --light-emphasis-color: #333333;
    --scrollbar-bg: #d3d3d3;
    --scrollbar-thumb: #a8a8a8;
    --scrollbar-thumb-hover: #808080;
    --max-content-width: 750px;
    -webkit-tap-highlight-color: transparent;
    --icon-github: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 496 512'%3E%3Cpath d='M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3 .3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5 .3-6.2 2.3zm44.2-1.7c-2.9 .7-4.9 2.6-4.6 4.9 .3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3 .7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3 .3 2.9 2.3 3.9 1.6 1 3.6 .7 4.3-.7 .7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3 .7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3 .7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z'/%3E%3C/svg%3E");
    --icon-twitter: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M459.4 151.7c.3 4.5 .3 9.1 .3 13.6 0 138.7-105.6 298.6-298.6 298.6-59.5 0-114.7-17.2-161.1-47.1 8.4 1 16.6 1.3 25.3 1.3 49.1 0 94.2-16.6 130.3-44.8-46.1-1-84.8-31.2-98.1-72.8 6.5 1 13 1.6 19.8 1.6 9.4 0 18.8-1.3 27.6-3.6-48.1-9.7-84.1-52-84.1-103v-1.3c14 7.8 30.2 12.7 47.4 13.3-28.3-18.8-46.8-51-46.8-87.4 0-19.5 5.2-37.4 14.3-53 51.7 63.7 129.3 105.3 216.4 109.8-1.6-7.8-2.6-15.9-2.6-24 0-57.8 46.8-104.9 104.9-104.9 30.2 0 57.5 12.7 76.7 33.1 23.7-4.5 46.5-13.3 66.6-25.3-7.8 24.4-24.4 44.8-46.1 57.8 21.1-2.3 41.6-8.1 60.4-16.2-14.3 20.8-32.2 39.3-52.6 54.3z'/%3E%3C/svg%3E");
    --border-color: #DAD4CB;
    --border-color-weak: #E5DFD6;
}

.icon {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    background-color: currentColor;
    mask-repeat: no-repeat;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
}

a .icon {
    vertical-align: middle;
}

.icon-twitter {
    mask-image: var(--icon-twitter);
    -webkit-mask-image: var(--icon-twitter);
}

.icon-github {
    mask-image: var(--icon-github);
    -webkit-mask-image: var(--icon-github);
}

[data-theme="dark"] {
    --bg-color: linear-gradient(135deg, #252220 0%, #1e1e1e 150%);
    --text-color: #cac8bc;
    --text-color-opaque: rgba(211, 211, 211, 0.8);
    --link-color: #ffffed;
    --link-hover-color: #cccccc;
    --icon-fill: #d3d3d3;
    --icon-fill-hover: #cccccc;
    --emphasis-color: #fffdea;
    --light-emphasis-color: #d3d3d3;
    --scrollbar-bg: #333333;
    --scrollbar-thumb: #555555;
    --scrollbar-thumb-hover: #777777;
    -webkit-tap-highlight-color: transparent;
    --border-color: #48443D;
    --border-color-weak: #423D37;
}

body {
    font-family: 'Work Sans', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.4;
    margin: 0;
    padding: 0;
    font-kerning: normal;
    font-feature-settings: "kern";
    font-weight: 400;
}

h1, h2, h3 {
    font-family: 'Gelica', sans-serif;
    font-weight: 500;
    color: var(--emphasis-color);
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-bg);
}

::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 20px;
    border: 3px solid var(--scrollbar-bg);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

main {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 100px;
}

a {
    color: var(--link-color);
    text-decoration: underline;
    text-decoration-color: var(--text-color-opaque);
    text-underline-offset: 0.2em;
}

p#email {
    padding-top: 0.25em;
}

a:hover {
    color: var(--link-hover-color);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    text-align: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.25rem;
    border-bottom: 3px solid var(--text-color);
}

header h1 {
    font-size: 2rem;
    margin: 0;
}

nav a {
    font-size: 1.5rem;
}

nav a:not(:last-child) {
    margin-right: 0.75rem;
}

section h2 {
    font-size: 1.6rem;
    margin-bottom: 0.25em;
    padding-bottom: 0.25em;
    border-bottom: 2px solid var(--text-color);
}

section p {
    font-size: 1.1rem;
    margin: 0;
    padding-bottom: 0.5em;
}

.project:not(:last-child) {
    margin-bottom: 1rem;
}

.project.project:not(:last-child)::after {
    content: "";
    display: block;
    height: 2px;
    background: var(--border-color);
    filter: opacity(1.0);
    width: 100%;
    margin-top: 1rem;
}

.project h3 {
    font-size: 1.4rem;
    margin: 0;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
    padding: 5px 0;
}

.project-content {
    display: flex;
    flex-direction: column;
}

.project-images-container {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    overflow: hidden;
    width: 100%;
    cursor: pointer;
    border-radius: 8px;
}

.project-images {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease;
    border-radius: 8px;
    padding-right: 2px;
}

.project-images img {
    height: 100%;
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    flex: 0 0 100%;
    user-select: none;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.project-images img.top {
    object-position: top;
}

.project-images img.bottom {
    object-position: bottom;
}

.project-images-container::-webkit-scrollbar {
    display: none;
}

.project-images-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(10px);
    overflow: auto;
}

.modal-content {
    margin: auto;
    display: block;
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.close {
    position: absolute;
    top: 10px;
    right: 30px;
    color: var(--text-color);
    font-size: 40px;
    height: 40px;
    line-height: 40px;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: var(--text-color-opaque);
    text-decoration: none;
    cursor: pointer;
}

.modal-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 30px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.modal-btn.left {
    left: 30px;
}

.modal-btn.right {
    right: 30px;
}

/* theme toggle */

.theme-toggle-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-toggle-container button {
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.sun-and-moon > :is(.moon, .sun, .sun-beams) {
    transform-origin: center;
}

.sun-and-moon > :is(.moon, .sun) {
    fill: var(--icon-fill);
}

.theme-toggle:is(:hover, :focus-visible) > .sun-and-moon > :is(.moon, .sun) {
    fill: var(--icon-fill-hover);
}

.sun-and-moon > .sun-beams {
    stroke: var(--icon-fill);
    stroke-width: 2px;
}

.theme-toggle:is(:hover, :focus-visible) .sun-and-moon > .sun-beams {
    stroke: var(--icon-fill-hover);
}

[data-theme="dark"] .sun-and-moon > .sun {
    transform: scale(1.75);
}

[data-theme="dark"] .sun-and-moon > .sun-beams {
    opacity: 0;
}

[data-theme="dark"] .sun-and-moon > .moon > circle {
    transform: translateX(-7px);
}

@supports (cx: 1) {
    [data-theme="dark"] .sun-and-moon > .moon > circle {
        cx: 17;
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .sun-and-moon > .sun {
        transition: transform .5s var(--ease-elastic-3);
    }

    .sun-and-moon > .sun-beams {
        transition: transform .5s var(--ease-elastic-4), opacity .5s var(--ease-3);
    }

    .sun-and-moon .moon > circle {
        transition: transform .25s var(--ease-out-5);
    }

    @supports (cx: 1) {
        .sun-and-moon .moon > circle {
            transition: cx .25s var(--ease-out-5);
        }
    }

    [data-theme="dark"] .sun-and-moon > .sun {
        transition-timing-function: var(--ease-3);
        transition-duration: .25s;
        transform: scale(1.75);
    }

    [data-theme="dark"] .sun-and-moon > .sun-beams {
        transition-duration: .15s;
        transform: rotateZ(-25deg);
    }

    [data-theme="dark"] .sun-and-moon > .moon > circle {
        transition-duration: .5s;
        transition-delay: .25s;
    }
}

/* animations */

@keyframes slidein {
    from {
        transform: translateX(100%);
        max-height: 0vh;
    }
    to {
        transform: translateX(0%);
        max-height: 100vh;
    }
}

@keyframes slideout {
    from {
        transform: translateX(0%);
        max-height: 100vh;
    }
    to {
        transform: translateX(100%);
        max-height: 0vh;
    }
}

@keyframes fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeout {
    from { opacity: 1; }
    to { opacity: 0; }
}

.fadein {
    animation: fadein 1s, slidein 0.75s;
    animation-fill-mode: forwards;
}

.fadeout {
    animation: fadeout 0.75s, slideout 0.75s;
    padding: 0 !important;
}

.project-images-container .gallery-btn {
    background: none;
    border: none;
    color: #d3d3d3;
    font-size: 1.5em;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 200;
}

.project-images-container .gallery-btn.left {
    left: 10px;
}

.project-images-container .gallery-btn.right {
    right: 10px;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.project-header:has(+ .project-content > .project-images-container) {
    margin-bottom: 0.75rem;
}

.project-header h3 {
    margin: 0;
}

.project-date {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-top: 0.4rem;
    flex-grow: 1;
    margin-left: 1rem;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-links a {
    color: var(--link-color);
    text-decoration: none;
}

.project-links a:hover {
    color: var(--link-hover-color);
}

.icon-external-link {
    width: 20px;
    height: 20px;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' width='18' height='18' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.5 9.75v4.5a1.5 1.5 0 0 1-1.5 1.5H3.75a1.5 1.5 0 0 1-1.5-1.5V6a1.5 1.5 0 0 1 1.5-1.5h4.5'/%3E%3Cpolyline points='11.25 2.25 15.75 2.25 15.75 6.75'/%3E%3Cline x1='7.5' y1='10.5' x2='15.75' y2='2.25'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' width='18' height='18' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.5 9.75v4.5a1.5 1.5 0 0 1-1.5 1.5H3.75a1.5 1.5 0 0 1-1.5-1.5V6a1.5 1.5 0 0 1 1.5-1.5h4.5'/%3E%3Cpolyline points='11.25 2.25 15.75 2.25 15.75 6.75'/%3E%3Cline x1='7.5' y1='10.5' x2='15.75' y2='2.25'/%3E%3C/svg%3E");
    background-color: currentColor;
    display: inline-block;
    vertical-align: middle;
}

.highlight {
    color: var(--emphasis-color);
    font-weight: 500;
}

@media (max-width: 768px) {
    main {
        padding: 40px;
        padding-left: 25px;
        padding-right: 25px;
    }

    .theme-toggle-container {
        display: none;
    }

    body {
        line-height: 1.4;
    }

    header h1 {
        font-size: 1.8rem;
    }

    section h2 {
        font-size: 1.6rem;
    }

    .project h3 {
        font-size: 1.3rem;
    }

    .project-date {
        font-size: 1.1rem;
        margin-top: 0.3rem;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    #about .about-content {
        flex-direction: column;
    }

    #about .profile-picture {
        width: 120px;
        height: 120px;
    }
}
