/* Fonts and colors from csanaadb.com (landing_page/src/style.css). */

@font-face {
    font-family: "Space Mono";
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url("../fonts/space-mono-400.woff2") format("woff2");
}

@font-face {
    font-family: "Space Mono";
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: url("../fonts/space-mono-700.woff2") format("woff2");
}

@font-face {
    font-family: "Saira Condensed";
    font-weight: 800;
    font-style: normal;
    font-display: swap;
    src: url("../fonts/saira-condensed-800.woff2") format("woff2");
}

:root {
    --bg: #f5f0e8;
    --fg: #1c1a17;
    --muted: #6b6157;
    --taupe: #9a9186;
    --rust: #c24d2c;
    --code-bg: #ebe4d8;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #2b2a27;
        --fg: #f4eee3;
        --muted: #a89e92;
        --taupe: #b8ac9d;
        --rust: #e0653f;
        --code-bg: #1f1e1c;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Space Mono", monospace;
    font-size: 1rem;
    line-height: 1.7;
    background: var(--bg);
    color: var(--fg);
}

.site-header,
main,
.site-footer {
    max-width: 46rem;
    margin-inline: auto;
    padding-inline: 1rem;
}

/* --- header --- */

.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 2rem 3rem;
}

.site-name {
    font-family: "Saira Condensed", sans-serif;
    font-weight: 800;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--fg);
    text-decoration: none;
}

.site-name .last {
    color: var(--taupe);
}

.site-header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.site-header nav a {
    position: relative;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--fg);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
}

.site-header nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.375em;
    height: 0.125em;
    width: 100%;
    background: var(--rust);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.site-header nav a:hover {
    color: var(--rust);
}

.site-header nav a:hover::after {
    transform: scaleX(1);
}

/* --- titles --- */

.page-title,
.post-body h2,
.post-body h3,
.post-body h4 {
    font-family: "Saira Condensed", sans-serif;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.006em;
}

.page-title {
    margin: 0 0 0.5rem;
    font-size: 2.75rem;
}

.page-title::after {
    content: "";
    display: block;
    width: 9.25rem;
    height: 0.25rem;
    margin-top: 1rem;
    background: var(--fg);
}

.post-header {
    margin-bottom: 2.5rem;
}

.post-meta {
    color: var(--muted);
    font-size: 0.875rem;
}

.post-meta .tag {
    margin-left: 0.75rem;
}

/* --- article body --- */

.post-body h2 {
    margin-top: 2.5rem;
    font-size: 2rem;
}

.post-body h3 {
    margin-top: 2rem;
    font-size: 1.5rem;
}

.post-body h4 {
    font-size: 1.25rem;
}

a {
    color: var(--rust);
}

a:hover {
    text-decoration-thickness: 0.125em;
}

.post-body img {
    max-width: 100%;
    height: auto;
}

code {
    font-family: "Space Mono", monospace;
    font-size: 0.875em;
}

:not(pre) > code {
    padding: 0.1em 0.3em;
    background: var(--code-bg);
}

pre {
    overflow-x: auto;
    padding: 1rem;
    line-height: 1.5;
    background: var(--code-bg);
}

/* Chroma sets its own background; keep the site's instead. */
.chroma,
.highlight pre {
    background: var(--code-bg);
}

blockquote {
    margin-inline: 0;
    padding-left: 1rem;
    border-left: 0.25rem solid var(--taupe);
    color: var(--muted);
}

table {
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
}

th,
td {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--taupe);
}

math[display="block"] {
    overflow-x: auto;
}

.footnotes {
    margin-top: 3rem;
    font-size: 0.875rem;
    color: var(--muted);
}

/* --- lists of posts and tags --- */

.post-list,
.term-list {
    padding: 0;
    list-style: none;
}

.post-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.25rem;
    margin-bottom: 0.75rem;
}

.post-list time,
.term-list .count {
    color: var(--muted);
}

.pager {
    display: flex;
    gap: 1.25rem;
    margin-top: 2rem;
}

/* --- footer --- */

.site-footer {
    padding-block: 4rem 2rem;
    font-size: 0.875rem;
}

@media (prefers-reduced-motion: reduce) {
    .site-header nav a::after {
        transition: none;
    }
}
