/* General classes. */
:root {
    --font-color: black;
    --background-color: white;
    --auxiliary-color-1: #ebebeb;
    --auxiliary-color-2: #b9b9b9;
    --theme-color-1: #ff6600;
    --theme-color-2: #04b4ff;
    --theme-color-mix-orientation: 135deg;
    --theme-transition:
        background-color 1s ease,
        color 1s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    max-width: 1200px;
    margin: 0 auto;
    padding: min(5rem, 8%);
    font-family: system-ui, sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--font-color);
    transition: var(--theme-transition);
}

body.light-theme {
    --font-color: black;
    --background-color: white;
    --auxiliary-color-1: #ebebeb;
    --auxiliary-color-2: #b9b9b9;
}

body.dark-theme {
    --font-color: white;
    --background-color: black;
    --auxiliary-color-1: #0f172a;
    --auxiliary-color-2: #324c8b;
}

header {
    margin-bottom: 3rem;
    text-align: center;
}

.main-title {
    display: inline-block;
    overflow: hidden;
    border-right: .15em solid var(--theme-color-1);
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: .10em;
    animation:
        typing 2.5s steps(17, end),
        blink-caret .50s infinite;
}

@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 11ch
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--theme-color-1);
    }
}

nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    padding: 1rem;
    margin-bottom: 3rem;
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    nav {
        gap: 1rem;
        font-size: 1.1rem;
    }
}

footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.footer-left {
    justify-self: start;
}

.footer-center {
    justify-self: center;
}

.footer-right {
    justify-self: end;
}

.action-button {
    position: relative;
    text-decoration: none;
    color: var(--font-color);
    transition: var(--theme-transition);
    padding: 14px 25px;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    background:
        linear-gradient(var(--theme-color-mix-orientation),
            var(--theme-color-1),
            var(--theme-color-2));
}

.action-button span {
    position: relative;
    z-index: 1;
}

.action-button::before {
    content: "";
    position: absolute;
    inset: 2px;
    background: var(--auxiliary-color-1);
    transition: var(--theme-transition);
    border-radius: 9px;
}

.action-button:hover::before {
    opacity: 0.7;
}

.action-button::after {
    content: "";
    position: absolute;
    inset: 0px;
    border-radius: 9px;
    transition: 0.5s;
    opacity: 0;
    filter: blur(20px);
    background:
        linear-gradient(var(--theme-color-mix-orientation),
            var(--theme-color-1),
            var(--theme-color-2));
}

.action-button:hover:after {
    opacity: 1;
}

.section-title {
    text-align: center;
}


/* Intro section. */
.intro-section {
    display: grid;
    grid-template-columns: auto;
    align-items: center;
}

.intro-section-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.intro-text {
    display: grid;
    vertical-align: middle;
    transform: translateX(100vw);
    animation: slide-in-left 1s ease-out forwards;
    opacity: 0;
    max-width: 60ch;
    width: 100%;
}

.intro-photo-column {
    display: grid;
    place-items: center;
    animation: slide-in-right 1s ease-out forwards;
    opacity: 0;
}

.intro-photo {
    width: min(400px, 100%);
    height: auto;
    border-radius: 100%;
}

.icons-section-separator {
    width: fit-content;
    display: flex;
    flex-direction: row;
    text-align: center;
    justify-self: center;
    font-size: 1.5rem;
    animation: fade-in 1.5s ease-out forwards;
}


/* Tech stack section. */
.tech-stack-section {
    height: 40rem;
}

.tech-stack-node {
    position: absolute;
    width: 80px;
    height: 80px;
    background: var(--auxiliary-color-1);
    color: var(--font-color);
    border-color: var(--theme-color-1);
    border-style: solid;
    border-width: 3px;
    border-radius: 50%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    z-index: 1;
    transition:
        var(--theme-transition),
        transform 0.3s ease,
        border-width 0.3s ease;
}

.tech-stack-node:hover {
    border-color: var(--theme-color-1);
    border-style: solid;
    border-width: 0.5px;
    font-size: 0.3rem;
    transform: scale(2.8);
}

.tech-stack-node img {
    width: 60px;
    height: 60px;
    border-radius: 100%;
    object-fit: contain;
}

.diagonal-line {
    width: 50px;
    height: 3px;
    background: var(--theme-color-1);
    transform: rotate(45deg);
    transform-origin: left;
}

.graph {
    position: relative;
    width: 100%;
    height: 100%;
    animation: text-appear ease both;
    animation-timeline: view();
    animation-range: entry 40% cover 100vh;
}

.tech-stack-graph-links {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}


/* Career section. */
.career-timeline {
    margin: 4rem auto;
    position: relative;
    max-width: 46rem;
}

.career-timeline::before {
    content: "";
    position: absolute;
    top: 0;
    left: 2rem;
    width: 3px;
    height: 100%;
    background:
        linear-gradient(var(--theme-color-mix-orientation),
            var(--theme-color-1),
            var(--theme-color-2));
}

.career-timeline-event {
    list-style-type: none;
    position: relative;
    opacity: 0;
    transform: translateY(30%);
    transition:
        opacity 0.6s ease,
        transform 0.6s ease;
}

.career-timeline-event.visible {
    opacity: 1;
    transform: translateY(0);
}

.career-timeline-event-copy {
    position: relative;
    left: 4rem;
    top: -1.875rem;
    width: 80%;
    padding: 2rem;
}

.career-timeline-event-copy h3 {
    margin: 0;
    font-size: 1.4rem;
}

.career-timeline-event-copy h4 {
    margin-top: 0.25rem;
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
    color: #cccccc;
}

.career-timeline-event-copy strong {
    font-weight: 700;
}

.career-timeline-event-copy p:not(.career-timeline-event-time-period) {
    margin-top: 0;
    padding-bottom: 1.2rem;
}

.career-timeline-event-icon {
    position: absolute;
    top: 0;
    left: 2rem;
    width: 1rem;
    height: 1rem;
    margin: 0.5rem 0.5rem 0.5rem -0.5rem;
    background-color: var(--background-color);
    outline: 10px solid var(--font-color);
    transform: rotate(45deg);
    transition:
        var(--theme-transition),
        outline 1s ease;
}

.career-timeline-event:hover .career-timeline-event-icon {
    background-color: var(--theme-color-1);
    transition: 0.25s ease;
    transform: rotate(-45deg);
}

.career-timeline-event-time-period {
    display: inline-block;
    margin-bottom: 1.2rem;
    margin-left: -1.2rem;
    padding: 0.25rem 1rem;
    font-weight: bold;
    color: var(--font-color);
    background-color: var(--background-color);
    transition: var(--theme-transition);
}

.career-timeline-event-company img {
    height: 1rem;
    width: 1rem;
    border-radius: 20%;
}

.career-timeline-event:hover .career-timeline-event-time-period {
    box-shadow: inset 40rem 0 0 0 var(--theme-color-1);
    transition: 0.25s ease;
}


/* Projects section. */
.personal-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    row-gap: 0.5rem;
    column-gap: 1.5rem;
}

.project-container {
    background: var(--auxiliary-color-1);
    transition: var(--theme-transition);
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
    border-radius: 15px;
}

.container-hover-wrap {
    transition: transform 0.2s;
}

.container-hover-wrap:hover {
    transform: scale(1.03);
}

.container-border-wrap {
    padding: 1px;
    opacity: 0;
    border-radius: 15px;
    transform: translateY(100px);
    background:
        linear-gradient(var(--theme-color-mix-orientation),
            var(--theme-color-1),
            var(--theme-color-2));

    transition: padding 0.2s ease;
    animation: text-appear ease both;
    animation-timeline: view();
    animation-range: entry 20% cover 100vh;
}

.container-border-wrap:hover {
    padding: 3px;
}

.modal-wrap {
    text-align: center;
    display: block;
    position: fixed;
    z-index: 1;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    height: 100%;
    overflow: auto;
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(0px);
    transition:
        opacity 0.5s ease,
        backdrop-filter 0.5s ease,
        visibility 0s linear 0.5s;
}

.modal-wrap.show {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(5px);
    transition:
        opacity 0.5s ease,
        backdrop-filter 0.5s ease;
}

.modal-border-wrap {
    width: 50%;
    display: inline-block;
    padding: 3px;
    margin: auto;
    opacity: 1;
    border-radius: 15px;
    transform: translateY(100px);
    background:
        linear-gradient(var(--theme-color-mix-orientation),
            var(--theme-color-1),
            var(--theme-color-2));
}

.modal {
    box-sizing: border-box;
    width: 100%;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: min-content;
    grid-column-gap: 0.3rem;
    grid-row-gap: 0.3rem;
    background-color: var(--auxiliary-color-1);
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    border-radius: 15px;
}

.modal-section {
    padding: 0.5rem;
}

.modal-logo {
    width: 100%;
    height: 100%;
    border-radius: 15px;
}

.modal-title {
    text-align: left;
}

.close-modal-button {
    color: var(--font-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
    transition: all 0.2s;
}

.close-modal-button:hover,
.close-modal-button:focus {
    text-decoration: none;
    cursor: pointer;
    color: var(--theme-color-1);
    transform: scale(1.1);
}

.modal-dates {
    text-align: left;
}

.modal-badges-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: start;
    align-items: center;
    gap: 0.6rem;
}

.modal-tech-stack-badge {
    border-color: var(--auxiliary-color-2);
    padding: 0.4rem;
    font-size: 0.7rem;
    font-weight: bold;
    border-style: solid;
    border-width: 1px;
    border-radius: 50px;
    background: linear-gradient(var(--theme-color-mix-orientation),
            var(--auxiliary-color-1),
            var(--auxiliary-color-2));
}

.modal-description-container {
    text-align: left;
}

.links-container {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    font-size: 1.5rem;
}


/* Talks & papers section. */
.talks-and-papers-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.talks-and-papers-container {
    background: var(--auxiliary-color-1);
    transition: var(--theme-transition);
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
    border-radius: 15px;

    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: min-content;
}


/* Contact section. */
.contact-section-links-container {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 1.8rem;
}

.contact-section-link-names {
    font-size: 1rem;
    padding-left: 0.3rem;
    animation: reveal-contact-link-name 250ms ease-out forwards;
}

.contact-section-link-names.hiding {
    animation: hide-contact-link-name 250ms ease-in forwards;
}


/* Icons and links. */
a.generic-link {
    color: inherit;
    display: inline-block;
    text-decoration: none;
    transition: all 0.2s;
}

a.generic-link:hover {
    color: var(--theme-color-1);
    transform: scale(1.1);
}

a.dotted-link {
    text-decoration-line: underline;
    text-decoration-style: dotted;
}

.arrow-link {
    position: relative;
    display: inline-block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease;
}

.arrow-link:hover::after {
    content: "→";
    position: absolute;
    left: 100%;
    margin-left: 0.2em;
    opacity: 0;
    animation: arrow-in 0.25s ease forwards;
}


/* Theme toggle switch. */
.theme-toggle-switch {
    font-size: 17px;
    position: relative;
    display: inline-block;
    width: 3.5em;
    height: 2em;
}

.theme-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #c8def5;
    transition: 0.5s;
    border-radius: 30px;
}

.slider:before {
    content: "";
    position: absolute;
    height: 1.4em;
    width: 1.4em;
    left: 10%;
    bottom: 15%;
    border-radius: 50%;
    transition: 0.5s;
    background: #fff000;
    box-shadow:
        0 0 8px #fff000,
        0 0 16px #fff000;
}

input:checked+.slider {
    background-color: #7862a8;
}

input:checked+.slider:before {
    transform: translateX(100%);
    background: #7862a8;
    box-shadow: inset 8px -4px 0px 0px #c9c9c8;
}


/* Animations. */
@keyframes slide-in-left {
    from {
        transform: translateX(-20vw);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-in-right {
    from {
        transform: translateX(20vw);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes text-appear {
    from {
        opacity: 0;
        transform: translateY(100px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes reveal-contact-link-name {
    from {
        opacity: 0;
        transform: translateX(-1vw);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes hide-contact-link-name {
    from {
        opacity: 1;
        transform: translateX(0px);
    }

    to {
        opacity: 0;
        transform: translateX(-1vw);
    }
}

@keyframes arrow-in {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}