/* Tom Fucks a Retarded Child — reading stylesheet */
/* Same Nether palette, tuned for long-form prose */

:root {
    --bodyFonts: Georgia, "Times New Roman", serif;
    --headerFonts: DejaVu Sans Mono, monospace;
    --bgColor: #282c34;
    --txtColor: #bbc2cf;
    --linkColor: #ff6c6b;
    --headerColor: #51afef;
    --accentColor: #c678dd;
    --dimColor: #5b6268;
}

/* Responsiveness */
@media screen and (min-width: 820px) {
    :root { --mainSize: 55vw; }
    header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        white-space: nowrap;
        flex-wrap: wrap;
    }
    nav {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 1rem;
    }
}
@media screen and (max-width: 820px) { :root { --mainSize: 75vw; } }
@media screen and (max-width: 620px) { :root { --mainSize: 90vw; } }
@media screen and (max-width: 560px) {
    :root { --mainSize: 95vw; }
    header { display: initial; text-align: center; }
}

body {
    font-family: var(--bodyFonts);
    background: var(--bgColor);
    color: var(--txtColor);
    line-height: 1.8;
    word-wrap: break-word;
    margin: 0;
    padding: 0;
    font-size: 1.05rem;
}

header, main, footer {
    margin: auto;
    width: var(--mainSize);
}

/* Header */
header {
    border-bottom: 2px solid var(--linkColor);
    border-radius: 0.5rem;
    padding: 0.5rem 0;
    font-family: var(--headerFonts);
    font-size: 0.85rem;
}

#logo {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accentColor);
}

/* Footer */
footer {
    border-top: 2px solid var(--linkColor);
    border-radius: 0.5rem;
    padding-top: 0.5rem;
    margin-top: 3rem !important;
    font-family: var(--headerFonts);
    font-size: 0.8rem;
}
footer p { margin: 0.2em 0; }

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--headerFonts);
    color: var(--headerColor);
    line-height: 1.2;
}
h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }

/* Links */
a {
    color: var(--linkColor);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

/* Prose */
article {
    margin: 2rem 0;
}

article p {
    margin: 1.2em 0;
    text-indent: 0;
}

/* Chapter navigation */
.chapter-nav {
    font-family: var(--headerFonts);
    font-size: 0.85rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.chapter-nav.top {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--dimColor);
}

.chapter-nav.bottom {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--dimColor);
}

.nav-separator {
    color: var(--dimColor);
}

/* Scene breaks — horizontal rule style */
article hr {
    border: none;
    text-align: center;
    margin: 2em 0;
    color: var(--dimColor);
}

article hr::after {
    content: "* * *";
    font-family: var(--headerFonts);
}

/* Scene breaks — numbered */
.scene-break {
    text-align: center;
    margin: 3em 0;
    font-family: var(--headerFonts);
    font-size: 1.3rem;
    color: var(--headerColor);
}

/* Division pages (title page, part dividers) — vertically centered in viewport */
main.page-title,
main.page-divider {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}
main.page-title .chapter-nav,
main.page-divider .chapter-nav {
    flex: 0 0 auto;
}
main.page-title article,
main.page-divider article {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
main.page-title article p,
main.page-divider article p {
    text-indent: 0;
    margin: 0;
}

/* Title page */
.title-sub {
    font-family: var(--headerFonts);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--dimColor);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.title-main {
    font-family: var(--headerFonts);
    font-size: 2.6rem;
    font-weight: bold;
    color: var(--headerColor);
    line-height: 1.15;
    margin: 0 0 1.25rem;
}

.title-logline {
    font-style: italic;
    font-size: 1.05rem;
    color: var(--dimColor);
    margin: 0;
}

/* Part divider */
.part-label {
    font-family: var(--headerFonts);
    font-size: 1rem;
    letter-spacing: 0.25em;
    color: var(--dimColor);
    margin: 0 0 0.75rem;
}

.part-name {
    font-family: var(--headerFonts);
    font-size: 2rem;
    font-weight: bold;
    color: var(--headerColor);
    margin: 0;
}

/* Front-matter section headings — larger, centered dividers */
main.page-frontmatter article h2 {
    text-align: center;
    font-size: 2rem;
    margin: 2.5rem 0 1.5rem;
}

/* Blockquote attribution — right-justified, darker */
.attribution {
    display: block;
    text-align: left;
    color: var(--dimColor);
    font-style: normal;
    margin-top: 0.4em;
}

/* Content warning */
.content-warning {
    border-left: 3px solid var(--linkColor);
    padding: 0.8rem 1.2rem;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    color: var(--dimColor);
}

.content-warning p {
    text-indent: 0;
    margin: 0.4em 0;
}

/* Author's note — body prose with a small header label */
.author-note {
    margin: 2rem 0 3rem;
}

.author-note h2 {
    font-size: 1.15rem;
    letter-spacing: 0.15em;
    color: var(--dimColor);
    margin: 0 0 1rem;
}

.author-note p {
    text-indent: 0;
}

/* Blockquotes — praise blurbs and pull quotes */
article blockquote {
    margin: 1.4em 0;
    padding: 0.2em 0 0.2em 1.2rem;
    border-left: 3px solid var(--linkColor);
    color: var(--txtColor);
}

article blockquote p {
    margin: 0.3em 0;
}

/* Letter / institutional document */
.letter {
    margin: 2rem 0;
    padding: 1.4rem 1.6rem;
    border: 1px solid var(--dimColor);
    border-radius: 0.4rem;
    background: rgba(0, 0, 0, 0.15);
    font-family: var(--headerFonts);
    font-size: 0.92rem;
    line-height: 1.6;
}

.letter p {
    text-indent: 0;
    margin: 0.6em 0;
}

.letter .letter-field {
    color: var(--dimColor);
}

.letter .letter-sign {
    color: var(--accentColor);
}

.letter .letter-ps {
    color: var(--txtColor);
}

/* Chapter opening (centered title above scene marker) */
.chapter-open {
    text-align: center;
    font-family: var(--headerFonts);
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--headerColor);
    margin: 1rem 0 0;
}

/* End-of-chapter signature */
.invalid-sig {
    text-align: right;
    font-weight: bold;
    font-style: italic;
    font-size: 1.4rem;
    margin: 3.5rem 0 1rem;
    color: var(--dimColor);
}

.invalid-sig a {
    color: var(--linkColor);
}
