@font-face {
    font-family: Typewriter;
    src: url('/fonts/typewriter-latin-20260708.woff2') format('woff2'),
         url('/fonts/typewriter.ttf') format('truetype');
    font-display: swap;
}

:root {
    color-scheme: dark;
    --bg: #b7051e;
    --text: #efd8ce;
    --frame-color: #100609;
    --rule: #efd8ce66;
    --rule-soft: #efd8ce33;
    --panel: #97071c;
    --frame: 16px;
    --page-pad: clamp(1.25rem, 3vw, 3rem);
    --page-width: 46rem;
    background: var(--frame-color);
    text-size-adjust: 100%;
    scrollbar-gutter: stable;
    overflow-x: clip;
    scroll-padding-block: calc(var(--frame) + 1rem);
}

* { box-sizing: border-box; }

body {
    isolation: isolate;
    min-height: 100svh;
    margin: 0;
    padding: calc(var(--frame) + var(--page-pad));
    background: var(--bg);
    color: var(--text);
    text-shadow: 0 1px 0 #10060980;
    font-family: Typewriter, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 17px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

body::before, body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    z-index: -1;
    background-image:
        radial-gradient(circle at 50% calc(50% - .4px), #10060999 .6px, #42091880 1.1px, transparent 1.65px),
        radial-gradient(circle at 50% calc(50% + .65px), #ffd2ad59 .9px, transparent 1.95px),
        radial-gradient(circle at 50% calc(50% - .8px), #10060926 1.2px, transparent 2.5px);
    background-size: 24px 24px;
    opacity: .8;
    /* Quiet the fixed texture behind the reading column. */
    mask-image: linear-gradient(90deg, #000, #0009 calc(50% - var(--page-width) / 2), #0009 calc(50% + var(--page-width) / 2), #000);
}

body::after {
    width: 100vw;
    box-sizing: border-box;
    z-index: 100;
    border: var(--frame) solid var(--frame-color);
}

#main, .site-footer {
    width: 100%;
    max-width: var(--page-width);
    margin-inline: auto;
}

#main :is(a, [id]) { scroll-margin-block: calc(var(--frame) + 1rem); }
::selection { color: var(--bg); background: var(--text); text-shadow: none; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
.page-post { line-height: 1.72; }
.site-brand > :first-child, .page-heading h1, .home-statement, .post-title, .game-title {
    text-shadow: 0 clamp(1px, .035em, 2px) 0 #10060980;
}

h1, h2, h3, p, ul, ol, figure, blockquote, pre, table { margin-top: 0; }
h1, h2, h3 { font-weight: 400; }
h1 { margin-bottom: .35rem; font-size: 1.25rem; line-height: 1.35; letter-spacing: .04em; }
h2 { margin: 2rem 0 .65rem; font-size: 1.35rem; line-height: 1.3; letter-spacing: -.025em; }
h3 { margin: 1.65rem 0 .5rem; font-size: 1.15rem; line-height: 1.4; }
p { margin-bottom: .95rem; text-wrap: pretty; }
.page-post p { margin-bottom: 1.05rem; }
hr { margin: 1.4rem 0; border: 0; }
#main > hr { margin: 2.5rem 0; }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--rule); text-underline-offset: .2em; }
a:hover, a:focus-visible { text-decoration-color: var(--text); }

.site-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1.25rem 2rem; }
.brand-title { margin: 0; font: inherit; }
.site-brand { display: inline-flex; align-items: baseline; gap: .2em; text-decoration: none; font-size: clamp(2.4rem, 5.5vw, 4.5rem); line-height: 1.15; }
.site-brand > :first-child { letter-spacing: -.075em; }
.site-brand .home-alias { font-size: clamp(.8rem, 1.2vw, 1rem); }
.site-nav { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; margin: 0; font-size: .9rem; line-height: 1.5; }
.site-nav a { display: inline-flex; align-items: center; min-height: 2rem; text-decoration: none; }
.site-nav a:hover, .site-nav [aria-current] {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .3em;
}

.page-heading { margin: 3rem 0; }
.page-heading h1 {
    margin: 0;
    font: 400 clamp(2rem, 4vw, 3.5rem)/1.12 Typewriter, monospace;
    letter-spacing: -.035em;
    text-wrap: balance;
}
.page-heading > p { margin: .75rem 0 0; font-size: .86rem; line-height: 1.6; }
.page-heading + hr { display: none; }
.post-date { letter-spacing: .08em; text-transform: uppercase; }
.section-title {
    margin: 1.15rem 0 .5rem;
    font-size: .82rem;
    line-height: 1.45;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.index-group { margin: 2.5rem 0 0; }
.page-heading + .index-group { margin-top: 0; }
.index-group > .section-title { margin: 0 0 1rem; }
.index-entries { min-width: 0; }
.index-entries > :last-child { margin-bottom: 0; }
:is(.index-entries, .project-list) > :is(.post, .game) { margin: 0; padding: 0 0 1.8rem; }
:is(.index-entries, .project-list) > :last-child { padding-bottom: 0; }
.post-title, .game-title {
    display: block;
    width: fit-content;
    max-width: 100%;
    text-decoration: none;
    font-size: clamp(1.45rem, 2.5vw, 1.9rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -.025em;
}
.post-title:hover, .game-title:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .2em;
}
.index-entries :is(.game-meta, .post-meta) { display: block; margin-top: .3rem; font-size: .78rem; }
.game-desc, .post-desc { display: block; margin: .45rem 0 0; font-size: 1rem; line-height: 1.65; }
.project-list { margin: 0; }
.index-aside { margin-top: 1.8rem; font-size: .86rem; }
.page-about .index-entries ul { margin: 0; }
.about-intro { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); align-items: center; gap: 2rem; }
.about-intro p { margin: 0; }
.about-portrait { aspect-ratio: 1; overflow: hidden; border: 1px solid var(--rule); }
.about-portrait img { height: 100%; margin: 0; border: 0; object-fit: cover; object-position: 50% 18%; transform: scale(1.25); transform-origin: 50% 18%; }
.archive-list { columns: 2; column-gap: 3rem; }
.archive-list > li { break-inside: avoid; }

ul { margin: 0 0 1rem; padding: 0; list-style: none; }
li { padding: .15rem 0; }
li::before { content: "- "; }
ol { margin: .65rem 0 1.1rem; padding-left: 1.4rem; }
ol li::before { content: ""; }

img {
    display: block;
    width: 100%;
    height: auto;
    margin: 1.1rem 0;
    border: 1px solid var(--rule);
    background: var(--panel);
}
figure { margin: 1.35rem 0; }
figcaption { margin-top: .45rem; font-size: .82rem; line-height: 1.45; text-align: center; }
.hero { margin: 1.15rem 0 2rem; }
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: .8rem;
    margin: 1.15rem 0;
}
.gallery img { margin: 0; }

pre, code { text-shadow: none; }
code {
    padding: .1rem .35rem;
    border: 1px solid var(--rule-soft);
    border-radius: 2px;
    background: var(--panel);
    font-size: .88em;
}
pre {
    overflow-x: auto;
    margin: 1.15rem 0;
    padding: 1rem;
    border: 1px solid var(--rule);
    background: var(--panel);
    font-size: .88rem;
    line-height: 1.55;
    white-space: pre-wrap;
}
pre code { padding: 0; border: 0; background: transparent; font-size: inherit; }
table { width: 100%; margin: 1.15rem 0; border-collapse: collapse; font-size: .92rem; overflow-wrap: normal; }
.table-scroll { margin: 1.15rem 0; }
.table-scroll table { margin: 0; }
th, td { padding: .6rem .75rem; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
th { font-weight: 400; letter-spacing: .03em; }
td code { font-size: .82rem; }

.lore { font-size: .9rem; }
.note { margin-top: .4rem; font-size: .85rem; }
.disclaimer, .scratch, .journal, .pull, blockquote, .toc, .char { margin: 1.55rem 0; padding: .95rem 0; }
.page-archive .disclaimer { padding: 1rem; background: var(--panel); font-size: .9rem; line-height: 1.65; }
.page-archive .disclaimer .tag {
    display: block;
    margin-bottom: .45rem;
    font-size: .78rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.page-archive .disclaimer p, .scratch p, .journal p, blockquote p { margin: 0 0 .65rem; }
.page-archive .disclaimer p:last-child, .scratch p:last-child, .journal p:last-child, blockquote p:last-child { margin-bottom: 0; }
.scratch, .journal, blockquote, .toc { font-size: .92rem; }
.scratch { line-height: 1.82; }
.journal { line-height: 1.9; }
.pull { font-size: .96rem; font-style: italic; }
.close p { margin-bottom: .85rem; }
blockquote { font-style: italic; }
blockquote .date { font-size: .8rem; font-style: normal; letter-spacing: .08em; text-transform: uppercase; }
.source { margin-top: 1.65rem; padding-top: 1.1rem; font-size: .86rem; }
.toc ul { margin: 0; }
.toc ul ul { padding-left: 1.15rem; }
.toc li { padding: .12rem 0; }
.toc a { text-decoration: none; }
.char { margin: 1.35rem 0 1.8rem; }
.char-name { font-size: .96rem; letter-spacing: .03em; }
.char-class { margin-bottom: .55rem; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.char-stats { margin: .55rem 0 0; font-size: .9rem; }
.char-stats li { padding: .12rem 0; }
.char-stats .label { display: inline-block; min-width: 9rem; }

.post-nav { display: flex; justify-content: space-between; gap: 1.5rem; margin: 1.8rem 0; font-size: .92rem; }
.nav-prev, .nav-next { max-width: 48%; }
.nav-next { margin-left: auto; text-align: right; }
.nav-label { display: block; margin-bottom: .15rem; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.post-nav a { display: block; text-decoration: none; }
.site-footer { margin-top: 3rem; }
.footer { margin: 0; font-size: .86rem; }

.page-home {
    background-image: linear-gradient(180deg, #b7051e 0%, #b7051e 78%, #b1051e 86%, #9e001a 100%);
}
.page-home #main { display: flex; flex-direction: column; min-height: calc(100svh - (var(--frame) + var(--page-pad)) * 2); }
.home-intro { margin: .75rem 0 0; font-size: .86rem; }
.home-statement { max-width: 24ch; margin: 3rem 0 0; font-size: clamp(1.8rem, 3.5vw, 3rem); line-height: 1.2; letter-spacing: -.035em; text-wrap: balance; }
.page-home .home-contact { margin-top: auto; padding-top: 4rem; }
.home-contact ul { display: flex; flex-wrap: wrap; gap: .3rem 2rem; margin: 0; font-size: .8rem; }
.home-contact li { margin: 0; padding: .08rem 0; }
.home-contact li:first-child { flex-basis: 100%; }
.home-contact li::before { content: none; }
.home-contact .section-title { display: none; }

@media (max-width: 700px) {
    :root { --frame: 8px; scrollbar-gutter: auto; }
    .page-home .site-header { flex-direction: column; }
    .page-heading { margin-block: 2rem; }
    .archive-list { columns: 1; }
    .home-contact ul { flex-direction: column; }
}

@media (max-width: 640px) {
    .about-intro { grid-template-columns: 1fr; gap: 1.25rem; }
    .about-portrait { max-width: 14rem; }
    .post-nav { display: block; }
    .nav-prev, .nav-next { max-width: none; }
    .nav-next { margin-top: 1rem; text-align: left; }
    .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-scroll table { min-width: 34rem; white-space: nowrap; }
    .char-stats .label { display: block; min-width: 0; }
}

@media print {
    * { text-shadow: none !important; }
}
