/* LOAD FONTS */
@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Alegreya:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

/* *************
VARIABLES
************* */
:root {
    /* dark theme */
    --text: #ffffff;
    --background: #1e261c;
    --background-opacity: #293127;
    --primary: #92c1c4;
    --secondary: #d5e0af;
    --accent: #b5cc78;
    --focus: #c25a47;

    /* fonts */
    --primary-font: "Montserrat", "Gill Sans MT", "Trebuchet MS", sans-serif;
    --heading-font: "Alegreya", "Times New Roman", Times, serif;
}

.theme-light {
    --text: #000000;
    --background: #e9f2e7;
    --background-opacity: #dde6db;
    --primary: #92c1c4;
    --secondary: #d5e0af;
    --accent: #b5cc78;
    --focus: #c25a47;
}

/* *************
DEFAULT STYLING
************* */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;

    overflow-x: hidden;

    /* width: 100%; */

    font-family: var(--primary-font);
    font-size: 22px;
    color: var(--text);
}

body {
    width: 100vw;

    background-color: var(--background);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--heading-font);
}

h1 {
    font-size: 82px;
}

h2 {
    font-size: 48px;
}

h3 {
    font-size: 28px;
}

a {
    text-decoration: none;
}

span {
    font-weight: bold;
}

.theme-light .icon {
    filter: invert();
}

/* *************
MENU BAR
************* */

nav ul {
    display: flex;
    justify-content: space-between;

    position: fixed;
    top: -1em;
    left: -1em;

    margin: 1em;
    box-shadow: 0px 5px 10px var(--background);

    width: 100vw;

    background-color: var(--background);

    z-index: 20;
}

nav ul div {
    display: flex;
    justify-content: space-between;
    gap: 1em;

    margin: 0.5em 1em 0 1.75em;
}

nav ul > div:first-of-type {
    width: 10%;
}

nav ul > div:last-of-type {
    justify-content: flex-end;

    width: 65%;
}

nav ul > div:last-of-type > div {
    position: relative;
    top: 0;

    margin: 0;
}

nav ul li {
    position: relative;

    padding: 0.5em 0.75em 0.5em 0.75em;

    width: 7.5em;

    text-align: center;
}

.active {
    font-weight: bold;
    color: var(--primary);
}

nav ul li a:hover,
nav ul li span:hover,
nav ul li span.active:hover,
nav ul > div:last-of-type button:hover {
    font-weight: bold;
    color: var(--primary);
    cursor: pointer;
}

nav ul li:not(:nth-of-type(4), :nth-of-type(5), :nth-of-type(6))::after,
nav ul > div:last-of-type button::after {
    content: "";

    position: absolute;
    bottom: 100%; /* Start the line above the element */
    left: 0;

    width: 100%;
    height: 0;

    background-color: transparent;

    transition: height 0.25s ease-in-out, background-color 0.25s ease-in-out,
        bottom 0.25s ease-in-out;
}

nav ul li:hover::after,
nav ul > div:last-of-type button:hover::after {
    bottom: 0;

    height: 3px;

    background-color: var(--primary);
}

nav ul li:nth-of-type(4) {
    padding-top: 0.1em;

    list-style-type: none;

    overflow: visible;
}

nav ul li:nth-of-type(4) a {
    display: block;

    border-radius: 10px;
    padding: 0.5em 0.75em 0.5em 0.75em;

    font-weight: bold;
    text-align: center;
    color: var(--background);
    background-color: var(--primary);
}

nav ul li:nth-of-type(4) a:hover {
    transform: scale(1.1);

    background-color: var(--primary);

    filter: brightness(0.75);
}

/* theme switch button styling */

nav ul li:nth-of-type(5) {
    width: 2em;
}

nav ul li svg {
    position: relative;
    left: -0.5em;

    width: 1.5em;
    height: 1.5em;
}

nav ul li svg circle {
    fill: var(--text);
    stroke: var(--text);
}

nav ul li svg circle.light {
    fill: none;
    stroke-width: 10px;
}

nav ul li svg path {
    fill: var(--text);
}

nav ul li svg:hover {
    cursor: pointer;
}

nav ul li svg:hover circle {
    fill: var(--primary);
    stroke: var(--primary);
}

nav ul li svg:hover path {
    fill: var(--primary);
}

nav ul li span {
    font-weight: normal;
}

nav ul li span.active {
    font-weight: bold;
    color: var(--text);
}

/* hamburger menu */

nav ul > div:last-of-type button {
    display: none;
    box-sizing: border-box;

    position: relative;

    background: none;
    outline: none;
    border: 0;

    width: 7.5em;

    color: var(--text);
}

nav ul > div:last-of-type div.open {
    display: none;

    position: fixed;
    top: 0;
    left: 0;

    margin: 0;
    padding: 4em 0 4em 2em;

    width: 100%;
    height: 100%;

    background-color: var(--background-opacity);
    overflow-y: auto;
}

nav ul > div:last-of-type div > svg {
    display: none;

    position: absolute;
    bottom: 1em;
    left: calc(50% - 2.5em / 2);

    width: 2.5em;
    height: 2.5em;
}

nav ul > div:last-of-type div > svg:hover {
    cursor: pointer;
}

nav ul > div:last-of-type div > svg path {
    stroke: var(--text);
}

nav ul > div:last-of-type div > svg:hover path {
    stroke: var(--primary);
    stroke-width: 200px;
}

/* *************
MEDIA QUERIES
************* */

@media screen and (max-width: 90em) {
    nav ul > div:last-of-type {
        width: 80%;
    }
}

@media screen and (max-width: 67em) {
    h1 {
        font-size: 64px;
    }

    p {
        font-size: 18px;
    }

    span {
        font-size: 18px;
    }

    nav ul div:first-of-type {
        width: auto;
    }

    nav ul div:last-of-type {
        width: auto;
    }

    nav ul > div:last-of-type button {
        display: block;
    }

    nav ul > div:last-of-type div {
        display: none;
    }

    nav ul > div:last-of-type div.open {
        display: block;
    }

    /* *************
    HAMBURGER MENU
    ************* */

    nav ul > div:last-of-type div.open li {
        padding: 3em 0 0 0;

        width: auto;

        text-align: start;
    }

    nav ul > div:last-of-type div.open li:first-of-type {
        padding: 2em 0 0 0;
    }

    nav ul > div:last-of-type div.open li a {
        font-size: 48px;
    }

    nav ul > div:last-of-type div > svg {
        display: block;
    }

    nav
        ul
        > div:last-of-type
        div.open
        li:not(:nth-of-type(5), :nth-of-type(6)) {
        margin-left: -2em;
        padding-left: 2em;

        width: 15em;

        overflow: visible;
    }

    nav
        ul
        > div:last-of-type
        div.open
        li:not(:nth-of-type(5), :nth-of-type(6))::after {
        content: "";

        position: absolute;
        bottom: -0.5em;
        left: -2em;

        width: 0%;

        transition: width 0.25s ease-in-out, background-color 0.25s ease-in-out,
            bottom 0.25s ease-in-out;
    }

    nav
        ul
        > div:last-of-type
        div.open
        li:not(:nth-of-type(5), :nth-of-type(6)):hover::after {
        width: 100%;
        height: 3px;

        background-color: var(--primary);
    }

    /* contact link styling */

    nav ul > div:last-of-type div.open li:nth-of-type(4) a {
        border-radius: 0px;
        padding: 0;

        font-weight: normal;
        text-align: left;
        color: var(--text);
        background: none;
    }

    nav ul > div:last-of-type div.open li:nth-of-type(4) a:hover {
        transform: scale(1);

        font-weight: bold;
        color: var(--primary);

        filter: brightness(1);
    }

    /* theme button styling */

    nav ul > div:last-of-type div.open li:nth-of-type(5) {
        position: absolute;
        top: 1em;
        left: 1em;

        padding: 0;

        width: 4em;
        height: 4em;
    }

    nav ul > div:last-of-type div.open li:nth-of-type(5) svg {
        top: 0.5em;
        left: 0.5em;

        width: 2.5em;
        height: 2.5em;
    }

    /* language switch styling */

    nav ul > div:last-of-type div.open li:nth-of-type(6) {
        position: absolute;
        top: 1.25em;
        right: 1em;

        padding: 0;

        font-size: 32px;
    }

    nav ul > div:last-of-type div.open li:nth-of-type(6) span {
        font-size: 32px;
    }
}
