@font-face {
    font-family: jetbrains;
    src: url(/css/fonts/JetBrainsMono-Regular.woff2);
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: jetbrains;
    src: url(/css/fonts/JetBrainsMono-Bold.woff2);
    font-weight: 700;
    font-style: normal;
}

@font-face {
  font-family: jetbrains;
  src: url(/css/fonts/JetBrainsMono-Italic.woff2);
  font-weight: 400;
  font-style: italic;
}

@font-face {
    font-family: jetbrains;
    src: url(/css/fonts/JetBrainsMono-BoldItalic.woff2);
    font-weight: 700;
    font-style: italic;
}

@font-face {
    font-family: saturno;
    src: url(/css/fonts/SenorSaturno.ttf);
}

:root {
    /* --text: #424758; */
    --text: #515870;
    --border: dotted #515870bd;
    --border-link: dotted #51587070;
    --border-size: 0.25em;
    --bubble-bg: rgba(0, 0, 0, 0.074);
    --link: #515870;
    --nav-link: #b88d8a;
    --light-toggle: #f0ece5;
    --dark-toggle: #515870;
    --sun-toggle: #ecc05d;
    --active: #80a571;
    --on-hold: #9a97c5;
    --done: #b88d8a;
}

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

html {
    font-size: clamp(16.5px, 1vw + 10px, 20px);
    font-family: jetbrains;
    /* font-family: "Droid Sans Mono", monospace; */
    /* font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; */
}

body {
    margin: 0;
    position: relative;
    color: var(--text);
    transition: color 0.3s ease;
}

body::before,
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: repeat;
    z-index: -1;
    transition: opacity 0.3s ease;
}

body::before {
    background-image: url(../images/bg.jpg);
    opacity: 1;
}

body::after {
    background-image: url(../images/bg-dark.png);
    opacity: 0;
}

body.dark::before {
    opacity: 0;
}

body.dark::after {
    opacity: 1;
}

/* +++++++++++++++++++++ typography +++++++++++++++++++++ */
h1 {
    font-size: 150%;
    font-family: saturno;
}

h2 {
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 5px;
}

h3 {
    font-size: 100%;
    font-weight: bold;
    font-style: italic;
}

a:link,
a:visited {
    color: var(--text);
    border-bottom: var(--border-link);
    text-decoration: none;
    cursor: pointer;
    position: relative;
    top: 0;
    left: 0;
    transition: all 0.1s ease-out;
}

a:hover {
    font-weight: bold;
    border-bottom: var(--text) dotted;
}

a:active {
    top: 2px;
    left: 2px;
}

/* +++++++++++++++++++++ layout +++++++++++++++++++++ */
.page {
    height: 100dvh;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "head head"
        "avatar bubble"
        "main main"
        "footer footer"
        "nav nav";
    grid-template-rows: auto auto 1fr auto auto;
    gap: 1rem;
    padding: 1.3rem;
    max-width: 100%;
}

header {
    grid-area: head;
    padding-bottom: 0.5rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: self-end;
    flex-shrink: 0;
    border-bottom: var(--border);
    border-width: var(--border-size);
    margin-bottom: 5px;
}

nav {
    grid-area: nav;
    font-size: 120%;
    font-weight: bold;
    text-align: right;
    margin-right: 40px;
    margin-top: -10px;
}

nav a:hover {
    color: var(--nav-link);
    border-color: var(--nav-link);
}

nav ul {
    list-style: none;
}

nav li {
    padding: 3px;
}

main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* prevents horizontal scrolling */
    overflow-y: auto;
    gap: 1rem;
    margin-top: -33px;
}

.page-changelog main {
    margin-top: 5px;
    gap: 2rem;
}

footer {
    grid-area: footer;
    text-align: center;
    border-top: var(--border) 5px;
    /* position: sticky;
    bottom: 0;
    left: 0;
    right: 0; */
}

/* +++++++++++++++++++++ components +++++++++++++++++++++ */

.avatar {
    grid-area: avatar;
    margin-top: 10px;
}

.page-changelog .avatar {
    margin-top: 0px;
}

.pixelart {
    display: block;
    width: 96px;
    height: auto;
    image-rendering: pixelated;
    filter: drop-shadow(-12px 0px 0px rgba(0, 0, 0, 0.041));
}

/* +++ speech bubble +++ */
.bubble {
    grid-area: bubble;
    background-color: var(--bubble-bg);
    width: auto;
    height: fit-content;
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 1.1rem 1.5rem;
    margin-left: 8px;
    gap: 10px;
    font-size: 95%;
}

.bubble::before {
    content: "";
    width: 0;
    height: 0;
    position: absolute;
    right: 100%;
    top: 35px;
    border-left: 10px solid transparent;
    border-bottom: 12px solid var(--bubble-bg);
}

.bubble-under {
    background-color: var(--bubble-bg);
    width: auto;
    height: auto;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    padding: 1.3rem 1.5rem;
    gap: 0.5rem;
}

/* +++ lightwidget +++ */
.lightwidget-wrapper {
    height: fit-content;
    width: 100%;
}

/* +++ logo +++ */
.logo {
    position: fixed;
    width: 1.8rem;
    height: 6rem;
    right: 27px;
    top: auto;
    bottom: 28px;
    z-index: 1;
}

.logo svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: var(--text);
    opacity: 100%;
}

.logo::before {
    position: absolute;
}

/* +++ toggle +++ */
label.switch {
    width: 4em;
    height: 2em;
    background-color: var(--dark-toggle);
    border-radius: 2em;
    cursor: pointer;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    width: 4em;
    height: 2em;
    border-radius: 2em;
    transition: 0.3s;
}

input:checked~.slider {
    background-color: var(--light-toggle);
}

.slider::before {
    content: "";
    position: absolute;
    top: 0.25em;
    left: 0.25em;
    width: 1.5em;
    height: 1.5em;
    border-radius: 50%;
    box-shadow: inset 0.60em -0.08em 0px 0px var(--light-toggle);
    background-color: var(--dark-toggle);
    transition: 0.3s;
}

input:checked~.slider::before {
    transform: translateX(2em);
    background-color: var(--sun-toggle);
    box-shadow: none;
}

/* +++ (changelog) article +++ */
.update {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.update li {
    list-style-type: outside;
    list-style: "+ ";
    margin: 0.5rem 0 0.5rem 1.2rem;
}

.update li.remove {
    list-style: "- ";
}

/* +++ text block +++ */

.info {
    display: grid;
    grid-template-columns: auto auto;
    gap: 1rem;
    row-gap: 0.1rem;
    align-items: start;
    margin: 0;
}

.info> :nth-child(odd) {
    text-align: right;
}

.info :nth-child(even) {
    text-align: left;
}

dl.info:not(:last-child) {
    margin-bottom: 5px;
}

.info dt {
    font-weight: bold;
}

dl.info dt.active {
    color: var(--active);
}

dl.info dt.on-hold {
    color: var(--on-hold);
}

dl.info dt.done {
    color: var(--done);
}

/* +++++++++++++++++++++ utilities ++++++++++++++++++++++ */
 
.copyright {
    text-align: center;
    font-size: 90%;
    margin-top: -1.7rem;
}

/* +++++++++++++++++++++ overrides +++++++++++++++++++++ */

/* +++ dark mode +++ */
body.dark {
    --text: #ffffff;
    --border: dotted rgba(255, 255, 255, 0.548);
    --border-link: dotted rgba(255, 255, 255, 0.315);
    --bubble-bg: rgba(255, 255, 255, 0.13);
    --link: #ffffff;
    --nav-link: #afd8d5;
    --active: #b0d79f;
    --on-hold: #afaafd;
    --done: #ffe794;
}

/* +++ desktop +++ */
@media (min-width: 768px) {
    .page {
        grid-template-columns: 10rem 1fr 35px;
        grid-template-rows: auto auto auto auto auto;
        grid-template-areas:
            ".    head  ."
            "avatar bubble  ."
            "nav    main  logo"
            ". footer ."
            " . copyright .";
        max-width: 900px;
        margin: 0 auto;
        margin-top: 3rem;
        margin-bottom: 3rem;
        height: 85dvh;
        gap: 0.8rem;
    }

    .copyright {
        grid-area: copyright;
        margin: 0;
    }

    main {
        margin-top: 0px;
    }

    .page-changelog main {
        margin-top: 0px;
    }

    .logo {
        grid-area: logo;
        position: static;
        top: unset;
        bottom: 0;
        right: unset;
        align-self: end;
    }

    nav {
        font-size: 100%;
        margin-right: 15px;
        position: sticky;
    }

    .avatar {
        margin-top: -50px;
        justify-self: end;
        margin-right: 15px;
        position: sticky;
    }

    .page-changelog .avatar {
        margin-top: -2rem;
        margin-bottom: 5px;
    }

    .bubble {
        border-radius: 0px 40px 40px 40px;
        display: flex;
        flex-direction: column;
        position: relative;
        padding: 1.1rem 1.5rem;
        margin-left: 0;
        gap: 10px;
        font-size: 90%;
    }

    .bubble::before {
        content: "";
        width: 0;
        height: 0;
        position: absolute;
        top: 0px;
        border-right: 12px solid var(--bubble-bg);
        border-bottom: 10px solid transparent;
    }

    .bubble-under {
        flex-direction: row;
        justify-content: center;
        gap: 1.5rem;
        font-size: 90%;
    }
}