@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colours */
    --clr-black: #000000;
    --clr-dark: #212121;
    --clr-dark2: #333333;
    --clr-grey-mid: #686868;
    --clr-grey-mid2: #D9D9D9;
    --clr-light-2: #e6e6e6;
    --clr-light: #F6F6F6;
    --clr-white: #FFFFFF;
    /* Fonts */
    --font-title: "Bebas Neue", sans-serif;
    --font-text: "Roboto", system-ui, sans-serif;
    /* Shadows */
    --shadow: drop-shadow(0 0 10px var(--clr-grey-mid2));
}

.portfolio {
    background-color: var(--clr-light);
    transition: 200ms ease-in-out;
}

#main-header {
    margin: 0 auto;
    position: sticky;
    top: 0;
    z-index: 9999;
}

.portfolio p {
    font-family: var(--font-text);
}

.play-background {
    background-color: var(--clr-dark);
}

/* Main navigation -------------------------------------------- */

#main-nav {
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    padding: 15px;
    position: relative;
}

.back-portfolio {
    font-family: var(--font-text);
    background-color: var(--clr-light);
    filter: var(--shadow);
    border-radius: 9999px;
    padding: 20px;
}

/* Hey picture */

#main-nav__picture {
    background-color: var(--clr-grey-mid2);
    height: 66px; width: 66px;
    border-radius: 50%;
    overflow: hidden;
    filter: var(--shadow);
    cursor: pointer;
}

#main-nav__picture > img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

#hey {
    position: absolute;
    bottom: 25px; left: 15px;
    z-index: -1;
    height: 33px;
    width: 66px;
    background-color: rgba(64, 156, 255, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 9999px;
    font-family: var(--font-text);
    opacity: 0;
}

.hey {
    animation: hey 1.5s ease-in-out 1 forwards;
}

@keyframes hey {
    0% {
        translate: 0 0;
        scale: .5;
        opacity: 0;
    }
    10% {
        translate: 0 150%;
        opacity: 1;
    }
    30%, 80% {
        translate: 0 150%;
        scale: 1;
        opacity: 1;
    }
    100% {
        translate: 0 150%;
        opacity: 0;
    }
}

/*  Work/Play toggle */

#main-nav__toggle {
    background-color: var(--clr-light);
    filter: var(--shadow);
    border-radius: 9999px;
    padding: 5px;
}

#main-nav__toggle > li {
    display: inline-block;
    color: var(--clr-grey-mid);
    font-family: var(--font-text);
    font-size: 1.5rem;
    background-color: transparent;
    border-radius: 9999px;
    padding: 10px 20px;
    transition: 200ms ease-in-out;
    cursor: pointer;
}

#main-nav__toggle > .toggle--selected {
    font-weight: bold;
    color: var(--clr-light);
    background-color: var(--clr-dark);
    pointer-events: none;
}

/* Burger toggler */

#main-nav__burger {
    filter: var(--shadow);
    overflow: hidden;
}

.burger-toggler {
    height: 66px; width: 66px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 3px;
    cursor: pointer;
    transition: rotate 0.2s ease-in-out;
    background-color: var(--clr-white);
    border-radius: 9999px;
}

.burger-toggler:has(input:checked) {
    rotate: 90deg;
}

.burger-toggler::before,
.burger-toggler::after,
.burger-toggler input {
    content: "";
    width: 50%;
    height: 5px;
    border-radius: 9999px;
    background-color: var(--clr-grey-mid);
    transform-origin: left center;
    transition: all 200ms ease-in-out;
    transition-delay: 300ms;
}

.burger-toggler input {
    appearance: none;
    padding: 0;
    margin: 0;
    outline: none;
    pointer-events: none;
}

.burger-toggler input:checked {
    opacity: 0;
    width: 0;
}

.burger-toggler:has(input:checked)::before {
    rotate: 45deg;
    translate: 5px -5px;
}

.burger-toggler:has(input:checked)::after {
    rotate: -45deg;
    translate: 5px 2px;
}

/* Burger overlay */

#burger-overlay {
    position: absolute;
    bottom: -125px; right: 15px;
    z-index: 9999;
    height: fit-content;
    width: 200px;
    padding: 15px;
    background-color: var(--clr-white);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 25px;
    font-family: var(--font-text);
    transition: 200ms ease-in-out;
    scale: 0;
    translate: 100px -100px;
    filter: var(--shadow);
}

#burger-overlay li {
    display: block;
    list-style: none;
    line-height: 2rem;
    text-align: center;
}

#burger-overlay li a {
    text-decoration: none;
    color: var(--clr-grey-mid);
    transition: 400ms ease-in-out;
}

#burger-overlay li a:hover {
    color: var(--clr-black);
}

#burger-overlay li a[current] {
    font-weight: bold;
    pointer-events: none;
}

#main-nav__burger:has(input:checked) ~ #burger-overlay {
    scale: 1;
    translate: 0;
}

/* Hero header ------------------------------------------------- */

#hero-header {
    position: relative;
    height: calc(100svh - 100px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: clip;
}

#hero-header div:only-child {
    max-width: 50%;
}

#hero-header h1 {
    font-family: var(--font-title);
    font-size: 4rem;
    letter-spacing: .1rem;
    text-transform: uppercase;
}

.work-gradient {
    background: linear-gradient(90deg, #3F9FFF, #7104FB);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.play-gradient {
    background: linear-gradient(90deg, #FFB200, #E91F61, #E91FB0);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#hero-header__location {
    color: var(--clr-grey-mid);
    font-size: 1.5rem;
    position: relative;
    margin-top: 1rem;
}

#hero-header__location::before {
    content: '';
    position: absolute;
    left: -50px; top: 50%;
    transform: translateY(-50%);
    width: 50px; height: 50px;
    background: url('img/Location\ icon.png');
}

#hero-header__intro {
    margin-top: 1rem;
    padding: 15px;
}

#hero-header__more {
    position: absolute;
    bottom: 25px;
    color: var(--clr-dark);
}
#hero-header__more p {
    font-family: var(--font-title);
    font-size: 1.2rem;
}

#hero-header__more > p:nth-child(2) {
    opacity: .8;
}

#hero-header__more > p:nth-child(3) {
    opacity: .5;
}

.slice-left {
    animation: slice-left linear forwards;
    animation-timeline: view();
    animation-range-start: contain 55%;
    animation-range-end: contain 100%;
}

.slice-right {
    animation: slice-right linear forwards;
    animation-timeline: view();
    animation-range-start: contain 50%;
    animation-range-end: contain 100%;
}

@keyframes slice-left {
    0% {
        translate: 0 0;
        opacity: 1;
    }
    100% {
        translate: -40vh 0;
        opacity: 0;
    }
}

@keyframes slice-right {
    0% {
        translate: 0 0;
        opacity: 1;
    }
    100% {
        translate: 40vh 0;
        opacity: 0;
    }
}

@supports (-moz-appearance:none) {
    .slice-left {
        animation: none;
    }
    .slice-right {
        animation: none;
    }
}

/* Grid --------------------------------------------------------- */

main {
    max-width: 1000px;
    margin: 0 auto 200px auto;
}

.grid-container {
    margin: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1rem;
    justify-content: center;
}

.grid-container h2 {
    font-family: var(--font-title);
    letter-spacing: .1rem;
    font-size: 2rem;
    text-transform: uppercase;
}

.card {
    background-color: #212121;
    border-radius: 50px;
    overflow: hidden;
    transition: 200ms ease-in-out;
    min-height: 310px;
}

.card:hover {
    filter: var(--shadow);
}

.card--single {
    grid-column: span 1 / auto;
}

.card--horizontal {
    grid-column: span 2 / auto;
    max-height: 310px;
    position: relative;
}

.card--vertical {
    grid-row: span 2 / auto;
    min-height: 500px;
    position: relative;
}

@media screen and (max-width: 700px) {
    .card--horizontal {
        grid-column: span 1;
        grid-row: span 2;
        max-height: 620px;
    }
    .card--vertical {
        max-height: 500px;
    }
}

/* Card color variants */

.card--sky {
    background-color: #a7cdf7;
}

.card--blue {
    background-color: #7ebcff;
}

.card--darkblue {
    background-color: #288efa;
}

.card--purple {
    background-color: #b27ffa;
}

.card--violet {
    background-color: #fc7cd8;
}

.card--red {
    background-color: #bb2b2b;
}

.card--pink {
    background-color: #B73B60;
}

.card--orange {
    background-color: #ffd268;
}

.card--lightgrey {
    background-color: var(--clr-grey-mid2);
}

.card--darkgrey {
    background-color: var(--clr-grey-mid);
}

/* Card specific styles */

.grid-container > div:first-child {
    opacity: 0;
}

.card--photo img {
    height: 100%; width: 100%;
    object-fit: cover;
    transition: 200ms ease-in-out;
}

.card--photo:hover img {
    scale: 1.1;
}

.card--text {
    padding: 50px;
}

.card--text p {
    margin: 1rem 0;
}

.card--logo {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card--logo:hover .external-button {
    translate: 0;
}

.card--logo img {
    height: 75px;
    aspect-ratio: 1;
    transition: 200ms ease-in-out;
}

.inverted-logo {
    filter: invert(100%);
}

.card--vertical img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: 400ms ease-in-out;
    opacity: 1;
}

.card--vertical:hover img {
    opacity: .2;
}

.card--vertical .hover-desc {
    position: absolute;
    bottom: 0px; left: 0px;
    margin: 50px;
    translate: 0 150%;
    transition: 200ms ease-in-out;
}

.card--vertical p {
    margin: 1rem 0;
}

.card--vertical:hover .hover-desc {
    translate: 0;
}

.card--vertical .card-button {
    margin-top: 1rem;
}

.card--horizontal p {
    margin: 1rem 0;
}

.card--horizontal .card-button {
    margin-top: .5rem;
}

.card--horizontal-cover img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    object-position: left;
    transition: 200ms ease-in-out;
    opacity: 1;
}

.card--horizontal-cover:hover img {
    opacity: .1;
}

.card--horizontal-cover .hover-desc {
    position: absolute;
    top: 0; left: 0px;
    margin: 50px;
    translate: 150% 0;
    transition: 300ms ease-in-out;
}

.card--horizontal-cover:hover .hover-desc {
    translate: 0;
}

.card--function {
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.function-head h2 {
    margin-top: 15px;
    font-size: 1.5rem;
}

.card--function figure {
    position: relative;
    width: 60px; height: 60px;
    clip-path: circle(50%);
}

.icon-js {
    background-color: #f0db4f;
}

.icon-vue {
    background-color: #42b883;
}

.card--function img {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    aspect-ratio: 1;
}

.card--function p {
    margin: 2rem 0;
}

.card--function:hover .external-button {
    translate: 0;
}

.card--spotify {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card--leisures {
    padding: 15px;
}

.card--leisures > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
}

.card--leisures h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-align: center;
}

.icon-leisure {
    position: relative;
    width: 60px; height: 60px;
    clip-path: circle(50%);
    background-color: var(--clr-light-2);
    margin-top: 5px;
}

.icon-leisure img {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    aspect-ratio: 1;
    transition: 200ms ease-in-out;
}

.card--leisures p {
    margin-top: 5px;
}

.card--leisures p:first-of-type {
    font-weight: bold;
}

.card--leisures p:last-of-type {
   font-style: italic; 
}

/* Grid animations */

@keyframes reveal {
    0% {
        scale: 0.5;
        opacity: 0;
    }
    100% {
        scale: 1;
        opacity: 1;
    }
}

@keyframes disappear {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        animation: reveal ease-in-out forwards;
        animation-timeline: view();
        animation-range-end: contain 10%;
    }
    .disappear {
        animation: disappear ease-in-out forwards;
        animation-timeline: view();
        animation-range-start: contain 0%;
        animation-range-end: contain 40%;
    }
}

@supports (-moz-appearance:none) {
    .disappear {
        animation: none;
    }
}


/* Buttons --------------------------------------- */

/* Main button */

.card-button {
    background-color: var(--clr-white);
    padding: 15px 25px;
    border-radius: 9999px;
    font-family: var(--font-text);
    font-weight: 500;
    text-decoration: none;
    color: var(--clr-dark);
    transition: all 400ms ease-in-out;
    position: relative;
    overflow: hidden;
    z-index: 1;
    float: right;
    align-self: end;
}

.card-button:hover {
    color: var(--clr-light);
}

.card-button::before {
    content: "";
    background-color: var(--clr-dark);
    position: absolute;
    inset: 0;
    transition: transform 400ms ease-in-out;
    transform: scaleX(0);
    transform-origin: left;
    z-index: -1;
}

.card-button:hover::before {
    transform: scaleX(1);
}

/* External button */

.external-button {
    position: absolute;
    bottom: 15px; right: 15px;
    height: 60px;
    aspect-ratio: 1;
    background-color: var(--clr-light);
    border-radius: 9999px;
    translate: 100px 100px;
    transition: 200ms ease-in-out;
}

.external-button:hover {
    background-color: var(--clr-grey-mid);
}

.external-button img {
    width: 40%;
    height: 40%;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

.external-button:hover img {
    filter: invert(100%);
}

/* Download button */

.download-button {
    display: inline-block;
    text-align: center;
    margin: 25px;
    background-color: #dec706;
    padding: 15px 45px 15px 25px;
    color: var(--clr-dark);
    font-family: var(--font-text);
    border-radius: 5px;
    border: 2px solid #dec706;
    transition: 200ms ease-in-out;
    position: relative;
}

.download-button::after {
    content: "";
    background-image: url('cv/images/download_file_icon.svg');
    background-repeat: no-repeat;
    position: absolute;
    height: 25px;
    width: 25px;
    margin-left: 10px;
}

.download-button:hover {
    background-color: transparent;
}

/* Footer ------------------------------------------- */

.main-footer {
    margin: 50px 0;
    display: flex;
    justify-content: center;
}

.main-footer > p {
    font-family: var(--font-text);
    color: var(--clr-grey-mid2);
}

/* Background animation ------------------------------- */

.animated-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.animated-background li {
    position: absolute;
    display: block;
    list-style: none;
    width: 20px;
    height: 20px;
    background-color: var(--clr-light-2);
    bottom: -150px;
    transition: 200ms ease-in-out;
}

.animated-background li:nth-child(1) {
    left: 25%;
    width: 80px;
    height: 80px;
    animation-delay: 0s;
}

.animated-background li:nth-child(2) {
    left: 10%;
    width: 20px;
    height: 20px;
    animation-delay: 2s;
    animation-duration: 12s;
}

.animated-background li:nth-child(3) {
    left: 70%;
    width: 20px;
    height: 20px;
    animation-delay: 4s;
}

.animated-background li:nth-child(4) {
    left: 40%;
    width: 60px;
    height: 60px;
    animation-delay: 0s;
    animation-duration: 18s;
}

.animated-background li:nth-child(5) {
    left: 65%;
    width: 20px;
    height: 20px;
    animation-delay: 0s;
}

.animated-background li:nth-child(6) {
    left: 75%;
    width: 110px;
    height: 110px;
    animation-delay: 3s;
}

.animated-background li:nth-child(7) {
    left: 35%;
    width: 150px;
    height: 150px;
    animation-delay: 7s;
}

.animated-background li:nth-child(8) {
    left: 50%;
    width: 25px;
    height: 25px;
    animation-delay: 15s;
    animation-duration: 45s;
}

.animated-background li:nth-child(9) {
    left: 20%;
    width: 15px;
    height: 15px;
    animation-delay: 2s;
    animation-duration: 35s;
}

.animated-background li:nth-child(10) {
    left: 85%;
    width: 150px;
    height: 150px;
    animation-delay: 0s;
    animation-duration: 11s;
}


@keyframes rainfall {
    0%{
        transform: translateY(0) rotate(0deg);
        opacity: 0;
        border-radius: 0;
    }
    70% {
        opacity: 1;
        border-radius: 50%;

    }
    100%{
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
        border-radius: 0%;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .animated-background li {
        animation: rainfall 25s linear infinite;
    }
}

/* Leaflet map ------------------------ */

.leaflet-top {
    margin: 10px;
}