@font-face {
    font-family: 'Merriweather';
    src: url('../assets/fonts/Merriweather.ttf') format('truetype');
}

@font-face {
    font-family: 'Lora';
    src: url('../assets/fonts/Lora.ttf') format('truetype');
}

/* Layout */

* {
    box-sizing: border-box;
}

/* Animations */

@keyframes underlineExpand {
    0% {
        width: 0;
        opacity: 0;
    }
    100% {
        width: 100%;
        opacity: 1;
    }
}

/* Main styles */

html {
    scrollbar-gutter: stable;
    background: var(--clr-bg);
    color: var(--d-clr-text);
    font-family: 'Lora', sans-serif;
}

body {
    min-height: 100dvh;
    margin: 0;
}

a {
    text-decoration: none;
    color: var(--clr-accent);

    &[href*="://"]::before {
        content: "↗ ";
    }

    &:hover {
        text-decoration: underline;
    }
}


h1, h2, h3 {
    margin: 0;
    font-family: 'Merriweather', serif;
    color: var(--d-clr-text-highlight);

    em {
        color: var(--clr-accent);
    }
}

em {
    color: var(--d-clr-text-highlight);
}

div {
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2.5rem;
    font-weight: 500;
    transition: var(--duration-normal) var(--fn-0);
    background: var(--clr-accent);
    color: var(--d-clr-text);
    border: var(--border-width) solid var(--clr-accent);
}

.btn--highlight {
    background: var(--clr-accent);
    color: var(--clr-text);
    border: var(--border-width) solid var(--clr-accent);

    &:hover {
        transform: translateY(-1px);
    }
}

.btn--outline {
    background: transparent;
    color: var(--d-clr-text);
    border: var(--border-width) solid var(--d-clr-text);

    &:hover {
        background: rgb(from var(--d-clr-text) r g b / 20%);
        color: var(--d-clr-text-highlight);
    }
}

/* ================== */
/*  Nav: Version 2.1  */
/* ================== */

#nav {
    display: flex;
    position: sticky;
    z-index: 50;
    top: 0;
    left: 0;
    height: var(--nav-height);
    width: 100dvw;
    padding: 0;
    font-size: calc(var(--nav-unit) / 2);
    user-select: none;
    background: var(--clr-surface);
    color: var(--clr-brand);
    transition: background var(--duration-snappy) var(--fn-0);

    * {
        box-sizing: content-box;
        align-items: center;
        justify-content: center;
    }

    a {
        color: inherit;
    }
}

.nav__spacer {
    margin-left: auto;
}

.nav__sidebar-toggle {
    display: none;
    text-align: center;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    height: 100%;
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav__sidebar-toggle {
        display: flex;
    }

    .nav__tab:not(.nav__tab--highlighted) {
        display: none;
    }

    .nav__logo {
        margin-left: auto;
    }
}

.nav__tab {
    display: flex;
    position: relative;
    min-width: var(--nav-unit);
    width: 10rem;
    padding: 0.5rem 0;
    will-change: opacity, border-color;
}

.nav__lang-select {
    display: flex;
    gap: 0.5rem;
}

.nav__logo {
    width: max-content;
    padding: 0.25rem 2rem;

    svg {
        display: block;
        height: 100%;
        aspect-ratio: 3 / 1;
    }
}

.nav__tab--highlighted {
    position: relative;
    background: var(--clr-accent);
    color: var(--clr-brand) !important;
}

a.nav__tab--highlighted {
    &::after {
        content: "➔";
        position: absolute;
        right: 1rem;
    }
}

.nav__tab--current {
    box-shadow: inset 0 -3px 0 0 var(--clr-accent);
}

/* ==================== */
/*  Sidebar: Version 3  */
/* ==================== */
  
.sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 1rem;
    left: 0;
    height: calc(100dvh - 2rem);
    width: 22.5vw;
    min-width: min(250px, 100vw - 2rem);
    z-index: 999;
    font-size: calc(var(--nav-height) / 2);
    border-radius: var(--radius);
    border: var(--border-width) var(--clr-border) solid;
    color: var(--clr-text);
    user-select: none;
    background: linear-gradient(0deg, var(--clr-surface) 0%, var(--clr-bg) 100%);
    backdrop-filter: blur(25px);
    transform: translateX(-100%);
    transition: var(--duration-slow) var(--fn-0);
    overflow: hidden;
    will-change: transform;
}

.sidebar__menu {
    margin: 65px 0;
    display: flex;
    flex-grow: 1;
    flex-direction: column;
    padding: 1rem;
}
 
.sidebar__item {
    display: flex;
    white-space: nowrap;
    position: relative;
    flex-grow: 1;
    align-items: center;
    overflow-x: hidden;
    height: calc(var(--nav-height) * 1.125);
    cursor: pointer;
    transition: var(--duration-snappy) var(--fn-0);
    mask-image: linear-gradient(to left, rgba(0,0,0,0) 0, rgba(0,0,0,1) 10px);
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0) 0, rgba(0,0,0,1) 10px);
}
 
.sidebar__item:hover {
    color: var(--clr-accent);
    font-weight: 600;
    letter-spacing: 1px;
}
 
.sidebar__close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    border: none;
    background: none;
    color: var(--clr-text-muted);
    font-size: 25px;
    cursor: pointer;
}

.sidebar__lang-select {
    display: flex;
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    gap: 0.5rem;
    color: var(--clr-text-muted);
    font-size: 0.9rem;
}
 
.sidebar-backdrop {
    display: none;
    position: fixed;
    z-index: 550;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    user-select: none;
    backdrop-filter: blur(0px);
    will-change: backdrop-filter;
}



