/* Normalize */

html,
body {
    border: 0;
    margin: 0;
    padding: 0;

    position: relative;

    font-size: 20px;
}

body {
    color: var(--fg-color);
    background-color: var(--bg-color);
    font-family: 'Miller Text', Georgia, 'Times New Roman', sans-serif;
}


/* Fonts */

@font-face {
    font-family: "Miller Text";
    src: url("miller-text-regular.woff2") format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Miller Text";
    src: url("miller-text-regular-italic.woff2") format('woff2');
    font-style: italic;
    font-weight: 400;
    font-display: swap;
}


/* Theme variables */
:root {
    --fg-color: #3b3837;
    --bg-color: #fefefd;
    --accent-color: #810f29;
    --secondary-fg-color: #747170;
    --secondary-bg-color: #edeceb;
    --secondary-accent-color: #b64962;
    --fg-color-transparent: #3b383700;
    --bg-color-transparent: #fefefd00;
    --accent-color-transparent: #810f2900;

    --line-height: 1.4142;
}


/* Page setup */

.home-container {
    max-width: 872px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 8rem 2rem;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    justify-content: center;
}


/* Text */

.text {
    padding: 0 2rem;
    margin: 2rem 0 0;
    font-size: 1rem;
    line-height: var(--line-height);
    hyphens: auto;
}

.text__p:first-of-type,
.text__p--no-margin-top {
    margin-top: 0;
    hyphens: none;
}

.text__p:last-child,
.text__p--no-margin-bottom {
    margin: 0;
}

.text__p--link {
    color: inherit;
    text-decoration: none;
    text-decoration-style: wavy;
    text-decoration-thickness: from-font;
    text-decoration-color: var(--accent-color);

    transition: text-decoration 0.2s;
}

.text__p--link::after {
    content: "*";
    color: var(--accent-color);
}

.text__p--link:hover {
    text-decoration-line: underline;
}

.text__p--dropcap {
    font-variant: small-caps;
    letter-spacing: 0.03rem;
}

.signature__container {
    text-align: left;
}

.signature__img {
    margin: 1rem 0 0.5rem;
    height: 3rem;
    opacity: 0.78;
}

.signature__img--light {
    display: inline;
}

.signature__img--dark {
    display: none;
}

.page__title {
    font-size: 1rem;
    font-weight: 400;
    font-style: italic;
}

.h2 {
    font-size: 1rem;
    font-weight: 400;
    text-transform: lowercase;
    font-variant: small-caps;
    letter-spacing: 0.1rem;

    padding: 0;
    margin: 1rem 0 0;
}

.h2--link {
    color: inherit;

    text-decoration-line: underline;
    text-decoration-style: wavy;
    text-decoration-color: var(--fg-color-transparent);
    text-decoration-thickness: from-font;
    transition: text-decoration-color 0.1s;
}

.h2--link:hover {
    text-decoration-color: var(--fg-color);
}

.nav {
    margin: 0 auto;
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 5vh;
    padding: 1rem 0.5rem;

    background-color: var(--bg-color);
    box-shadow: 0 0 0.05rem 0.2rem var(--bg-color);
}

.nav__link {
    margin: 0 1.5rem;

    color: inherit;
    font-size: 0.8rem;
    font-style: italic;

    text-decoration-line: underline;
    text-decoration-style: wavy;
    text-decoration-color: var(--fg-color-transparent);
    text-decoration-thickness: from-font;
    transition: text-decoration-color 0.1s;
}

.nav__link:hover {
    text-decoration-color: var(--fg-color);
}

.nav__link--ext::after {
    content: "*";
    color: var(--accent-color);
}

/* Adjustments for small screens */

@media (max-width: 600px) {
    .home-container {
        justify-content: flex-start;
        padding: 6rem 0 8rem;
    }

    .text__p--link {
        text-decoration-line: underline;
        text-decoration-color: var(--secondary-accent-color);
    }
}


/* Dark mode */

@media screen and (prefers-color-scheme: dark) {
    :root {
        --fg-color: #d0d0cd;
        --bg-color: #181716;
        --accent-color: #ff4040;
        --secondary-fg-color: #adacae;
        --secondary-bg-color: #393837;
        --secondary-accent-color: #874958;
        --fg-color-transparent: #d0d0cd00;
        --bg-color-transparent: #18171600;
        --accent-color-transparent: #ff404000;
    }

    body {
        -webkit-font-smoothing: antialiased;
    }

    .text {
        letter-spacing: 0.005em;
        line-height: 1.5;
    }

    .signature__img--light {
        display: none;
    }

    .signature__img--dark {
        display: inline;
        opacity: 0.75 !important;
    }
}
