:root {
    /* light theme */
    --primary-bg-color: #ffffff;
    --secondary-bg-color: #ffffff;
    --text-color: black;
    --inverted-text-color: rgb(from var(--text-color) calc(255 - r) calc(255 - g) calc(255 - b));
    --primary-color: #e34fdb;
    --secondary-color: #30b6b3;
    --accent-color: #e34fdb;
    --navbar-color: #ffffff9a;
    --cursor: #ff00f250;
    --shadow: rgba(0, 0, 0, 0.3);
    --underline-color: #e1e1e1;

    /* z-index */
    --nav-z: 1000;
    --circle-deco-z: 1100;
    --progress-bar-z: 900;

    /* transitions */
    --fast-transition-time: 0.2s;
    --base-transition-time: 0.4s;
    --long-transition-time: 0.7s;

    /* sizes */
    --rem-xxs: 0.5rem;
    --rem-xs: 0.8rem;
    --rem-s: 1rem;
    --rem-m: 1.5rem;
    --rem-l: 2rem;
    --rem-xl: 3rem;
    --rem-xxl: 5rem;

    --px-xxs: 1px;
    --px-xs: 3px;
    --px-s: 5px;
    --px-m: 10px;
    --px-l: 15px;
}

/* dark theme */
[data-theme="dark"] {
    --primary-bg-color: #121212;
    --secondary-bg-color: #1e1e1e;
    --text-color: white;
    --inverted-text-color: black;
    --navbar-color: #1a1a1add;
    --shadow: rgba(0, 0, 0, 0.6);
    --underline-color: #1e1e1e;
}

/* ############### */
/* ### General ### */
/* ############### */

body {
    margin: 0;
    background: var(--secondary-bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color var(--base-transition-time), color var(--base-transition-time);
}

/* defaults */
h1,
h2,
h3,
p {
    margin: 0;
}

h1,
h2,
h3 {
    color: var(--secondary-color);
}

h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    background-image: linear-gradient(110deg, var(--secondary-color), var(--accent-color));
    color: transparent;
    background-clip: text;
    width: fit-content;
}

h2 {
    font-size: var(--rem-l);
}

/* links and buttons */
a {
    text-decoration: none;
    border: none;
    color: var(--text-color);
    border-radius: var(--px-m);
    font-size: var(--rem-s);
    line-height: 1;
    padding: var(--rem-xs) var(--rem-s);
    background: transparent;
    transition: var(--base-transition-time) background-color;
}

button {
    border: none;
    border-radius: var(--px-m);
    padding: var(--rem-xs) var(--rem-s);
    background: transparent;
    font-size: var(--rem-s);
    color: var(--text-color);
    cursor: pointer;
    transition: var(--base-transition-time) background-color;
}

button:hover,
a:hover {
    background: var(--primary-color);
    color: rgb(from var(--text-color) calc(255 - r) calc(255 - g) calc(255 - b));
}

/* ############## */
/* ### Layout ### */
/* ############## */

/* main containers */
#body-main {
    padding: var(--rem-xl);
}

.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--px-l);
}

#home {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    height: 90dvh;
    align-items: center;
    justify-content: center;
    margin-bottom: 10dvh;
}

/* ################## */
/* ### Navigation ### */
/* ################## */

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--navbar-color);
    backdrop-filter: blur(5px);
    margin: 0;
    padding: var(--rem-l) var(--rem-xxl);
    position: fixed;
    box-sizing: border-box;
    width: 100%;
    box-shadow: 0px 0px 20px var(--shadow);
    transition: var(--long-transition-time) all;
    z-index: var(--nav-z);
}

.nav-initials {
    font-size: var(--rem-l);
    color: var(--navbar-color);
    font-family: monospace;
    font-weight: bold;
    line-height: 1;
    padding: var(--rem-xs);
    border-radius: var(--px-l);
    background-color: var(--secondary-color);
    box-shadow: 0px 0px 15px 1px var(--secondary-color);
}

.nav-links button {
    font-size: var(--rem-s);
}

.nav-links {
    display: flex;
    gap: var(--rem-m);
}

.nav-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--rem-s);
}

.nav-buttons button,
.nav-buttons a {
    display: inline-block;
    line-height: 1;
    border-radius: 2;
    padding: var(--rem-s);
}

.nav-scrolled {
    margin: var(--rem-l);
    width: calc(100% - calc(2 * var(--rem-l)));
    border-radius: var(--px-l);
    padding: var(--rem-l) var(--rem-xl);
}

/* ########################### */
/* ### Interactive details ### */
/* ########################### */

/* circle cursor */

@keyframes clickCursor {

    30% {
        scale: 0.8;
    }

    0% {
        scale: 1;
    }
}

#circle-decoration-wrapper {
    visibility: hidden;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: var(--circle-deco-z);
    transition: none;
}

#circle-decoration {
    display: inline-block;
    background-color: var(--cursor);
    box-shadow: 0px 0px 21px 1px var(--cursor);
    backdrop-filter: blur(2px);
    border-radius: 100%;
    padding: 1.2rem;
    transition: scale var(--long-transition-time);
}

.play-click-anim {
    animation: clickCursor 0.5s ease-in-out;
}

/* scroll arrows */

@keyframes idleBounceBottom {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(15px);
    }

    60% {
        transform: translateY(7px);
    }
}

@keyframes idleBounceTop {

    0%,
    22%,
    52%,
    82%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(15px);
    }

    60% {
        transform: translateY(7px);
    }
}

.down-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: var(--rem-l);
    gap: var(--rem-xs);
    background: none;
    border: none;
}

.down-arrow:hover {
    background: none;
}

.top-arrow,
.bottom-arrow {
    display: flex;
    transition: var(--base-transition-time);
}

.top-arrow {
    animation: idleBounceTop 2.5s infinite;
}

.bottom-arrow {
    animation: idleBounceBottom 2.5s infinite;
}

.top-arrow-left,
.top-arrow-right {
    width: var(--rem-s);
    height: 0.2rem;
    background-color: var(--primary-color);
    transition: var(--base-transition-time);
}

.down-arrow:hover .top-arrow-left,
.down-arrow:hover .top-arrow-right,
.down-arrow:hover .bottom-arrow-left,
.down-arrow:hover .bottom-arrow-right {
    filter: brightness(150%);
}

.top-arrow-left {
    transform: rotate(45deg) translateX(1px);
    transform-origin: right;
    border-radius: 5px 0 0 5px;
}

.top-arrow-right {
    transform: rotate(-45deg) translateX(-1px);
    transform-origin: left;
    border-radius: 0 5px 5px 0;
}

.bottom-arrow-left,
.bottom-arrow-right {
    width: var(--rem-s);
    height: 0.2rem;
    background-color: var(--primary-color);
    transition: var(--base-transition-time);
}

.bottom-arrow-left {
    transform: rotate(45deg) translateX(1px);
    transform-origin: right;
    border-radius: 5px 0 0 5px;
}

.bottom-arrow-right {
    transform: rotate(-45deg) translateX(-1px);
    transform-origin: left;
    border-radius: 0 5px 5px 0;
}

/* spacer */

.tile-spacer {
    margin: 10dvh 0;
}

/* progress bar */

#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: var(--px-s);
    background-color: var(--accent-color);
    z-index: var(--progress-bar-z);
    transition: border-radius var(--fast-transition-time);
    will-change: width;
}

/* background particles */

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
}

/* ############### */
/* ### Content ### */
/* ############### */

/* main tiles */
.main-tile {
    border-radius: var(--px-l);
    box-shadow: 0px 0px 10px var(--shadow);
    padding: var(--rem-l) var(--rem-xl);
    box-sizing: border-box;
    width: 100%;
    background-color: var(--primary-bg-color);
}

.main-tile-content {
    margin-top: var(--rem-m);
    display: flex;
    gap: var(--rem-m);
}

.main-tile-content>div {
    display: flex;
    flex-direction: column;
    gap: var(--rem-xs);
}

#about img {
    height: clamp(10dvh, 25rem, 80dvh);
    border-radius: var(--px-l);
}

.hor-scroll-container {
    display: flex;
    gap: var(--rem-s);
    margin-top: var(--rem-s);
    overflow-x: auto;
    padding: var(--rem-xs);
}

.hor-scroll-container::-webkit-scrollbar {
    height: var(--px-s);
}

.hor-scroll-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: var(--px-m);
}

/* project tiles */
.inline-tile {
    flex: 0 0 280px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: var(--rem-xs);
    padding: var(--rem-l);
    border-radius: var(--px-l);
    box-shadow: 0 0 10px var(--shadow);
    background: var(--secondary-bg-color);
}

.inline-tile h3 {
    font-size: var(--rem-m);
}

.inline-tile p {
    font-size: var(--rem-s);
    line-height: 1.4;
    color: var(--text-color);
}

.inline-tile .tags {
    font-size: var(--rem-xs);
    color: var(--accent-color);
    opacity: 85%;
}

.inline-tile .tile-links {
    display: flex;
    gap: var(--rem-xs);
    flex-wrap: wrap;
    margin-top: auto;
}

.inline-tile a {
    padding: var(--rem-xxs) var(--rem-s);
    font-size: var(--rem-xs);
}

/* skill tiles */
.skill-category {
    margin-top: var(--rem-m);
}

.skill-category:first-of-type {
    margin-top: var(--rem-xs);
}

.category-title {
    margin-bottom: var(--rem-s);
}

.skill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--rem-s);
}

.skill-tile {
    flex: 0 1 170px;
    display: flex;
    flex-direction: column;
    gap: var(--rem-xs);
    padding: var(--rem-m);
    border-radius: var(--px-l);
    box-shadow: 0 0 10px var(--shadow);
    background: var(--secondary-bg-color);
}

.skill-tile h4 {
    color: var(--secondary-color);
    font-size: var(--rem-s);
    margin: 0;
}

.skill-tile p {
    font-size: var(--rem-xs);
    line-height: 1.4;
    color: var(--text-color);
}

.project-tag {
    margin-top: auto;
    font-size: var(--rem-xs);
    color: var(--accent-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--px-s);
    padding: 0.3rem var(--rem-s);
    width: fit-content;
}

/* contact form */
#contact form {
    display: flex;
    flex-direction: column;
    gap: var(--rem-s);
}

form textarea {
    resize: vertical;
    background: none;
    height: 20svh;
    margin-top: var(--rem-xs);
    padding: var(--rem-s);
    border-radius: var(--px-l);
    font-size: var(--rem-s);
    color: var(--text-color);
    border: solid 2px var(--underline-color);
    transition: border var(--fast-transition-time);
}

form textarea:focus {
    outline: none !important;
    border: solid 2px var(--accent-color);
}

form input {
    background: none;
    border: none;
    border-bottom: solid 2px var(--underline-color);
    padding: var(--rem-xs);
    color: var(--text-color);
    font-size: var(--rem-s);
    transition: border var(--fast-transition-time);
}

form input:focus {
    outline: none !important;
    border-bottom: solid 2px var(--accent-color);
}

.form-vertical {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.form-horizontal {
    display: flex;
    width: 100%;
    gap: var(--rem-m);
}