@font-face {
    font-family: 'Triptych Roman';
    src: url('/assets/type/triptych_roman.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Triptych Italick';
    src: url('/assets/type/triptych_italick.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Triptych Grotesque';
    src: url('/assets/type/triptych_grotesque.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

:root {
    --max-width: 56ch;
    --gap: 1.5rem;
    --big-gap: 3rem;
    --body: 'Triptych Roman';
    --italic: 'Triptych Italick';
    --heading: 'Triptych Grotesque';
    --paragraph: calc(1.06rem + .35vw);
    --micro: calc(var(--paragraph) * .9);
    --nav-link: calc(1.2rem + .5vw);
    --heading-1: calc(1.6rem + .75vw);
    --heading-2: calc(var(--heading-1) * .7);
    --primary: #111;
    --accent: brown;
    --border: #DDD;
    --post-background: floralwhite;
    --background: #ECE6DD;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #D3CEC1;
        --accent: #E08585;
        --border: #5D5D5D;
        --post-background: #171717;
        --background: #111;
    }
}

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: var(--big-gap) 1rem;
    font-family: var(--body);
    font-size: var(--paragraph);
    line-height: 1.65;
    color: var(--primary);
    background-color: var(--background);
}

main * + * {
    margin-block-start: var(--gap);
}

.header-big > * + * {
    margin-block-start: 2.5rem;
} 

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

p + h2 {
    margin-block-start: var(--big-gap);
}

.margins-off > * {
    margin-block-start: 0;
}

main {
    width: 100%;
    max-width: var(--max-width);
    margin-block-end: var(--big-gap);
}

img.header-image {
    max-width: 200px;
    height: auto;
    aspect-ratio: 1/1;
}

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

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

h2 {
    font-family: var(--italic);
    font-weight: normal;
    font-size: var(--heading-2);
    line-height: 1.4;
}

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

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

.site-description {
    margin-block-start: 1.65rem;
    font-size: calc(var(--heading-1) * .675);
    color: var(--primary);
}

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

.site-title-small {
    font-family: var(--heading);
    font-size: var(--heading-2);
}

.header-small svg {
    width: auto;
    height: calc(var(--heading-2) * .7);
    line-height: normal;
}

header sup {
    font-size: calc(var(--heading-1) * .3);
    line-height: normal;
    vertical-align: text-top;
}

.header-small sup {
    font-size: calc(var(--heading-2) * .3);
}

ul {
    list-style: none;
}

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

nav ul li:not(:last-of-type) {
    margin-inline-end: 1rem;
}

header + main .page-title {
    margin-block-start: var(--big-gap);
}

#blogroll,
#post-content,
#tag-posts {
    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; }
}

@media (prefers-reduced-motion: reduce) {
    #blogroll { animation: none; }
}

#blogroll,
.tag-search-container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
}

#tag-search-form {
    display: block;
    margin-block-start: 4rem;
    margin-block-end: 4.75rem;
}

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

#tag-search-input::placeholder {
    font-family: var(--italic);
    font-size: var(--paragraph);
    color: #808080;
}

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

.tag-results-heading, 
.post-results-heading {
    margin-block-start: var(--big-gap);
    margin-block-end: var(--big-gap);
}

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

.post,
#post-content {
    width: 100%;
    max-width: var(--max-width);
    margin-block-start: calc(var(--big-gap) * 2);
    padding: calc(var(--big-gap) * 1.25) 2rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
    background-color: var(--post-background);
}

.post.message {
    margin-block-start: unset;
    padding: calc(var(--big-gap) * 1.25) 2rem;
}

#post-content,
#tag-posts .post:first-of-type {
    margin-block-start: unset;
}


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

.post-notes {
    font-family: var(--italic);
    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: 1rem;
    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(--gap);
}

.share-container p {
    font-family: var(--heading);
    text-transform: uppercase;
}

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

button {
    border-radius: .5rem;
    font-family: var(--heading);
    color: var(--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;
}

em {
    font-family: var(--italic);
}

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

hr.mini-padding {
    margin-block-start: 2rem;
    margin-block-end: 2rem;
}

footer {
    display: flex;
    align-items: center;
    position: sticky;
    bottom: 0;
    width: 100%;
    max-width: var(--max-width);
    z-index: 999999;
    height: 4rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
    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 var(--gap);
}

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

footer svg {
    width: auto;
    height: var(--paragraph);
    margin-left: .15rem;
}

.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 only screen and (max-width: 640px) {
    .header-big > * + * {
    margin-block-start: 2rem;
    } 
    
    .site-title-big, 
    .site-title-big sup {
        color: var(--primary);
    }

    .site-description {
        display: none;
    }

    .post,
    #post-content {
        padding: var(--big-gap)  1.5rem;
    }

    .post.message {
        margin-block-start: unset;
        padding: var(--big-gap) 1.5rem;
    }
}