/* basics */

body {
    background-attachment: fixed;
    background-color: var(--bg);
    background-size: cover;
    color: var(--text);
    font-family: sans-serif;
    hyphens: auto;
    max-width: 95%;
    margin-left: auto;
    margin-right: auto;
    text-align: justify;
}

html {
    min-height: 95%;
    height: 95%;
    margin: 10px;
    position: relative
}

body {
    min-height: 90%;
    height: 95%
}

hr {
    margin: 0.5em 0;
    padding: 1px;
    background: var(--text);
}

/* color schemes */

@media (prefers-color-scheme: light) {
    :root {
        --bg-figure: #ddd;
        --bg: #fdfdfd;
        --secondary: #444;
        --text: #000;
        --link-new: #0000ee;
        --link-vis: #551a8b;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-figure: #151515;
        --bg: #050709;
        --secondary: #9eac30;
        --text: #e6e2bd;
        --link-new: #9eac30;
        --link-vis: #7e8926;
    }
}

/* relative size */

@media (max-width: 900px) {
    body {
        font-size: 15px;
        margin: 20px 5% 25px;
    }
}

@media (min-width: 901px) and (max-width: 1800px) {
    body {
        font-size: 17px;
        margin: 30px 10% 25px;
    }
}

@media (min-width: 1801px) {
    body {
        font-size: 18px;
        margin: 30px 15% 25px;
    }
}

/* hide decoration on small screens */

@media only screen and (max-width: 420px) {
    #house {
        display: none;
    }
}

@media only screen and (max-width: 450px) {
    #kopimi {
        display: none;
    }
}

/* links */

a:active, a:link, a:visited {
    text-decoration: none;
}

a:link {
    color: var(--link-new);
    text-decoration: none;
}

a:visited {
    color: var(--link-vis);
    text-decoration: none;
}

a:hover, a:hover:hover, a:link:hover, a:visited:hover {
    color: inherit;
    text-decoration: none;
}

a:hover.footnoteRef, a:link.footnoteRef, a:visited.footnoteRef {
    border-bottom: none;
    color: var(--secondary);
}

/* headlines */

h1 {
    font-size: 150%;
}

h2 {
    font-size: 125%;
}

h1, h2, h3 {
    margin: 1.25em 0 0.25em;
    font-weight: bold;
    line-height: 1.2;
}

h4, h5, h6 {
    margin: 1em 0 0;
    line-height: 1.1;
}

/* article */

article > p:first-of-type {
    margin: 0.75em 0 0;
}

main > p {
    line-height: 1.5em;
}

/* tables */

table {
    border-collapse: collapse;
    border-spacing: 0;
    margin-bottom: 1em;
    margin-top: 1em;
    overflow-wrap: normal;
    table-layout: fixed;
    width: 100%;
}

table > * {
    overflow-wrap: normal;
}

thead {
    background-color: var(--bg-figure);
    font-weight: bold;
}

tbody:first-child, thead {
    border-top: 1px solid var(--secondary);
}

tbody:last-child, thead {
    border-bottom: 1px solid var(--secondary);
}

tr {
    border-left: 1px solid var(--secondary);
    border-right: 1px solid var(--secondary);
}

tr:nth-child(even) {
    background-color: var(--bg-figure);
}

tr td, tr th {
    padding: .2em .7em;
}

/* lists */

li {
    margin-bottom: 7px;
    margin-top: 5px;
}

ul, ol {
    font-size: 90%;
    padding-left: 25px;
}

ul > li {
    list-style-type: "➫ ";
}

ol > li {
    list-style-type: decimal;
}

li > section > h2 > a:link, li > section > h2 > a:visited,
li > section > h3 > a:link, li > section > h3 > a:visited {
    color: var(--secondary);
}

/* codeblocks */

code {
    font-family: monospace;
    padding: 0 .15em;
    font-size: 85%;
}

pre {
    overflow: auto;
    font-size: 85%;
    background-color: var(--bg-figure);
    border: 1px solid var(--secondary);
    padding: 0;
    margin-top: 1em;
}

pre > code {
    padding: 10px;
    overflow-x: auto;
    border-width: 0
}

code, p > code, a > code {
    border: 1px solid var(--secondary);
}

code, pre > code {
    white-space: unset;
    overflow-wrap: normal;
    hyphens: manual;
    text-align: left
}

pre, pre > code {
    display: block
}

/* images */

img {
    margin: 0 1.2em 0 1.2em;
    padding: 0;
    display: block;
    max-width: 90%;
    float: left;
}

/* figures */

figcaption, figure {
    display: block
}

figure {
    margin: 1.2em 0;
    text-align: left;
    background-color: var(--bg-figure);
    border: 1px solid var(--secondary);
    overflow: hidden
}

figure > * {
    box-shadow: 0 0;
    border-width: 0;
}

figure > p {
    text-align: justify
}

figure > img {
    padding-top: 1em;
    margin: auto;
    float: none;
}

figcaption {
    margin: 5px 10px 5px 30px;
    text-align: right
}

figcaption:empty {
    display: none
}

/* quotes */

blockquote {
    quotes: none;
    border-left: .35em var(--secondary) solid;
    padding-left: 1em;
    margin: 1.5em 0.5em 1.5em 0.5em;
    font-size: 90%
}

blockquote, figcaption {
    font-style: italic
}

blockquote:after, blockquote:before {
    content: none
}

/* navbar */

nav {
    display: block
}

nav > a:link, nav > a:visited {
    color: var(--secondary);
}

.nav_link + .nav_link:before {
    content: " · "
}

/* contact info */

aside {
    margin: 0.5em 0;
}

aside > dl > dd > a:link, aside > dl > dd > a:visited {
    color: var(--secondary);
}

aside > dl > dd {
    margin-left: 0;
}

dt {
    font-weight: bold
}

dl > dd, dl > dt {
    white-space: nowrap;
}

dl > dd {
    color: var(--secondary);
    margin-bottom: 10px;
}

/* tags */

.tag:link, .tag:visited {
    color: var(--secondary);
}

/* deco */

#house {
    color: var(--secondary);
    margin: 0 0 5px;
}

#kopimi {
    max-width: 1.5%;
    min-width: 1%;
    animation: 6s linear infinite rotateRight;
    position: fixed;
    bottom: 10px;
    right: 0;
    filter: opacity(85%);
}

@media (prefers-color-scheme: dark) {
    #kopimi {
        filter: invert(100%) opacity(85%);
    }
}

@keyframes rotateRight {
    100% {
        transform: rotate(360deg)
    }
}

/* etx marker */

#etx {
    font-weight: bold;
    text-align: center;
}

/* projects */

.project-lang, .project-tag {
    float: left;
    margin-top: 0;
    margin-right: 5px;
}

.project-card {
    border: var(--secondary);
    border-width: 1px;
    border-style: solid;
    margin: 5px 10px 5px 0;
    padding: 10px 10px 10px 10px;
    min-width: 300px;
    max-width: 300px;
}

.project-desc {
    margin-top: 0;
    margin-bottom: 0;
}

.project-role {
    color: gray;
    display: inline;
    float: right;
    margin-top: 0;
}

/* theme switcher */

.theme-switcher {
    opacity: 0;
    position: absolute;
}

.theme-switcher-label {
    background-color: var(--bg-figure);
    width: 50px;
    height: 26px;
    border-radius: 50px;
    padding: 5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    position: fixed;
    top: 10px;
    left: 10px;
}

.theme-switcher-label .theme-switcher-knob {
    background-color: var(--bg);
    width: 22px;
    height: 20px;
    position: absolute;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    transition: transform 0.1s linear;
}

.theme-switcher:checked + .theme-switcher-label .theme-switcher-knob {
    transform: translateX(22px);
}
