@charset "utf-8";

:root {
    /***** Sizes *****/

    --main-width: 70vw;
    --max-main-width: 1200px;

    --header-footer-width: calc(var(--main-width) + 128px);
    --max-header-footer-width: calc(var(--max-main-width) + 128px);

    /***** Colors *****/

    --font-color: hsl(0 0% 100%);
    --background-color: hsl(0 0% 10%);
    --menu-color: hsl(0 0% 5%);

    --active-color: var(--light-blue);
    --link-color: var(--light-blue);
    --hr-color: hsl(0 0% 100% / 50%);

    --red: #ed1515;
    --green: #11d116;
    --blue: #1d99f3;
    --light-grey: #bdc3c7;
    --dark-blue: #002551;
    --light-blue: #1d99f3;
    --very-light-grey: #eee;
}

html {
    font-family: 'Inter', 'Neue Helvetica', 'Helvetica Neue', 'Helvetica', 'Nimbus Sans', 'Arial', sans-serif;
    font-style: normal;
    font-variant: normal;
    font-stretch: normal;
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: 16px;

    height: 100%;
    width: 100%;

    box-sizing: border-box;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

body {
    color: var(--font-color);
    background: var(--background-color);
    height: 100%;
    margin: 0;
    padding: 0;

    min-height: 100vh;
    
    display: flex;
    flex-direction: column;
}

/***** Layout *****/

body > header {
    color: var(--font-color);
    background: var(--background-color);

    width: var(--header-footer-width);
    max-width: var(--max-header-footer-width);

    margin: 0 auto;
    padding: 3em 0;

    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

body > header > a {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1em;
    user-select: none;
}

body > header > a > img {
    display: inline-block;
    height: 4em;
    aspect-ratio: 1 / 1;
    border-radius: 50%;

    border: 0.2em solid transparent;
    outline: 0.2em solid var(--active-color);
}

body > header > a > span {
    color: var(--font-color);

    font-size: 2em;

    margin-left: 1ch;
}

body > main {
    width: var(--main-width);
    max-width: var(--max-main-width);

    margin: 0 auto;
    padding: 0;

    position: relative;

    flex: 1;
}

body > footer {
    width: var(--header-footer-width);
    max-width: var(--max-header-footer-width);

    margin: 0 auto;
    padding: 3em 0;

    text-align: left;
}

body > footer p {
    font-size: 1.25em;

    margin: 0;
}

body > main > article {
    h1 {
        margin-bottom: 2em;
    }
}

/***** Menu *****/

nav {
    user-select: none;
}

nav input {
    display: none;
}

nav label {
    display: none;
}

nav ul {
    list-style-type: none;

    margin: 0;
    padding: 0;

    display: flex;
    flex-direction: row;
}

nav input ~ ul li {
    color: white;
    font-weight: 600;
    padding: 1em;
}

nav input ~ ul li.active {
    color: var(--active-color);
}

nav input ~ ul li a {
    color: inherit;
}

@media screen and (max-width: 767px) {
    nav {
        display: block;
        z-index: 1;

        width: 2em;
        aspect-ratio: 1 / 1;

        display: grid;
        place-items: center;
        grid-template-areas: 'inner-div';
    }

    nav input {
        display: none;
    }

    nav label {
        cursor: pointer;
        width: 100%;
        aspect-ratio: 1 / 1;
        display:flex;
        align-items:center;

        z-index: 100;
    }

    nav label span {
        background-color: white;
        width: inherit;
        height: 0.3em;
        border-radius: 0.15em;
        position: relative;
        transition: background 10ms 300ms;
    }

    nav label span::before,
    nav label span::after {
        transition: top 300ms 350ms, transform 300ms 50ms;
        position: absolute;
        background-color: white;
        width: inherit;
        height: inherit;
        border-radius: inherit;
        content: "";
    }

    nav label span::before {
      top: -250%;

    }

    nav label span::after {
      top: +250%;

    }

    nav input:checked ~ label span {
        background: unset;
    }

    nav input:checked ~ label span::after,
    nav input:checked ~ label span::before {
        transition: top 300ms 50ms, transform 300ms 350ms;
        top: 0;
    }

    nav input:checked ~ label span::before {
      transform: rotate(45deg);
    }

    nav input:checked ~ label span::after {
      transform: rotate(-45deg);
    }

    nav {
        position: relative;
    }

    nav ul {
        display: block;

        position: absolute;
        top: -1em;
        right: -1em;
        padding: 3em 3em 1em 2em;

        background: var(--menu-color);
        border-top: 0.2em solid var(--active-color);
    }

    nav input ~ ul {
        transform-origin: top;
        transform: rotateX(90deg);
        transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0);
    }

    nav input ~ ul li {
        color: white;
        font-weight: 600;
        padding: 1em;

        transform-origin: top;
        transform: perspective(350px) rotateX(90deg);
        transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0);
    }

    nav input:checked ~ ul {
        transform: none;
    }

    nav input:checked ~ ul li {
        transform: none;
    }
}

/***** Misc *****/

h1 {
    font-size: 2em;
    font-weight: 700;
}

h2 {
    font-size: 1.5em;
    font-weight: 700;
}

h3 {
    font-size: 1.2em;
    font-weight: 700;
}

h4 {
    font-size: 1.1em;
    font-weight: 600;
}

h5 {
    font-size: 1.1em;
    font-weight: 500;
}

h6 {
    font-size: 1em;
    font-weight: 500;
}

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

hr {
    color: var(--hr-color);

    height: 1px;
    width: 100%;

    margin: 1.5em 0;
}

strong {
    font-size: 1em;
    font-weight: 600;
}

/***** Logos *****/

.signature {
    font-family: Inter;
    font-style: normal;
    font-variant: normal;
    font-stretch: normal;
    font-optical-sizing: auto;
    font-weight: 400;

    color: var(--font-color);
    white-space: nowrap;

    margin: 0;
    padding: 0;
}

.typewriter {
    font-family: JetBrainsMono, monospace;
    font-style: normal;
    font-variant: normal;
    font-stretch: normal;
    font-optical-sizing: auto;

    white-space: nowrap;

    display: flex;
    flex-wrap: nowrap;
}

.typewriter .text {
    overflow: hidden;
    text-decoration: underline;
}

.typewriter.animate .text {
    animation: typewriter-typing calc(var(--n)*.5s) steps(var(--n));
}

.typewriter .cursor {
    color: var(--active-color);

    opacity: 0;
}

.typewriter.animate .cursor {
    animation: typewriter-cursor .75s step-end var(--n);
}

@keyframes typewriter-typing {
    from { width: 0 }
    to { width: calc(var(--n)*1ch) }
}

@keyframes typewriter-cursor {
    from, to { opacity: 0% }
    50% { opacity: 100%; }
}

/***** Home page *****/

.alternate-img, .alternate-noimg {
    display: grid;
    flex-direction: row;
    gap: 0 2em;

    align-items: center;

    > img, > .img, > .imgs {
        grid-area: img;
        align-self: center;

        width: 100%;
        aspect-ratio: 1 / 1;

        position: relative;

        margin: 0;
        padding: 0;
    }

    > .img {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    > .img img {
        width: 100%;

        display: inline-block;
        overflow: unset;
    }

    > .imgs img {
        width: 100%;
        aspect-ratio: 1 / 1;

        position: absolute;
        top: 0;

        animation-name: imgs-fade;
        animation-iteration-count: infinite;
        animation-duration: 12s;
        animation-delay: -1s;
    }

    > .imgs img:nth-child(2) {
        animation-delay: -9s;
    }

    > .imgs img:nth-child(3) {
        animation-delay: -5s;
    }

    h2 {
        grid-area: title;
        align-self: end;

        margin-top: 0.25em;
        margin-bottom: 0.25em;
    }

    h3 {
        grid-area: title;
        align-self: end;

        margin-top: 0.25em;
        margin-bottom: 0.25em;
    }

    div {
        grid-area: text;
        align-self: center;

        text-align: justify;

        margin-top: 0.25em;
        margin-bottom: 0.25em;
    }
}

@keyframes imgs-fade {
    0% {opacity: 1;}
    30% {opacity: 1;}
    40% {opacity: 0;}
    90% {opacity: 0;}
    100% {opacity: 1;}
}

.alternate-noimg {
    grid-template:
    "empty_l title empty_r" max-content
    "empty_l text empty_r" max-content / 8em auto 8em;
}

:nth-child(odd of .alternate-img) {
    grid-template:
        "empty_l title empty_r" max-content
        "img text empty_r" max-content / 8em auto 8em;
}

:nth-child(even of .alternate-img) {
    grid-template:
        "empty_l title empty_r" max-content
        "empty_l text img" max-content / 8em auto 8em;
}

@media screen and (max-width: 767px) {
    .alternate-noimg {
        grid-template:
        "empty_l title" max-content
        "empty_l text" max-content / 5em auto;
    }

    :nth-child(odd of .alternate-img), :nth-child(even of .alternate-img) {
        grid-template:
        "empty_l title" max-content
        "img text" max-content / 5em auto;
    }
}

.img-round {
    border-radius: 50%;
}

.img-round.outline {
    border: 0.2em solid transparent;
    outline: 0.2em solid;
    outline-color: var(--outline);
}

/***** Publications *****/

#refs {
    display: flex;
    flex-direction: column-reverse;
}

/***** Mobile *****/

@media screen and (max-width: 767px) {
    html {
        font-size: 12px;
    }

    body > header {
        width: 90vw;
    }

    body > main {
        width: 90vw;
    }

    body > footer {
        width: 90vw;
    }
}

/***** VCard *****/

.vcard-wrapper {
    width: 100%;
    height: 100%;

    display: flex;
    justify-content: center;
    align-items: center;
}

.vcard {
    width: 50vw;

    @media screen and (max-width: 767px) {
        width: 80vw;
    }

    aspect-ratio: 85 / 55;
    --border-radius: 5% / calc(5% * 85 / 55);

    background-color: transparent;
    perspective: 1000px;
}

.vcard-content {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;

    border-radius: var(--border-radius); /* Keep for proper shadow */
    box-shadow: 50px 50px 30px rgba(0, 0, 0, 0.3);
}

.vcard:hover .vcard-content {
    transform: rotateY(180deg);
}

.vcard-front, .vcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;

    border-radius: var(--border-radius);
    overflow: hidden;

    background-size: cover;
}

.vcard-back {
    transform: rotateY(180deg);
}

.vcard-shine-effect-metal {
    --shine-deg: 0deg;
    position: relative;

    width: 100%;
    height: 100%;

    background: linear-gradient(to bottom, hsl(0 0% 80%), hsl(0 0% 40%), hsl(0 0% 80%));

    mask-size: cover;
}

.vcard-shine-effect-metal:after {
    content: "";
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(
        30deg,
        transparent 0%,
        transparent 40%,
        rgb(255, 255, 255, 0.5) 49%,
        rgb(255, 255, 255, 0.5) 51%,
        transparent 60%,
        transparent 100%
    );
    background-size: 100% 300%;
    background-position: 0% -20%;
    background-repeat: no-repeat;
    animation: shine 2s infinite ease-in;
}

@keyframes shine {
    0% {background-position: 0% -20%}
    50% {background-position: 0% 120%}
    100% {background-position: 0% 120%}
}
