/* Reset */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding: 16vh;
    font-synthesis: none;
}

@media (max-width: 512px) {
    * {
        font-size: 12px;
    }
}

/* Variables */

:root {
    --primary-color: #f6f6f6;
    --secondary-color: #060606;
    --accent-color: #20ee88;

    --primary-color-light: #fafafa;
    --secondary-color-light: #767676;
}

/* Fonts */

@font-face {
    font-family: "Space Grotesk";
    src: url("../../assets/fonts/space-grotesk/SpaceGrotesk-VariableFont_wght.ttf")
        format("truetype");

    font-style: normal;
    font-display: swap;
}
/* Layout */

body {
    font-family: "Space Grotesk", sans-serif;
    text-align: justify;
    text-justify: auto;

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

    max-width: 640px;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    padding: 1.5rem 1.5rem;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    width: 100%;
}

nav > a {
    font-size: 1.25rem;
    text-decoration: none;
    color: var(--secondary);
}

nav > ul {
    display: flex;
    flex-direction: row;
    gap: 2rem;
}

nav > ul > li {
    list-style-type: none;
    list-style-position: inside;
}

nav > ul > li > a {
    cursor: pointer;
    text-decoration: none;
    color: var(--secondary-color);
}

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

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0;
}

main > * {
    width: 100%;
}

footer {
    margin-top: 2rem;
    color: var(--secondary-color-light);
    font-size: 0.875rem;
}

footer a {
    color: inherit;
    text-decoration: none;
}

footer span {
    padding: 0 0.5rem;
}
/* Headings */

h1,
h2,
h3,
h4 {
    margin-top: 2rem;
}

h1 {
    font-size: 1.25rem;
}

h2 {
    font-weight: 600;
    font-size: 1rem;
}

h3 {
    font-weight: 500;
    font-size: 1rem;
}

h4 {
    font-weight: 300;
    font-size: 1rem;
}

h1 + h2,
h2 + h3,
h3 + h4 {
    margin-top: 0.5rem;
}

/* Horizontal Rules */

h1 + hr,
h2 + hr,
h3 + hr,
h4 + hr {
    margin-top: 0.5rem;
}

/* Paragraphs */

p {
    margin: 0.5rem 0;
}

/* Text */

::target-text {
    color: var(--secondary-color);
}

/* Mark */

::selection,
mark {
    background-color: var(--accent-color);
    padding: 0rem 0.25rem;
    border-radius: 0.25rem;
}

mark::selection {
    background-color: var(--secondary-color-light);
}

/* Lists */

li {
    margin: 0.5rem 1rem;
}

/* Links */

a {
    color: var(--secondary-color);
    text-decoration-style: underline;
}

a:visited {
    color: var(--secondary-color-light);
}

a:is(.anchor),
a:is(.anchor):visited {
    font-size: inherit;
    font-weight: inherit;
    color: var(--secondary-color);
    text-decoration: none;
}

/* Quotes */

blockquote {
    margin: 0.5rem 0;
    padding-left: 1rem;
    border-left: 2px solid var(--secondary-color-light);
}

/* Footnotes & References */

.footnote,
.reference {
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--secondary-color);
    /*margin-left: -0.125rem;*/
}

.footnote-table,
.reference-table {
    width: 100%;
    margin: 0.5rem 0;
}

.footnote-table > tbody,
.reference-table > tbody {
    border: none;
}

.footnote-target-id {
    font-weight: 300;
    font-style: italic;
    color: var(--secondary-color);
}

.reference-target-id {
    font-style: italic;
    color: var(--secondary-color);
}

/* Tables */

table {
    border-collapse: collapse;
    margin: 1rem auto;
    width: 75%;
    min-width: 256px;
}

tbody {
    border-top: 2px solid var(--secondary-color);
}

/* Images */

img {
    max-width: 100%;
    height: auto;
    margin: 0.5rem;
    background-color: inherit;
}

img:is(.full-image) {
    border-radius: 0.5rem;
    box-shadow: 0 0 0.75rem rgba(0, 0, 0, 0.1);
}
