:root {
    color: #000;
    font-family: "IBM Plex Sans", sans-serif;
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
}

html, body {
    overflow-x: hidden;
}

a {
    color: #3333CC;
    text-decoration: underline;
}

@media (min-width: 850px) {
    a:hover {
        cursor: pointer;
        filter: brightness(0.5);
    }
}

/* ==================== */
/* Navbar               */
/* ==================== */

nav {
    display: grid;
    grid-auto-flow: column;
    gap: 5px;
    position: fixed;
    z-index: 1;
    top: 30px;
    left: 50%;
    padding: 4px;
    transform: translateX(-50%);
    border-radius: 1000px;
    box-shadow: 0 0 10px #9191c988;
    background: #FFFFFF44;
    backdrop-filter: blur(5px) brightness(1.05);
}

nav a {
    padding: 5px 12px;
    border-radius: 1000px;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    transition: box-shadow 0.2s ease-in-out, background 0.2s ease-in-out;
    color: #000000;
}

nav a:hover {
    filter: none;
    background: #FFFFFF44;
    box-shadow: 0 0 10px #9191c988;
}

@media (max-width: 850px) {
    nav a {
        font-size: 16px;
        padding: 5px 5px;
    }
}

/* ==================== */
/* Hero section         */
/* ==================== */

#hero {
    display: grid;
    position: relative;
    justify-content: center;
    width: 100%;
}

/* Spiral */

#spiral {
    min-width: 800px;
    width: 100vw;
}

#spiral-desc {
    position: absolute;
    color: #9191C9;
    font-size: 14px;
    bottom: 0;
    padding: 25px;
    padding-top: 100px;
    background: linear-gradient(#FFFFFF00, #FFFFFFFF);
    width: calc(100vw - 50px);
    text-align: right;
    pointer-events: none;
}

#spiral-desc a {
    pointer-events: all;
    cursor: pointer;
    transition: filter 0.1s linear;
}

#tooltip {
    display: block;
    font-size: 16px;
    position: absolute;
    color: #3333CC;
    font-weight: bold;
    text-shadow: #FFFFFF 0 0 1px, #FFFFFF 0 0 10px, #FFFFFF 0 0 20px, #FFFFFF 0 0 30px;
    pointer-events: none;
    backdrop-filter: blur(4px);
    padding: 5px;
    border-radius: 100px;;
}

/* Intro */

#intro {
    position: absolute;
    bottom: 50%;
    right: 50%;
    width: 350px;
    font-size: 48px;
    text-shadow: #FFFFFF 0 0 1px, #FFFFFF 0 0 10px, #FFFFFF 0 0 20px, #FFFFFF 0 0 30px;
    pointer-events: none;
}

#intro #title {
    font-size: 32px;
    line-height: 42px;
    white-space: nowrap;
    overflow: hidden;
}

@media (max-width: 850px) {
    #intro {
        transform: translateX(50%);
        text-align: center;
    }

    #intro #title {
        font-size: 24px;
    }

    #spiral-desc {
        text-align: center;
    }

    #spiral circle {
        r: 2px;
        pointer-events: none;
    }

    #tooltip {
        display: none !important;
    }
}

/* ==================== */
/* Section styles       */
/* ==================== */

section {
    max-width: min(850px, calc(100% - 100px));
    margin: 180px auto;
    scroll-margin-top: 80px;
}

section .title {
    font-weight: bold;
    font-size: 36px;
}

@media (max-width: 850px) {
    section {
        max-width: min(500px, calc(100% - 100px));
    }

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

/* ==================== */
/* About                */
/* ==================== */

#about {
    display: grid;
    grid-template-areas:
        "title title"
        "desc years";
    grid-template-columns: max-content auto;
    row-gap: 10px;
    margin-top: 100px;
}

#about .title {
    font-size: 36px;
    grid-area: title;
}

#about p {
    grid-area: desc;
    font-size: 24px;
}

#about #years {
    display: grid;
    grid-area: years;
    grid-template-columns: 1fr 1fr;
    column-gap: 50px;
    align-items: center;
    margin-left: auto;
}

#about #years .year {
    text-align: center;
}

#about #years .year p:nth-child(1) {
    font-size: 64px;
    font-weight: bold;
}

#about #years .year p:nth-child(2) {
    font-size: 20px;
}

@media (max-width: 850px) {
    #about {
        grid-template-areas:
            "title"
            "desc"
            "years";
        grid-template-columns: auto;
        text-align: center;
    }

    #about p {
        font-size: 20px;
    }

    #about #years {
        margin-right: auto;
    }

    #about > p > br {
        display: none;
    }

    #about #years .year p:nth-child(2) {
        font-size: 18px;
    }
}

/* ==================== */
/* Big Projects         */
/* ==================== */

.big-project:first-of-type {
    margin-top: 30px;
}

.big-project {
    display: grid;
    grid-template-areas: 
        "img meta"
        "img name"
        "img desc"
        "img links";
    grid-template-columns: max-content auto;
    grid-template-rows: min-content min-content 1fr min-content;
    column-gap: 26px;
    margin: 60px 0;
}

.big-project .img-container {
    grid-area: img;
    max-width: 360px;
    min-height: 240px;
    box-shadow: 0 0 10px #9191c988;
    border-radius: 15px;
    overflow: hidden;
}

.big-project .img-container img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.big-project .meta {
    grid-area: meta;
    font-size: 16px;
}

.big-project .name {
    grid-area: name;
    font-size: 32px;
    font-weight: bold;
    padding-bottom: 10px;
}

.big-project .desc {
    grid-area: desc;
    font-size: 20px;
}

.big-project .meta a, .big-project .desc a {
    color: #000000;
    text-decoration: underline solid #AAAAAA;
}

.big-project .links {
    grid-area: links;
    gap: 18px;
    font-size: 20px;
    padding-top: 10px;
}

.big-project .links a:first-of-type {
    margin-right: 18px;
}

@media (max-width: 850px) {
    .big-project {
        grid-template-areas: 
            "name"
            "meta"
            "img"
            "desc"
            "links";
        grid-template-columns: auto;
        justify-items: center;
        text-align: center;
        margin: 80px 0;
        gap: 10px;
    }

    .big-project .name {
        font-size: 26px;
        padding: 0;
    }

    .big-project .img-container {
        margin-bottom: 10px;
        max-width: 100%;
    }
}

/* ==================== */
/* Mini-Projects        */
/* ==================== */

@media (min-width: 850.5px) {
    .mini-projects {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr);
        grid-template-areas:
            "l1 mini-projects r1"
            "l2 c r2";
        --gap: 14px;
        row-gap: var(--gap);
        column-gap: calc(var(--gap) / sqrt(3) * 2);
    }

    .mini-projects .title {
        grid-area: mini-projects;
        text-align: center;
    }

    .hover-shadow {
        width: 120%;
        filter: drop-shadow(0 0 2px #9191c988);
        transition: filter 0.1s linear;
        pointer-events: none;
    }

    .hover-shadow:has(.mini-project:hover) {
        filter: drop-shadow(0 0 10px #9191c988);
    }

    .mini-projects .left {
        justify-self: left;
    }

    .mini-projects .center {
        justify-self: center;
        transform: translateY(calc(-50% - var(--gap) / 2));
    }

    .mini-projects .right {
        justify-self: right;
    }

    .mini-project {
        position: relative;
        display: grid;
        grid-template-areas:
            "name name"
            "link1 link2";
        row-gap: 10px;
        column-gap: 20px;
        align-content: center;
        justify-content: center;
        aspect-ratio: calc(2 / sqrt(3));
        overflow: hidden;
        background: #DDDDDD;
        clip-path: url(#hexagon);
        -webkit-clip-path: url(#hexagon);
        pointer-events: all;
    }

    .mini-project.one-link {
        grid-template-areas:
            "name"
            "link1";
    }

    .mini-project img {
        position: absolute;
        top: 0;
        left: 0;
        z-index: -1;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: filter 0.1s linear;
    }

    .mini-project *:not(img) {
        opacity: 0;
        transition: opacity 0.2s ease-in-out;
    }

    .mini-project:hover *:not(img) {
        opacity: 1;
    }

    .mini-project:hover img {
        filter: blur(4px) contrast(0.3) brightness(1.5);
    }

    .mini-project p {
        text-align: center;
        justify-self: center;
        padding: 0 60px;
        font-size: 28px;
        font-weight: bold;
        grid-area: name;
        text-shadow: #FFFFFF 0 0 10px, #FFFFFF 0 0 20px, #FFFFFF 0 0 30px;
    }

    .mini-project a {
        font-size: 20px;
        text-shadow: #FFFFFF 0 0 10px, #FFFFFF 0 0 20px, #FFFFFF 0 0 30px;
        filter: none;
    }

    .mini-project a:hover {
        color: #1A1A66;
    }

    .mini-project a:nth-of-type(1) {
        justify-self: end;
    }

    .mini-project.one-link a:nth-of-type(1) {
        justify-self: center;
    }

    .mini-project a:nth-of-type(2) {
        justify-self: start;
    }
}

@media (max-width: 850px) {
    .mini-projects {
        display: grid;
        grid-template-columns: 100%;
        margin-top: 100px;
    }

    .mini-projects .title {
        grid-row: 1;
    }

    .mini-project {
        display: grid;
        grid-template-areas:
            "img img img img"
            "pad1 a1 a2 pad2";
        grid-template-columns: 1fr max-content max-content 1fr;
        row-gap: 10px;
        margin: 40px 0;
        position: relative;
        overflow: hidden;
        height: min-content;
    }

    .mini-projects .hover-shadow:nth-of-type(1) {
        margin-top: 0px;
    }

    .mini-projects .hover-shadow:last-child {
        margin-bottom: 0;
    }

    .mini-project img {
        grid-area: img;
        width: 100%;
        border-radius: 15px;
        aspect-ratio: 1.3;
        object-fit: cover;
    }

    .mini-project .name {
        position: absolute;
        width: max-content;
        bottom: 24px;
        left: 50%;
        transform: translateX(-50%);
        box-shadow: 0 0 10px #9191C988;
        border-radius: 1000px;
        background: #FFFFFF88;
        backdrop-filter: blur(5px) brightness(1.3);
        padding: 5px 10px;
        font-size: 20px;
        font-weight: bold;
    }

    .mini-project:has(a) .name {
        bottom: 50px;
    }

    .mini-project a {
        font-size: 20px;
        margin: 0 10px;
    }

    .mini-project a.no-mobile {
        display: none;
    }

    .mini-project a:nth-of-type(1) {
        grid-area: a1;
    }

    .mini-project a:nth-of-type(2) {
        grid-area: a2;
    }
}

/* ==================== */
/* Publications         */
/* ==================== */

.publication:nth-of-type(1) {
    margin-top: 20px;
}

.publication {
    margin: 60px 0;
}

.publication p {
    margin: 6px 0;
}

.publication .meta {
    font-size: 16px;
    margin: 0;
}

.publication .name {
    font-size: 32px;
    font-weight: bold;
    margin-top: 0;
}

.publication .authors {
    font-size: 20px;
}

.publication .keywords::before {
    content: "Keywords: ";
    font-weight: bold;
}

.publication .keywords {
    font-size: 20px;
}

.publication .links {
    display: grid;
    gap: 16px;
    grid-auto-flow: column;
    justify-content: start;
    font-size: 20px;
}

@media (max-width: 850px) {
    .publication .name {
        font-size: 26px;
    }
}

/* ==================== */
/* Footer               */
/* ==================== */

#footer {
    box-shadow: 0 0 10px #9191c988;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

#form {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: 8fr 13fr min-content;
    gap: 20px;
    margin-bottom: 20px;
}

#form > * {
    box-shadow: 0 0 10px #9191C988;
    border: none;
    border-radius: 10px;
    transition: box-shadow 0.1s linear;
}

#form.angry > * {
    box-shadow: 0 0 10px #FF000088;
}

#form input {
    padding: 8px 14px;
    font-size: 20px;
    outline: none;
    background: #FFFFFF;
}

#form input:focus {
    box-shadow: 0 0 10px #9191C9FF;
}

#form input::placeholder {
    color: #858585;
}

#form button {
    aspect-ratio: 1;
    display: grid;
    align-items: center;
    justify-items: center;
    background: #3333CC;
    transition: filter 0.1s linear, background 0.2s linear;
    cursor: pointer;
}

#form.angry button {
    background: #FF0000;
}

#form button:hover {
    filter: brightness(1.4);
}

#form button:disabled {
    background: #444444;
    filter: none;
}

#form button img {
    width: 50%;
}

#extras {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: auto min-content min-content;
    font-size: 18px;
    gap: 30px;
}

#extras a {
    filter: brightness(0);
}

#extras a:hover {
    filter: brightness(1);
}

@media (max-width: 850px) {
    #form {
        grid-auto-flow: row;
        grid-template-columns: auto;
    }

    #form button {
        aspect-ratio: unset;
    }

    #form button::before {
        content: "Send";
        padding: 8px 14px;
        font-size: 20px;
        color: #FFFFFF;
        font-weight: bold;
    }

    #form button img {
        display: none;
    }

    #extras {
        grid-template-areas:
            "link1 link2"
            "p p";
        grid-template-columns: 1fr 1fr;
        text-align: center;
    }

    #extras p {
        grid-area: p;
    }
}
