@font-face {
    font-family: 'MD Nichrome';
    src: url('/assets/type/mdnichrome_black.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --max-width: 56ch;
    --ratio: 1.8;
    --space--2: calc(var(--space--1) / var(--ratio));
    --space--1: calc(var(--space-0) / var(--ratio));
    --space-0: 1rem;
    --space-1: calc(var(--space-0) * var(--ratio));
    --space-2: calc(var(--space-1) * var(--ratio));
    --space-3: calc(var(--space-2) * var(--ratio));
    --space-4: calc(var(--space-3) * var(--ratio));
    --body: 'Georgia', serif;
    --heading: 'MD Nichrome', system-ui, sans-serif;
    --paragraph: calc(1.13rem + .4vw);
    --micro: calc(var(--paragraph) * .9);
    --nav-link: calc(var(--paragraph) * 1.4);
    --heading-1: calc(2.6rem + 1.3vw);
    --heading-2: calc(var(--heading-1) * .5);
    --primary: #D3CEC1;
    --accent: #D788CD;
    --border: #5D5D5D;
    --post-background: #221C1A;
    --background: #1A1614;
}

html {
    font-size: 16px;
    background-color: var(--background);
}

html:focus-within {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    border: 0;
    box-sizing: border-box;
    overscroll-behavior: none;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 4rem 1rem;
    font-family: var(--body);
    font-size: var(--paragraph);
    font-style: normal;
    line-height: 1.65;
    color: var(--primary);
    background-color: var(--background);
}

header, 
header > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: var(--max-width);
}

header > div * + * {
    margin-block-start: var(--space-1);
} 

.header-big > * + * {
    margin-block-start: calc(var(--space-2) + .5vw);
}

.header-image {
    background:url(/assets/graphics/header_img.webp) center/cover no-repeat;
    width: 100%;
    max-width: 225px;
    aspect-ratio: 1/1;
}

h1 {
    font-family: var(--heading);
    font-size: var(--heading-1);
    font-weight: 800;
    line-height: 1; 
}

h2 {
    font-family: var(--heading);
    font-size: var(--heading-2);
    font-weight: 800;
    line-height: 1;
}

em {
    font-style: italic;
}

.block {
    display: inline-block;
}

.site-title-big {
    text-align: center;
    color: var(--accent);
}

.site-description {
    font-family: var(--body);
    font-size: calc(var(--heading-1) * .5);
    font-style: italic;
    line-height: normal;
    color: var(--primary);
}

.header-small > * + * {
    margin-block-start: var(--space-1);
}

.header-small a {
    display: flex;
    align-items: center;
}

.site-title-small {
    font-family: var(--heading);
    font-size: var(--nav-link);
    line-height: normal;
}

.header-small svg {
    width: 1em;
    height: auto;
}

header sup {
    font-size: .3em;
    line-height: normal;
    vertical-align: text-top;
}

ul {
    list-style: none;
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    font-family: var(--heading);
    font-size: var(--nav-link);
    line-height: normal;
}

nav ul li:not(:last-of-type) {
    margin-inline-end: var(--space-0);
}

.tag-search-container {
    position: relative;
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
}

#tag-search-form {
    display: block;
    border-radius: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
}

#tag-search-input {
    width: 100%;
    padding: 1rem var(--space-1);
    border-radius: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
    font-family: var(--body);
    font-size: var(--paragraph);
    font-style: italic;
    color: #808080;
    background-color: var(--post-background);
}

#tag-search-input::placeholder {
    color: #808080;
}

#tag-search-error {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 1rem;
    padding: 0 var(--space-1);
    font-size: var(--paragraph);
    color: var(--accent);
}

main {
    width: 100%;
    max-width: var(--max-width);
}

main.index > div,
.post + .post {
    margin-block-start: calc(var(--space-3) + .5vw);
}

main > div.page {
    margin-block-start: var(--space-2);
} 

#blogroll,
#post-content,
#tag-posts {
    opacity: 0;
}

.fade-in-ready {
    animation: fade-in-content 360ms cubic-bezier(.2,.9,.2,1) both;
}

@keyframes fade-in-content {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

#blogroll {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
}

.gradient-border::before {
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #9947AA, #E55961, #F0AAB0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    content: "";
    pointer-events: none;
}

.post,
.box {
    position: relative;
    width: 100%;
    max-width: var(--max-width);
    padding: calc(var(--space-2) + 1vw) 2.25rem;
    border-radius: 1rem;
    background-color: var(--post-background);
}

.post > *:not(hr) + *:not(hr),
.page > *:not(hr) + *:not(hr):not(.box),
.box > * + * {
    margin-block-start: var(--space-1);
}

.post-title {
    font-family: var(--heading);
    font-size: var(--heading-1);
}

p:not(.post p) {
    max-width: 52ch;
}

hr {
    max-width: 52ch;
    height: 2px;
    margin-block-start: var(--space-2);
    margin-block-end: var(--space-2);
    border-top: 2px dotted var(--accent);
    background: transparent;
}

.post-notes {
    padding-top: var(--space-0);
    border-top: 1px solid #808080;
    font-family: var(--mono);
    font-size: var(--micro);
}

.post-text sup,
.post-notes sup  {
    margin-right: .25rem;
    line-height: 1;
    color: var(--accent);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
}

.tag {
    margin-right: var(--space-1);
    font-family: var(--mono);
    font-size: var(--micro);
}

.active-tag {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-decoration-color: var(--accent);
    text-underline-offset: 2px;
    text-decoration-skip-ink: all;
}

.highlight-tag {
    font-weight: inherit;
    color: var(--accent);
}

.post-image {
    display: block;
    width: 100%;
    max-width: 500px;
    height: auto;
    margin: 0 auto;
    border-radius: 0.5rem;
}

.share-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-1);
    letter-spacing: 1px;
}

.share-container p {
    font-family: var(--heading);
    font-size: calc(var(--paragraph) * 1.5);
    text-transform: uppercase;
}

.share-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

button {
    border-radius: .5rem;
    font-family: var(--heading);
    text-transform: uppercase;
    color: var(--post-background);
    background: var(--accent);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.share-buttons button {
    width: 8ch;
    padding: .25rem .75rem .35rem;
    font-size: var(--micro);
}  

a {
    color: var(--accent);
    text-decoration: none;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

@media (hover:hover) and (pointer:fine) {
    a:hover,
    button:hover {
        opacity: .6;
    }
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    border-radius: .25rem;
}

.tag-results-heading, 
.post-results-heading {
    font-family: var(--heading);
    font-size: calc(var(--heading-1) * .7);
    margin-block-start: calc(var(--space-2) + 2vw);
    margin-block-end: calc(var(--space-2) + 2vw);
}

.tag-results-heading .tag-term, 
.post-results-heading .post-term {
    color: var(--accent);
}

#faq li + li,
.box {
    margin-block-start: calc(var(--space-2) + 1vw); 
}

#faq li:first-of-type {
    margin-block-start: var(--space-2);
}

#faq li > * + * {
    margin-block-start: var(--space-0);
}

footer {
    display: flex;
    align-items: center;
    position: sticky;
    bottom: 0;
    z-index: 999999;
    width: 100%;
    max-width: var(--max-width);    
    height: 4rem;
    margin-top: var(--space-2);
    border: 1px solid var(--border);
    border-radius: 1rem;
    background-color: var(--post-background);
    transform: translateY(100%); 
    transition: transform 0.3s ease;
}

.footer-inner {
    width: 100%;
}

.footer-inner-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

footer a {
    font-family: var(--heading);
    font-size: var(--nav-link);
    color: var(--accent);
    background: transparent;
}

.skip-link {
    position: absolute;
    top: -999px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--primary);
}

.skip-link:focus {
    top: 6px;
}

.vh {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 640px) {
    .header-big > * + * {
        margin-block-start: var(--space-1);
    }

    .site-title-big, 
    .site-title-big sup {
        color: var(--primary);
    }

    .site-description {
        display: none;
    }

    .post,
    .box {
        padding: calc(var(--space-2) + 1vw) 1.5rem;
    }

    .footer-inner-links {
        padding: 0 1.5rem;
    }
}